diff options
| author | 2020-05-02 00:45:41 -0400 | |
|---|---|---|
| committer | 2020-05-02 00:45:41 -0400 | |
| commit | e6b4311178b4f87b67eb2383f2a64520c2a8dd25 (patch) | |
| tree | 066f25773f9db49747f26ddf94b23a5007502ff8 /src/video_core/shader/decode.cpp | |
| parent | Merge pull request #3859 from jbeich/clang (diff) | |
| parent | shader/texture: Support multiple unknown sampler properties (diff) | |
| download | yuzu-e6b4311178b4f87b67eb2383f2a64520c2a8dd25.tar.gz yuzu-e6b4311178b4f87b67eb2383f2a64520c2a8dd25.tar.xz yuzu-e6b4311178b4f87b67eb2383f2a64520c2a8dd25.zip | |
Merge pull request #3693 from ReinUsesLisp/clean-samplers
shader/texture: Support multiple unknown sampler properties
Diffstat (limited to 'src/video_core/shader/decode.cpp')
| -rw-r--r-- | src/video_core/shader/decode.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/video_core/shader/decode.cpp b/src/video_core/shader/decode.cpp index 1167ff4ec..a75a5cc63 100644 --- a/src/video_core/shader/decode.cpp +++ b/src/video_core/shader/decode.cpp | |||
| @@ -32,11 +32,11 @@ void DeduceTextureHandlerSize(VideoCore::GuestDriverProfile& gpu_driver, | |||
| 32 | u32 count{}; | 32 | u32 count{}; |
| 33 | std::vector<u32> bound_offsets; | 33 | std::vector<u32> bound_offsets; |
| 34 | for (const auto& sampler : used_samplers) { | 34 | for (const auto& sampler : used_samplers) { |
| 35 | if (sampler.IsBindless()) { | 35 | if (sampler.is_bindless) { |
| 36 | continue; | 36 | continue; |
| 37 | } | 37 | } |
| 38 | ++count; | 38 | ++count; |
| 39 | bound_offsets.emplace_back(sampler.GetOffset()); | 39 | bound_offsets.emplace_back(sampler.offset); |
| 40 | } | 40 | } |
| 41 | if (count > 1) { | 41 | if (count > 1) { |
| 42 | gpu_driver.DeduceTextureHandlerSize(std::move(bound_offsets)); | 42 | gpu_driver.DeduceTextureHandlerSize(std::move(bound_offsets)); |
| @@ -46,14 +46,14 @@ void DeduceTextureHandlerSize(VideoCore::GuestDriverProfile& gpu_driver, | |||
| 46 | std::optional<u32> TryDeduceSamplerSize(const Sampler& sampler_to_deduce, | 46 | std::optional<u32> TryDeduceSamplerSize(const Sampler& sampler_to_deduce, |
| 47 | VideoCore::GuestDriverProfile& gpu_driver, | 47 | VideoCore::GuestDriverProfile& gpu_driver, |
| 48 | const std::list<Sampler>& used_samplers) { | 48 | const std::list<Sampler>& used_samplers) { |
| 49 | const u32 base_offset = sampler_to_deduce.GetOffset(); | 49 | const u32 base_offset = sampler_to_deduce.offset; |
| 50 | u32 max_offset{std::numeric_limits<u32>::max()}; | 50 | u32 max_offset{std::numeric_limits<u32>::max()}; |
| 51 | for (const auto& sampler : used_samplers) { | 51 | for (const auto& sampler : used_samplers) { |
| 52 | if (sampler.IsBindless()) { | 52 | if (sampler.is_bindless) { |
| 53 | continue; | 53 | continue; |
| 54 | } | 54 | } |
| 55 | if (sampler.GetOffset() > base_offset) { | 55 | if (sampler.offset > base_offset) { |
| 56 | max_offset = std::min(sampler.GetOffset(), max_offset); | 56 | max_offset = std::min(sampler.offset, max_offset); |
| 57 | } | 57 | } |
| 58 | } | 58 | } |
| 59 | if (max_offset == std::numeric_limits<u32>::max()) { | 59 | if (max_offset == std::numeric_limits<u32>::max()) { |
| @@ -353,14 +353,14 @@ void ShaderIR::PostDecode() { | |||
| 353 | return; | 353 | return; |
| 354 | } | 354 | } |
| 355 | for (auto& sampler : used_samplers) { | 355 | for (auto& sampler : used_samplers) { |
| 356 | if (!sampler.IsIndexed()) { | 356 | if (!sampler.is_indexed) { |
| 357 | continue; | 357 | continue; |
| 358 | } | 358 | } |
| 359 | if (const auto size = TryDeduceSamplerSize(sampler, gpu_driver, used_samplers)) { | 359 | if (const auto size = TryDeduceSamplerSize(sampler, gpu_driver, used_samplers)) { |
| 360 | sampler.SetSize(*size); | 360 | sampler.size = *size; |
| 361 | } else { | 361 | } else { |
| 362 | LOG_CRITICAL(HW_GPU, "Failed to deduce size of indexed sampler"); | 362 | LOG_CRITICAL(HW_GPU, "Failed to deduce size of indexed sampler"); |
| 363 | sampler.SetSize(1); | 363 | sampler.size = 1; |
| 364 | } | 364 | } |
| 365 | } | 365 | } |
| 366 | } | 366 | } |