diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/maxwell_to_gl.h | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 8b3b3ce92..69dcf952f 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -1019,6 +1019,14 @@ void RasterizerOpenGL::SyncViewport() { | |||
| 1019 | const GLdouble near_depth = src.translate_z - src.scale_z * reduce_z; | 1019 | const GLdouble near_depth = src.translate_z - src.scale_z * reduce_z; |
| 1020 | const GLdouble far_depth = src.translate_z + src.scale_z; | 1020 | const GLdouble far_depth = src.translate_z + src.scale_z; |
| 1021 | glDepthRangeIndexed(static_cast<GLuint>(i), near_depth, far_depth); | 1021 | glDepthRangeIndexed(static_cast<GLuint>(i), near_depth, far_depth); |
| 1022 | |||
| 1023 | if (!GLAD_GL_NV_viewport_swizzle) { | ||
| 1024 | continue; | ||
| 1025 | } | ||
| 1026 | glViewportSwizzleNV(static_cast<GLuint>(i), MaxwellToGL::ViewportSwizzle(src.swizzle.x), | ||
| 1027 | MaxwellToGL::ViewportSwizzle(src.swizzle.y), | ||
| 1028 | MaxwellToGL::ViewportSwizzle(src.swizzle.z), | ||
| 1029 | MaxwellToGL::ViewportSwizzle(src.swizzle.w)); | ||
| 1022 | } | 1030 | } |
| 1023 | } | 1031 | } |
| 1024 | } | 1032 | } |
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h index 2c0c77c28..994ae98eb 100644 --- a/src/video_core/renderer_opengl/maxwell_to_gl.h +++ b/src/video_core/renderer_opengl/maxwell_to_gl.h | |||
| @@ -503,5 +503,10 @@ inline GLenum PolygonMode(Maxwell::PolygonMode polygon_mode) { | |||
| 503 | return GL_FILL; | 503 | return GL_FILL; |
| 504 | } | 504 | } |
| 505 | 505 | ||
| 506 | inline GLenum ViewportSwizzle(Maxwell::ViewportSwizzle swizzle) { | ||
| 507 | // Enumeration order matches register order. We can convert it arithmetically. | ||
| 508 | return GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV + static_cast<GLenum>(swizzle); | ||
| 509 | } | ||
| 510 | |||
| 506 | } // namespace MaxwellToGL | 511 | } // namespace MaxwellToGL |
| 507 | } // namespace OpenGL | 512 | } // namespace OpenGL |