diff options
Diffstat (limited to '')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.cpp | 13 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.h | 6 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/modifiers.h | 1 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/opcodes.inc | 6 |
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 | ||
| 1477 | Value 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 | |||
| 1483 | Value 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 | |||
| 1477 | U1 IREmitter::VoteAll(const U1& value) { | 1490 | U1 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 | }; |
| 42 | static_assert(sizeof(TextureInstInfo) <= sizeof(u32)); | 43 | static_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, | |||
| 353 | OPCODE(BindlessImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) | 353 | OPCODE(BindlessImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) |
| 354 | OPCODE(BindlessImageSampleDrefImplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) | 354 | OPCODE(BindlessImageSampleDrefImplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) |
| 355 | OPCODE(BindlessImageSampleDrefExplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) | 355 | OPCODE(BindlessImageSampleDrefExplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) |
| 356 | OPCODE(BindlessImageGather, F32x4, U32, Opaque, Opaque, Opaque, ) | ||
| 357 | OPCODE(BindlessImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, ) | ||
| 356 | 358 | ||
| 357 | OPCODE(BoundImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) | 359 | OPCODE(BoundImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) |
| 358 | OPCODE(BoundImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) | 360 | OPCODE(BoundImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) |
| 359 | OPCODE(BoundImageSampleDrefImplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) | 361 | OPCODE(BoundImageSampleDrefImplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) |
| 360 | OPCODE(BoundImageSampleDrefExplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) | 362 | OPCODE(BoundImageSampleDrefExplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) |
| 363 | OPCODE(BoundImageGather, F32x4, U32, Opaque, Opaque, Opaque, ) | ||
| 364 | OPCODE(BoundImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, ) | ||
| 361 | 365 | ||
| 362 | OPCODE(ImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) | 366 | OPCODE(ImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) |
| 363 | OPCODE(ImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) | 367 | OPCODE(ImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) |
| 364 | OPCODE(ImageSampleDrefImplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) | 368 | OPCODE(ImageSampleDrefImplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) |
| 365 | OPCODE(ImageSampleDrefExplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) | 369 | OPCODE(ImageSampleDrefExplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, ) |
| 370 | OPCODE(ImageGather, F32x4, U32, Opaque, Opaque, Opaque, ) | ||
| 371 | OPCODE(ImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, ) | ||
| 366 | 372 | ||
| 367 | // Warp operations | 373 | // Warp operations |
| 368 | OPCODE(VoteAll, U1, U1, ) | 374 | OPCODE(VoteAll, U1, U1, ) |