summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/decode.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-01-05 17:08:39 +0100
committerFernandoS27 <fsahmkow27@gmail.com>2020-01-24 21:43:29 +0100
commitdc5cfa8d287757dede737553b6f1f8521971c6e2 (patch)
treeba57a2e25d25d46aae22d18f032ac9e70d982ed7 /src/video_core/shader/decode.cpp
parentGuest_driver: Correct compiling errors in GCC. (diff)
downloadyuzu-dc5cfa8d287757dede737553b6f1f8521971c6e2.tar
yuzu-dc5cfa8d287757dede737553b6f1f8521971c6e2.tar.gz
yuzu-dc5cfa8d287757dede737553b6f1f8521971c6e2.tar.bz2
yuzu-dc5cfa8d287757dede737553b6f1f8521971c6e2.tar.lz
yuzu-dc5cfa8d287757dede737553b6f1f8521971c6e2.tar.xz
yuzu-dc5cfa8d287757dede737553b6f1f8521971c6e2.tar.zst
yuzu-dc5cfa8d287757dede737553b6f1f8521971c6e2.zip
Diffstat (limited to 'src/video_core/shader/decode.cpp')
-rw-r--r--src/video_core/shader/decode.cpp40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/video_core/shader/decode.cpp b/src/video_core/shader/decode.cpp
index aed35a9b8..c702c7629 100644
--- a/src/video_core/shader/decode.cpp
+++ b/src/video_core/shader/decode.cpp
@@ -315,25 +315,33 @@ u32 ShaderIR::DecodeInstr(NodeBlock& bb, u32 pc) {
return pc + 1;
}
+void DeduceTextureHandlerSize(VideoCore::GuestDriverProfile* gpu_driver,
+ std::list<Sampler>& used_samplers) {
+ if (gpu_driver == nullptr) {
+ LOG_CRITICAL(HW_GPU, "GPU Driver profile has not been created yet");
+ return;
+ }
+ if (gpu_driver->TextureHandlerSizeKnown() || used_samplers.size() <= 1) {
+ return;
+ }
+ 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));
+ }
+}
+
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));
- }
- }
- }
+ DeduceTextureHandlerSize(gpu_driver, used_samplers);
}
} // namespace VideoCommon::Shader