Sign in to follow this  

Write to a texture with a Compute Shader

This topic is 831 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

I am struggling to see any data in a texture that I write to with a compute shader.  The shader declares it as

 

RWTexture2D<float4> OutputTexture : register(u0);

 

And writes some (relatively arbitrary) non-zero data to it.  I've set up a D3D12_UNORDERED_ACCESS_VIEW_DESC with a Format of DXGI_FORMAT_R16G16B16A16_FLOAT and a ViewDimension of D3D12_UAV_DIMENSION_TEXTURE2D, and passed the ID3D12Resource of a texture created with the same pixel format to CreateUnorderedAccessView.

 

I've called CreateShaderResourceView with the same ID3D12Resource, and tried to use the SRV to paint a quad that I'm displaying.  I see absolutely nothing.  I know that if I load the texture with pixel data by more conventional means (by loading it from an upload heap or rendering to it with a pixel shader) it works just fine.  But I can't figure out how to get the Compute Shader to have any effect on it!

Share this post


Link to post
Share on other sites

I've looked at the texture in the debugger and confirmed that nothing was written to it, and I don't get any warnings or errors.  I'm glad there was nothing blatantly wrong in the original description I posted.  I will keep digging at it.

Edited by Funkymunky

Share this post


Link to post
Share on other sites

This topic is 831 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.

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

Sign in to follow this