summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2020-01-08 12:13:05 -0400
committerGravatar FernandoS272020-01-24 16:44:48 -0400
commit3919b7b8a935174c91927bc0a312cbfee2971583 (patch)
treef5f08be1c47e09631368321146cc227b5a4c8263 /src
parentShader_IR: Correct Custom Variable assignment. (diff)
downloadyuzu-3919b7b8a935174c91927bc0a312cbfee2971583.tar.gz
yuzu-3919b7b8a935174c91927bc0a312cbfee2971583.tar.xz
yuzu-3919b7b8a935174c91927bc0a312cbfee2971583.zip
Shader_IR: Corrections, styling and extras.
Diffstat (limited to 'src')
-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 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <cstring> 5#include <cstring>
6#include <limits>
6#include <set> 7#include <set>
7 8
8#include <fmt/format.h> 9#include <fmt/format.h>
@@ -64,7 +65,7 @@ std::optional<u32> TryDeduceSamplerSize(Sampler& sampler_to_deduce,
64 return std::nullopt; 65 return std::nullopt;
65 } 66 }
66 const u32 base_offset = sampler_to_deduce.GetOffset(); 67 const u32 base_offset = sampler_to_deduce.GetOffset();
67 u32 max_offset{UINT_MAX}; 68 u32 max_offset{std::numeric_limits<u32>::max()};
68 for (const auto& sampler : used_samplers) { 69 for (const auto& sampler : used_samplers) {
69 if (sampler.IsBindless()) { 70 if (sampler.IsBindless()) {
70 continue; 71 continue;
@@ -73,7 +74,7 @@ std::optional<u32> TryDeduceSamplerSize(Sampler& sampler_to_deduce,
73 max_offset = std::min(sampler.GetOffset(), max_offset); 74 max_offset = std::min(sampler.GetOffset(), max_offset);
74 } 75 }
75 } 76 }
76 if (max_offset == UINT_MAX) { 77 if (max_offset == std::numeric_limits<u32>::max()) {
77 return std::nullopt; 78 return std::nullopt;
78 } 79 }
79 return ((max_offset - base_offset) * 4) / gpu_driver->GetTextureHandlerSize(); 80 return ((max_offset - base_offset) * 4) / gpu_driver->GetTextureHandlerSize();
@@ -373,6 +374,7 @@ void ShaderIR::PostDecode() {
373 if (size) { 374 if (size) {
374 sampler.SetSize(*size); 375 sampler.SetSize(*size);
375 } else { 376 } else {
377 LOG_CRITICAL(HW_GPU, "Failed to deduce size of indexed sampler");
376 sampler.SetSize(1); 378 sampler.SetSize(1);
377 } 379 }
378 } 380 }