-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPU: Simplify depth clamped clip planes #16069
Conversation
There's no need to think about the scaled Z if we're using w anyway, just use the existing Z clipping.
Actually, when I made this change I was thinking I must've handled it somewhere but I thought about it again - the clipping was overly lenient before, and this will fix bugs (not just efficiency.) The integerZ way is only clipping against 0 / 65535. This was the most important (i.e. if you set clamp but then maxz = 65520, you don't want 999999 clamped to 65535), but meant it's not actually clipping against minz/maxz. However, this change should properly clip against minz and maxz. -[Unknown] |
Can you provide a GE frame dump? The line looks better, at least. -[Unknown] |
Here: |
-[Unknown] |
Okay, so this is only happening in GLES, and if I step and flush in the GE debugger, it goes away. So most likely a state flushing issue. -[Unknown] |
Just recreate when it needs to be larger. Fixes Test Drive Unlimited issues noted in hrydgard#16069.
Sorry, after #16068 I realized this could be simpler with less constants, probably more efficient and more likely to avoid math errors. This makes more sense when thinking about w.
There's no need to think about the scaled Z if we're using w anyway, just use the existing Z clipping range to avoid clamp.
-[Unknown]