summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-02-03 22:07:20 +0100
committerFernandoS27 <fsahmkow27@gmail.com>2019-02-03 23:17:18 +0100
commit0306c50339ae6f5a739826accadd91dabeec9f7b (patch)
tree8e02ef9450614c78274ea2196593d1101ef43c6f /src/video_core/shader
parentMerge pull request #2072 from lioncash/service (diff)
downloadyuzu-0306c50339ae6f5a739826accadd91dabeec9f7b.tar
yuzu-0306c50339ae6f5a739826accadd91dabeec9f7b.tar.gz
yuzu-0306c50339ae6f5a739826accadd91dabeec9f7b.tar.bz2
yuzu-0306c50339ae6f5a739826accadd91dabeec9f7b.tar.lz
yuzu-0306c50339ae6f5a739826accadd91dabeec9f7b.tar.xz
yuzu-0306c50339ae6f5a739826accadd91dabeec9f7b.tar.zst
yuzu-0306c50339ae6f5a739826accadd91dabeec9f7b.zip
Diffstat (limited to 'src/video_core/shader')
-rw-r--r--src/video_core/shader/decode/memory.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp
index 04cb386b7..7d4d2b9ef 100644
--- a/src/video_core/shader/decode/memory.cpp
+++ b/src/video_core/shader/decode/memory.cpp
@@ -324,15 +324,18 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, const BasicBlock& code, u32 pc) {
const auto& sampler =
GetSampler(instr.sampler, Tegra::Shader::TextureType::Texture2D, false, false);
+ u32 indexer = 0;
switch (instr.txq.query_type) {
case Tegra::Shader::TextureQueryType::Dimension: {
for (u32 element = 0; element < 4; ++element) {
- MetaTexture meta{sampler, element};
- const Node value = Operation(OperationCode::F4TextureQueryDimensions,
- std::move(meta), GetRegister(instr.gpr8));
- SetTemporal(bb, element, value);
+ if (instr.txq.IsComponentEnabled(element)) {
+ MetaTexture meta{sampler, element};
+ const Node value = Operation(OperationCode::F4TextureQueryDimensions,
+ std::move(meta), GetRegister(instr.gpr8));
+ SetTemporal(bb, indexer++, value);
+ }
}
- for (u32 i = 0; i < 4; ++i) {
+ for (u32 i = 0; i < indexer; ++i) {
SetRegister(bb, instr.gpr0.Value() + i, GetTemporal(i));
}
break;
@@ -734,4 +737,4 @@ std::tuple<std::size_t, std::size_t> ShaderIR::ValidateAndGetCoordinateElement(
return {coord_count, total_coord_count};
}
-} // namespace VideoCommon::Shader \ No newline at end of file
+} // namespace VideoCommon::Shader