1
0
Fork 0
forked from suyu/suyu
This commit is contained in:
Fernando Sahmkow 2019-03-28 19:45:19 -04:00 committed by FernandoS27
parent a77e9a27b0
commit c60b0b8432

View file

@ -226,17 +226,19 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) {
coords.push_back(GetRegister(instr.gpr8.Value() + 1)); coords.push_back(GetRegister(instr.gpr8.Value() + 1));
texture_type = TextureType::Texture2D; texture_type = TextureType::Texture2D;
} }
u32 indexer = 0;
for (u32 element = 0; element < 2; ++element) { for (u32 element = 0; element < 2; ++element) {
if (!instr.tmml.IsComponentEnabled(element)) {
continue;
}
auto params = coords; auto params = coords;
MetaTexture meta{sampler, {}, {}, {}, {}, {}, {}, element}; MetaTexture meta{sampler, {}, {}, {}, {}, {}, {}, element};
const Node value = Operation(OperationCode::TextureQueryLod, meta, std::move(params)); 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) { for (u32 i = 0; i < indexer; ++i) {
SetRegister(bb, instr.gpr0.Value() + element, GetTemporal(element)); SetRegister(bb, instr.gpr0.Value() + i, GetTemporal(i));
} }
break; break;
} }
case OpCode::Id::TLDS: { case OpCode::Id::TLDS: {