diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 22 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 10 |
2 files changed, 29 insertions, 3 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 988a6433e..cc1f90de6 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -478,7 +478,9 @@ public: | |||
| 478 | 478 | ||
| 479 | u32 depth_write_enabled; | 479 | u32 depth_write_enabled; |
| 480 | 480 | ||
| 481 | INSERT_PADDING_WORDS(0x8); | 481 | INSERT_PADDING_WORDS(0x7); |
| 482 | |||
| 483 | u32 d3d_cull_mode; | ||
| 482 | 484 | ||
| 483 | BitField<0, 3, ComparisonOp> depth_test_func; | 485 | BitField<0, 3, ComparisonOp> depth_test_func; |
| 484 | 486 | ||
| @@ -498,7 +500,13 @@ public: | |||
| 498 | u32 enable[NumRenderTargets]; | 500 | u32 enable[NumRenderTargets]; |
| 499 | } blend; | 501 | } blend; |
| 500 | 502 | ||
| 501 | INSERT_PADDING_WORDS(0x2D); | 503 | INSERT_PADDING_WORDS(0xB); |
| 504 | |||
| 505 | union { | ||
| 506 | BitField<4, 1, u32> triangle_rast_flip; | ||
| 507 | } screen_y_control; | ||
| 508 | |||
| 509 | INSERT_PADDING_WORDS(0x21); | ||
| 502 | 510 | ||
| 503 | u32 vb_element_base; | 511 | u32 vb_element_base; |
| 504 | 512 | ||
| @@ -528,7 +536,12 @@ public: | |||
| 528 | } | 536 | } |
| 529 | } tic; | 537 | } tic; |
| 530 | 538 | ||
| 531 | INSERT_PADDING_WORDS(0x22); | 539 | INSERT_PADDING_WORDS(0x21); |
| 540 | |||
| 541 | union { | ||
| 542 | BitField<2, 1, u32> coord_origin; | ||
| 543 | BitField<3, 10, u32> enable; | ||
| 544 | } point_coord_replace; | ||
| 532 | 545 | ||
| 533 | struct { | 546 | struct { |
| 534 | u32 code_address_high; | 547 | u32 code_address_high; |
| @@ -818,11 +831,14 @@ ASSERT_REG_POSITION(rt_control, 0x487); | |||
| 818 | ASSERT_REG_POSITION(depth_test_enable, 0x4B3); | 831 | ASSERT_REG_POSITION(depth_test_enable, 0x4B3); |
| 819 | ASSERT_REG_POSITION(independent_blend_enable, 0x4B9); | 832 | ASSERT_REG_POSITION(independent_blend_enable, 0x4B9); |
| 820 | ASSERT_REG_POSITION(depth_write_enabled, 0x4BA); | 833 | ASSERT_REG_POSITION(depth_write_enabled, 0x4BA); |
| 834 | ASSERT_REG_POSITION(d3d_cull_mode, 0x4C2); | ||
| 821 | ASSERT_REG_POSITION(depth_test_func, 0x4C3); | 835 | ASSERT_REG_POSITION(depth_test_func, 0x4C3); |
| 822 | ASSERT_REG_POSITION(blend, 0x4CF); | 836 | ASSERT_REG_POSITION(blend, 0x4CF); |
| 837 | ASSERT_REG_POSITION(screen_y_control, 0x4EB); | ||
| 823 | ASSERT_REG_POSITION(vb_element_base, 0x50D); | 838 | ASSERT_REG_POSITION(vb_element_base, 0x50D); |
| 824 | ASSERT_REG_POSITION(tsc, 0x557); | 839 | ASSERT_REG_POSITION(tsc, 0x557); |
| 825 | ASSERT_REG_POSITION(tic, 0x55D); | 840 | ASSERT_REG_POSITION(tic, 0x55D); |
| 841 | ASSERT_REG_POSITION(point_coord_replace, 0x581); | ||
| 826 | ASSERT_REG_POSITION(code_address, 0x582); | 842 | ASSERT_REG_POSITION(code_address, 0x582); |
| 827 | ASSERT_REG_POSITION(draw, 0x585); | 843 | ASSERT_REG_POSITION(draw, 0x585); |
| 828 | ASSERT_REG_POSITION(index_array, 0x5F2); | 844 | ASSERT_REG_POSITION(index_array, 0x5F2); |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index e516eb1ad..3c3657d9d 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -771,6 +771,16 @@ void RasterizerOpenGL::SyncCullMode() { | |||
| 771 | if (state.cull.enabled) { | 771 | if (state.cull.enabled) { |
| 772 | state.cull.front_face = MaxwellToGL::FrontFace(regs.cull.front_face); | 772 | state.cull.front_face = MaxwellToGL::FrontFace(regs.cull.front_face); |
| 773 | state.cull.mode = MaxwellToGL::CullFace(regs.cull.cull_face); | 773 | state.cull.mode = MaxwellToGL::CullFace(regs.cull.cull_face); |
| 774 | |||
| 775 | // If the GPU is configured to flip the rasterized triangles, then we need to flip the | ||
| 776 | // notion of front and back. Note: We flip the triangles when the value of the register is 0 | ||
| 777 | // because OpenGL already does it for us. | ||
| 778 | if (regs.screen_y_control.triangle_rast_flip == 0) { | ||
| 779 | if (state.cull.front_face == GL_CCW) | ||
| 780 | state.cull.front_face = GL_CW; | ||
| 781 | else if (state.cull.front_face == GL_CW) | ||
| 782 | state.cull.front_face = GL_CCW; | ||
| 783 | } | ||
| 774 | } | 784 | } |
| 775 | } | 785 | } |
| 776 | 786 | ||