aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl/gl_rasterizer.cpp
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2018-10-10 09:20:13 -0400
committerFernandoS27 <fsahmkow27@gmail.com>2018-10-22 15:07:30 -0400
commit7b39107e3ae056a857e1780b2123e757b8deab26 (patch)
tree41837991e80339ace30754f832af05c451b2fd3e /src/video_core/renderer_opengl/gl_rasterizer.cpp
parentaa620c14af0a9bc2bf7784ed096298fc3c8899c3 (diff)
Added Alpha Func
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index e2a422052..17860d447 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -885,10 +885,18 @@ u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, Shader& shader,
void RasterizerOpenGL::SetupAlphaTesting(Shader& shader) {
const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
- glProgramUniform1i(shader->GetProgramHandle(), shader->GetAlphaTestingEnableLocation(),
+ glProgramUniform1ui(shader->GetProgramHandle(), shader->GetAlphaTestingEnableLocation(),
regs.alpha_test_enabled);
glProgramUniform1f(shader->GetProgramHandle(), shader->GetAlphaTestingRefLocation(),
regs.alpha_test_ref);
+
+ u32 func = static_cast<u32>(regs.alpha_test_func);
+ // Normalize the gl variants of opCompare to be the same as the normal variants
+ if (func >= 0x200) {
+ func = func - 0x200 + 1U;
+ }
+
+ glProgramUniform1ui(shader->GetProgramHandle(), shader->GetAlphaTestingFuncLocation(), func);
}
void RasterizerOpenGL::SyncViewport() {