mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2024-11-22 13:55:41 +01:00
gl_rasterizer: Implement viewport swizzles with NV_viewport_swizzle
This commit is contained in:
parent
9b8e962368
commit
f813cd3ff7
@ -1019,6 +1019,14 @@ void RasterizerOpenGL::SyncViewport() {
|
||||
const GLdouble near_depth = src.translate_z - src.scale_z * reduce_z;
|
||||
const GLdouble far_depth = src.translate_z + src.scale_z;
|
||||
glDepthRangeIndexed(static_cast<GLuint>(i), near_depth, far_depth);
|
||||
|
||||
if (!GLAD_GL_NV_viewport_swizzle) {
|
||||
continue;
|
||||
}
|
||||
glViewportSwizzleNV(static_cast<GLuint>(i), MaxwellToGL::ViewportSwizzle(src.swizzle.x),
|
||||
MaxwellToGL::ViewportSwizzle(src.swizzle.y),
|
||||
MaxwellToGL::ViewportSwizzle(src.swizzle.z),
|
||||
MaxwellToGL::ViewportSwizzle(src.swizzle.w));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -503,5 +503,10 @@ inline GLenum PolygonMode(Maxwell::PolygonMode polygon_mode) {
|
||||
return GL_FILL;
|
||||
}
|
||||
|
||||
inline GLenum ViewportSwizzle(Maxwell::ViewportSwizzle swizzle) {
|
||||
// Enumeration order matches register order. We can convert it arithmetically.
|
||||
return GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV + static_cast<GLenum>(swizzle);
|
||||
}
|
||||
|
||||
} // namespace MaxwellToGL
|
||||
} // namespace OpenGL
|
||||
|
Loading…
Reference in New Issue
Block a user