summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-03-26 19:46:11 -0400
committerGravatar FernandoS272019-04-08 11:29:52 -0400
commit4841440382c72047d68bb2c0ce7a7defadab7d3d (patch)
tree849c245021c01d8a121e6d1cbbf25e04d0fed906 /src
parentImplement TMML_B (diff)
downloadyuzu-4841440382c72047d68bb2c0ce7a7defadab7d3d.tar.gz
yuzu-4841440382c72047d68bb2c0ce7a7defadab7d3d.tar.xz
yuzu-4841440382c72047d68bb2c0ce7a7defadab7d3d.zip
Implement TXQ_B
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/shader_bytecode.h2
-rw-r--r--src/video_core/shader/decode/texture.cpp10
2 files changed, 10 insertions, 2 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index 71c22aff0..f7ef9a32a 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -1343,6 +1343,7 @@ public:
1343 TEX, 1343 TEX,
1344 TEX_B, // Texture Load Bindless 1344 TEX_B, // Texture Load Bindless
1345 TXQ, // Texture Query 1345 TXQ, // Texture Query
1346 TXQ_B, // Texture Query Bindless
1346 TEXS, // Texture Fetch with scalar/non-vec4 source/destinations 1347 TEXS, // Texture Fetch with scalar/non-vec4 source/destinations
1347 TLDS, // Texture Load with scalar/non-vec4 source/destinations 1348 TLDS, // Texture Load with scalar/non-vec4 source/destinations
1348 TLD4, // Texture Load 4 1349 TLD4, // Texture Load 4
@@ -1612,6 +1613,7 @@ private:
1612 INST("110000----111---", Id::TEX, Type::Texture, "TEX"), 1613 INST("110000----111---", Id::TEX, Type::Texture, "TEX"),
1613 INST("1101111010111---", Id::TEX_B, Type::Texture, "TEX_B"), 1614 INST("1101111010111---", Id::TEX_B, Type::Texture, "TEX_B"),
1614 INST("1101111101001---", Id::TXQ, Type::Texture, "TXQ"), 1615 INST("1101111101001---", Id::TXQ, Type::Texture, "TXQ"),
1616 INST("1101111101010---", Id::TXQ_B, Type::Texture, "TXQ_B"),
1615 INST("1101-00---------", Id::TEXS, Type::Texture, "TEXS"), 1617 INST("1101-00---------", Id::TEXS, Type::Texture, "TEXS"),
1616 INST("1101101---------", Id::TLDS, Type::Texture, "TLDS"), 1618 INST("1101101---------", Id::TLDS, Type::Texture, "TLDS"),
1617 INST("110010----111---", Id::TLD4, Type::Texture, "TLD4"), 1619 INST("110010----111---", Id::TLD4, Type::Texture, "TLD4"),
diff --git a/src/video_core/shader/decode/texture.cpp b/src/video_core/shader/decode/texture.cpp
index ddb7755b8..3eac75bef 100644
--- a/src/video_core/shader/decode/texture.cpp
+++ b/src/video_core/shader/decode/texture.cpp
@@ -151,6 +151,8 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) {
151 WriteTexsInstructionFloat(bb, instr, values); 151 WriteTexsInstructionFloat(bb, instr, values);
152 break; 152 break;
153 } 153 }
154 case OpCode::Id::TXQ_B:
155 is_bindless = true;
154 case OpCode::Id::TXQ: { 156 case OpCode::Id::TXQ: {
155 if (instr.txq.UsesMiscMode(TextureMiscMode::NODEP)) { 157 if (instr.txq.UsesMiscMode(TextureMiscMode::NODEP)) {
156 LOG_WARNING(HW_GPU, "TXQ.NODEP implementation is incomplete"); 158 LOG_WARNING(HW_GPU, "TXQ.NODEP implementation is incomplete");
@@ -160,7 +162,10 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) {
160 // Sadly, not all texture instructions specify the type of texture their sampler 162 // Sadly, not all texture instructions specify the type of texture their sampler
161 // uses. This must be fixed at a later instance. 163 // uses. This must be fixed at a later instance.
162 const auto& sampler = 164 const auto& sampler =
163 GetSampler(instr.sampler, Tegra::Shader::TextureType::Texture2D, false, false); 165 !is_bindless
166 ? GetSampler(instr.sampler, Tegra::Shader::TextureType::Texture2D, false, false)
167 : GetBindlessSampler(instr.gpr8, Tegra::Shader::TextureType::Texture2D, false,
168 false);
164 169
165 u32 indexer = 0; 170 u32 indexer = 0;
166 switch (instr.txq.query_type) { 171 switch (instr.txq.query_type) {
@@ -171,7 +176,8 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) {
171 } 176 }
172 MetaTexture meta{sampler, {}, {}, {}, {}, {}, {}, element}; 177 MetaTexture meta{sampler, {}, {}, {}, {}, {}, {}, element};
173 const Node value = 178 const Node value =
174 Operation(OperationCode::TextureQueryDimensions, meta, GetRegister(instr.gpr8)); 179 Operation(OperationCode::TextureQueryDimensions, meta,
180 GetRegister(instr.gpr8.Value() + (is_bindless ? 1 : 0)));
175 SetTemporal(bb, indexer++, value); 181 SetTemporal(bb, indexer++, value);
176 } 182 }
177 for (u32 i = 0; i < indexer; ++i) { 183 for (u32 i = 0; i < indexer; ++i) {