diff options
author | FernandoS27 <fsahmkow27@gmail.com> | 2018-10-10 21:06:32 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2018-10-22 21:07:32 +0200 |
commit | 17315cee16df0848ed095ba3bc3fc1460465a682 (patch) | |
tree | 389f727594923b179584c48c85b994d269c1f937 /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | Remove SyncAlphaTest and clang format (diff) | |
download | yuzu-17315cee16df0848ed095ba3bc3fc1460465a682.tar yuzu-17315cee16df0848ed095ba3bc3fc1460465a682.tar.gz yuzu-17315cee16df0848ed095ba3bc3fc1460465a682.tar.bz2 yuzu-17315cee16df0848ed095ba3bc3fc1460465a682.tar.lz yuzu-17315cee16df0848ed095ba3bc3fc1460465a682.tar.xz yuzu-17315cee16df0848ed095ba3bc3fc1460465a682.tar.zst yuzu-17315cee16df0848ed095ba3bc3fc1460465a682.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index e5fc6e8f5..0f8227f7b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -885,18 +885,14 @@ u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, Shader& shader, void RasterizerOpenGL::SetupAlphaTesting(Shader& shader) { const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; - 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; + u32 op = static_cast<u32>(Tegra::Engines::Maxwell3D::Regs::ComparisonOp::Never); + if (func >= op) { + func = func - op + 1U; } - glProgramUniform1ui(shader->GetProgramHandle(), shader->GetAlphaTestingFuncLocation(), func); + shader->SetAlphaTesting(regs.alpha_test_enabled == 1, regs.alpha_test_ref, func); } void RasterizerOpenGL::SyncViewport() { @@ -1026,18 +1022,6 @@ void RasterizerOpenGL::SyncLogicOpState() { state.logic_op.operation = MaxwellToGL::LogicOp(regs.logic_op.operation); } -<<<<<<< HEAD -void RasterizerOpenGL::SyncAlphaTest() { - const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; - - // TODO(Rodrigo): Alpha testing is a legacy OpenGL feature, but it can be - // implemented with a test+discard in fragment shaders. - if (regs.alpha_test_enabled != 0) { - LOG_CRITICAL(Render_OpenGL, "Alpha testing is not implemented"); - UNREACHABLE(); - } -} - void RasterizerOpenGL::SyncScissorTest() { const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; @@ -1054,8 +1038,6 @@ void RasterizerOpenGL::SyncScissorTest() { } } -======= ->>>>>>> Remove SyncAlphaTest and clang format void RasterizerOpenGL::SyncTransformFeedback() { const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; |