summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/decode/texture.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-03-29 00:45:19 +0100
committerFernandoS27 <fsahmkow27@gmail.com>2019-04-08 17:35:22 +0200
commitc60b0b8432953fbbd7434578fd0858073b908392 (patch)
tree92eb1180b86e664af74525c4ecc6faa5673691de /src/video_core/shader/decode/texture.cpp
parentSimplify ConstBufferAccessor (diff)
downloadyuzu-c60b0b8432953fbbd7434578fd0858073b908392.tar
yuzu-c60b0b8432953fbbd7434578fd0858073b908392.tar.gz
yuzu-c60b0b8432953fbbd7434578fd0858073b908392.tar.bz2
yuzu-c60b0b8432953fbbd7434578fd0858073b908392.tar.lz
yuzu-c60b0b8432953fbbd7434578fd0858073b908392.tar.xz
yuzu-c60b0b8432953fbbd7434578fd0858073b908392.tar.zst
yuzu-c60b0b8432953fbbd7434578fd0858073b908392.zip
Diffstat (limited to 'src/video_core/shader/decode/texture.cpp')
-rw-r--r--src/video_core/shader/decode/texture.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/video_core/shader/decode/texture.cpp b/src/video_core/shader/decode/texture.cpp
index 5d670b24e..99385c46e 100644
--- a/src/video_core/shader/decode/texture.cpp
+++ b/src/video_core/shader/decode/texture.cpp
@@ -226,17 +226,19 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) {
coords.push_back(GetRegister(instr.gpr8.Value() + 1));
texture_type = TextureType::Texture2D;
}
-
+ u32 indexer = 0;
for (u32 element = 0; element < 2; ++element) {
+ if (!instr.tmml.IsComponentEnabled(element)) {
+ continue;
+ }
auto params = coords;
MetaTexture meta{sampler, {}, {}, {}, {}, {}, {}, element};
const Node value = Operation(OperationCode::TextureQueryLod, meta, std::move(params));
- SetTemporal(bb, element, value);
+ SetTemporal(bb, indexer++, value);
}
- for (u32 element = 0; element < 2; ++element) {
- SetRegister(bb, instr.gpr0.Value() + element, GetTemporal(element));
+ for (u32 i = 0; i < indexer; ++i) {
+ SetRegister(bb, instr.gpr0.Value() + i, GetTemporal(i));
}
-
break;
}
case OpCode::Id::TLDS: {