summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/maxwell_to_gl.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-03 03:24:43 +0200
committerGitHub <noreply@github.com>2018-07-03 03:24:43 +0200
commit92c713506542d5e628a5495943792b11e8de5c20 (patch)
tree1b46282f09e46b163be059965aaf1dc410ba1be4 /src/video_core/renderer_opengl/maxwell_to_gl.h
parentMerge pull request #606 from Subv/base_vertex (diff)
parentGPU: Set up the culling configuration on each draw. (diff)
downloadyuzu-92c713506542d5e628a5495943792b11e8de5c20.tar
yuzu-92c713506542d5e628a5495943792b11e8de5c20.tar.gz
yuzu-92c713506542d5e628a5495943792b11e8de5c20.tar.bz2
yuzu-92c713506542d5e628a5495943792b11e8de5c20.tar.lz
yuzu-92c713506542d5e628a5495943792b11e8de5c20.tar.xz
yuzu-92c713506542d5e628a5495943792b11e8de5c20.tar.zst
yuzu-92c713506542d5e628a5495943792b11e8de5c20.zip
Diffstat (limited to 'src/video_core/renderer_opengl/maxwell_to_gl.h')
-rw-r--r--src/video_core/renderer_opengl/maxwell_to_gl.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h
index 2155fb019..392041a1c 100644
--- a/src/video_core/renderer_opengl/maxwell_to_gl.h
+++ b/src/video_core/renderer_opengl/maxwell_to_gl.h
@@ -201,4 +201,54 @@ inline GLenum SwizzleSource(Tegra::Texture::SwizzleSource source) {
return {};
}
+inline GLenum ComparisonOp(Maxwell::ComparisonOp comparison) {
+ switch (comparison) {
+ case Maxwell::ComparisonOp::Never:
+ return GL_NEVER;
+ case Maxwell::ComparisonOp::Less:
+ return GL_LESS;
+ case Maxwell::ComparisonOp::Equal:
+ return GL_EQUAL;
+ case Maxwell::ComparisonOp::LessEqual:
+ return GL_LEQUAL;
+ case Maxwell::ComparisonOp::Greater:
+ return GL_GREATER;
+ case Maxwell::ComparisonOp::NotEqual:
+ return GL_NOTEQUAL;
+ case Maxwell::ComparisonOp::GreaterEqual:
+ return GL_GEQUAL;
+ case Maxwell::ComparisonOp::Always:
+ return GL_ALWAYS;
+ }
+ NGLOG_CRITICAL(Render_OpenGL, "Unimplemented comparison op={}", static_cast<u32>(comparison));
+ UNREACHABLE();
+ return {};
+}
+
+inline GLenum FrontFace(Maxwell::Cull::FrontFace front_face) {
+ switch (front_face) {
+ case Maxwell::Cull::FrontFace::ClockWise:
+ return GL_CW;
+ case Maxwell::Cull::FrontFace::CounterClockWise:
+ return GL_CCW;
+ }
+ NGLOG_CRITICAL(Render_OpenGL, "Unimplemented front face cull={}", static_cast<u32>(front_face));
+ UNREACHABLE();
+ return {};
+}
+
+inline GLenum CullFace(Maxwell::Cull::CullFace cull_face) {
+ switch (cull_face) {
+ case Maxwell::Cull::CullFace::Front:
+ return GL_FRONT;
+ case Maxwell::Cull::CullFace::Back:
+ return GL_BACK;
+ case Maxwell::Cull::CullFace::FrontAndBack:
+ return GL_FRONT_AND_BACK;
+ }
+ NGLOG_CRITICAL(Render_OpenGL, "Unimplemented cull face={}", static_cast<u32>(cull_face));
+ UNREACHABLE();
+ return {};
+}
+
} // namespace MaxwellToGL