diff options
Diffstat (limited to 'src/shader_recompiler/frontend/ir')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.cpp | 7 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.h | 4 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/modifiers.h | 1 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/opcodes.inc | 3 |
4 files changed, 15 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp index f6818ec8a..edf8c05d4 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp +++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp | |||
| @@ -1573,6 +1573,13 @@ Value IREmitter::ImageQueryLod(const Value& handle, const Value& coords, Texture | |||
| 1573 | return Inst(op, Flags{info}, handle, coords); | 1573 | return Inst(op, Flags{info}, handle, coords); |
| 1574 | } | 1574 | } |
| 1575 | 1575 | ||
| 1576 | Value IREmitter::ImageGradient(const Value& handle, const Value& coords, const Value& derivates, | ||
| 1577 | const Value& offset, const F32& lod_clamp, TextureInstInfo info) { | ||
| 1578 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageGradient | ||
| 1579 | : Opcode::BindlessImageGradient}; | ||
| 1580 | return Inst(op, Flags{info}, handle, coords, derivates, offset, lod_clamp); | ||
| 1581 | } | ||
| 1582 | |||
| 1576 | U1 IREmitter::VoteAll(const U1& value) { | 1583 | U1 IREmitter::VoteAll(const U1& value) { |
| 1577 | return Inst<U1>(Opcode::VoteAll, value); | 1584 | return Inst<U1>(Opcode::VoteAll, value); |
| 1578 | } | 1585 | } |
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h index 2beeace8f..a4616e247 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.h +++ b/src/shader_recompiler/frontend/ir/ir_emitter.h | |||
| @@ -268,6 +268,10 @@ public: | |||
| 268 | [[nodiscard]] Value ImageFetch(const Value& handle, const Value& coords, const Value& offset, | 268 | [[nodiscard]] Value ImageFetch(const Value& handle, const Value& coords, const Value& offset, |
| 269 | const U32& lod, const U32& multisampling, TextureInstInfo info); | 269 | const U32& lod, const U32& multisampling, TextureInstInfo info); |
| 270 | 270 | ||
| 271 | [[nodiscard]] Value ImageGradient(const Value& handle, const Value& coords, | ||
| 272 | const Value& derivates, const Value& offset, | ||
| 273 | const F32& lod_clamp, TextureInstInfo info); | ||
| 274 | |||
| 271 | [[nodiscard]] U1 VoteAll(const U1& value); | 275 | [[nodiscard]] U1 VoteAll(const U1& value); |
| 272 | [[nodiscard]] U1 VoteAny(const U1& value); | 276 | [[nodiscard]] U1 VoteAny(const U1& value); |
| 273 | [[nodiscard]] U1 VoteEqual(const U1& value); | 277 | [[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 4f09a4b39..90078f535 100644 --- a/src/shader_recompiler/frontend/ir/modifiers.h +++ b/src/shader_recompiler/frontend/ir/modifiers.h | |||
| @@ -39,6 +39,7 @@ union TextureInstInfo { | |||
| 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 | BitField<11, 2, u32> gather_component; |
| 42 | BitField<13, 2, u32> num_derivates; | ||
| 42 | }; | 43 | }; |
| 43 | static_assert(sizeof(TextureInstInfo) <= sizeof(u32)); | 44 | static_assert(sizeof(TextureInstInfo) <= sizeof(u32)); |
| 44 | 45 | ||
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc index 49cdcd57f..79baacd08 100644 --- a/src/shader_recompiler/frontend/ir/opcodes.inc +++ b/src/shader_recompiler/frontend/ir/opcodes.inc | |||
| @@ -381,6 +381,7 @@ OPCODE(BindlessImageGatherDref, F32x4, U32, | |||
| 381 | OPCODE(BindlessImageFetch, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) | 381 | OPCODE(BindlessImageFetch, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) |
| 382 | OPCODE(BindlessImageQueryDimensions, U32x4, U32, U32, ) | 382 | OPCODE(BindlessImageQueryDimensions, U32x4, U32, U32, ) |
| 383 | OPCODE(BindlessImageQueryLod, F32x4, U32, Opaque, ) | 383 | OPCODE(BindlessImageQueryLod, F32x4, U32, Opaque, ) |
| 384 | OPCODE(BindlessImageGradient, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) | ||
| 384 | 385 | ||
| 385 | OPCODE(BoundImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) | 386 | OPCODE(BoundImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) |
| 386 | OPCODE(BoundImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) | 387 | OPCODE(BoundImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) |
| @@ -391,6 +392,7 @@ OPCODE(BoundImageGatherDref, F32x4, U32, | |||
| 391 | OPCODE(BoundImageFetch, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) | 392 | OPCODE(BoundImageFetch, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) |
| 392 | OPCODE(BoundImageQueryDimensions, U32x4, U32, U32, ) | 393 | OPCODE(BoundImageQueryDimensions, U32x4, U32, U32, ) |
| 393 | OPCODE(BoundImageQueryLod, F32x4, U32, Opaque, ) | 394 | OPCODE(BoundImageQueryLod, F32x4, U32, Opaque, ) |
| 395 | OPCODE(BoundImageGradient, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) | ||
| 394 | 396 | ||
| 395 | OPCODE(ImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) | 397 | OPCODE(ImageSampleImplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) |
| 396 | OPCODE(ImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) | 398 | OPCODE(ImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, ) |
| @@ -401,6 +403,7 @@ OPCODE(ImageGatherDref, F32x4, U32, | |||
| 401 | OPCODE(ImageFetch, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) | 403 | OPCODE(ImageFetch, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) |
| 402 | OPCODE(ImageQueryDimensions, U32x4, U32, U32, ) | 404 | OPCODE(ImageQueryDimensions, U32x4, U32, U32, ) |
| 403 | OPCODE(ImageQueryLod, F32x4, U32, Opaque, ) | 405 | OPCODE(ImageQueryLod, F32x4, U32, Opaque, ) |
| 406 | OPCODE(ImageGradient, F32x4, U32, Opaque, Opaque, Opaque, F32, ) | ||
| 404 | 407 | ||
| 405 | // Warp operations | 408 | // Warp operations |
| 406 | OPCODE(VoteAll, U1, U1, ) | 409 | OPCODE(VoteAll, U1, U1, ) |