diff options
| author | 2023-01-29 12:27:26 -0500 | |
|---|---|---|
| committer | 2023-01-29 12:27:26 -0500 | |
| commit | 208e635f370d7cf90b80e9a5301f161283eefd8b (patch) | |
| tree | 830bb769857629e25b0e43fefd79d8bfe0b231e9 /src/shader_recompiler/frontend/ir | |
| parent | Merge pull request #9684 from liamwhite/read-the-spec (diff) | |
| parent | shader_recompiler: TXQ: Skip QueryLevels when possible (diff) | |
| download | yuzu-208e635f370d7cf90b80e9a5301f161283eefd8b.tar.gz yuzu-208e635f370d7cf90b80e9a5301f161283eefd8b.tar.xz yuzu-208e635f370d7cf90b80e9a5301f161283eefd8b.zip | |
Merge pull request #9694 from ameerj/txq-mips
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 430797d23..b7caa4246 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp +++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp | |||
| @@ -1846,15 +1846,16 @@ Value IREmitter::ImageFetch(const Value& handle, const Value& coords, const Valu | |||
| 1846 | return Inst(op, Flags{info}, handle, coords, offset, lod, multisampling); | 1846 | return Inst(op, Flags{info}, handle, coords, offset, lod, multisampling); |
| 1847 | } | 1847 | } |
| 1848 | 1848 | ||
| 1849 | Value IREmitter::ImageQueryDimension(const Value& handle, const IR::U32& lod) { | 1849 | Value IREmitter::ImageQueryDimension(const Value& handle, const IR::U32& lod, |
| 1850 | const IR::U1& skip_mips) { | ||
| 1850 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageQueryDimensions | 1851 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageQueryDimensions |
| 1851 | : Opcode::BindlessImageQueryDimensions}; | 1852 | : Opcode::BindlessImageQueryDimensions}; |
| 1852 | return Inst(op, handle, lod); | 1853 | return Inst(op, handle, lod, skip_mips); |
| 1853 | } | 1854 | } |
| 1854 | 1855 | ||
| 1855 | Value IREmitter::ImageQueryDimension(const Value& handle, const IR::U32& lod, | 1856 | Value IREmitter::ImageQueryDimension(const Value& handle, const IR::U32& lod, |
| 1856 | TextureInstInfo info) { | 1857 | const IR::U1& skip_mips, TextureInstInfo info) { |
| 1857 | return Inst(Opcode::ImageQueryDimensions, Flags{info}, handle, lod); | 1858 | return Inst(Opcode::ImageQueryDimensions, Flags{info}, handle, lod, skip_mips); |
| 1858 | } | 1859 | } |
| 1859 | 1860 | ||
| 1860 | Value IREmitter::ImageQueryLod(const Value& handle, const Value& coords, TextureInstInfo info) { | 1861 | 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 24e82f802..4447d67b0 100644 --- a/src/shader_recompiler/frontend/ir/opcodes.inc +++ b/src/shader_recompiler/frontend/ir/opcodes.inc | |||
| @@ -482,7 +482,7 @@ OPCODE(BindlessImageSampleDrefExplicitLod, F32, U32, | |||
| 482 | OPCODE(BindlessImageGather, F32x4, U32, Opaque, Opaque, Opaque, ) | 482 | OPCODE(BindlessImageGather, F32x4, U32, Opaque, Opaque, Opaque, ) |
| 483 | OPCODE(BindlessImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, ) | 483 | OPCODE(BindlessImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, ) |
| 484 | OPCODE(BindlessImageFetch, F32x4, U32, Opaque, Opaque, U32, Opaque, ) | 484 | OPCODE(BindlessImageFetch, F32x4, U32, Opaque, Opaque, U32, Opaque, ) |
| 485 | OPCODE(BindlessImageQueryDimensions, U32x4, U32, U32, ) | 485 | OPCODE(BindlessImageQueryDimensions, U32x4, U32, U32, U1, ) |
| 486 | OPCODE(BindlessImageQueryLod, F32x4, U32, Opaque, ) | 486 | OPCODE(BindlessImageQueryLod, F32x4, U32, Opaque, ) |
| 487 | OPCODE(BindlessImageGradient, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) | 487 | OPCODE(BindlessImageGradient, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) |
| 488 | OPCODE(BindlessImageRead, U32x4, U32, Opaque, ) | 488 | OPCODE(BindlessImageRead, U32x4, U32, Opaque, ) |
| @@ -495,7 +495,7 @@ OPCODE(BoundImageSampleDrefExplicitLod, F32, U32, | |||
| 495 | OPCODE(BoundImageGather, F32x4, U32, Opaque, Opaque, Opaque, ) | 495 | OPCODE(BoundImageGather, F32x4, U32, Opaque, Opaque, Opaque, ) |
| 496 | OPCODE(BoundImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, ) | 496 | OPCODE(BoundImageGatherDref, F32x4, U32, Opaque, Opaque, Opaque, F32, ) |
| 497 | OPCODE(BoundImageFetch, F32x4, U32, Opaque, Opaque, U32, Opaque, ) | 497 | OPCODE(BoundImageFetch, F32x4, U32, Opaque, Opaque, U32, Opaque, ) |
| 498 | OPCODE(BoundImageQueryDimensions, U32x4, U32, U32, ) | 498 | OPCODE(BoundImageQueryDimensions, U32x4, U32, U32, U1, ) |
| 499 | OPCODE(BoundImageQueryLod, F32x4, U32, Opaque, ) | 499 | OPCODE(BoundImageQueryLod, F32x4, U32, Opaque, ) |
| 500 | OPCODE(BoundImageGradient, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) | 500 | OPCODE(BoundImageGradient, F32x4, U32, Opaque, Opaque, Opaque, Opaque, ) |
| 501 | OPCODE(BoundImageRead, U32x4, U32, Opaque, ) | 501 | OPCODE(BoundImageRead, U32x4, U32, Opaque, ) |
| @@ -508,7 +508,7 @@ OPCODE(ImageSampleDrefExplicitLod, F32, Opaq | |||
| 508 | OPCODE(ImageGather, F32x4, Opaque, Opaque, Opaque, Opaque, ) | 508 | OPCODE(ImageGather, F32x4, Opaque, Opaque, Opaque, Opaque, ) |
| 509 | OPCODE(ImageGatherDref, F32x4, Opaque, Opaque, Opaque, Opaque, F32, ) | 509 | OPCODE(ImageGatherDref, F32x4, Opaque, Opaque, Opaque, Opaque, F32, ) |
| 510 | OPCODE(ImageFetch, F32x4, Opaque, Opaque, Opaque, U32, Opaque, ) | 510 | OPCODE(ImageFetch, F32x4, Opaque, Opaque, Opaque, U32, Opaque, ) |
| 511 | OPCODE(ImageQueryDimensions, U32x4, Opaque, U32, ) | 511 | OPCODE(ImageQueryDimensions, U32x4, Opaque, U32, U1, ) |
| 512 | OPCODE(ImageQueryLod, F32x4, Opaque, Opaque, ) | 512 | OPCODE(ImageQueryLod, F32x4, Opaque, Opaque, ) |
| 513 | OPCODE(ImageGradient, F32x4, Opaque, Opaque, Opaque, Opaque, Opaque, ) | 513 | OPCODE(ImageGradient, F32x4, Opaque, Opaque, Opaque, Opaque, Opaque, ) |
| 514 | OPCODE(ImageRead, U32x4, Opaque, Opaque, ) | 514 | OPCODE(ImageRead, U32x4, Opaque, Opaque, ) |