summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorGravatar bunnei2020-12-05 00:48:08 -0800
committerGravatar GitHub2020-12-05 00:48:08 -0800
commite6a896c4bdf9cc47c2002c115c9ff280e540fd1b (patch)
treee5cd397cb3a11f1529f38ed8fa0a0185d07becaa /src/video_core/renderer_opengl
parentMerge pull request #5127 from FearlessTobi/port-5617 (diff)
parentvideo_core: Resolve more variable shadowing scenarios (diff)
downloadyuzu-e6a896c4bdf9cc47c2002c115c9ff280e540fd1b.tar.gz
yuzu-e6a896c4bdf9cc47c2002c115c9ff280e540fd1b.tar.xz
yuzu-e6a896c4bdf9cc47c2002c115c9ff280e540fd1b.zip
Merge pull request #5124 from lioncash/video-shadow
video_core: Resolve more variable shadowing scenarios
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_arb_decompiler.cpp48
-rw-r--r--src/video_core/renderer_opengl/gl_fence_manager.cpp14
-rw-r--r--src/video_core/renderer_opengl/gl_fence_manager.h10
-rw-r--r--src/video_core/renderer_opengl/gl_query_cache.cpp15
-rw-r--r--src/video_core/renderer_opengl/gl_query_cache.h6
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.cpp6
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.h2
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp35
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.h12
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp20
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.h5
11 files changed, 88 insertions, 85 deletions
diff --git a/src/video_core/renderer_opengl/gl_arb_decompiler.cpp b/src/video_core/renderer_opengl/gl_arb_decompiler.cpp
index d6120c23e..5378c398e 100644
--- a/src/video_core/renderer_opengl/gl_arb_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_arb_decompiler.cpp
@@ -187,8 +187,8 @@ std::string TextureType(const MetaTexture& meta) {
187 187
188class ARBDecompiler final { 188class ARBDecompiler final {
189public: 189public:
190 explicit ARBDecompiler(const Device& device, const ShaderIR& ir, const Registry& registry, 190 explicit ARBDecompiler(const Device& device_, const ShaderIR& ir_, const Registry& registry_,
191 ShaderType stage, std::string_view identifier); 191 ShaderType stage_, std::string_view identifier);
192 192
193 std::string Code() const { 193 std::string Code() const {
194 return shader_source; 194 return shader_source;
@@ -802,9 +802,9 @@ private:
802 }; 802 };
803}; 803};
804 804
805ARBDecompiler::ARBDecompiler(const Device& device, const ShaderIR& ir, const Registry& registry, 805ARBDecompiler::ARBDecompiler(const Device& device_, const ShaderIR& ir_, const Registry& registry_,
806 ShaderType stage, std::string_view identifier) 806 ShaderType stage_, std::string_view identifier)
807 : device{device}, ir{ir}, registry{registry}, stage{stage} { 807 : device{device_}, ir{ir_}, registry{registry_}, stage{stage_} {
808 DefineGlobalMemory(); 808 DefineGlobalMemory();
809 809
810 AddLine("TEMP RC;"); 810 AddLine("TEMP RC;");
@@ -1134,44 +1134,44 @@ void ARBDecompiler::VisitAST(const ASTNode& node) {
1134 for (ASTNode current = ast->nodes.GetFirst(); current; current = current->GetNext()) { 1134 for (ASTNode current = ast->nodes.GetFirst(); current; current = current->GetNext()) {
1135 VisitAST(current); 1135 VisitAST(current);
1136 } 1136 }
1137 } else if (const auto ast = std::get_if<ASTIfThen>(&*node->GetInnerData())) { 1137 } else if (const auto if_then = std::get_if<ASTIfThen>(&*node->GetInnerData())) {
1138 const std::string condition = VisitExpression(ast->condition); 1138 const std::string condition = VisitExpression(if_then->condition);
1139 ResetTemporaries(); 1139 ResetTemporaries();
1140 1140
1141 AddLine("MOVC.U RC.x, {};", condition); 1141 AddLine("MOVC.U RC.x, {};", condition);
1142 AddLine("IF NE.x;"); 1142 AddLine("IF NE.x;");
1143 for (ASTNode current = ast->nodes.GetFirst(); current; current = current->GetNext()) { 1143 for (ASTNode current = if_then->nodes.GetFirst(); current; current = current->GetNext()) {
1144 VisitAST(current); 1144 VisitAST(current);
1145 } 1145 }
1146 AddLine("ENDIF;"); 1146 AddLine("ENDIF;");
1147 } else if (const auto ast = std::get_if<ASTIfElse>(&*node->GetInnerData())) { 1147 } else if (const auto if_else = std::get_if<ASTIfElse>(&*node->GetInnerData())) {
1148 AddLine("ELSE;"); 1148 AddLine("ELSE;");
1149 for (ASTNode current = ast->nodes.GetFirst(); current; current = current->GetNext()) { 1149 for (ASTNode current = if_else->nodes.GetFirst(); current; current = current->GetNext()) {
1150 VisitAST(current); 1150 VisitAST(current);
1151 } 1151 }
1152 } else if (const auto ast = std::get_if<ASTBlockDecoded>(&*node->GetInnerData())) { 1152 } else if (const auto decoded = std::get_if<ASTBlockDecoded>(&*node->GetInnerData())) {
1153 VisitBlock(ast->nodes); 1153 VisitBlock(decoded->nodes);
1154 } else if (const auto ast = std::get_if<ASTVarSet>(&*node->GetInnerData())) { 1154 } else if (const auto var_set = std::get_if<ASTVarSet>(&*node->GetInnerData())) {
1155 AddLine("MOV.U F{}, {};", ast->index, VisitExpression(ast->condition)); 1155 AddLine("MOV.U F{}, {};", var_set->index, VisitExpression(var_set->condition));
1156 ResetTemporaries(); 1156 ResetTemporaries();
1157 } else if (const auto ast = std::get_if<ASTDoWhile>(&*node->GetInnerData())) { 1157 } else if (const auto do_while = std::get_if<ASTDoWhile>(&*node->GetInnerData())) {
1158 const std::string condition = VisitExpression(ast->condition); 1158 const std::string condition = VisitExpression(do_while->condition);
1159 ResetTemporaries(); 1159 ResetTemporaries();
1160 AddLine("REP;"); 1160 AddLine("REP;");
1161 for (ASTNode current = ast->nodes.GetFirst(); current; current = current->GetNext()) { 1161 for (ASTNode current = do_while->nodes.GetFirst(); current; current = current->GetNext()) {
1162 VisitAST(current); 1162 VisitAST(current);
1163 } 1163 }
1164 AddLine("MOVC.U RC.x, {};", condition); 1164 AddLine("MOVC.U RC.x, {};", condition);
1165 AddLine("BRK (NE.x);"); 1165 AddLine("BRK (NE.x);");
1166 AddLine("ENDREP;"); 1166 AddLine("ENDREP;");
1167 } else if (const auto ast = std::get_if<ASTReturn>(&*node->GetInnerData())) { 1167 } else if (const auto ast_return = std::get_if<ASTReturn>(&*node->GetInnerData())) {
1168 const bool is_true = ExprIsTrue(ast->condition); 1168 const bool is_true = ExprIsTrue(ast_return->condition);
1169 if (!is_true) { 1169 if (!is_true) {
1170 AddLine("MOVC.U RC.x, {};", VisitExpression(ast->condition)); 1170 AddLine("MOVC.U RC.x, {};", VisitExpression(ast_return->condition));
1171 AddLine("IF NE.x;"); 1171 AddLine("IF NE.x;");
1172 ResetTemporaries(); 1172 ResetTemporaries();
1173 } 1173 }
1174 if (ast->kills) { 1174 if (ast_return->kills) {
1175 AddLine("KIL TR;"); 1175 AddLine("KIL TR;");
1176 } else { 1176 } else {
1177 Exit(); 1177 Exit();
@@ -1179,11 +1179,11 @@ void ARBDecompiler::VisitAST(const ASTNode& node) {
1179 if (!is_true) { 1179 if (!is_true) {
1180 AddLine("ENDIF;"); 1180 AddLine("ENDIF;");
1181 } 1181 }
1182 } else if (const auto ast = std::get_if<ASTBreak>(&*node->GetInnerData())) { 1182 } else if (const auto ast_break = std::get_if<ASTBreak>(&*node->GetInnerData())) {
1183 if (ExprIsTrue(ast->condition)) { 1183 if (ExprIsTrue(ast_break->condition)) {
1184 AddLine("BRK;"); 1184 AddLine("BRK;");
1185 } else { 1185 } else {
1186 AddLine("MOVC.U RC.x, {};", VisitExpression(ast->condition)); 1186 AddLine("MOVC.U RC.x, {};", VisitExpression(ast_break->condition));
1187 AddLine("BRK (NE.x);"); 1187 AddLine("BRK (NE.x);");
1188 ResetTemporaries(); 1188 ResetTemporaries();
1189 } 1189 }
diff --git a/src/video_core/renderer_opengl/gl_fence_manager.cpp b/src/video_core/renderer_opengl/gl_fence_manager.cpp
index b532fdcc2..6040646cb 100644
--- a/src/video_core/renderer_opengl/gl_fence_manager.cpp
+++ b/src/video_core/renderer_opengl/gl_fence_manager.cpp
@@ -11,10 +11,10 @@
11 11
12namespace OpenGL { 12namespace OpenGL {
13 13
14GLInnerFence::GLInnerFence(u32 payload, bool is_stubbed) : FenceBase(payload, is_stubbed) {} 14GLInnerFence::GLInnerFence(u32 payload_, bool is_stubbed_) : FenceBase{payload_, is_stubbed_} {}
15 15
16GLInnerFence::GLInnerFence(GPUVAddr address, u32 payload, bool is_stubbed) 16GLInnerFence::GLInnerFence(GPUVAddr address_, u32 payload_, bool is_stubbed_)
17 : FenceBase(address, payload, is_stubbed) {} 17 : FenceBase{address_, payload_, is_stubbed_} {}
18 18
19GLInnerFence::~GLInnerFence() = default; 19GLInnerFence::~GLInnerFence() = default;
20 20
@@ -45,10 +45,10 @@ void GLInnerFence::Wait() {
45 glClientWaitSync(sync_object.handle, 0, GL_TIMEOUT_IGNORED); 45 glClientWaitSync(sync_object.handle, 0, GL_TIMEOUT_IGNORED);
46} 46}
47 47
48FenceManagerOpenGL::FenceManagerOpenGL(VideoCore::RasterizerInterface& rasterizer, Tegra::GPU& gpu, 48FenceManagerOpenGL::FenceManagerOpenGL(VideoCore::RasterizerInterface& rasterizer_,
49 TextureCacheOpenGL& texture_cache, 49 Tegra::GPU& gpu_, TextureCacheOpenGL& texture_cache_,
50 OGLBufferCache& buffer_cache, QueryCache& query_cache) 50 OGLBufferCache& buffer_cache_, QueryCache& query_cache_)
51 : GenericFenceManager{rasterizer, gpu, texture_cache, buffer_cache, query_cache} {} 51 : GenericFenceManager{rasterizer_, gpu_, texture_cache_, buffer_cache_, query_cache_} {}
52 52
53Fence FenceManagerOpenGL::CreateFence(u32 value, bool is_stubbed) { 53Fence FenceManagerOpenGL::CreateFence(u32 value, bool is_stubbed) {
54 return std::make_shared<GLInnerFence>(value, is_stubbed); 54 return std::make_shared<GLInnerFence>(value, is_stubbed);
diff --git a/src/video_core/renderer_opengl/gl_fence_manager.h b/src/video_core/renderer_opengl/gl_fence_manager.h
index da1dcdace..39ca6125b 100644
--- a/src/video_core/renderer_opengl/gl_fence_manager.h
+++ b/src/video_core/renderer_opengl/gl_fence_manager.h
@@ -17,8 +17,8 @@ namespace OpenGL {
17 17
18class GLInnerFence : public VideoCommon::FenceBase { 18class GLInnerFence : public VideoCommon::FenceBase {
19public: 19public:
20 GLInnerFence(u32 payload, bool is_stubbed); 20 explicit GLInnerFence(u32 payload_, bool is_stubbed_);
21 GLInnerFence(GPUVAddr address, u32 payload, bool is_stubbed); 21 explicit GLInnerFence(GPUVAddr address_, u32 payload_, bool is_stubbed_);
22 ~GLInnerFence(); 22 ~GLInnerFence();
23 23
24 void Queue(); 24 void Queue();
@@ -37,9 +37,9 @@ using GenericFenceManager =
37 37
38class FenceManagerOpenGL final : public GenericFenceManager { 38class FenceManagerOpenGL final : public GenericFenceManager {
39public: 39public:
40 explicit FenceManagerOpenGL(VideoCore::RasterizerInterface& rasterizer, Tegra::GPU& gpu, 40 explicit FenceManagerOpenGL(VideoCore::RasterizerInterface& rasterizer_, Tegra::GPU& gpu_,
41 TextureCacheOpenGL& texture_cache, OGLBufferCache& buffer_cache, 41 TextureCacheOpenGL& texture_cache_, OGLBufferCache& buffer_cache_,
42 QueryCache& query_cache); 42 QueryCache& query_cache_);
43 43
44protected: 44protected:
45 Fence CreateFence(u32 value, bool is_stubbed) override; 45 Fence CreateFence(u32 value, bool is_stubbed) override;
diff --git a/src/video_core/renderer_opengl/gl_query_cache.cpp b/src/video_core/renderer_opengl/gl_query_cache.cpp
index 1a3d9720e..bcc37471f 100644
--- a/src/video_core/renderer_opengl/gl_query_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_query_cache.cpp
@@ -59,10 +59,10 @@ bool QueryCache::AnyCommandQueued() const noexcept {
59 return gl_rasterizer.AnyCommandQueued(); 59 return gl_rasterizer.AnyCommandQueued();
60} 60}
61 61
62HostCounter::HostCounter(QueryCache& cache, std::shared_ptr<HostCounter> dependency, 62HostCounter::HostCounter(QueryCache& cache_, std::shared_ptr<HostCounter> dependency,
63 VideoCore::QueryType type) 63 VideoCore::QueryType type_)
64 : VideoCommon::HostCounterBase<QueryCache, HostCounter>{std::move(dependency)}, cache{cache}, 64 : HostCounterBase<QueryCache, HostCounter>{std::move(dependency)}, cache{cache_}, type{type_},
65 type{type}, query{cache.AllocateQuery(type)} { 65 query{cache.AllocateQuery(type)} {
66 glBeginQuery(GetTarget(type), query.handle); 66 glBeginQuery(GetTarget(type), query.handle);
67} 67}
68 68
@@ -86,13 +86,14 @@ u64 HostCounter::BlockingQuery() const {
86 return static_cast<u64>(value); 86 return static_cast<u64>(value);
87} 87}
88 88
89CachedQuery::CachedQuery(QueryCache& cache, VideoCore::QueryType type, VAddr cpu_addr, u8* host_ptr) 89CachedQuery::CachedQuery(QueryCache& cache_, VideoCore::QueryType type_, VAddr cpu_addr,
90 : VideoCommon::CachedQueryBase<HostCounter>{cpu_addr, host_ptr}, cache{&cache}, type{type} {} 90 u8* host_ptr)
91 : CachedQueryBase<HostCounter>{cpu_addr, host_ptr}, cache{&cache_}, type{type_} {}
91 92
92CachedQuery::~CachedQuery() = default; 93CachedQuery::~CachedQuery() = default;
93 94
94CachedQuery::CachedQuery(CachedQuery&& rhs) noexcept 95CachedQuery::CachedQuery(CachedQuery&& rhs) noexcept
95 : VideoCommon::CachedQueryBase<HostCounter>(std::move(rhs)), cache{rhs.cache}, type{rhs.type} {} 96 : CachedQueryBase<HostCounter>(std::move(rhs)), cache{rhs.cache}, type{rhs.type} {}
96 97
97CachedQuery& CachedQuery::operator=(CachedQuery&& rhs) noexcept { 98CachedQuery& CachedQuery::operator=(CachedQuery&& rhs) noexcept {
98 cache = rhs.cache; 99 cache = rhs.cache;
diff --git a/src/video_core/renderer_opengl/gl_query_cache.h b/src/video_core/renderer_opengl/gl_query_cache.h
index 82cac51ee..d9851e880 100644
--- a/src/video_core/renderer_opengl/gl_query_cache.h
+++ b/src/video_core/renderer_opengl/gl_query_cache.h
@@ -46,8 +46,8 @@ private:
46 46
47class HostCounter final : public VideoCommon::HostCounterBase<QueryCache, HostCounter> { 47class HostCounter final : public VideoCommon::HostCounterBase<QueryCache, HostCounter> {
48public: 48public:
49 explicit HostCounter(QueryCache& cache, std::shared_ptr<HostCounter> dependency, 49 explicit HostCounter(QueryCache& cache_, std::shared_ptr<HostCounter> dependency,
50 VideoCore::QueryType type); 50 VideoCore::QueryType type_);
51 ~HostCounter(); 51 ~HostCounter();
52 52
53 void EndQuery(); 53 void EndQuery();
@@ -62,7 +62,7 @@ private:
62 62
63class CachedQuery final : public VideoCommon::CachedQueryBase<HostCounter> { 63class CachedQuery final : public VideoCommon::CachedQueryBase<HostCounter> {
64public: 64public:
65 explicit CachedQuery(QueryCache& cache, VideoCore::QueryType type, VAddr cpu_addr, 65 explicit CachedQuery(QueryCache& cache_, VideoCore::QueryType type_, VAddr cpu_addr,
66 u8* host_ptr); 66 u8* host_ptr);
67 ~CachedQuery() override; 67 ~CachedQuery() override;
68 68
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp
index bd56bed0c..9f2c0a222 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp
@@ -198,10 +198,10 @@ ProgramSharedPtr BuildShader(const Device& device, ShaderType shader_type, u64 u
198 return program; 198 return program;
199} 199}
200 200
201Shader::Shader(std::shared_ptr<VideoCommon::Shader::Registry> registry_, ShaderEntries entries_, 201Shader::Shader(std::shared_ptr<Registry> registry_, ShaderEntries entries_,
202 ProgramSharedPtr program_, bool is_built) 202 ProgramSharedPtr program_, bool is_built_)
203 : registry{std::move(registry_)}, entries{std::move(entries_)}, program{std::move(program_)}, 203 : registry{std::move(registry_)}, entries{std::move(entries_)}, program{std::move(program_)},
204 is_built(is_built) { 204 is_built{is_built_} {
205 handle = program->assembly_program.handle; 205 handle = program->assembly_program.handle;
206 if (handle == 0) { 206 if (handle == 0) {
207 handle = program->source_program.handle; 207 handle = program->source_program.handle;
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.h b/src/video_core/renderer_opengl/gl_shader_cache.h
index 1708af06a..ab5374fac 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.h
+++ b/src/video_core/renderer_opengl/gl_shader_cache.h
@@ -108,7 +108,7 @@ public:
108 108
109private: 109private:
110 explicit Shader(std::shared_ptr<VideoCommon::Shader::Registry> registry, ShaderEntries entries, 110 explicit Shader(std::shared_ptr<VideoCommon::Shader::Registry> registry, ShaderEntries entries,
111 ProgramSharedPtr program, bool is_built = true); 111 ProgramSharedPtr program, bool is_built_ = true);
112 112
113 std::shared_ptr<VideoCommon::Shader::Registry> registry; 113 std::shared_ptr<VideoCommon::Shader::Registry> registry;
114 ShaderEntries entries; 114 ShaderEntries entries;
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 95ca96c8e..0940969ba 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -131,7 +131,7 @@ private:
131 131
132class Expression final { 132class Expression final {
133public: 133public:
134 Expression(std::string code, Type type) : code{std::move(code)}, type{type} { 134 Expression(std::string code_, Type type_) : code{std::move(code_)}, type{type_} {
135 ASSERT(type != Type::Void); 135 ASSERT(type != Type::Void);
136 } 136 }
137 Expression() : type{Type::Void} {} 137 Expression() : type{Type::Void} {}
@@ -148,8 +148,8 @@ public:
148 ASSERT(type == Type::Void); 148 ASSERT(type == Type::Void);
149 } 149 }
150 150
151 std::string As(Type type) const { 151 std::string As(Type type_) const {
152 switch (type) { 152 switch (type_) {
153 case Type::Bool: 153 case Type::Bool:
154 return AsBool(); 154 return AsBool();
155 case Type::Bool2: 155 case Type::Bool2:
@@ -418,11 +418,12 @@ struct GenericVaryingDescription {
418 418
419class GLSLDecompiler final { 419class GLSLDecompiler final {
420public: 420public:
421 explicit GLSLDecompiler(const Device& device, const ShaderIR& ir, const Registry& registry, 421 explicit GLSLDecompiler(const Device& device_, const ShaderIR& ir_, const Registry& registry_,
422 ShaderType stage, std::string_view identifier, std::string_view suffix) 422 ShaderType stage_, std::string_view identifier_,
423 : device{device}, ir{ir}, registry{registry}, stage{stage}, identifier{identifier}, 423 std::string_view suffix_)
424 suffix{suffix}, header{ir.GetHeader()}, use_unified_uniforms{ 424 : device{device_}, ir{ir_}, registry{registry_}, stage{stage_}, identifier{identifier_},
425 UseUnifiedUniforms(device, ir, stage)} { 425 suffix{suffix_}, header{ir.GetHeader()}, use_unified_uniforms{
426 UseUnifiedUniforms(device_, ir_, stage_)} {
426 if (stage != ShaderType::Compute) { 427 if (stage != ShaderType::Compute) {
427 transform_feedback = BuildTransformFeedback(registry.GetGraphicsInfo()); 428 transform_feedback = BuildTransformFeedback(registry.GetGraphicsInfo());
428 } 429 }
@@ -777,16 +778,16 @@ private:
777 name = "gs_" + name + "[]"; 778 name = "gs_" + name + "[]";
778 } 779 }
779 780
780 std::string suffix; 781 std::string suffix_;
781 if (stage == ShaderType::Fragment) { 782 if (stage == ShaderType::Fragment) {
782 const auto input_mode{header.ps.GetPixelImap(location)}; 783 const auto input_mode{header.ps.GetPixelImap(location)};
783 if (input_mode == PixelImap::Unused) { 784 if (input_mode == PixelImap::Unused) {
784 return; 785 return;
785 } 786 }
786 suffix = GetInputFlags(input_mode); 787 suffix_ = GetInputFlags(input_mode);
787 } 788 }
788 789
789 code.AddLine("layout (location = {}) {} in vec4 {};", location, suffix, name); 790 code.AddLine("layout (location = {}) {} in vec4 {};", location, suffix_, name);
790 } 791 }
791 792
792 void DeclareOutputAttributes() { 793 void DeclareOutputAttributes() {
@@ -2100,13 +2101,13 @@ private:
2100 const auto type = meta.sampler.is_shadow ? Type::Float : Type::Int; 2101 const auto type = meta.sampler.is_shadow ? Type::Float : Type::Int;
2101 const bool separate_dc = meta.sampler.is_shadow; 2102 const bool separate_dc = meta.sampler.is_shadow;
2102 2103
2103 std::vector<TextureIR> ir; 2104 std::vector<TextureIR> ir_;
2104 if (meta.sampler.is_shadow) { 2105 if (meta.sampler.is_shadow) {
2105 ir = {TextureOffset{}}; 2106 ir_ = {TextureOffset{}};
2106 } else { 2107 } else {
2107 ir = {TextureOffset{}, TextureArgument{type, meta.component}}; 2108 ir_ = {TextureOffset{}, TextureArgument{type, meta.component}};
2108 } 2109 }
2109 return {GenerateTexture(operation, "Gather", ir, separate_dc) + GetSwizzle(meta.element), 2110 return {GenerateTexture(operation, "Gather", ir_, separate_dc) + GetSwizzle(meta.element),
2110 Type::Float}; 2111 Type::Float};
2111 } 2112 }
2112 2113
@@ -2801,7 +2802,7 @@ std::string GetFlowVariable(u32 index) {
2801 2802
2802class ExprDecompiler { 2803class ExprDecompiler {
2803public: 2804public:
2804 explicit ExprDecompiler(GLSLDecompiler& decomp) : decomp{decomp} {} 2805 explicit ExprDecompiler(GLSLDecompiler& decomp_) : decomp{decomp_} {}
2805 2806
2806 void operator()(const ExprAnd& expr) { 2807 void operator()(const ExprAnd& expr) {
2807 inner += '('; 2808 inner += '(';
@@ -2856,7 +2857,7 @@ private:
2856 2857
2857class ASTDecompiler { 2858class ASTDecompiler {
2858public: 2859public:
2859 explicit ASTDecompiler(GLSLDecompiler& decomp) : decomp{decomp} {} 2860 explicit ASTDecompiler(GLSLDecompiler& decomp_) : decomp{decomp_} {}
2860 2861
2861 void operator()(const ASTProgram& ast) { 2862 void operator()(const ASTProgram& ast) {
2862 ASTNode current = ast.nodes.GetFirst(); 2863 ASTNode current = ast.nodes.GetFirst();
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.h b/src/video_core/renderer_opengl/gl_shader_decompiler.h
index 451c9689a..f5a5249f2 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.h
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.h
@@ -25,8 +25,8 @@ using ImageEntry = VideoCommon::Shader::Image;
25 25
26class ConstBufferEntry : public VideoCommon::Shader::ConstBuffer { 26class ConstBufferEntry : public VideoCommon::Shader::ConstBuffer {
27public: 27public:
28 explicit ConstBufferEntry(u32 max_offset, bool is_indirect, u32 index) 28 explicit ConstBufferEntry(u32 max_offset, bool is_indirect, u32 index_)
29 : VideoCommon::Shader::ConstBuffer{max_offset, is_indirect}, index{index} {} 29 : ConstBuffer{max_offset, is_indirect}, index{index_} {}
30 30
31 u32 GetIndex() const { 31 u32 GetIndex() const {
32 return index; 32 return index;
@@ -37,10 +37,10 @@ private:
37}; 37};
38 38
39struct GlobalMemoryEntry { 39struct GlobalMemoryEntry {
40 constexpr explicit GlobalMemoryEntry(u32 cbuf_index, u32 cbuf_offset, bool is_read, 40 constexpr explicit GlobalMemoryEntry(u32 cbuf_index_, u32 cbuf_offset_, bool is_read_,
41 bool is_written) 41 bool is_written_)
42 : cbuf_index{cbuf_index}, cbuf_offset{cbuf_offset}, is_read{is_read}, is_written{ 42 : cbuf_index{cbuf_index_}, cbuf_offset{cbuf_offset_}, is_read{is_read_}, is_written{
43 is_written} {} 43 is_written_} {}
44 44
45 u32 cbuf_index = 0; 45 u32 cbuf_index = 0;
46 u32 cbuf_offset = 0; 46 u32 cbuf_offset = 0;
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index a863ef218..a59fe853e 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -258,9 +258,9 @@ constexpr u32 EncodeSwizzle(SwizzleSource x_source, SwizzleSource y_source, Swiz
258 258
259} // Anonymous namespace 259} // Anonymous namespace
260 260
261CachedSurface::CachedSurface(const GPUVAddr gpu_addr, const SurfaceParams& params, 261CachedSurface::CachedSurface(const GPUVAddr gpu_addr_, const SurfaceParams& params_,
262 bool is_astc_supported) 262 bool is_astc_supported_)
263 : VideoCommon::SurfaceBase<View>(gpu_addr, params, is_astc_supported) { 263 : SurfaceBase<View>{gpu_addr_, params_, is_astc_supported_} {
264 if (is_converted) { 264 if (is_converted) {
265 internal_format = params.srgb_conversion ? GL_SRGB8_ALPHA8 : GL_RGBA8; 265 internal_format = params.srgb_conversion ? GL_SRGB8_ALPHA8 : GL_RGBA8;
266 format = GL_RGBA; 266 format = GL_RGBA;
@@ -419,11 +419,11 @@ View CachedSurface::CreateViewInner(const ViewParams& view_key, const bool is_pr
419 return view; 419 return view;
420} 420}
421 421
422CachedSurfaceView::CachedSurfaceView(CachedSurface& surface, const ViewParams& params, 422CachedSurfaceView::CachedSurfaceView(CachedSurface& surface_, const ViewParams& params_,
423 bool is_proxy) 423 bool is_proxy_)
424 : VideoCommon::ViewBase(params), surface{surface}, format{surface.internal_format}, 424 : ViewBase{params_}, surface{surface_}, format{surface_.internal_format},
425 target{GetTextureTarget(params.target)}, is_proxy{is_proxy} { 425 target{GetTextureTarget(params_.target)}, is_proxy{is_proxy_} {
426 if (!is_proxy) { 426 if (!is_proxy_) {
427 main_view = CreateTextureView(); 427 main_view = CreateTextureView();
428 } 428 }
429} 429}
@@ -493,13 +493,13 @@ GLuint CachedSurfaceView::GetTexture(SwizzleSource x_source, SwizzleSource y_sou
493 493
494 std::array swizzle{x_source, y_source, z_source, w_source}; 494 std::array swizzle{x_source, y_source, z_source, w_source};
495 495
496 switch (const PixelFormat format = GetSurfaceParams().pixel_format) { 496 switch (const PixelFormat pixel_format = GetSurfaceParams().pixel_format) {
497 case PixelFormat::D24_UNORM_S8_UINT: 497 case PixelFormat::D24_UNORM_S8_UINT:
498 case PixelFormat::D32_FLOAT_S8_UINT: 498 case PixelFormat::D32_FLOAT_S8_UINT:
499 case PixelFormat::S8_UINT_D24_UNORM: 499 case PixelFormat::S8_UINT_D24_UNORM:
500 UNIMPLEMENTED_IF(x_source != SwizzleSource::R && x_source != SwizzleSource::G); 500 UNIMPLEMENTED_IF(x_source != SwizzleSource::R && x_source != SwizzleSource::G);
501 glTextureParameteri(view.handle, GL_DEPTH_STENCIL_TEXTURE_MODE, 501 glTextureParameteri(view.handle, GL_DEPTH_STENCIL_TEXTURE_MODE,
502 GetComponent(format, x_source == SwizzleSource::R)); 502 GetComponent(pixel_format, x_source == SwizzleSource::R));
503 503
504 // Make sure we sample the first component 504 // Make sure we sample the first component
505 std::transform(swizzle.begin(), swizzle.end(), swizzle.begin(), [](SwizzleSource value) { 505 std::transform(swizzle.begin(), swizzle.end(), swizzle.begin(), [](SwizzleSource value) {
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h
index 7787134fc..76a7b2316 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.h
+++ b/src/video_core/renderer_opengl/gl_texture_cache.h
@@ -37,7 +37,8 @@ class CachedSurface final : public VideoCommon::SurfaceBase<View> {
37 friend CachedSurfaceView; 37 friend CachedSurfaceView;
38 38
39public: 39public:
40 explicit CachedSurface(GPUVAddr gpu_addr, const SurfaceParams& params, bool is_astc_supported); 40 explicit CachedSurface(GPUVAddr gpu_addr_, const SurfaceParams& params_,
41 bool is_astc_supported_);
41 ~CachedSurface(); 42 ~CachedSurface();
42 43
43 void UploadTexture(const std::vector<u8>& staging_buffer) override; 44 void UploadTexture(const std::vector<u8>& staging_buffer) override;
@@ -77,7 +78,7 @@ private:
77 78
78class CachedSurfaceView final : public VideoCommon::ViewBase { 79class CachedSurfaceView final : public VideoCommon::ViewBase {
79public: 80public:
80 explicit CachedSurfaceView(CachedSurface& surface, const ViewParams& params, bool is_proxy); 81 explicit CachedSurfaceView(CachedSurface& surface_, const ViewParams& params_, bool is_proxy_);
81 ~CachedSurfaceView(); 82 ~CachedSurfaceView();
82 83
83 /// @brief Attaches this texture view to the currently bound fb_target framebuffer 84 /// @brief Attaches this texture view to the currently bound fb_target framebuffer