diff options
| author | Techjar <tecknojar@gmail.com> | 2021-06-05 06:47:04 -0400 |
|---|---|---|
| committer | Techjar <tecknojar@gmail.com> | 2021-06-06 20:55:06 -0400 |
| commit | 4866002c9bf6d4438087c4b53c100d7cf1271084 (patch) | |
| tree | b7fd47cfe59f06867f5d7b4fc8cd385e98a71e7f /Source/Core/VideoBackends/OGL/OGLRender.cpp | |
| parent | 638909aec6ef07483f9c9301d4926bbd7d9d6bb0 (diff) | |
VideoCommon: Perform OpenGL bounding box inversion in pixel shader
Running the min/max operation on the upside down, quad-rounded pixel
coordinates before inverting them to the standard upper-left origin
produces wrong results. Therefore, we need to do the inversion before
rounding to pixel quads.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/OGLRender.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/OGLRender.cpp | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/Source/Core/VideoBackends/OGL/OGLRender.cpp b/Source/Core/VideoBackends/OGL/OGLRender.cpp index d3435c51d5..bf0650f961 100644 --- a/Source/Core/VideoBackends/OGL/OGLRender.cpp +++ b/Source/Core/VideoBackends/OGL/OGLRender.cpp @@ -856,30 +856,12 @@ void Renderer::SetScissorRect(const MathUtil::Rectangle<int>& rc) u16 Renderer::BBoxReadImpl(int index) { - // swap 2 and 3 for top/bottom - if (index >= 2) - index ^= 1; - - int value = BoundingBox::Get(index); - if (index >= 2) - { - // up/down -- we have to swap up and down - value = EFB_HEIGHT - value; - } - - return static_cast<u16>(value); + return static_cast<u16>(BoundingBox::Get(index)); } void Renderer::BBoxWriteImpl(int index, u16 value) { - s32 swapped_value = value; - if (index >= 2) - { - index ^= 1; // swap 2 and 3 for top/bottom - swapped_value = EFB_HEIGHT - swapped_value; - } - - BoundingBox::Set(index, swapped_value); + BoundingBox::Set(index, value); } void Renderer::BBoxFlushImpl() |
