diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-03-27 00:46:11 +0100 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-04-08 17:29:52 +0200 |
commit | 4841440382c72047d68bb2c0ce7a7defadab7d3d (patch) | |
tree | 849c245021c01d8a121e6d1cbbf25e04d0fed906 | |
parent | Implement TMML_B (diff) | |
download | yuzu-4841440382c72047d68bb2c0ce7a7defadab7d3d.tar yuzu-4841440382c72047d68bb2c0ce7a7defadab7d3d.tar.gz yuzu-4841440382c72047d68bb2c0ce7a7defadab7d3d.tar.bz2 yuzu-4841440382c72047d68bb2c0ce7a7defadab7d3d.tar.lz yuzu-4841440382c72047d68bb2c0ce7a7defadab7d3d.tar.xz yuzu-4841440382c72047d68bb2c0ce7a7defadab7d3d.tar.zst yuzu-4841440382c72047d68bb2c0ce7a7defadab7d3d.zip |
-rw-r--r-- | src/video_core/engines/shader_bytecode.h | 2 | ||||
-rw-r--r-- | src/video_core/shader/decode/texture.cpp | 10 |
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: TEX, TEX_B, // Texture Load Bindless TXQ, // Texture Query + TXQ_B, // Texture Query Bindless TEXS, // Texture Fetch with scalar/non-vec4 source/destinations TLDS, // Texture Load with scalar/non-vec4 source/destinations TLD4, // Texture Load 4 @@ -1612,6 +1613,7 @@ private: INST("110000----111---", Id::TEX, Type::Texture, "TEX"), INST("1101111010111---", Id::TEX_B, Type::Texture, "TEX_B"), INST("1101111101001---", Id::TXQ, Type::Texture, "TXQ"), + INST("1101111101010---", Id::TXQ_B, Type::Texture, "TXQ_B"), INST("1101-00---------", Id::TEXS, Type::Texture, "TEXS"), INST("1101101---------", Id::TLDS, Type::Texture, "TLDS"), 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) { WriteTexsInstructionFloat(bb, instr, values); break; } + case OpCode::Id::TXQ_B: + is_bindless = true; case OpCode::Id::TXQ: { if (instr.txq.UsesMiscMode(TextureMiscMode::NODEP)) { LOG_WARNING(HW_GPU, "TXQ.NODEP implementation is incomplete"); @@ -160,7 +162,10 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { // Sadly, not all texture instructions specify the type of texture their sampler // uses. This must be fixed at a later instance. const auto& sampler = - GetSampler(instr.sampler, Tegra::Shader::TextureType::Texture2D, false, false); + !is_bindless + ? GetSampler(instr.sampler, Tegra::Shader::TextureType::Texture2D, false, false) + : GetBindlessSampler(instr.gpr8, Tegra::Shader::TextureType::Texture2D, false, + false); u32 indexer = 0; switch (instr.txq.query_type) { @@ -171,7 +176,8 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { } MetaTexture meta{sampler, {}, {}, {}, {}, {}, {}, element}; const Node value = - Operation(OperationCode::TextureQueryDimensions, meta, GetRegister(instr.gpr8)); + Operation(OperationCode::TextureQueryDimensions, meta, + GetRegister(instr.gpr8.Value() + (is_bindless ? 1 : 0))); SetTemporal(bb, indexer++, value); } for (u32 i = 0; i < indexer; ++i) { |