summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/shader_bytecode.h1
-rw-r--r--src/video_core/shader/decode/other.cpp13
2 files changed, 9 insertions, 5 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index e4a9471b8..7bbc556da 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -596,6 +596,7 @@ union Instruction {
596 } alu; 596 } alu;
597 597
598 union { 598 union {
599 BitField<38, 1, u64> idx;
599 BitField<51, 1, u64> saturate; 600 BitField<51, 1, u64> saturate;
600 BitField<52, 2, IpaSampleMode> sample_mode; 601 BitField<52, 2, IpaSampleMode> sample_mode;
601 BitField<54, 2, IpaInterpMode> interp_mode; 602 BitField<54, 2, IpaInterpMode> interp_mode;
diff --git a/src/video_core/shader/decode/other.cpp b/src/video_core/shader/decode/other.cpp
index 776bdb931..fa17c45b5 100644
--- a/src/video_core/shader/decode/other.cpp
+++ b/src/video_core/shader/decode/other.cpp
@@ -130,15 +130,18 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) {
130 break; 130 break;
131 } 131 }
132 case OpCode::Id::IPA: { 132 case OpCode::Id::IPA: {
133 const auto& attribute = instr.attribute.fmt28; 133 const bool is_physical = instr.ipa.idx && instr.gpr8.Value() != 0xff;
134
135 const auto attribute = instr.attribute.fmt28;
134 const Tegra::Shader::IpaMode input_mode{instr.ipa.interp_mode.Value(), 136 const Tegra::Shader::IpaMode input_mode{instr.ipa.interp_mode.Value(),
135 instr.ipa.sample_mode.Value()}; 137 instr.ipa.sample_mode.Value()};
136 138
137 const Node attr = GetInputAttribute(attribute.index, attribute.element); 139 Node value = is_physical ? GetPhysicalInputAttribute(instr.gpr8)
138 Node value = attr; 140 : GetInputAttribute(attribute.index, attribute.element);
139 const Tegra::Shader::Attribute::Index index = attribute.index.Value(); 141 const Tegra::Shader::Attribute::Index index = attribute.index.Value();
140 if (index >= Tegra::Shader::Attribute::Index::Attribute_0 && 142 const bool is_generic = index >= Tegra::Shader::Attribute::Index::Attribute_0 &&
141 index <= Tegra::Shader::Attribute::Index::Attribute_31) { 143 index <= Tegra::Shader::Attribute::Index::Attribute_31;
144 if (is_generic || is_physical) {
142 // TODO(Blinkhawk): There are cases where a perspective attribute use PASS. 145 // TODO(Blinkhawk): There are cases where a perspective attribute use PASS.
143 // In theory by setting them as perspective, OpenGL does the perspective correction. 146 // In theory by setting them as perspective, OpenGL does the perspective correction.
144 // A way must figured to reverse the last step of it. 147 // A way must figured to reverse the last step of it.