summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir
diff options
context:
space:
mode:
authorGravatar FernandoS272021-04-04 06:47:14 +0200
committerGravatar ameerj2021-07-22 21:51:26 -0400
commit1d51803169f72f79e19995072fb9e8a371dbdcbf (patch)
treeeb668d924985e4b0bd599a695a0a2eee30fd0090 /src/shader_recompiler/frontend/ir
parentshader: Implement AL2P (diff)
downloadyuzu-1d51803169f72f79e19995072fb9e8a371dbdcbf.tar.gz
yuzu-1d51803169f72f79e19995072fb9e8a371dbdcbf.tar.xz
yuzu-1d51803169f72f79e19995072fb9e8a371dbdcbf.zip
shader: Implement indexed attributes
Diffstat (limited to 'src/shader_recompiler/frontend/ir')
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.cpp8
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
index ed1e0dd3b..e4e9b260c 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
@@ -307,6 +307,14 @@ void IREmitter::SetAttribute(IR::Attribute attribute, const F32& value) {
307 Inst(Opcode::SetAttribute, attribute, value); 307 Inst(Opcode::SetAttribute, attribute, value);
308} 308}
309 309
310F32 IREmitter::GetAttributeIndexed(IR::U32 phys_address) {
311 return Inst<F32>(Opcode::GetAttributeIndexed, phys_address);
312}
313
314void IREmitter::SetAttributeIndexed(IR::U32 phys_address, const F32& value) {
315 Inst(Opcode::SetAttributeIndexed, phys_address, value);
316}
317
310void IREmitter::SetFragColor(u32 index, u32 component, const F32& value) { 318void IREmitter::SetFragColor(u32 index, u32 component, const F32& value) {
311 Inst(Opcode::SetFragColor, Imm32(index), Imm32(component), value); 319 Inst(Opcode::SetFragColor, Imm32(index), Imm32(component), value);
312} 320}
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h
index 42756af43..afa8bd924 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.h
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.h
@@ -76,6 +76,9 @@ public:
76 [[nodiscard]] F32 GetAttribute(IR::Attribute attribute); 76 [[nodiscard]] F32 GetAttribute(IR::Attribute attribute);
77 void SetAttribute(IR::Attribute attribute, const F32& value); 77 void SetAttribute(IR::Attribute attribute, const F32& value);
78 78
79 [[nodiscard]] F32 GetAttributeIndexed(IR::U32 phys_address);
80 void SetAttributeIndexed(IR::U32 phys_address, const F32& value);
81
79 void SetFragColor(u32 index, u32 component, const F32& value); 82 void SetFragColor(u32 index, u32 component, const F32& value);
80 void SetFragDepth(const F32& value); 83 void SetFragDepth(const F32& value);
81 84