summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/video_core/engines/maxwell_3d.h17
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp17
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h3
3 files changed, 36 insertions, 1 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index 4290da33f..20e1884da 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -532,7 +532,21 @@ public:
532 INSERT_PADDING_WORDS(0x3); 532 INSERT_PADDING_WORDS(0x3);
533 s32 clear_stencil; 533 s32 clear_stencil;
534 534
535 INSERT_PADDING_WORDS(0x6C); 535 INSERT_PADDING_WORDS(0x17);
536
537 struct {
538 u32 enable;
539 union {
540 BitField<0, 16, u32> min_x;
541 BitField<16, 16, u32> max_x;
542 };
543 union {
544 BitField<0, 16, u32> min_y;
545 BitField<16, 16, u32> max_y;
546 };
547 } scissor_test;
548
549 INSERT_PADDING_WORDS(0x52);
536 550
537 s32 stencil_back_func_ref; 551 s32 stencil_back_func_ref;
538 u32 stencil_back_mask; 552 u32 stencil_back_mask;
@@ -1002,6 +1016,7 @@ ASSERT_REG_POSITION(vertex_buffer, 0x35D);
1002ASSERT_REG_POSITION(clear_color[0], 0x360); 1016ASSERT_REG_POSITION(clear_color[0], 0x360);
1003ASSERT_REG_POSITION(clear_depth, 0x364); 1017ASSERT_REG_POSITION(clear_depth, 0x364);
1004ASSERT_REG_POSITION(clear_stencil, 0x368); 1018ASSERT_REG_POSITION(clear_stencil, 0x368);
1019ASSERT_REG_POSITION(scissor_test, 0x380);
1005ASSERT_REG_POSITION(stencil_back_func_ref, 0x3D5); 1020ASSERT_REG_POSITION(stencil_back_func_ref, 0x3D5);
1006ASSERT_REG_POSITION(stencil_back_mask, 0x3D6); 1021ASSERT_REG_POSITION(stencil_back_mask, 0x3D6);
1007ASSERT_REG_POSITION(stencil_back_func_mask, 0x3D7); 1022ASSERT_REG_POSITION(stencil_back_func_mask, 0x3D7);
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index b7215448c..84582c777 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -552,6 +552,7 @@ void RasterizerOpenGL::DrawArrays() {
552 SyncLogicOpState(); 552 SyncLogicOpState();
553 SyncCullMode(); 553 SyncCullMode();
554 SyncAlphaTest(); 554 SyncAlphaTest();
555 SyncScissorTest();
555 SyncTransformFeedback(); 556 SyncTransformFeedback();
556 SyncPointState(); 557 SyncPointState();
557 558
@@ -984,6 +985,22 @@ void RasterizerOpenGL::SyncAlphaTest() {
984 } 985 }
985} 986}
986 987
988void RasterizerOpenGL::SyncScissorTest() {
989 const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
990
991 state.scissor.enabled = (regs.scissor_test.enable != 0);
992 // TODO(Blinkhawk): Figure if the hardware supports scissor testing per viewport and how it's
993 // implemented.
994 if (regs.scissor_test.enable != 0) {
995 const u32 width = regs.scissor_test.max_x - regs.scissor_test.min_x;
996 const u32 height = regs.scissor_test.max_y - regs.scissor_test.min_y;
997 state.scissor.x = regs.scissor_test.min_x;
998 state.scissor.y = regs.scissor_test.min_y;
999 state.scissor.width = width;
1000 state.scissor.height = height;
1001 }
1002}
1003
987void RasterizerOpenGL::SyncTransformFeedback() { 1004void RasterizerOpenGL::SyncTransformFeedback() {
988 const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; 1005 const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
989 1006
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index 8de831468..b1f7ccc7e 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -165,6 +165,9 @@ private:
165 /// Syncs the alpha test state to match the guest state 165 /// Syncs the alpha test state to match the guest state
166 void SyncAlphaTest(); 166 void SyncAlphaTest();
167 167
168 /// Syncs the scissor test state to match the guest state
169 void SyncScissorTest();
170
168 /// Syncs the transform feedback state to match the guest state 171 /// Syncs the transform feedback state to match the guest state
169 void SyncTransformFeedback(); 172 void SyncTransformFeedback();
170 173