Skip to content
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

OGL: Force memory barrier when reading back bounding box values #9766

Merged
merged 1 commit into from May 29, 2021

Conversation

stenzek
Copy link
Contributor

@stenzek stenzek commented May 29, 2021

We also need to ensure the the CPU does not receive stale values which have been updated by the GPU. Apparently the buffer here is not coherent on NVIDIA drivers.

Not sure if this is a driver bug/spec violation or not, one would think that glGetBufferSubData() would invalidate any caches as needed, but this path is only used on NVIDIA anyway, so it's fine.

A point to note is that according to ARB_debug_report, it's moved from video to host memory, which would explain why it needs the cache invalidate.

We also need to ensure the the CPU does not receive stale values
which have been updated by the GPU. Apparently the buffer here
is not coherent on NVIDIA drivers. Not sure if this is a driver
bug/spec violation or not, one would think that
glGetBufferSubData() would invalidate any caches as needed, but
this path is only used on NVIDIA anyway, so it's fine. A point
to note is that according to ARB_debug_report, it's moved from
video to host memory, which would explain why it needs the
cache invalidate.
Copy link
Contributor

@Techjar Techjar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes the flickering dining car window reflections in Paper Mario TTYD.

@stenzek stenzek merged commit b3a414e into dolphin-emu:master May 29, 2021
9 checks passed
@stenzek stenzek deleted the ogl-bbox-memory-barrier branch May 29, 2021 07:05
@Techjar
Copy link
Contributor

Techjar commented May 29, 2021

The incoherent access here is actually entirely within spec, and not a bug at all: https://www.khronos.org/opengl/wiki/Memory_Model#Incoherent_memory_access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants