diff options
| author | 2023-01-28 16:09:58 -0500 | |
|---|---|---|
| committer | 2023-01-28 16:25:18 -0500 | |
| commit | 2c2e019a44e353921d5fdf3cc6ab4304502eb2bd (patch) | |
| tree | 37c9582394bca3fe15fe2827d82f4b0da4e450a8 /src/shader_recompiler/frontend/ir | |
| parent | Merge pull request #9685 from liamwhite/minmax (diff) | |
| download | yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.tar.gz yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.tar.xz yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.zip | |
shader_recompiler: TXQ: Skip QueryLevels when possible
Diffstat (limited to 'src/shader_recompiler/frontend/ir')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.cpp | 9 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.h | 5 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/opcodes.inc | 6 |
3 files changed, 11 insertions, 9 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp index eb2e49a68..8b379c920 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp +++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp | |||
| @@ -1851,15 +1851,16 @@ Value IREmitter::ImageFetch(const Value& handle, const Value& coords, const Valu | |||
| 1851 | return Inst(op, Flags{info}, handle, coords, offset, lod, multisampling); | 1851 | return Inst(op, Flags{info}, handle, coords, offset, lod, multisampling); |
| 1852 | } | 1852 | } |
| 1853 | 1853 | ||
| 1854 | Value IREmitter::ImageQueryDimension(const Value& handle, const IR::U32& lod) { | 1854 | Value IREmitter::ImageQueryDimension(const Value& handle, const IR::U32& lod, |
| 1855 | const IR::U1& skip_mips) { | ||
| 1855 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageQueryDimensions | 1856 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageQueryDimensions |
| 1856 | : Opcode::BindlessImageQueryDimensions}; | 1857 | : Opcode::BindlessImageQueryDimensions}; |
| 1857 | return Inst(op, handle, lod); | 1858 | return Inst(op, handle, lod, skip_mips); |
| 1858 | } | 1859 | } |
| 1859 | 1860 | ||
| 1860 | Value IREmitter::ImageQueryDimension(const Value& handle, const IR::U32& lod, | 1861 | Value IREmitter::ImageQueryDimension(const Value& handle, const IR::U32& lod, |
| 1861 | TextureInstInfo info) { | 1862 | const IR::U1& skip_mips, TextureInstInfo info) { |
| 1862 | return Inst(Opcode::ImageQueryDimensions, Flags{info}, handle, lod); | 1863 | return Inst(Opcode::ImageQueryDimensions, Flags{info}, handle, lod, skip_mips); |
| 1863 | } | 1864 | } |
| 1864 | 1865 | ||
| 1865 | Value IREmitter::ImageQueryLod(const Value& handle, const Value& coords, TextureInstInfo info) { | 1866 | Value IREmitter::ImageQueryLod(const Value& handle, const Value& coords, TextureInstInfo info) { |
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h index 7aaaa4ab0..df158c928 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.h +++ b/src/shader_recompiler/frontend/ir/ir_emitter.h | |||
| @@ -320,9 +320,10 @@ public: | |||
| 320 | [[nodiscard]] F32 ImageSampleDrefExplicitLod(const Value& handle, const Value& coords, | 320 | [[nodiscard]] F32 ImageSampleDrefExplicitLod(const Value& handle, const Value& coords, |
| 321 | const F32& dref, const F32& lod, | 321 | const F32& dref, const F32& lod, |
| 322 | const Value& offset, TextureInstInfo info); | 322 | const Value& offset, TextureInstInfo info); |
| 323 | [[nodiscard]] Value ImageQueryDimension(const Value& handle, const IR::U32& lod); | ||
| 324 | [[nodiscard]] Value ImageQueryDimension(const Value& handle, const IR::U32& lod, | 323 | [[nodiscard]] Value ImageQueryDimension(const Value& handle, const IR::U32& lod, |
| 325 | TextureInstInfo info); | 324 | const IR::U1& skip_mips); |
| 325 | [[nodiscard]] Value ImageQueryDimension(const Value& handle, const IR::U32& lod, | ||
| 326 | const IR::U1& skip_mips, TextureInstInfo info); | ||
| 326 | 327 | ||
| 327 | [[nodiscard]] Value ImageQueryLod(const Value& handle, const Value& coords, | 328 | [[nodiscard]] Value ImageQueryLod(const Value& handle, const Value& coords, |
| 328 | TextureInstInfo info); | 329 | TextureInstInfo info); |
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc index 1fe3749cc..4ba262b84 100644 --- a/src/shader_recompiler/frontend/ir/opcodes.inc +++ b/src/shader_recompiler/frontend/ir/opcodes.inc | |||
| @@ -483,7 +483,7 @@ OPCODE(BindlessImageSampleDrefExplicitLod, F32, U32, | |||
| 483 | OPCODE(BindlessImageGather, F32x4, U32, Opaque, Opaque, Opaque, ) | 483 | OPCODE(BindlessImageGather, F32x4, U32, Opaque, Opaque, Opaque, ) |
| 484 | OPCODE(BindlessImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, ) | 484 | OPCODE(BindlessImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, ) |
| 485 | OPCODE(BindlessImageFetch, F32x4, U32, Opaque, Opaque, U32, Opaque, ) | 485 | OPCODE(BindlessImageFetch, F32x4, U32, Opaque, Opaque, U32, Opaque, ) |
| 486 | OPCODE(BindlessImageQueryDimensions, U32x4, U32, U32, ) | 486 | OPCODE(BindlessImageQueryDimensions, U32x4, U32, U32, U1, ) |
| 487 | OPCODE(BindlessImageQueryLod, F32x4, U32, Opaque, ) | 487 | OPCODE(BindlessImageQueryLod, F32x4, U32, Opaque, ) |
| 488 | OPCODE(BindlessImageGradient, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) | 488 | OPCODE(BindlessImageGradient, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) |
| 489 | OPCODE(BindlessImageRead, U32x4, U32, Opaque, ) | 489 | OPCODE(BindlessImageRead, U32x4, U32, Opaque, ) |
| @@ -496,7 +496,7 @@ OPCODE(BoundImageSampleDrefExplicitLod, F32, U32, | |||
| 496 | OPCODE(BoundImageGather, F32x4, U32, Opaque, Opaque, Opaque, ) | 496 | OPCODE(BoundImageGather, F32x4, U32, Opaque, Opaque, Opaque, ) |
| 497 | OPCODE(BoundImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, ) | 497 | OPCODE(BoundImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, ) |
| 498 | OPCODE(BoundImageFetch, F32x4, U32, Opaque, Opaque, U32, Opaque, ) | 498 | OPCODE(BoundImageFetch, F32x4, U32, Opaque, Opaque, U32, Opaque, ) |
| 499 | OPCODE(BoundImageQueryDimensions, U32x4, U32, U32, ) | 499 | OPCODE(BoundImageQueryDimensions, U32x4, U32, U32, U1, ) |
| 500 | OPCODE(BoundImageQueryLod, F32x4, U32, Opaque, ) | 500 | OPCODE(BoundImageQueryLod, F32x4, U32, Opaque, ) |
| 501 | OPCODE(BoundImageGradient, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) | 501 | OPCODE(BoundImageGradient, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) |
| 502 | OPCODE(BoundImageRead, U32x4, U32, Opaque, ) | 502 | OPCODE(BoundImageRead, U32x4, U32, Opaque, ) |
| @@ -509,7 +509,7 @@ OPCODE(ImageSampleDrefExplicitLod, F32, Opaq | |||
| 509 | OPCODE(ImageGather, F32x4, Opaque, Opaque, Opaque, Opaque, ) | 509 | OPCODE(ImageGather, F32x4, Opaque, Opaque, Opaque, Opaque, ) |
| 510 | OPCODE(ImageGatherDref, F32x4, Opaque, Opaque, Opaque, Opaque, F32, ) | 510 | OPCODE(ImageGatherDref, F32x4, Opaque, Opaque, Opaque, Opaque, F32, ) |
| 511 | OPCODE(ImageFetch, F32x4, Opaque, Opaque, Opaque, U32, Opaque, ) | 511 | OPCODE(ImageFetch, F32x4, Opaque, Opaque, Opaque, U32, Opaque, ) |
| 512 | OPCODE(ImageQueryDimensions, U32x4, Opaque, U32, ) | 512 | OPCODE(ImageQueryDimensions, U32x4, Opaque, U32, U1, ) |
| 513 | OPCODE(ImageQueryLod, F32x4, Opaque, Opaque, ) | 513 | OPCODE(ImageQueryLod, F32x4, Opaque, Opaque, ) |
| 514 | OPCODE(ImageGradient, F32x4, Opaque, Opaque, Opaque, Opaque, Opaque, ) | 514 | OPCODE(ImageGradient, F32x4, Opaque, Opaque, Opaque, Opaque, Opaque, ) |
| 515 | OPCODE(ImageRead, U32x4, Opaque, Opaque, ) | 515 | OPCODE(ImageRead, U32x4, Opaque, Opaque, ) |