diff options
| author | 2021-05-17 02:52:01 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:31 -0400 | |
| commit | ec6fc5fe78c9038fc9ad7259b7b3a7be751ecef6 (patch) | |
| tree | 063963b0a197526467902ef9bfceff1be8f5b9ef /src/shader_recompiler/frontend/ir/ir_emitter.cpp | |
| parent | glasm: Add support for non-2D texture samples (diff) | |
| download | yuzu-ec6fc5fe78c9038fc9ad7259b7b3a7be751ecef6.tar.gz yuzu-ec6fc5fe78c9038fc9ad7259b7b3a7be751ecef6.tar.xz yuzu-ec6fc5fe78c9038fc9ad7259b7b3a7be751ecef6.zip | |
glasm: Implement TEX and TEXS instructions
Remove lod clamp from texture instructions with lod, as this is not
needed (nor supported).
Diffstat (limited to 'src/shader_recompiler/frontend/ir/ir_emitter.cpp')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp index def29143e..94bdbe39c 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp +++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp | |||
| @@ -1778,12 +1778,10 @@ Value IREmitter::ImageSampleImplicitLod(const Value& handle, const Value& coords | |||
| 1778 | } | 1778 | } |
| 1779 | 1779 | ||
| 1780 | Value IREmitter::ImageSampleExplicitLod(const Value& handle, const Value& coords, const F32& lod, | 1780 | Value IREmitter::ImageSampleExplicitLod(const Value& handle, const Value& coords, const F32& lod, |
| 1781 | const Value& offset, const F32& lod_clamp, | 1781 | const Value& offset, TextureInstInfo info) { |
| 1782 | TextureInstInfo info) { | ||
| 1783 | const Value lod_lc{MakeLodClampPair(*this, lod, lod_clamp)}; | ||
| 1784 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageSampleExplicitLod | 1782 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageSampleExplicitLod |
| 1785 | : Opcode::BindlessImageSampleExplicitLod}; | 1783 | : Opcode::BindlessImageSampleExplicitLod}; |
| 1786 | return Inst(op, Flags{info}, handle, coords, lod_lc, offset); | 1784 | return Inst(op, Flags{info}, handle, coords, lod, offset); |
| 1787 | } | 1785 | } |
| 1788 | 1786 | ||
| 1789 | F32 IREmitter::ImageSampleDrefImplicitLod(const Value& handle, const Value& coords, const F32& dref, | 1787 | F32 IREmitter::ImageSampleDrefImplicitLod(const Value& handle, const Value& coords, const F32& dref, |
| @@ -1796,12 +1794,11 @@ F32 IREmitter::ImageSampleDrefImplicitLod(const Value& handle, const Value& coor | |||
| 1796 | } | 1794 | } |
| 1797 | 1795 | ||
| 1798 | F32 IREmitter::ImageSampleDrefExplicitLod(const Value& handle, const Value& coords, const F32& dref, | 1796 | F32 IREmitter::ImageSampleDrefExplicitLod(const Value& handle, const Value& coords, const F32& dref, |
| 1799 | const F32& lod, const Value& offset, const F32& lod_clamp, | 1797 | const F32& lod, const Value& offset, |
| 1800 | TextureInstInfo info) { | 1798 | TextureInstInfo info) { |
| 1801 | const Value lod_lc{MakeLodClampPair(*this, lod, lod_clamp)}; | ||
| 1802 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageSampleDrefExplicitLod | 1799 | const Opcode op{handle.IsImmediate() ? Opcode::BoundImageSampleDrefExplicitLod |
| 1803 | : Opcode::BindlessImageSampleDrefExplicitLod}; | 1800 | : Opcode::BindlessImageSampleDrefExplicitLod}; |
| 1804 | return Inst<F32>(op, Flags{info}, handle, coords, dref, lod_lc, offset); | 1801 | return Inst<F32>(op, Flags{info}, handle, coords, dref, lod, offset); |
| 1805 | } | 1802 | } |
| 1806 | 1803 | ||
| 1807 | Value IREmitter::ImageGather(const Value& handle, const Value& coords, const Value& offset, | 1804 | Value IREmitter::ImageGather(const Value& handle, const Value& coords, const Value& offset, |