Jump to content
  • Advertisement
Sign in to follow this  
Aqua Costa

[DirectX 11] Binding Shader resources

This topic is 2535 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When I bind a shader resource or a buffer using this method:

device->VSSetShaderResources(0, 1, rv);

The shader resouce is bound to vertex shader resource slot 0. But will it also be accessible by a pixel shader in the slot 0 or do I also have to call PSSetShaderResource?

Share this post


Link to post
Share on other sites
Advertisement

When I bind a shader resource or a buffer using this method:

device->VSSetShaderResources(0, 1, rv);

The shader resouce is bound to vertex shader resource slot 0. But will it also be accessible by a pixel shader in the slot 0 or do I must also call PSSetShaderResource?


Kinda render PSSetShaderResources() redundant if it did :)

Share this post


Link to post
Share on other sites
No, it will not be bound to the ps also. You will have to send it to another slot too, not slot 0, so for example:

[color="#000000"]device[color="#666600"]->PS[color="#660066"]SetShaderResources[color="#666600"]([color="#006666"]1[color="#666600"], [color="#006666"]1[color="#666600"],[color="#000000"] rv);

Share this post


Link to post
Share on other sites

No, it will not be bound to the ps also. You will have to send it to another slot too, not slot 0, so for example:

[color="#000000"]device[color="#666600"]->PS[color="#660066"]SetShaderResources[color="#666600"]([color="#006666"]1[color="#666600"], [color="#006666"]1[color="#666600"],[color="#000000"] rv);


That isn't correct - the set of resources that are bound to each stage don't influence each other (outside of the restrictions with UAVs being bound to multiple locations). So you could set a shader resource view to the same index on each stage, or different indices - they are independent of each other.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!