How can I compile SM 3.0 effects in D3D11 in slimdx?

Posted by jacker on Game Development See other posts from Game Development or by jacker
Published on 2013-06-27T23:52:02Z Indexed on 2013/06/28 4:29 UTC
Read the original article Hit count: 432

Filed under:
|
|
|
var bytecode = ShaderBytecode.CompileFromFile("shaders\\testShader.fx", "fx_5_0", ShaderFlags.None, SlimDX.D3DCompiler.EffectFlags.None, null, null, out str);
var effect = new SlimDX.Direct3D11.Effect(gpu.Device, bytecode);

Works fine but if I try to use another shader model like 4.0 or 3.0 it throws an error on the new effect creation:

E_FAIL: An undetermined error occurred (-2147467259)

How do I compile older shaders? And I've read about device context but I can't find any information on how to use them to maintain DX9 compatibility.

© Game Development or respective owner

Related posts about directx

Related posts about directx11