Sign in to follow this  

Render Target

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

hello, referring to this pipeline poster Pipeline i wanted to ask WHEN does d3d actually write to the render target? i think d3d writes at the last stage to the render target and all stages before it just reads from the render target. but maybe im wrong and d3d already writes after the z-buffer test to the render target. maybe u guys know it:)

Share this post


Link to post
Share on other sites
D3D writes to the rendertarget and/or depth buffer if it makes it all the way through the pipeline. Things than can prevent this are, Z depth tests, stencil tests, alphatests, texkill pixelshader instructions, or a COLORWRITEENABLE setting of 0. A card may do early Z rejection without doing pixel shading if the shader doesn't write to the depth output register.

The only time the backbuffer is read is when alphablending is enabled and DESTCOLOR or DESTALPHA is referred to in SRCBLEND or DESTBLEND.

Share this post


Link to post
Share on other sites
i think you are not correct. im (almost) sure, that d3d also reads from the render target during the depth/stencil test (besides the mentioned alphablending readings).

in this
pipeline poster u can see some arrows going FROM the render target to the two tests, but no arrow is GOING to the render target.
so i still think the d3d just writes a single time to the render target: if a pixel is through ALL stages. i hope somebody can approve my assumption ;)

Share this post


Link to post
Share on other sites
I had a look at that diagram...I think you're both right since it seems to be calling both the backbuffer and the depthstencil the render target. I mean, you wouldn't read colour in a depthstencil test would you [lol]

Share this post


Link to post
Share on other sites
Quote:
Original post by DrGUI
I had a look at that diagram...I think you're both right since it seems to be calling both the backbuffer and the depthstencil the render target. I mean, you wouldn't read colour in a depthstencil test would you [lol]

i wouldnt read color but the information stored in a stencil buffer.

Share this post


Link to post
Share on other sites
You're right that I was wrong, but not what I was wrong about. :) Backbuffer is read if SRCBLEND has DESTCOLOR or DESTALPHA, or DESTBLEND is not ZERO. It's one of the things that makes alpha blending slow. It needs to do a READ/MODIFY/WRITE instead of just WRITE.

Also, thinking about it a bit more, the GPU likely accesses more than 1 pixel at a time due to the size of cache lines. If a non blended triangle will affect all the pixels for a cache line, the read will likely be skipped (unless the engineers are quite bad, which I doubt). A read may occur if only some pixels on the cache line are affected, such at the edge of a triangle, or a hole caused by alphatest/stencil operations.

Share this post


Link to post
Share on other sites
Quote:
Original post by compiler
Quote:
Original post by DrGUI
I had a look at that diagram...I think you're both right since it seems to be calling both the backbuffer and the depthstencil the render target. I mean, you wouldn't read colour in a depthstencil test would you [lol]

i wouldnt read color but the information stored in a stencil buffer.

yep, i was just clarifying the terminology.

Share this post


Link to post
Share on other sites

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