Sign in to follow this  
bjarnia

Compute Shader - Reading and writing to the same RGBA16 texture?

Recommended Posts

I'm trying to implement post processing in compute shaders and I've been having difficulty figuring out how I can read and write to the same UAV bound texture resource whose format is   DXGI_FORMAT_R16G16B16A16_FLOAT. An RGBA8 format would not be an issue as far as I can tell, nor would it be an issue if I was reading from a different intput buffer.. but those are unfortunately 2 constraints that I have :)

 

I can't simply type it as RWTexture2D<float4>, this forbids me from reading from it. I can do RWTexture2D<float>, but I have not found a way of retrieving and writing to all 4 float values of a single pixel. 

 

I figured I'd have to use byte address buffers, but found this note on MSDN; "The UAV format bound to this resource needs to be created with the DXGI_FORMAT_R32_TYPELESS format.", but I need to operate on 64 bit granularity (so I only write to each "pixel" once.

 

Are there any good ways to do this? 

 

 

Share this post


Link to post
Share on other sites
Yeah it has to be an R32 format if you want to read and write to it in the same shader.

 

I'm searching msdn but can't find any source I could cite in my thesis that explicitly states this. Can anyone help me? Thx.

Edited by Tasty Texel

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

Sign in to follow this