diff options
| author | 2021-05-27 19:59:22 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:34 -0400 | |
| commit | b659212dbdcac6e4f54a4306fd716b7fb74505ad (patch) | |
| tree | feed1286637d6c1cd4cbeec61e8c17191d6532e6 /src/shader_recompiler | |
| parent | shader: Fix FSwizzleAdd folding when going through phi nodes (diff) | |
| download | yuzu-b659212dbdcac6e4f54a4306fd716b7fb74505ad.tar.gz yuzu-b659212dbdcac6e4f54a4306fd716b7fb74505ad.tar.xz yuzu-b659212dbdcac6e4f54a4306fd716b7fb74505ad.zip | |
shader: Fix TMML queries
Diffstat (limited to 'src/shader_recompiler')
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate/impl/texture_mipmap_level.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_mipmap_level.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_mipmap_level.cpp index 2277d24ff..abf87a0df 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_mipmap_level.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_mipmap_level.cpp | |||
| @@ -84,9 +84,6 @@ void Impl(TranslatorVisitor& v, u64 insn, bool is_bindless) { | |||
| 84 | if ((tmml.mask & 0b1100) != 0) { | 84 | if ((tmml.mask & 0b1100) != 0) { |
| 85 | throw NotImplementedException("TMML BA results are not implmented"); | 85 | throw NotImplementedException("TMML BA results are not implmented"); |
| 86 | } | 86 | } |
| 87 | |||
| 88 | IR::F32 transform_constant{v.ir.Imm32(256.0f)}; | ||
| 89 | |||
| 90 | const IR::Value coords{MakeCoords(v, tmml.coord_reg, tmml.type)}; | 87 | const IR::Value coords{MakeCoords(v, tmml.coord_reg, tmml.type)}; |
| 91 | 88 | ||
| 92 | IR::U32 handle; | 89 | IR::U32 handle; |
| @@ -107,9 +104,16 @@ void Impl(TranslatorVisitor& v, u64 insn, bool is_bindless) { | |||
| 107 | } | 104 | } |
| 108 | IR::F32 value{v.ir.CompositeExtract(sample, element)}; | 105 | IR::F32 value{v.ir.CompositeExtract(sample, element)}; |
| 109 | if (element < 2) { | 106 | if (element < 2) { |
| 110 | value = v.ir.FPMul(value, transform_constant); | 107 | IR::U32 casted_value; |
| 108 | if (element == 0) { | ||
| 109 | casted_value = v.ir.ConvertFToU(32, value); | ||
| 110 | } else { | ||
| 111 | casted_value = v.ir.ConvertFToS(16, value); | ||
| 112 | } | ||
| 113 | v.X(dest_reg, v.ir.ShiftLeftLogical(casted_value, v.ir.Imm32(8))); | ||
| 114 | } else { | ||
| 115 | v.F(dest_reg, value); | ||
| 111 | } | 116 | } |
| 112 | v.F(dest_reg, value); | ||
| 113 | ++dest_reg; | 117 | ++dest_reg; |
| 114 | } | 118 | } |
| 115 | } | 119 | } |