Jump to content
  • Advertisement
xhcao

3D Does D3D11 allows that a texture was bound to a SRV and a UAV simultaneously

Recommended Posts

Does D3D11 allows that a texture was bound to a SRV and a UAV simultaneously? And SRV is in render pipeline and UAV is in compute pipeline. The detail is as below,

1. Create a texture 'tex', and an UAV 'uav' for compute pipeline, which is bound to 'tex'.

2. In compute shader, dispatchCompute, change 'tex' content through compute shader.

3. Does not unbind the UAV to texture, then create a SRV for render pipeline, which is also bound to 'tex '

4. In pixel shader, drawArrays, sample 'tex' content through pixel shader, and draw content to window.

I had written a case, and found that compute shader had written correct content to texture 'tex', but seemed that sampler sampled an undefined content in pixel shader.

Share this post


Link to post
Share on other sites
Advertisement

You can't have the same (sub)-resource bound as both an SRV and a UAV at the same time. You can create an SRV and a UAV for the same resource, but you can only access one at a time from a particular Draw or Dispatch call. If you bind both simultaneously, the debug layer will emit an error.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!