summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend
diff options
context:
space:
mode:
authorGravatar FernandoS272021-04-17 12:51:43 +0200
committerGravatar ameerj2021-07-22 21:51:28 -0400
commit080857b60e78836901cf6e9601f48613812fcd04 (patch)
treeef466d23ba86a14f01abaa7b01acd7a7d6b24aa7 /src/shader_recompiler/frontend
parentshader: Implement fine derivates constant propagation (diff)
downloadyuzu-080857b60e78836901cf6e9601f48613812fcd04.tar.gz
yuzu-080857b60e78836901cf6e9601f48613812fcd04.tar.xz
yuzu-080857b60e78836901cf6e9601f48613812fcd04.zip
shader: Add coarse derivatives
Diffstat (limited to 'src/shader_recompiler/frontend')
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.cpp8
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.h4
-rw-r--r--src/shader_recompiler/frontend/ir/opcodes.inc2
3 files changed, 14 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
index 845a57b1e..b3c9fe72a 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
@@ -1933,4 +1933,12 @@ F32 IREmitter::DPdyFine(const F32& a) {
1933 return Inst<F32>(Opcode::DPdyFine, a); 1933 return Inst<F32>(Opcode::DPdyFine, a);
1934} 1934}
1935 1935
1936F32 IREmitter::DPdxCoarse(const F32& a) {
1937 return Inst<F32>(Opcode::DPdxCoarse, a);
1938}
1939
1940F32 IREmitter::DPdyCoarse(const F32& a) {
1941 return Inst<F32>(Opcode::DPdyCoarse, a);
1942}
1943
1936} // namespace Shader::IR 1944} // namespace Shader::IR
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h
index c7101d668..4441c495d 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.h
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.h
@@ -357,6 +357,10 @@ public:
357 357
358 [[nodiscard]] F32 DPdyFine(const F32& a); 358 [[nodiscard]] F32 DPdyFine(const F32& a);
359 359
360 [[nodiscard]] F32 DPdxCoarse(const F32& a);
361
362 [[nodiscard]] F32 DPdyCoarse(const F32& a);
363
360private: 364private:
361 IR::Block::iterator insertion_point; 365 IR::Block::iterator insertion_point;
362 366
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc
index e4cb8964a..b6869d4e4 100644
--- a/src/shader_recompiler/frontend/ir/opcodes.inc
+++ b/src/shader_recompiler/frontend/ir/opcodes.inc
@@ -513,3 +513,5 @@ OPCODE(ShuffleButterfly, U32, U32,
513OPCODE(FSwizzleAdd, F32, F32, F32, U32, ) 513OPCODE(FSwizzleAdd, F32, F32, F32, U32, )
514OPCODE(DPdxFine, F32, F32, ) 514OPCODE(DPdxFine, F32, F32, )
515OPCODE(DPdyFine, F32, F32, ) 515OPCODE(DPdyFine, F32, F32, )
516OPCODE(DPdxCoarse, F32, F32, )
517OPCODE(DPdyCoarse, F32, F32, )