From 579fd0411752ddd82a31ba819057ea48c9c3fa7b Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 30 Oct 2022 16:22:31 +0000 Subject: [PATCH] Fixup ReadTextureType shader compiler callback --- .../maxwell_3d/pipeline_manager.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.cpp b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.cpp index e9ea3535..3d85e6b5 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/maxwell_3d/pipeline_manager.cpp @@ -9,6 +9,15 @@ #include "pipeline_manager.h" namespace skyline::gpu::interconnect::maxwell3d { + union BindlessHandle { + u32 raw; + + struct { + u32 textureIndex : 20; + u32 samplerIndex : 12; + }; + }; + static constexpr Shader::Stage ConvertCompilerShaderStage(engine::Pipeline::Shader::Type stage) { switch (stage) { case engine::Pipeline::Shader::Type::VertexCullBeforeFetch: @@ -193,7 +202,7 @@ namespace skyline::gpu::interconnect::maxwell3d { size_t shaderStage{i > 0 ? (i - 1) : 0}; return constantBuffers[shaderStage][index].Read(ctx.executor, offset); }, [&](u32 index) { - return textures.GetTextureType(ctx, index); + return textures.GetTextureType(ctx, BindlessHandle{ .raw = index }.textureIndex); })}; if (i == stageIdx(PipelineStage::Vertex) && packedState.shaderHashes[stageIdx(PipelineStage::VertexCullBeforeFetch)]) { ignoreVertexCullBeforeFetch = true; @@ -657,15 +666,6 @@ namespace skyline::gpu::interconnect::maxwell3d { return view; } - union BindlessHandle { - u32 raw; - - struct { - u32 textureIndex : 20; - u32 samplerIndex : 12; - }; - }; - static BindlessHandle ReadBindlessHandle(InterconnectContext &ctx, std::array &constantBuffers, const auto &desc, size_t arrayIdx) { ConstantBuffer &primaryCbuf{constantBuffers[desc.cbuf_index]}; size_t elemOffset{arrayIdx << desc.size_shift};