summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/pica_to_gl.h
diff options
context:
space:
mode:
authorJannik Vogel <email@jannikvogel.de>2016-05-12 22:57:15 +0200
committerJannik Vogel <email@jannikvogel.de>2016-05-12 22:57:40 +0200
commit5864cb7e00d241473b43f8895449f8cebb9e7ec5 (patch)
tree64decd59c20ccb7f8c3326758fabe2552f469827 /src/video_core/renderer_opengl/pica_to_gl.h
parentMerge pull request #1690 from JayFoxRox/tex-type-3 (diff)
downloadyuzu-5864cb7e00d241473b43f8895449f8cebb9e7ec5.tar
yuzu-5864cb7e00d241473b43f8895449f8cebb9e7ec5.tar.gz
yuzu-5864cb7e00d241473b43f8895449f8cebb9e7ec5.tar.bz2
yuzu-5864cb7e00d241473b43f8895449f8cebb9e7ec5.tar.lz
yuzu-5864cb7e00d241473b43f8895449f8cebb9e7ec5.tar.xz
yuzu-5864cb7e00d241473b43f8895449f8cebb9e7ec5.tar.zst
yuzu-5864cb7e00d241473b43f8895449f8cebb9e7ec5.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/pica_to_gl.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/pica_to_gl.h b/src/video_core/renderer_opengl/pica_to_gl.h
index 976d1f364..6dc2758c5 100644
--- a/src/video_core/renderer_opengl/pica_to_gl.h
+++ b/src/video_core/renderer_opengl/pica_to_gl.h
@@ -78,6 +78,26 @@ inline GLenum WrapMode(Pica::Regs::TextureConfig::WrapMode mode) {
return gl_mode;
}
+inline GLenum BlendEquation(Pica::Regs::BlendEquation equation) {
+ static const GLenum blend_equation_table[] = {
+ GL_FUNC_ADD, // BlendEquation::Add
+ GL_FUNC_SUBTRACT, // BlendEquation::Subtract
+ GL_FUNC_REVERSE_SUBTRACT, // BlendEquation::ReverseSubtract
+ GL_MIN, // BlendEquation::Min
+ GL_MAX, // BlendEquation::Max
+ };
+
+ // Range check table for input
+ if (static_cast<size_t>(equation) >= ARRAY_SIZE(blend_equation_table)) {
+ LOG_CRITICAL(Render_OpenGL, "Unknown blend equation %d", equation);
+ UNREACHABLE();
+
+ return GL_FUNC_ADD;
+ }
+
+ return blend_equation_table[(unsigned)equation];
+}
+
inline GLenum BlendFunc(Pica::Regs::BlendFactor factor) {
static const GLenum blend_func_table[] = {
GL_ZERO, // BlendFactor::Zero