summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_shader_manager.cpp
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2018-10-10 22:34:15 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2018-10-22 21:07:33 +0200
commit59a004f915e84fec4a4fed125661eb486e1de198 (patch)
tree0503fc9161e632023e1deeb005b33ee028440bcc /src/video_core/renderer_opengl/gl_shader_manager.cpp
parentCache uniform locations and restructure the implementation (diff)
downloadyuzu-59a004f915e84fec4a4fed125661eb486e1de198.tar
yuzu-59a004f915e84fec4a4fed125661eb486e1de198.tar.gz
yuzu-59a004f915e84fec4a4fed125661eb486e1de198.tar.bz2
yuzu-59a004f915e84fec4a4fed125661eb486e1de198.tar.lz
yuzu-59a004f915e84fec4a4fed125661eb486e1de198.tar.xz
yuzu-59a004f915e84fec4a4fed125661eb486e1de198.tar.zst
yuzu-59a004f915e84fec4a4fed125661eb486e1de198.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_manager.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_manager.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_manager.cpp b/src/video_core/renderer_opengl/gl_shader_manager.cpp
index 010857ec6..8b8869ecb 100644
--- a/src/video_core/renderer_opengl/gl_shader_manager.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_manager.cpp
@@ -16,6 +16,17 @@ void MaxwellUniformData::SetFromRegs(const Maxwell3D::State::ShaderStageInfo& sh
viewport_flip[0] = regs.viewport_transform[0].scale_x < 0.0 ? -1.0f : 1.0f;
viewport_flip[1] = regs.viewport_transform[0].scale_y < 0.0 ? -1.0f : 1.0f;
+ u32 func = static_cast<u32>(regs.alpha_test_func);
+ // Normalize the gl variants of opCompare to be the same as the normal variants
+ u32 op_gl_variant_base = static_cast<u32>(Tegra::Engines::Maxwell3D::Regs::ComparisonOp::Never);
+ if (func >= op_gl_variant_base) {
+ func = func - op_gl_variant_base + 1U;
+ }
+
+ alpha_test.enabled = regs.alpha_test_enabled;
+ alpha_test.func = func;
+ alpha_test.ref = regs.alpha_test_ref;
+
// We only assign the instance to the first component of the vector, the rest is just padding.
instance_id[0] = state.current_instance;