diff options
| author | 2020-04-16 01:34:45 -0300 | |
|---|---|---|
| committer | 2020-04-23 18:00:06 -0300 | |
| commit | 72deb773fdcc59b1df9752de4e846422b7bb5280 (patch) | |
| tree | 524006956b6dbb6789831652129013e54f185f16 /src/video_core/shader/decode.cpp | |
| parent | Merge pull request #3768 from H27CK/cmd-title-fmt (diff) | |
| download | yuzu-72deb773fdcc59b1df9752de4e846422b7bb5280.tar.gz yuzu-72deb773fdcc59b1df9752de4e846422b7bb5280.tar.xz yuzu-72deb773fdcc59b1df9752de4e846422b7bb5280.zip | |
shader_ir: Turn classes into data structures
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 87ac9ac6c..8427837b7 100644 --- a/src/video_core/shader/decode.cpp +++ b/src/video_core/shader/decode.cpp | |||
| @@ -42,11 +42,11 @@ void DeduceTextureHandlerSize(VideoCore::GuestDriverProfile& gpu_driver, | |||
| 42 | u32 count{}; | 42 | u32 count{}; |
| 43 | std::vector<u32> bound_offsets; | 43 | std::vector<u32> bound_offsets; |
| 44 | for (const auto& sampler : used_samplers) { | 44 | for (const auto& sampler : used_samplers) { |
| 45 | if (sampler.IsBindless()) { | 45 | if (sampler.is_bindless) { |
| 46 | continue; | 46 | continue; |
| 47 | } | 47 | } |
| 48 | ++count; | 48 | ++count; |
| 49 | bound_offsets.emplace_back(sampler.GetOffset()); | 49 | bound_offsets.emplace_back(sampler.offset); |
| 50 | } | 50 | } |
| 51 | if (count > 1) { | 51 | if (count > 1) { |
| 52 | gpu_driver.DeduceTextureHandlerSize(std::move(bound_offsets)); | 52 | gpu_driver.DeduceTextureHandlerSize(std::move(bound_offsets)); |
| @@ -56,14 +56,14 @@ void DeduceTextureHandlerSize(VideoCore::GuestDriverProfile& gpu_driver, | |||
| 56 | std::optional<u32> TryDeduceSamplerSize(const Sampler& sampler_to_deduce, | 56 | std::optional<u32> TryDeduceSamplerSize(const Sampler& sampler_to_deduce, |
| 57 | VideoCore::GuestDriverProfile& gpu_driver, | 57 | VideoCore::GuestDriverProfile& gpu_driver, |
| 58 | const std::list<Sampler>& used_samplers) { | 58 | const std::list<Sampler>& used_samplers) { |
| 59 | const u32 base_offset = sampler_to_deduce.GetOffset(); | 59 | const u32 base_offset = sampler_to_deduce.offset; |
| 60 | u32 max_offset{std::numeric_limits<u32>::max()}; | 60 | u32 max_offset{std::numeric_limits<u32>::max()}; |
| 61 | for (const auto& sampler : used_samplers) { | 61 | for (const auto& sampler : used_samplers) { |
| 62 | if (sampler.IsBindless()) { | 62 | if (sampler.is_bindless) { |
| 63 | continue; | 63 | continue; |
| 64 | } | 64 | } |
| 65 | if (sampler.GetOffset() > base_offset) { | 65 | if (sampler.offset > base_offset) { |
| 66 | max_offset = std::min(sampler.GetOffset(), max_offset); | 66 | max_offset = std::min(sampler.offset, max_offset); |
| 67 | } | 67 | } |
| 68 | } | 68 | } |
| 69 | if (max_offset == std::numeric_limits<u32>::max()) { | 69 | if (max_offset == std::numeric_limits<u32>::max()) { |
| @@ -363,14 +363,14 @@ void ShaderIR::PostDecode() { | |||
| 363 | return; | 363 | return; |
| 364 | } | 364 | } |
| 365 | for (auto& sampler : used_samplers) { | 365 | for (auto& sampler : used_samplers) { |
| 366 | if (!sampler.IsIndexed()) { | 366 | if (!sampler.is_indexed) { |
| 367 | continue; | 367 | continue; |
| 368 | } | 368 | } |
| 369 | if (const auto size = TryDeduceSamplerSize(sampler, gpu_driver, used_samplers)) { | 369 | if (const auto size = TryDeduceSamplerSize(sampler, gpu_driver, used_samplers)) { |
| 370 | sampler.SetSize(*size); | 370 | sampler.size = *size; |
| 371 | } else { | 371 | } else { |
| 372 | LOG_CRITICAL(HW_GPU, "Failed to deduce size of indexed sampler"); | 372 | LOG_CRITICAL(HW_GPU, "Failed to deduce size of indexed sampler"); |
| 373 | sampler.SetSize(1); | 373 | sampler.size = 1; |
| 374 | } | 374 | } |
| 375 | } | 375 | } |
| 376 | } | 376 | } |