diff options
author | FernandoS27 <fsahmkow27@gmail.com> | 2018-10-10 15:45:22 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2018-10-22 21:07:31 +0200 |
commit | bcb5b924fd10183fb8fdbbbbe3ba909f8b9fc346 (patch) | |
tree | c94b3071fca24eaf4eec9e09a6c8b0255fa89d7b | |
parent | Added Alpha Func (diff) | |
download | yuzu-bcb5b924fd10183fb8fdbbbbe3ba909f8b9fc346.tar yuzu-bcb5b924fd10183fb8fdbbbbe3ba909f8b9fc346.tar.gz yuzu-bcb5b924fd10183fb8fdbbbbe3ba909f8b9fc346.tar.bz2 yuzu-bcb5b924fd10183fb8fdbbbbe3ba909f8b9fc346.tar.lz yuzu-bcb5b924fd10183fb8fdbbbbe3ba909f8b9fc346.tar.xz yuzu-bcb5b924fd10183fb8fdbbbbe3ba909f8b9fc346.tar.zst yuzu-bcb5b924fd10183fb8fdbbbbe3ba909f8b9fc346.zip |
4 files changed, 9 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 17860d447..e5fc6e8f5 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -572,8 +572,8 @@ void RasterizerOpenGL::DrawArrays() { SyncBlendState(); SyncLogicOpState(); SyncCullMode(); - SyncAlphaTest(); SyncScissorTest(); + // Alpha Testing is synced on shaders. SyncTransformFeedback(); SyncPointState(); @@ -886,7 +886,7 @@ void RasterizerOpenGL::SetupAlphaTesting(Shader& shader) { const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; glProgramUniform1ui(shader->GetProgramHandle(), shader->GetAlphaTestingEnableLocation(), - regs.alpha_test_enabled); + regs.alpha_test_enabled); glProgramUniform1f(shader->GetProgramHandle(), shader->GetAlphaTestingRefLocation(), regs.alpha_test_ref); @@ -1026,6 +1026,7 @@ 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; @@ -1053,6 +1054,8 @@ void RasterizerOpenGL::SyncScissorTest() { } } +======= +>>>>>>> Remove SyncAlphaTest and clang format void RasterizerOpenGL::SyncTransformFeedback() { const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 06ba23f48..32a30e1b6 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -132,6 +132,7 @@ private: u32 SetupTextures(Tegra::Engines::Maxwell3D::Regs::ShaderStage stage, Shader& shader, GLenum primitive_mode, u32 current_unit); + /// Syncs the alpha test state to match the guest state void SetupAlphaTesting(Shader& shader); /// Syncs the viewport to match the guest state @@ -164,9 +165,6 @@ private: /// Syncs the LogicOp state to match the guest state void SyncLogicOpState(); - /// Syncs the alpha test state to match the guest state - void SyncAlphaTest(); - /// Syncs the scissor test state to match the guest state void SyncScissorTest(); diff --git a/src/video_core/renderer_opengl/gl_shader_cache.h b/src/video_core/renderer_opengl/gl_shader_cache.h index 9333f423f..2eaa63804 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.h +++ b/src/video_core/renderer_opengl/gl_shader_cache.h @@ -73,7 +73,6 @@ public: /// Gets the GL uniform location for the specified resource, caching as needed GLint GetUniformLocation(const GLShader::SamplerEntry& sampler); - GLint GetAlphaTestingEnableLocation(); GLint GetAlphaTestingFuncLocation(); GLint GetAlphaTestingRefLocation(); diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index cbf501cc7..7bd4d2d95 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -1280,8 +1280,9 @@ private: header.ps.IsColorComponentOutputEnabled(render_target, 1) || header.ps.IsColorComponentOutputEnabled(render_target, 2) || header.ps.IsColorComponentOutputEnabled(render_target, 3)) { - shader.AddLine(fmt::format("if (AlphaFunc({}, alpha_testing_ref, alpha_testing_func)) discard;", - regs.GetRegisterAsFloat(current_reg))); + shader.AddLine(fmt::format( + "if (AlphaFunc({}, alpha_testing_ref, alpha_testing_func)) discard;", + regs.GetRegisterAsFloat(current_reg))); current_reg += 4; } } |