开发者

Setting a Texture in a shader's constant buffer in D3D10

开发者 https://www.devze.com 2023-01-06 19:15 出处:网络
Ok I have a shader compiled up under D3D10. I am obtaining a shader reflection to get details of all the constants/globals in the shader.However I\'m a little conf开发者_StackOverflowused on somethin

Ok I have a shader compiled up under D3D10.

I am obtaining a shader reflection to get details of all the constants/globals in the shader. However I'm a little conf开发者_StackOverflowused on something ... how do I set a texture to a constant buffer?

I assume I don't just Map the constant buffer and copy the ID3D10Texture pointer into it ... I assume I use an ID3D10ShaderResourceView but I'm just unsure of how I set it in the constant buffer.

Any help would be much appreciated!


You don't bind a texture to a constant buffer. You bind textures, via views, to a stage (here GS stage) using method:

void GSSetShaderResources(
  [in]  UINT StartSlot,
  [in]  UINT NumViews,
  [in]  ID3D10ShaderResourceView *ppShaderResourceViews
);

Views and CBs are actually two separate things.

0

精彩评论

暂无评论...
验证码 换一张
取 消