summaryrefslogtreecommitdiff
path: root/src/video_core/shader/decode
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2019-04-30 18:12:30 -0300
committerGravatar ReinUsesLisp2019-05-02 21:46:25 -0300
commit71aa9d08772eb07ccae7b141e032e6e7e57871a1 (patch)
tree8cd11960894f23ff14b0129c247f2927dc0e815c /src/video_core/shader/decode
parentgl_shader_decompiler: Abstract generic attribute operations (diff)
downloadyuzu-71aa9d08772eb07ccae7b141e032e6e7e57871a1.tar.gz
yuzu-71aa9d08772eb07ccae7b141e032e6e7e57871a1.tar.xz
yuzu-71aa9d08772eb07ccae7b141e032e6e7e57871a1.zip
shader_ir/memory: Implement physical input attributes
Diffstat (limited to 'src/video_core/shader/decode')
-rw-r--r--src/video_core/shader/decode/memory.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp
index 84db4d4dc..339692295 100644
--- a/src/video_core/shader/decode/memory.cpp
+++ b/src/video_core/shader/decode/memory.cpp
@@ -50,13 +50,16 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) {
50 UNIMPLEMENTED_IF_MSG((instr.attribute.fmt20.immediate.Value() % sizeof(u32)) != 0, 50 UNIMPLEMENTED_IF_MSG((instr.attribute.fmt20.immediate.Value() % sizeof(u32)) != 0,
51 "Unaligned attribute loads are not supported"); 51 "Unaligned attribute loads are not supported");
52 52
53 const Node buffer{GetRegister(instr.gpr39)};
54
53 u64 next_element = instr.attribute.fmt20.element; 55 u64 next_element = instr.attribute.fmt20.element;
54 auto next_index = static_cast<u64>(instr.attribute.fmt20.index.Value()); 56 auto next_index = static_cast<u64>(instr.attribute.fmt20.index.Value());
55 57
56 const auto LoadNextElement = [&](u32 reg_offset) { 58 const auto LoadNextElement = [&](u32 reg_offset) {
57 const Node buffer = GetRegister(instr.gpr39); 59 const Node attribute{instr.attribute.fmt20.IsPhysical()
58 const Node attribute = 60 ? GetPhysicalInputAttribute(instr.gpr8, buffer)
59 GetInputAttribute(static_cast<Attribute::Index>(next_index), next_element, buffer); 61 : GetInputAttribute(static_cast<Attribute::Index>(next_index),
62 next_element, buffer)};
60 63
61 SetRegister(bb, instr.gpr0.Value() + reg_offset, attribute); 64 SetRegister(bb, instr.gpr0.Value() + reg_offset, attribute);
62 65