Sign in to follow this  

Performance question

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

How can I know if the CPU has to wait too much until GPU finish his work before presenting back buffer or if CPU is doing too much work?

Because I want to know what I need to improve the most in my application...

Share this post


Link to post
Share on other sites
PIX will tell you very quickly. Just use the first capture mode (statistics for each frame) and capture a bunch of frames. Then look in the timeline view. If your GPU is stalling a lot, you're CPU-bound. If it isn't, your GPU-bound. Tools like PerfHUD will also tell you your total GPU work time and GPU wait time per frame, which also tells you whether you're GPU-bound.

And yeah if you want to sort objects by distance, you'll have to calculate the distance and sort it yourself.

Share this post


Link to post
Share on other sites
Quote:
Original post by MJP
And yeah if you want to sort objects by distance, you'll have to calculate the distance and sort it yourself.


Sorting will probably improve the performance on my game right? Because the app wont waste time in pixels that wont appear in the final image right?

Share this post


Link to post
Share on other sites
It can reduce pixel shader executions by letting more pixels get culled by early-z. But you're doing light prepass, aren't you? In that case it will only help with your G-Buffer pass, since your depth buffer will already be filled for your second pass where you sample the lighting buffer.

Share this post


Link to post
Share on other sites
But is there any algorithm to help me calculate the distances?
Because, for example, if Ive to meshes, one is a bridge the other is a box, if I put the box below the bridge, when I calculate the distance from camera to the box it might be lower than the distance from the camera to the bridge, so the box will be drawn first but possibly the bridge will cover the box.

Also, can't I use the depth stencil buffer from G-Buffer pass in the material pass? So, again, I will reduce the number of pixel shader executions? Because only the pixel that will be visible in the final will pass the early z-test.

Share this post


Link to post
Share on other sites
Quote:

Also, can't I use the depth stencil buffer from G-Buffer pass in the material pass? So, again, I will reduce the number of pixel shader executions? Because only the pixel that will be visible in the final will pass the early z-test.


This is what you want if you have an early-z pass.

For the other thing, there is a nice example in the DX-SDK, called "Predicated Rendering". I think it could show what you need.

Share this post


Link to post
Share on other sites
Another question:
Im sampling a msaa texture, so I sample 8x the same pixel in order to use the 8 samples in each pixel. I want to only sample 8x in edges so I'm thinking about using sobel filter so detect if I need so sample 8x the same pixel. Can anyone explain me how is sobel filter performed to detect edges in a msaa texture?

Ive also read about centroid sampling in msaa texture... How do this work?

Share this post


Link to post
Share on other sites

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