diff options
author | bunnei <bunneidev@gmail.com> | 2016-05-17 02:00:21 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2016-05-17 02:00:21 +0200 |
commit | e5599ed300b4992e53425df63c7f217171f35603 (patch) | |
tree | b09211d211a75491d4600479132194da71b45d2d /src/video_core/renderer_opengl/pica_to_gl.h | |
parent | Merge pull request #1787 from JayFoxRox/refactor-jit (diff) | |
parent | OpenGL: Support blend equation (diff) | |
download | yuzu-e5599ed300b4992e53425df63c7f217171f35603.tar yuzu-e5599ed300b4992e53425df63c7f217171f35603.tar.gz yuzu-e5599ed300b4992e53425df63c7f217171f35603.tar.bz2 yuzu-e5599ed300b4992e53425df63c7f217171f35603.tar.lz yuzu-e5599ed300b4992e53425df63c7f217171f35603.tar.xz yuzu-e5599ed300b4992e53425df63c7f217171f35603.tar.zst yuzu-e5599ed300b4992e53425df63c7f217171f35603.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/pica_to_gl.h')
-rw-r--r-- | src/video_core/renderer_opengl/pica_to_gl.h | 20 |
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 |