summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp2
-rw-r--r--src/video_core/shader/decode/memory.cpp2
-rw-r--r--src/video_core/shader/shader_ir.cpp2
-rw-r--r--src/video_core/shader/shader_ir.h6
4 files changed, 8 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 47bfa5538..52552333f 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -895,6 +895,8 @@ private:
895 target = GetRegister(gpr->GetIndex()); 895 target = GetRegister(gpr->GetIndex());
896 896
897 } else if (const auto abuf = std::get_if<AbufNode>(dest)) { 897 } else if (const auto abuf = std::get_if<AbufNode>(dest)) {
898 UNIMPLEMENTED_IF(abuf->IsPhysicalBuffer());
899
898 target = [&]() -> std::string { 900 target = [&]() -> std::string {
899 switch (const auto attribute = abuf->GetIndex(); abuf->GetIndex()) { 901 switch (const auto attribute = abuf->GetIndex(); abuf->GetIndex()) {
900 case Attribute::Index::Position: 902 case Attribute::Index::Position:
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp
index 339692295..c4f68f8ab 100644
--- a/src/video_core/shader/decode/memory.cpp
+++ b/src/video_core/shader/decode/memory.cpp
@@ -253,7 +253,7 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) {
253 SetRegister(bb, instr.gpr0, fake_address); 253 SetRegister(bb, instr.gpr0, fake_address);
254 254
255 // Signal the shader IR to declare all possible attributes and varyings 255 // Signal the shader IR to declare all possible attributes and varyings
256 use_physical_attributes = true; 256 uses_physical_attributes = true;
257 break; 257 break;
258 } 258 }
259 default: 259 default:
diff --git a/src/video_core/shader/shader_ir.cpp b/src/video_core/shader/shader_ir.cpp
index 947a372a2..691d095c8 100644
--- a/src/video_core/shader/shader_ir.cpp
+++ b/src/video_core/shader/shader_ir.cpp
@@ -95,7 +95,7 @@ Node ShaderIR::GetInputAttribute(Attribute::Index index, u64 element, Node buffe
95} 95}
96 96
97Node ShaderIR::GetPhysicalInputAttribute(Tegra::Shader::Register physical_address, Node buffer) { 97Node ShaderIR::GetPhysicalInputAttribute(Tegra::Shader::Register physical_address, Node buffer) {
98 use_physical_attributes = true; 98 uses_physical_attributes = true;
99 return StoreNode(AbufNode(GetRegister(physical_address), buffer)); 99 return StoreNode(AbufNode(GetRegister(physical_address), buffer));
100} 100}
101 101
diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h
index a4bb0c41c..7e54f7e74 100644
--- a/src/video_core/shader/shader_ir.h
+++ b/src/video_core/shader/shader_ir.h
@@ -465,10 +465,12 @@ private:
465/// Attribute buffer memory (known as attributes or varyings in GLSL terms) 465/// Attribute buffer memory (known as attributes or varyings in GLSL terms)
466class AbufNode final { 466class AbufNode final {
467public: 467public:
468 // Initialize for standard attributes (index is explicit).
468 explicit constexpr AbufNode(Tegra::Shader::Attribute::Index index, u32 element, 469 explicit constexpr AbufNode(Tegra::Shader::Attribute::Index index, u32 element,
469 Node buffer = {}) 470 Node buffer = {})
470 : buffer{buffer}, index{index}, element{element} {} 471 : buffer{buffer}, index{index}, element{element} {}
471 472
473 // Initialize for physical attributes (index is a variable value).
472 explicit constexpr AbufNode(Node physical_address, Node buffer = {}) 474 explicit constexpr AbufNode(Node physical_address, Node buffer = {})
473 : physical_address{physical_address}, buffer{buffer} {} 475 : physical_address{physical_address}, buffer{buffer} {}
474 476
@@ -618,7 +620,7 @@ public:
618 } 620 }
619 621
620 bool HasPhysicalAttributes() const { 622 bool HasPhysicalAttributes() const {
621 return use_physical_attributes; 623 return uses_physical_attributes;
622 } 624 }
623 625
624 const Tegra::Shader::Header& GetHeader() const { 626 const Tegra::Shader::Header& GetHeader() const {
@@ -885,7 +887,7 @@ private:
885 std::set<Sampler> used_samplers; 887 std::set<Sampler> used_samplers;
886 std::array<bool, Tegra::Engines::Maxwell3D::Regs::NumClipDistances> used_clip_distances{}; 888 std::array<bool, Tegra::Engines::Maxwell3D::Regs::NumClipDistances> used_clip_distances{};
887 std::map<GlobalMemoryBase, GlobalMemoryUsage> used_global_memory; 889 std::map<GlobalMemoryBase, GlobalMemoryUsage> used_global_memory;
888 bool use_physical_attributes{}; // Shader uses AL2P or physical attribute read/writes 890 bool uses_physical_attributes{}; // Shader uses AL2P or physical attribute read/writes
889 891
890 Tegra::Shader::Header header; 892 Tegra::Shader::Header header;
891}; 893};