summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar ameerj2021-06-12 16:23:04 -0400
committerGravatar ameerj2021-07-22 21:51:35 -0400
commit3c125d41348b08a467333cf0e40bed7ce26cd7cc (patch)
tree6d27b0dbc479d9290b4a18b548ef6fd003440796
parentvulkan: Add VK_EXT_vertex_input_dynamic_state support (diff)
downloadyuzu-3c125d41348b08a467333cf0e40bed7ce26cd7cc.tar.gz
yuzu-3c125d41348b08a467333cf0e40bed7ce26cd7cc.tar.xz
yuzu-3c125d41348b08a467333cf0e40bed7ce26cd7cc.zip
tmml: Remove index component from coords vec
The lod query functions exposed by the rendering API's do not make use of the texturearray layer indexing.
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/texture_mipmap_level.cpp7
1 files changed, 3 insertions, 4 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 abf87a0df..667c69a0d 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
@@ -46,16 +46,15 @@ Shader::TextureType GetType(TextureType type) {
46} 46}
47 47
48IR::Value MakeCoords(TranslatorVisitor& v, IR::Reg reg, TextureType type) { 48IR::Value MakeCoords(TranslatorVisitor& v, IR::Reg reg, TextureType type) {
49 const auto read_array{[&]() -> IR::F32 { return v.ir.ConvertUToF(32, 16, v.X(reg)); }};
50 switch (type) { 49 switch (type) {
51 case TextureType::_1D: 50 case TextureType::_1D:
52 return v.F(reg); 51 return v.F(reg);
53 case TextureType::ARRAY_1D: 52 case TextureType::ARRAY_1D:
54 return v.ir.CompositeConstruct(v.F(reg + 1), read_array()); 53 return v.F(reg + 1);
55 case TextureType::_2D: 54 case TextureType::_2D:
56 return v.ir.CompositeConstruct(v.F(reg), v.F(reg + 1)); 55 return v.ir.CompositeConstruct(v.F(reg), v.F(reg + 1));
57 case TextureType::ARRAY_2D: 56 case TextureType::ARRAY_2D:
58 return v.ir.CompositeConstruct(v.F(reg + 1), v.F(reg + 2), read_array()); 57 return v.ir.CompositeConstruct(v.F(reg + 1), v.F(reg + 2));
59 case TextureType::_3D: 58 case TextureType::_3D:
60 return v.ir.CompositeConstruct(v.F(reg), v.F(reg + 1), v.F(reg + 2)); 59 return v.ir.CompositeConstruct(v.F(reg), v.F(reg + 1), v.F(reg + 2));
61 case TextureType::ARRAY_3D: 60 case TextureType::ARRAY_3D:
@@ -63,7 +62,7 @@ IR::Value MakeCoords(TranslatorVisitor& v, IR::Reg reg, TextureType type) {
63 case TextureType::CUBE: 62 case TextureType::CUBE:
64 return v.ir.CompositeConstruct(v.F(reg), v.F(reg + 1), v.F(reg + 2)); 63 return v.ir.CompositeConstruct(v.F(reg), v.F(reg + 1), v.F(reg + 2));
65 case TextureType::ARRAY_CUBE: 64 case TextureType::ARRAY_CUBE:
66 return v.ir.CompositeConstruct(v.F(reg + 1), v.F(reg + 2), v.F(reg + 3), read_array()); 65 return v.ir.CompositeConstruct(v.F(reg + 1), v.F(reg + 2), v.F(reg + 3));
67 } 66 }
68 throw NotImplementedException("Invalid texture type {}", type); 67 throw NotImplementedException("Invalid texture type {}", type);
69} 68}