Jump to content

  • Log In with Google      Sign In   
  • Create Account


about Shader Arrays, Reflection and BindCount


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 0x23   Members   -  Reputation: 110

Like
1Likes
Like

Posted 23 June 2013 - 05:02 AM

Hi,

 

I have a question about DirectX 11. I wrote a shader containing an input array (RWTexture2D<float4> TextureOut[8]).

The shader reflection interface now tells me that there are 8 bind points with names like this

 

"TextureOut[0]"

"TextureOut[1]"

...

 

Since the D3D11_SHADER_INPUT_BIND_DESC structure contains a 'BindCount' field I had rather expected a single

resource binding with  the name 'TextureOut' and a BindCount of 8. Why do I get 8 seperate bindings with bind count 1 instead?

I now wonder what the BindCount field is actually for and in which scenario it is larger than one?

 

Can anyone demystify this aspect of directX for me? Unfortunately the documention isnt much of a help.

 



Sponsor:

#2 MJP   Moderators   -  Reputation: 10632

Like
2Likes
Like

Posted 23 June 2013 - 02:14 PM

Arrays of textures in shaders are really just a syntactical convenience, the underlying shader assembly doesn't actually have any support for them so the compiler just turns the array into N separate resource bindings. So it doesn't surprise me that the reflection interface would report it as N separate resource bindings, since that's essentially how you have to treat it on the C++ side of things.

It does seem weird that the BIND_DESC structure has a BindCount fieldthat suggests it would be used for cases like these, but I suppose it doesn't actually work that way. I wonder if that field actually gets used for anything.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS