Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Writing to render target with compute shader?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 NotTakenSN   Members   -  Reputation: 149

Like
0Likes
Like

Posted 06 February 2013 - 10:48 PM

What's the best way to go about displaying an image calculated in a compute shader to the screen? Is it possible to write directly to a render target from the compute shader? Or would you have to write the results to a 2D UAV texture, then somehow swap that into the back buffer? I suppose writing to a RWTexture2D<float4> is the way to go, but how exactly would you set up the swap chain for this?

 

The only way I can get it working right now is to write into a 2D UAV texture, then render a rectangle to activate the pixel shader, which then reads from the texture and writes those values to the render target. Obviously, I would like to avoid this method because it requires unnecessary switching between the compute shader and pixel shader, which impacts performance.


Edited by NotTakenSN, 06 February 2013 - 11:01 PM.


Sponsor:

#2 MJP   Moderators   -  Reputation: 11736

Like
5Likes
Like

Posted 07 February 2013 - 12:17 AM

When you create your swap chain, specify DXGI_USAGE_UNORDERED_ACCESS as your BufferUsage. If you do that, you'll be able to create an unordered access view from the back buffer texture that you get from that swap chain.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS