summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.cpp13
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.h6
-rw-r--r--src/shader_recompiler/frontend/ir/modifiers.h1
-rw-r--r--src/shader_recompiler/frontend/ir/opcodes.inc6
4 files changed, 26 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
index 418b7f5ac..b365a8a6e 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
@@ -1474,6 +1474,19 @@ F32 IREmitter::ImageSampleDrefExplicitLod(const Value& handle, const Value& coor
1474 return Inst<F32>(op, Flags{info}, handle, coords, dref, lod_lc, offset); 1474 return Inst<F32>(op, Flags{info}, handle, coords, dref, lod_lc, offset);
1475} 1475}
1476 1476
1477Value IREmitter::ImageGather(const Value& handle, const Value& coords, const Value& offset,
1478 const Value& offset2, TextureInstInfo info) {
1479 const Opcode op{handle.IsImmediate() ? Opcode::BoundImageGather : Opcode::BindlessImageGather};
1480 return Inst(op, Flags{info}, handle, coords, offset, offset2);
1481}
1482
1483Value IREmitter::ImageGatherDref(const Value& handle, const Value& coords, const Value& offset,
1484 const Value& offset2, const F32& dref, TextureInstInfo info) {
1485 const Opcode op{handle.IsImmediate() ? Opcode::BoundImageGatherDref
1486 : Opcode::BindlessImageGatherDref};
1487 return Inst(op, Flags{info}, handle, coords, offset, offset2, dref);
1488}
1489
1477U1 IREmitter::VoteAll(const U1& value) { 1490U1 IREmitter::VoteAll(const U1& value) {
1478 return Inst<U1>(Opcode::VoteAll, value); 1491 return Inst<U1>(Opcode::VoteAll, value);
1479} 1492}
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h
index 64738735e..04b43197f 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.h
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.h
@@ -240,6 +240,12 @@ public:
240 const Value& offset, const F32& lod_clamp, 240 const Value& offset, const F32& lod_clamp,
241 TextureInstInfo info); 241 TextureInstInfo info);
242 242
243 [[nodiscard]] Value ImageGather(const Value& handle, const Value& coords, const Value& offset,
244 const Value& offset2, TextureInstInfo info);
245
246 [[nodiscard]] Value ImageGatherDref(const Value& handle, const Value& coords, const Value& offset,
247 const Value& offset2, const F32& dref, TextureInstInfo info);
248
243 [[nodiscard]] U1 VoteAll(const U1& value); 249 [[nodiscard]] U1 VoteAll(const U1& value);
244 [[nodiscard]] U1 VoteAny(const U1& value); 250 [[nodiscard]] U1 VoteAny(const U1& value);
245 [[nodiscard]] U1 VoteEqual(const U1& value); 251 [[nodiscard]] U1 VoteEqual(const U1& value);
diff --git a/src/shader_recompiler/frontend/ir/modifiers.h b/src/shader_recompiler/frontend/ir/modifiers.h
index 308c00153..4f09a4b39 100644
--- a/src/shader_recompiler/frontend/ir/modifiers.h
+++ b/src/shader_recompiler/frontend/ir/modifiers.h
@@ -38,6 +38,7 @@ union TextureInstInfo {
38 BitField<8, 1, u32> has_bias; 38 BitField<8, 1, u32> has_bias;
39 BitField<9, 1, u32> has_lod_clamp; 39 BitField<9, 1, u32> has_lod_clamp;
40 BitField<10, 1, u32> relaxed_precision; 40 BitField<10, 1, u32> relaxed_precision;
41 BitField<11, 2, u32> gather_component;
41}; 42};
42static_assert(sizeof(TextureInstInfo) <= sizeof(u32)); 43static_assert(sizeof(TextureInstInfo) <= sizeof(u32));
43 44
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc
index a2479c46a..60a0bc980 100644
--- a/src/shader_recompiler/frontend/ir/opcodes.inc
+++ b/src/shader_recompiler/frontend/ir/opcodes.inc
@@ -353,16 +353,22 @@ OPCODE(BindlessImageSampleImplicitLod, F32x4, U32,
353OPCODE(BindlessImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) 353OPCODE(BindlessImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
354OPCODE(BindlessImageSampleDrefImplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) 354OPCODE(BindlessImageSampleDrefImplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, )
355OPCODE(BindlessImageSampleDrefExplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) 355OPCODE(BindlessImageSampleDrefExplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, )
356OPCODE(BindlessImageGather, F32x4, U32, Opaque, Opaque, Opaque, )
357OPCODE(BindlessImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, )
356 358
357OPCODE(BoundImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) 359OPCODE(BoundImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
358OPCODE(BoundImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) 360OPCODE(BoundImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
359OPCODE(BoundImageSampleDrefImplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) 361OPCODE(BoundImageSampleDrefImplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, )
360OPCODE(BoundImageSampleDrefExplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) 362OPCODE(BoundImageSampleDrefExplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, )
363OPCODE(BoundImageGather, F32x4, U32, Opaque, Opaque, Opaque, )
364OPCODE(BoundImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, )
361 365
362OPCODE(ImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) 366OPCODE(ImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
363OPCODE(ImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) 367OPCODE(ImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
364OPCODE(ImageSampleDrefImplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) 368OPCODE(ImageSampleDrefImplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, )
365OPCODE(ImageSampleDrefExplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) 369OPCODE(ImageSampleDrefExplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, )
370OPCODE(ImageGather, F32x4, U32, Opaque, Opaque, Opaque, )
371OPCODE(ImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, )
366 372
367// Warp operations 373// Warp operations
368OPCODE(VoteAll, U1, U1, ) 374OPCODE(VoteAll, U1, U1, )