summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-01-08 17:13:05 +0100
committerFernandoS27 <fsahmkow27@gmail.com>2020-01-24 21:44:48 +0100
commit3919b7b8a935174c91927bc0a312cbfee2971583 (patch)
treef5f08be1c47e09631368321146cc227b5a4c8263 /src/video_core/shader
parentShader_IR: Correct Custom Variable assignment. (diff)
downloadyuzu-3919b7b8a935174c91927bc0a312cbfee2971583.tar
yuzu-3919b7b8a935174c91927bc0a312cbfee2971583.tar.gz
yuzu-3919b7b8a935174c91927bc0a312cbfee2971583.tar.bz2
yuzu-3919b7b8a935174c91927bc0a312cbfee2971583.tar.lz
yuzu-3919b7b8a935174c91927bc0a312cbfee2971583.tar.xz
yuzu-3919b7b8a935174c91927bc0a312cbfee2971583.tar.zst
yuzu-3919b7b8a935174c91927bc0a312cbfee2971583.zip
Diffstat (limited to 'src/video_core/shader')
-rw-r--r--src/video_core/shader/decode.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/video_core/shader/decode.cpp b/src/video_core/shader/decode.cpp
index dd2f68a3e..d4a10eee5 100644
--- a/src/video_core/shader/decode.cpp
+++ b/src/video_core/shader/decode.cpp
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include <cstring>
+#include <limits>
#include <set>
#include <fmt/format.h>
@@ -64,7 +65,7 @@ std::optional<u32> TryDeduceSamplerSize(Sampler& sampler_to_deduce,
return std::nullopt;
}
const u32 base_offset = sampler_to_deduce.GetOffset();
- u32 max_offset{UINT_MAX};
+ u32 max_offset{std::numeric_limits<u32>::max()};
for (const auto& sampler : used_samplers) {
if (sampler.IsBindless()) {
continue;
@@ -73,7 +74,7 @@ std::optional<u32> TryDeduceSamplerSize(Sampler& sampler_to_deduce,
max_offset = std::min(sampler.GetOffset(), max_offset);
}
}
- if (max_offset == UINT_MAX) {
+ if (max_offset == std::numeric_limits<u32>::max()) {
return std::nullopt;
}
return ((max_offset - base_offset) * 4) / gpu_driver->GetTextureHandlerSize();
@@ -373,6 +374,7 @@ void ShaderIR::PostDecode() {
if (size) {
sampler.SetSize(*size);
} else {
+ LOG_CRITICAL(HW_GPU, "Failed to deduce size of indexed sampler");
sampler.SetSize(1);
}
}