Jump to content
  • Advertisement
Sign in to follow this  
tete3

Rendering to texture and Stream-Out

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

Hi All, I'm generating some data on the GPU and then I'm sending them to a buffer through Stream-Out. I would like to use these generated data in the subsequent passes for both streaming out to another buffer and rendering to a 3d texture. Here come my questions: 1. I've noticed that calling OMSetRenderTargets() invalidates the data necessary to invoke DrawAuto() call, therefore I lose the information about the vertex buffer size. Is using D3D10_QUERY_SO_STATISTICS the only solution here? Can I keep the data about the vertex buffer size in some other way? Maybe using Multiple Render Targets somehow? 2. As far as I remember it is possible to Stream-Out from a Geometry Shader and use the same data in the following Pixel Shader. But is it possible to Stream-Out to a buffer and render to a 3d texture in one rendering pass? Regards.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
But is it possible to Stream-Out to a buffer and render to a 3d texture in one rendering pass?

Regards.


yes,

Set a Texture dx object as render target, the texture should be created with RENDER_TARGET flag set.
run a pass.
Unbind the target and set it to effect sampling slot, you can use it.

But unbinding a target will couse CPU to wait until the GPU is finished with rendering to it.

Share this post


Link to post
Share on other sites
correction, not unbinding but setting the target as a texture to effect.

Or I actualy do not know exactly. but you have to have randering to target finished, or maybe it uses back buffer, not the front buffer, so you can unbind anywhen?

Share this post


Link to post
Share on other sites
The stream out buffer has a special hidden counter that keeps track of the number of items written to it during the last stream out. You can also append data to the buffer, maintain the original count as a starting point. Since this hidden counter is part of the buffer it cannot be 'lost' unless you overwrite/zero it using the DX API. The counter is used to allow DrawAuto to work when the resource is later bound to the input assembler. And as you've mentioned, it is available by using the d3d10_query_so_statistics. I'm not sure how it is that you're losing the counter by calling OMSetRenderTargets(). I think that you probably have a different problem as the two are unrelated.

You can always use stream out in combination with rasterization. Because of this all of the usual pixel shader functionality and render target options are still available.

Share this post


Link to post
Share on other sites
Thank you for your answers.

Quote:
Original post by DieterVW
I'm not sure how it is that you're losing the counter by calling OMSetRenderTargets(). I think that you probably have a different problem as the two are unrelated.

Indeed, it was my mistake and thanks to your answer I was able to fix it.

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!