-
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
Implement vertex range culling #11393
Conversation
I guess we could maybe use this on some devices? Also wonder if I should add a hidden ini-only setting in case this causes issues or performance problems... -[Unknown] |
So the cull distance extension specifies how far behind a clipping plane a single vertex is? That means that to kill a whole triangle from the context of a single vertex, you'll have to set it to a very large number (and you still might get stray pixels from the other two verts? Though probably not much of an issue in this case). |
Tagged this for 1.8.0, depending on how it goes might un-bump to 1.7.0. |
What? It's not finished. No need for the sadface. |
Based on tests, skips triangles with any point outside the 4096x4096 box, except when depth clamping would engage.
Also D3D11, since they are very similar.
551cdd8
to
44ba31f
Compare
I tried setting Well, maybe we stick with the w approach. Anyway, I went ahead and ported this to the other backends. -[Unknown] |
Looking very good so far, though I don't have all the affected games either. Unlike my old change it doesn't break Wipeout subtly in the corners. It doesn't seem to have any bad effect that I can see, but I haven't tested on many devices yet. If there are issues, as mentioned we can just whitelist it per game... |
Vulkan depth clamp is interacting poorly with this on #11260 - of the two examples, one isn't fixed still, and it's only not fixed when Vulkan's depthClampEnable is true. On all other backends, it's fixed by this pull. I'm not sure why - presumably depth clamping happens right before depth testing, after the vertex shader? I didn't find any obvious definition of this for Vulkan. In that case, it would imply depth clamping is sometimes breaking the -[Unknown] |
Vulkan clamps to the clip range, not the full range. So when clipping, we don't really want to clamp at all. Unfortunately, when one side is clipping, we can't do it exactly right. But many games clip depth, like Dissidia. Fixes hrydgard#11260.
Thanks. I'll run through a whole bunch of games soon and then probably merge. Seems safe enough nw (and easy enough to disable in case of problems). The Vulkan clamping behavior is a bit unfortunate, yeah.. |
Let's try it. |
I will test some games and write if they are fixed |
Btw please can you answer me why are android builds minimaly? I see only for Windows platform on PPSSPP builds website |
There was an issue with cmake - fixed in 1f881d7. -[Unknown] |
Phone Specs: |
Maybe we ran out of vertex shader registers... ugh. Might have to blacklist cullrange on Mali-4xx. -[Unknown] |
Ohhhh. Aaaaaand problems are starting😂😂😂 |
Maybe we could use -[Unknown] |
Or maybe those games are using large viewports, should try after #11407. -[Unknown] |
Hmm, I wonder if we should try running a glsl->spirv->opt->glsl pass on the shaders... -[Unknown] |
Hm. They have so little confidence in the driver optimizer that they hide it behind an option? But yeah, that would be interesting to try. |
PPSSPP Build v1.6.3-492-g9fddfff66 didn't helped the issue :( |
Based on tests, skips triangles with any point outside the 4096x4096 box, except when depth clamping would engage. Does not actually implement depth clamp, just implements the culling rules related to it.
Alternative to (and heavily inspired by) #9527 and currently GLES only seeking feedback and tests in more games. This at least fixes the Brave Story triangle (#8251) so far, but I don't have all the affected racing games to confirm.
If this seems right, can port it to the other backends for merge.
Fixes #9527, fixes #8251, fixes #5001, fixes #10928, fixes #11260, may help #2159, #5507, #7026, and #7294.
-[Unknown]