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
Cache bounding box values between register reads in DX11/GL #9648
Conversation
aec023f
to
72ade61
Compare
| @@ -36,43 +50,101 @@ void BoundingBox::Shutdown() | |||
| glDeleteBuffers(1, &s_bbox_buffer_id); | |||
| } | |||
|
|
|||
| void BoundingBox::Set(int index, int value) | |||
| void BoundingBox::Flush() | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know enough about BoundingBox stuff to know if this is worth it but longer term it makes me wonder if we could split some of this out to a AbstractBoundingBox class that does some of this common logic and calls into the backend specific functionality. This is near identical to the D3D11::Flush() . I haven't looked at the other backends to know if they are similar but you mentioned there is caching there too..
|
This makes bounding box effects much faster in Paper Mario TTYD on D3D11 with an NVIDIA GPU. OpenGL got a marginal performance gain as well. However, despite what the PR description seems to imply, D3D12 is very slow. |
72ade61
to
46128ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I'm noticing (and it seems to extend to the VK and DX12 cache implementations too) is that bounding box behaviour is ill-defined during save-state load.
At the very least, perhaps the caches should be flushed after a save-state load to prevent dirty cached bbox values from being loaded. But even that could produce invalid results if there is a save state between the finish of a draw and the bbox values being read.
I'm not sure if this is worth worrying about. This shouldn't effect regular users, just people doing debugging with save-states, which is already a hairy proposition with lots of edge cases
46128ba
to
79eebd7
Compare
79eebd7
to
7fd0a52
Compare
|
FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:
automated-fifoci-reporter |
|
^ I think this fifoci diff is a false herring, bounding box shouldn't affect anything here. |
This was present in the Vulkan and DX12 renderers, but not DX11/GL.
Quick test shows 60fps->90fps at 1x, and 55fps->80fps at 3x on an AMD GPU.
Bounding box is broken on OpenGL/AMD due to what seems to be a driver bug - the atomic only works on one of the fields, so I can't test it.