summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/decode.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-01-03 21:16:29 +0100
committerFernandoS27 <fsahmkow27@gmail.com>2020-01-24 21:43:29 +0100
commitc921e496eb47de49a4d6ce62527581b966dca259 (patch)
tree788c71599f0abf53b479bd3f2f3ea730fc9c35c4 /src/video_core/shader/decode.cpp
parentMerge pull request #3273 from FernandoS27/txd-array (diff)
downloadyuzu-c921e496eb47de49a4d6ce62527581b966dca259.tar
yuzu-c921e496eb47de49a4d6ce62527581b966dca259.tar.gz
yuzu-c921e496eb47de49a4d6ce62527581b966dca259.tar.bz2
yuzu-c921e496eb47de49a4d6ce62527581b966dca259.tar.lz
yuzu-c921e496eb47de49a4d6ce62527581b966dca259.tar.xz
yuzu-c921e496eb47de49a4d6ce62527581b966dca259.tar.zst
yuzu-c921e496eb47de49a4d6ce62527581b966dca259.zip
Diffstat (limited to 'src/video_core/shader/decode.cpp')
-rw-r--r--src/video_core/shader/decode.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/video_core/shader/decode.cpp b/src/video_core/shader/decode.cpp
index 22c3e5120..aed35a9b8 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