summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/frontend/ir
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-03-26 22:45:38 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:24 +0200
commit17063d16a3cfe6542e74265739191e1d018fc456 (patch)
tree3dc74c85c9be19183f4c889306458c9a6307b108 /src/shader_recompiler/frontend/ir
parentshader: Refactor PTP and other minor changes (diff)
downloadyuzu-17063d16a3cfe6542e74265739191e1d018fc456.tar
yuzu-17063d16a3cfe6542e74265739191e1d018fc456.tar.gz
yuzu-17063d16a3cfe6542e74265739191e1d018fc456.tar.bz2
yuzu-17063d16a3cfe6542e74265739191e1d018fc456.tar.lz
yuzu-17063d16a3cfe6542e74265739191e1d018fc456.tar.xz
yuzu-17063d16a3cfe6542e74265739191e1d018fc456.tar.zst
yuzu-17063d16a3cfe6542e74265739191e1d018fc456.zip
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.cpp6
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.h1
-rw-r--r--src/shader_recompiler/frontend/ir/opcodes.inc3
3 files changed, 10 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
index 0296f8773..f281c023f 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
@@ -1493,6 +1493,12 @@ Value IREmitter::ImageFetch(const Value& handle, const Value& coords, const Valu
return Inst(op, Flags{info}, handle, coords, offset, lod, multisampling);
}
+Value IREmitter::ImageQueryDimension(const Value& handle, const IR::U32& lod) {
+ const Opcode op{handle.IsImmediate() ? Opcode::BoundImageQueryDimensions
+ : Opcode::BindlessImageQueryDimensions};
+ return Inst(op, handle, lod);
+}
+
U1 IREmitter::VoteAll(const U1& value) {
return Inst<U1>(Opcode::VoteAll, value);
}
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h
index 446fd7785..771c186d4 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.h
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.h
@@ -239,6 +239,7 @@ public:
const F32& dref, const F32& lod,
const Value& offset, const F32& lod_clamp,
TextureInstInfo info);
+ [[nodiscard]] Value ImageQueryDimension(const Value& handle, const IR::U32& lod);
[[nodiscard]] Value ImageGather(const Value& handle, const Value& coords, const Value& offset,
const Value& offset2, TextureInstInfo info);
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc
index e12b92c47..5d7462d76 100644
--- a/src/shader_recompiler/frontend/ir/opcodes.inc
+++ b/src/shader_recompiler/frontend/ir/opcodes.inc
@@ -356,6 +356,7 @@ OPCODE(BindlessImageSampleDrefExplicitLod, F32, U32,
OPCODE(BindlessImageGather, F32x4, U32, Opaque, Opaque, Opaque, )
OPCODE(BindlessImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, )
OPCODE(BindlessImageFetch, F32x4, U32, Opaque, U32, U32, )
+OPCODE(BindlessImageQueryDimensions, U32x4, U32, U32, )
OPCODE(BoundImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
OPCODE(BoundImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
@@ -364,6 +365,7 @@ OPCODE(BoundImageSampleDrefExplicitLod, F32, U32,
OPCODE(BoundImageGather, F32x4, U32, Opaque, Opaque, Opaque, )
OPCODE(BoundImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, )
OPCODE(BoundImageFetch, F32x4, U32, Opaque, U32, U32, )
+OPCODE(BoundImageQueryDimensions, U32x4, U32, U32, )
OPCODE(ImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
OPCODE(ImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
@@ -372,6 +374,7 @@ OPCODE(ImageSampleDrefExplicitLod, F32, U32,
OPCODE(ImageGather, F32x4, U32, Opaque, Opaque, Opaque, )
OPCODE(ImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, )
OPCODE(ImageFetch, F32x4, U32, Opaque, U32, U32, )
+OPCODE(ImageQueryDimensions, U32x4, U32, U32, )
// Warp operations
OPCODE(VoteAll, U1, U1, )