Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualcephalo

Posted 07 December 2012 - 09:50 AM

Thanks everyone. So in the SharpDX case of PixelShader.SetShaderResource(0, myTextureView), the function specifically requires a slot number.

If the effects framework is legacy, I probably don't want to become dependent on it.

So let me get this straight. Let's say I set 3 constant buffers with these API calls:

[source lang="csharp"]PixelShader.SetConstantBuffer(0,cb0);PixelShader.SetConstantBuffer(1,cb1);PixelShader.SetConstantBuffer(2,cb2);[/source]

If I don't specify registers in the shader code, and cb1 is not used and optimized away, then cb2 would end up in register b1? I still don't understand how its possible to know which buffer goes into which global variable, especially if they happen to be the same size. Perhaps its the order that the names appear in the shader file?

#1cephalo

Posted 07 December 2012 - 08:59 AM

Thanks everyone. So in the SharpDX case of PixelShader.SetShaderResource(0, myTextureView), the function specifically requires a slot number.

If the effects framework is legacy, I probably don't want to become dependent on it.

So let me get this straight. Let's say I set 3 constant buffers with these API calls:

[source lang="csharp"]PixelShader.SetConstantBuffer(0,cb0);PixelShader.SetConstantBuffer(1,cb1);PixelShader.SetConstantBuffer(2,cb2);[/source]

If I don't specify registers in the shader code, and cb1 is not used and optimized away, then cb2 would end up in register c1? I still don't understand how its possible to know which buffer goes into which global variable, especially if they happen to be the same size. Perhaps its the order that the names appear in the shader file?

PARTNERS