summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar FernandoS272018-10-10 09:45:22 -0400
committerGravatar FernandoS272018-10-22 15:07:31 -0400
commitbcb5b924fd10183fb8fdbbbbe3ba909f8b9fc346 (patch)
treec94b3071fca24eaf4eec9e09a6c8b0255fa89d7b
parentAdded Alpha Func (diff)
downloadyuzu-bcb5b924fd10183fb8fdbbbbe3ba909f8b9fc346.tar.gz
yuzu-bcb5b924fd10183fb8fdbbbbe3ba909f8b9fc346.tar.xz
yuzu-bcb5b924fd10183fb8fdbbbbe3ba909f8b9fc346.zip
Remove SyncAlphaTest and clang format
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp7
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h4
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.h1
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp5
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() {
572 SyncBlendState(); 572 SyncBlendState();
573 SyncLogicOpState(); 573 SyncLogicOpState();
574 SyncCullMode(); 574 SyncCullMode();
575 SyncAlphaTest();
576 SyncScissorTest(); 575 SyncScissorTest();
576 // Alpha Testing is synced on shaders.
577 SyncTransformFeedback(); 577 SyncTransformFeedback();
578 SyncPointState(); 578 SyncPointState();
579 579
@@ -886,7 +886,7 @@ void RasterizerOpenGL::SetupAlphaTesting(Shader& shader) {
886 const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; 886 const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
887 887
888 glProgramUniform1ui(shader->GetProgramHandle(), shader->GetAlphaTestingEnableLocation(), 888 glProgramUniform1ui(shader->GetProgramHandle(), shader->GetAlphaTestingEnableLocation(),
889 regs.alpha_test_enabled); 889 regs.alpha_test_enabled);
890 glProgramUniform1f(shader->GetProgramHandle(), shader->GetAlphaTestingRefLocation(), 890 glProgramUniform1f(shader->GetProgramHandle(), shader->GetAlphaTestingRefLocation(),
891 regs.alpha_test_ref); 891 regs.alpha_test_ref);
892 892
@@ -1026,6 +1026,7 @@ void RasterizerOpenGL::SyncLogicOpState() {
1026 state.logic_op.operation = MaxwellToGL::LogicOp(regs.logic_op.operation); 1026 state.logic_op.operation = MaxwellToGL::LogicOp(regs.logic_op.operation);
1027} 1027}
1028 1028
1029<<<<<<< HEAD
1029void RasterizerOpenGL::SyncAlphaTest() { 1030void RasterizerOpenGL::SyncAlphaTest() {
1030 const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; 1031 const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
1031 1032
@@ -1053,6 +1054,8 @@ void RasterizerOpenGL::SyncScissorTest() {
1053 } 1054 }
1054} 1055}
1055 1056
1057=======
1058>>>>>>> Remove SyncAlphaTest and clang format
1056void RasterizerOpenGL::SyncTransformFeedback() { 1059void RasterizerOpenGL::SyncTransformFeedback() {
1057 const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; 1060 const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
1058 1061
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:
132 u32 SetupTextures(Tegra::Engines::Maxwell3D::Regs::ShaderStage stage, Shader& shader, 132 u32 SetupTextures(Tegra::Engines::Maxwell3D::Regs::ShaderStage stage, Shader& shader,
133 GLenum primitive_mode, u32 current_unit); 133 GLenum primitive_mode, u32 current_unit);
134 134
135 /// Syncs the alpha test state to match the guest state
135 void SetupAlphaTesting(Shader& shader); 136 void SetupAlphaTesting(Shader& shader);
136 137
137 /// Syncs the viewport to match the guest state 138 /// Syncs the viewport to match the guest state
@@ -164,9 +165,6 @@ private:
164 /// Syncs the LogicOp state to match the guest state 165 /// Syncs the LogicOp state to match the guest state
165 void SyncLogicOpState(); 166 void SyncLogicOpState();
166 167
167 /// Syncs the alpha test state to match the guest state
168 void SyncAlphaTest();
169
170 /// Syncs the scissor test state to match the guest state 168 /// Syncs the scissor test state to match the guest state
171 void SyncScissorTest(); 169 void SyncScissorTest();
172 170
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:
73 /// Gets the GL uniform location for the specified resource, caching as needed 73 /// Gets the GL uniform location for the specified resource, caching as needed
74 GLint GetUniformLocation(const GLShader::SamplerEntry& sampler); 74 GLint GetUniformLocation(const GLShader::SamplerEntry& sampler);
75 75
76
77 GLint GetAlphaTestingEnableLocation(); 76 GLint GetAlphaTestingEnableLocation();
78 GLint GetAlphaTestingFuncLocation(); 77 GLint GetAlphaTestingFuncLocation();
79 GLint GetAlphaTestingRefLocation(); 78 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:
1280 header.ps.IsColorComponentOutputEnabled(render_target, 1) || 1280 header.ps.IsColorComponentOutputEnabled(render_target, 1) ||
1281 header.ps.IsColorComponentOutputEnabled(render_target, 2) || 1281 header.ps.IsColorComponentOutputEnabled(render_target, 2) ||
1282 header.ps.IsColorComponentOutputEnabled(render_target, 3)) { 1282 header.ps.IsColorComponentOutputEnabled(render_target, 3)) {
1283 shader.AddLine(fmt::format("if (AlphaFunc({}, alpha_testing_ref, alpha_testing_func)) discard;", 1283 shader.AddLine(fmt::format(
1284 regs.GetRegisterAsFloat(current_reg))); 1284 "if (AlphaFunc({}, alpha_testing_ref, alpha_testing_func)) discard;",
1285 regs.GetRegisterAsFloat(current_reg)));
1285 current_reg += 4; 1286 current_reg += 4;
1286 } 1287 }
1287 } 1288 }