From c986d0ea78cdd93cc18882bfe7de0642f96e8c3d Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 23 Sep 2023 13:16:03 +1000 Subject: [PATCH] OpenGLDevice: Persist GL_SCISSOR_TEST enabled --- src/util/opengl_device.cpp | 3 +++ src/util/opengl_pipeline.cpp | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/opengl_device.cpp b/src/util/opengl_device.cpp index 78dbf2bf1..3d7e1f57b 100644 --- a/src/util/opengl_device.cpp +++ b/src/util/opengl_device.cpp @@ -333,6 +333,9 @@ bool OpenGLDevice::CreateDevice(const std::string_view& adapter, bool threaded_p if (!CreateBuffers(buggy_pbo)) return false; + // Scissor test should always be enabled. + glEnable(GL_SCISSOR_TEST); + return true; } diff --git a/src/util/opengl_pipeline.cpp b/src/util/opengl_pipeline.cpp index c614557c1..c6cc5b9a0 100644 --- a/src/util/opengl_pipeline.cpp +++ b/src/util/opengl_pipeline.cpp @@ -595,9 +595,6 @@ ALWAYS_INLINE static void ApplyRasterizationState(const GPUPipeline::Rasterizati glEnable(GL_CULL_FACE); glCullFace((rs.cull_mode == GPUPipeline::CullMode::Front) ? GL_FRONT : GL_BACK); } - - // TODO: always enabled, should be done at init time - glEnable(GL_SCISSOR_TEST); } ALWAYS_INLINE static void ApplyDepthState(const GPUPipeline::DepthState& ds)