summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_rasterizer.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-12-26 05:28:17 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-02-28 21:00:23 +0100
commit7c16b3551b5294d86a7dc8e0721c081bd88547ed (patch)
tree481af352889cd5c22166c215d755f93a297869ef /src/video_core/renderer_opengl/gl_rasterizer.cpp
parentgl_state: Remove color mask tracking (diff)
downloadyuzu-7c16b3551b5294d86a7dc8e0721c081bd88547ed.tar
yuzu-7c16b3551b5294d86a7dc8e0721c081bd88547ed.tar.gz
yuzu-7c16b3551b5294d86a7dc8e0721c081bd88547ed.tar.bz2
yuzu-7c16b3551b5294d86a7dc8e0721c081bd88547ed.tar.lz
yuzu-7c16b3551b5294d86a7dc8e0721c081bd88547ed.tar.xz
yuzu-7c16b3551b5294d86a7dc8e0721c081bd88547ed.tar.zst
yuzu-7c16b3551b5294d86a7dc8e0721c081bd88547ed.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp32
1 files changed, 9 insertions, 23 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index d0c811929..3ccedcf55 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -467,12 +467,10 @@ void RasterizerOpenGL::Clear() {
SyncViewport(clear_state);
SyncRasterizeEnable(clear_state);
if (regs.clear_flags.scissor) {
- SyncScissorTest(clear_state);
+ SyncScissorTest();
}
- if (regs.clear_flags.viewport) {
- clear_state.EmulateViewportWithScissor();
- }
+ UNIMPLEMENTED_IF(regs.clear_flags.viewport);
clear_state.Apply();
@@ -508,7 +506,7 @@ void RasterizerOpenGL::Draw(bool is_indexed, bool is_instanced) {
SyncLogicOpState();
SyncCullMode();
SyncPrimitiveRestart();
- SyncScissorTest(state);
+ SyncScissorTest();
SyncTransformFeedback();
SyncPointState();
SyncPolygonOffset();
@@ -1140,25 +1138,13 @@ void RasterizerOpenGL::SyncLogicOpState() {
}
}
-void RasterizerOpenGL::SyncScissorTest(OpenGLState& current_state) {
+void RasterizerOpenGL::SyncScissorTest() {
const auto& regs = system.GPU().Maxwell3D().regs;
- const bool geometry_shaders_enabled =
- regs.IsShaderConfigEnabled(static_cast<size_t>(Maxwell::ShaderProgram::Geometry));
- const std::size_t viewport_count =
- geometry_shaders_enabled ? Tegra::Engines::Maxwell3D::Regs::NumViewports : 1;
- for (std::size_t i = 0; i < viewport_count; i++) {
- const auto& src = regs.scissor_test[i];
- auto& dst = current_state.viewports[i].scissor;
- dst.enabled = (src.enable != 0);
- if (dst.enabled == 0) {
- return;
- }
- const u32 width = src.max_x - src.min_x;
- const u32 height = src.max_y - src.min_y;
- dst.x = src.min_x;
- dst.y = src.min_y;
- dst.width = width;
- dst.height = height;
+ for (std::size_t index = 0; index < Maxwell::NumViewports; ++index) {
+ const auto& src = regs.scissor_test[index];
+ oglEnablei(GL_SCISSOR_TEST, src.enable, static_cast<GLuint>(index));
+ glScissorIndexed(static_cast<GLuint>(index), src.min_x, src.min_y, src.max_x - src.min_x,
+ src.max_y - src.min_y);
}
}