diff options
author | bunnei <bunneidev@gmail.com> | 2015-05-26 00:39:03 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-05-31 07:52:41 +0200 |
commit | e6ace388156735d3f5e2942cafc3d5f5d46b121b (patch) | |
tree | a8e24a233560796c8ff3d496653c4ee26db229f8 /src/video_core/renderer_opengl/pica_to_gl.h | |
parent | rasterizer: Implement AddSigned combiner function for alpha channel. (diff) | |
download | yuzu-e6ace388156735d3f5e2942cafc3d5f5d46b121b.tar yuzu-e6ace388156735d3f5e2942cafc3d5f5d46b121b.tar.gz yuzu-e6ace388156735d3f5e2942cafc3d5f5d46b121b.tar.bz2 yuzu-e6ace388156735d3f5e2942cafc3d5f5d46b121b.tar.lz yuzu-e6ace388156735d3f5e2942cafc3d5f5d46b121b.tar.xz yuzu-e6ace388156735d3f5e2942cafc3d5f5d46b121b.tar.zst yuzu-e6ace388156735d3f5e2942cafc3d5f5d46b121b.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 | 31 |
1 files changed, 31 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 f8763e71b..e566f9f7a 100644 --- a/src/video_core/renderer_opengl/pica_to_gl.h +++ b/src/video_core/renderer_opengl/pica_to_gl.h @@ -71,6 +71,37 @@ inline GLenum BlendFunc(Pica::Regs::BlendFactor factor) { return blend_func_table[(unsigned)factor]; } +inline GLenum LogicOp(Pica::Regs::LogicOp op) { + static const GLenum logic_op_table[] = { + GL_CLEAR, // Clear + GL_AND, // And + GL_AND_REVERSE, // AndReverse + GL_COPY, // Copy + GL_SET, // Set + GL_COPY_INVERTED, // CopyInverted + GL_NOOP, // NoOp + GL_INVERT, // Invert + GL_NAND, // Nand + GL_OR, // Or + GL_NOR, // Nor + GL_XOR, // Xor + GL_EQUIV, // Equiv + GL_AND_INVERTED, // AndInverted + GL_OR_REVERSE, // OrReverse + GL_OR_INVERTED, // OrInverted + }; + + // Range check table for input + if ((unsigned)op >= ARRAY_SIZE(logic_op_table)) { + LOG_CRITICAL(Render_OpenGL, "Unknown logic op %d", op); + UNREACHABLE(); + + return GL_COPY; + } + + return logic_op_table[(unsigned)op]; +} + inline GLenum CompareFunc(Pica::Regs::CompareFunc func) { static const GLenum compare_func_table[] = { GL_NEVER, // CompareFunc::Never |