• Advertisement
Sign in to follow this  

Write to a texture with a Compute Shader

This topic is 902 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
Advertisement

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

Could you share your texture ,resource view creation code ,shader code and the order of what graphics calls you are using. I have done what you are trying to but with DIrectx 11 I might be able to help.

Share this post


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

  • Advertisement