summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp24
-rw-r--r--src/video_core/shader/decode/memory.cpp15
-rw-r--r--src/video_core/shader/shader_ir.h12
3 files changed, 25 insertions, 26 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index aecd4758a..b39bb4843 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1140,7 +1140,7 @@ private:
1140 Type::HalfFloat); 1140 Type::HalfFloat);
1141 } 1141 }
1142 1142
1143 std::string F4Texture(Operation operation) { 1143 std::string Texture(Operation operation) {
1144 const auto meta = std::get_if<MetaTexture>(&operation.GetMeta()); 1144 const auto meta = std::get_if<MetaTexture>(&operation.GetMeta());
1145 ASSERT(meta); 1145 ASSERT(meta);
1146 1146
@@ -1151,7 +1151,7 @@ private:
1151 return expr + GetSwizzle(meta->element); 1151 return expr + GetSwizzle(meta->element);
1152 } 1152 }
1153 1153
1154 std::string F4TextureLod(Operation operation) { 1154 std::string TextureLod(Operation operation) {
1155 const auto meta = std::get_if<MetaTexture>(&operation.GetMeta()); 1155 const auto meta = std::get_if<MetaTexture>(&operation.GetMeta());
1156 ASSERT(meta); 1156 ASSERT(meta);
1157 1157
@@ -1162,7 +1162,7 @@ private:
1162 return expr + GetSwizzle(meta->element); 1162 return expr + GetSwizzle(meta->element);
1163 } 1163 }
1164 1164
1165 std::string F4TextureGather(Operation operation) { 1165 std::string TextureGather(Operation operation) {
1166 const auto meta = std::get_if<MetaTexture>(&operation.GetMeta()); 1166 const auto meta = std::get_if<MetaTexture>(&operation.GetMeta());
1167 ASSERT(meta); 1167 ASSERT(meta);
1168 1168
@@ -1170,7 +1170,7 @@ private:
1170 GetSwizzle(meta->element); 1170 GetSwizzle(meta->element);
1171 } 1171 }
1172 1172
1173 std::string F4TextureQueryDimensions(Operation operation) { 1173 std::string TextureQueryDimensions(Operation operation) {
1174 const auto meta = std::get_if<MetaTexture>(&operation.GetMeta()); 1174 const auto meta = std::get_if<MetaTexture>(&operation.GetMeta());
1175 ASSERT(meta); 1175 ASSERT(meta);
1176 1176
@@ -1190,7 +1190,7 @@ private:
1190 return "0"; 1190 return "0";
1191 } 1191 }
1192 1192
1193 std::string F4TextureQueryLod(Operation operation) { 1193 std::string TextureQueryLod(Operation operation) {
1194 const auto meta = std::get_if<MetaTexture>(&operation.GetMeta()); 1194 const auto meta = std::get_if<MetaTexture>(&operation.GetMeta());
1195 ASSERT(meta); 1195 ASSERT(meta);
1196 1196
@@ -1201,7 +1201,7 @@ private:
1201 return "0"; 1201 return "0";
1202 } 1202 }
1203 1203
1204 std::string F4TexelFetch(Operation operation) { 1204 std::string TexelFetch(Operation operation) {
1205 constexpr std::array<const char*, 4> constructors = {"int", "ivec2", "ivec3", "ivec4"}; 1205 constexpr std::array<const char*, 4> constructors = {"int", "ivec2", "ivec3", "ivec4"};
1206 const auto meta = std::get_if<MetaTexture>(&operation.GetMeta()); 1206 const auto meta = std::get_if<MetaTexture>(&operation.GetMeta());
1207 ASSERT(meta); 1207 ASSERT(meta);
@@ -1463,12 +1463,12 @@ private:
1463 &GLSLDecompiler::Logical2HNotEqual, 1463 &GLSLDecompiler::Logical2HNotEqual,
1464 &GLSLDecompiler::Logical2HGreaterEqual, 1464 &GLSLDecompiler::Logical2HGreaterEqual,
1465 1465
1466 &GLSLDecompiler::F4Texture, 1466 &GLSLDecompiler::Texture,
1467 &GLSLDecompiler::F4TextureLod, 1467 &GLSLDecompiler::TextureLod,
1468 &GLSLDecompiler::F4TextureGather, 1468 &GLSLDecompiler::TextureGather,
1469 &GLSLDecompiler::F4TextureQueryDimensions, 1469 &GLSLDecompiler::TextureQueryDimensions,
1470 &GLSLDecompiler::F4TextureQueryLod, 1470 &GLSLDecompiler::TextureQueryLod,
1471 &GLSLDecompiler::F4TexelFetch, 1471 &GLSLDecompiler::TexelFetch,
1472 1472
1473 &GLSLDecompiler::Branch, 1473 &GLSLDecompiler::Branch,
1474 &GLSLDecompiler::PushFlowStack, 1474 &GLSLDecompiler::PushFlowStack,
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp
index be6ca044b..523421794 100644
--- a/src/video_core/shader/decode/memory.cpp
+++ b/src/video_core/shader/decode/memory.cpp
@@ -336,8 +336,7 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) {
336 for (u32 element = 0; element < values.size(); ++element) { 336 for (u32 element = 0; element < values.size(); ++element) {
337 auto coords_copy = coords; 337 auto coords_copy = coords;
338 MetaTexture meta{sampler, {}, {}, extras, element}; 338 MetaTexture meta{sampler, {}, {}, extras, element};
339 values[element] = 339 values[element] = Operation(OperationCode::TextureGather, meta, std::move(coords_copy));
340 Operation(OperationCode::F4TextureGather, meta, std::move(coords_copy));
341 } 340 }
342 341
343 WriteTexsInstructionFloat(bb, instr, values); 342 WriteTexsInstructionFloat(bb, instr, values);
@@ -362,8 +361,8 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) {
362 continue; 361 continue;
363 } 362 }
364 MetaTexture meta{sampler, {}, {}, {}, element}; 363 MetaTexture meta{sampler, {}, {}, {}, element};
365 const Node value = Operation(OperationCode::F4TextureQueryDimensions, meta, 364 const Node value =
366 GetRegister(instr.gpr8)); 365 Operation(OperationCode::TextureQueryDimensions, meta, GetRegister(instr.gpr8));
367 SetTemporal(bb, indexer++, value); 366 SetTemporal(bb, indexer++, value);
368 } 367 }
369 for (u32 i = 0; i < indexer; ++i) { 368 for (u32 i = 0; i < indexer; ++i) {
@@ -412,7 +411,7 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) {
412 for (u32 element = 0; element < 2; ++element) { 411 for (u32 element = 0; element < 2; ++element) {
413 auto params = coords; 412 auto params = coords;
414 MetaTexture meta{sampler, {}, {}, {}, element}; 413 MetaTexture meta{sampler, {}, {}, {}, element};
415 const Node value = Operation(OperationCode::F4TextureQueryLod, meta, std::move(params)); 414 const Node value = Operation(OperationCode::TextureQueryLod, meta, std::move(params));
416 SetTemporal(bb, element, value); 415 SetTemporal(bb, element, value);
417 } 416 }
418 for (u32 element = 0; element < 2; ++element) { 417 for (u32 element = 0; element < 2; ++element) {
@@ -555,7 +554,7 @@ Node4 ShaderIR::GetTextureCode(Instruction instr, TextureType texture_type,
555 (texture_type == Tegra::Shader::TextureType::TextureCube && is_array && is_shadow)); 554 (texture_type == Tegra::Shader::TextureType::TextureCube && is_array && is_shadow));
556 555
557 const OperationCode read_method = 556 const OperationCode read_method =
558 lod_needed && gl_lod_supported ? OperationCode::F4TextureLod : OperationCode::F4Texture; 557 lod_needed && gl_lod_supported ? OperationCode::TextureLod : OperationCode::Texture;
559 558
560 UNIMPLEMENTED_IF(process_mode != TextureProcessMode::None && !gl_lod_supported); 559 UNIMPLEMENTED_IF(process_mode != TextureProcessMode::None && !gl_lod_supported);
561 560
@@ -671,7 +670,7 @@ Node4 ShaderIR::GetTld4Code(Instruction instr, TextureType texture_type, bool de
671 for (u32 element = 0; element < values.size(); ++element) { 670 for (u32 element = 0; element < values.size(); ++element) {
672 auto coords_copy = coords; 671 auto coords_copy = coords;
673 MetaTexture meta{sampler, GetRegister(array_register), {}, {}, element}; 672 MetaTexture meta{sampler, GetRegister(array_register), {}, {}, element};
674 values[element] = Operation(OperationCode::F4TextureGather, meta, std::move(coords_copy)); 673 values[element] = Operation(OperationCode::TextureGather, meta, std::move(coords_copy));
675 } 674 }
676 675
677 return values; 676 return values;
@@ -707,7 +706,7 @@ Node4 ShaderIR::GetTldsCode(Instruction instr, TextureType texture_type, bool is
707 for (u32 element = 0; element < values.size(); ++element) { 706 for (u32 element = 0; element < values.size(); ++element) {
708 auto coords_copy = coords; 707 auto coords_copy = coords;
709 MetaTexture meta{sampler, array, {}, {lod}, element}; 708 MetaTexture meta{sampler, array, {}, {lod}, element};
710 values[element] = Operation(OperationCode::F4TexelFetch, meta, std::move(coords_copy)); 709 values[element] = Operation(OperationCode::TexelFetch, meta, std::move(coords_copy));
711 } 710 }
712 return values; 711 return values;
713} 712}
diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h
index 0c3d9c61e..52c7f2c4e 100644
--- a/src/video_core/shader/shader_ir.h
+++ b/src/video_core/shader/shader_ir.h
@@ -156,12 +156,12 @@ enum class OperationCode {
156 Logical2HNotEqual, /// (MetaHalfArithmetic, f16vec2 a, f16vec2) -> bool2 156 Logical2HNotEqual, /// (MetaHalfArithmetic, f16vec2 a, f16vec2) -> bool2
157 Logical2HGreaterEqual, /// (MetaHalfArithmetic, f16vec2 a, f16vec2) -> bool2 157 Logical2HGreaterEqual, /// (MetaHalfArithmetic, f16vec2 a, f16vec2) -> bool2
158 158
159 F4Texture, /// (MetaTexture, float[N] coords, float[M] params) -> float4 159 Texture, /// (MetaTexture, float[N] coords) -> float4
160 F4TextureLod, /// (MetaTexture, float[N] coords, float[M] params) -> float4 160 TextureLod, /// (MetaTexture, float[N] coords) -> float4
161 F4TextureGather, /// (MetaTexture, float[N] coords, float[M] params) -> float4 161 TextureGather, /// (MetaTexture, float[N] coords) -> float4
162 F4TextureQueryDimensions, /// (MetaTexture, float a) -> float4 162 TextureQueryDimensions, /// (MetaTexture, float a) -> float4
163 F4TextureQueryLod, /// (MetaTexture, float[N] coords) -> float4 163 TextureQueryLod, /// (MetaTexture, float[N] coords) -> float4
164 F4TexelFetch, /// (MetaTexture, int[N], int) -> float4 164 TexelFetch, /// (MetaTexture, int[N], int) -> float4
165 165
166 Branch, /// (uint branch_target) -> void 166 Branch, /// (uint branch_target) -> void
167 PushFlowStack, /// (uint branch_target) -> void 167 PushFlowStack, /// (uint branch_target) -> void