diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-01-03 16:16:29 -0400 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2020-01-24 16:43:29 -0400 |
commit | c921e496eb47de49a4d6ce62527581b966dca259 (patch) | |
tree | 788c71599f0abf53b479bd3f2f3ea730fc9c35c4 /src/video_core/shader/decode.cpp | |
parent | a104b985a850f272831397c656e2fb01e5c1e52b (diff) |
GPU: Implement guest driver profile and deduce texture handler sizes.
Diffstat (limited to 'src/video_core/shader/decode.cpp')
-rw-r--r-- | src/video_core/shader/decode.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/video_core/shader/decode.cpp b/src/video_core/shader/decode.cpp index 22c3e51204..aed35a9b8a 100644 --- a/src/video_core/shader/decode.cpp +++ b/src/video_core/shader/decode.cpp @@ -315,4 +315,25 @@ u32 ShaderIR::DecodeInstr(NodeBlock& bb, u32 pc) { return pc + 1; } +void ShaderIR::PostDecode() { + // Deduce texture handler size if needed + auto* gpu_driver = locker.AccessGuestDriverProfile(); + if (gpu_driver) { + if (!gpu_driver->TextureHandlerSizeKnown() && used_samplers.size() > 1) { + u32 count{}; + std::vector<u32> bound_offsets; + for (const auto& sampler : used_samplers) { + if (sampler.IsBindless()) { + continue; + } + count++; + bound_offsets.emplace_back(sampler.GetOffset()); + } + if (count > 1) { + gpu_driver->DeduceTextureHandlerSize(std::move(bound_offsets)); + } + } + } +} + } // namespace VideoCommon::Shader |