Skip to main content
added 5 characters in body; edited title
Source Link
user1430
user1430

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

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);

WorksThis 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.

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

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.

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

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);

This 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.

Source Link
Levi H
  • 611
  • 5
  • 19

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

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.