diff options
| author | Mai <mai.iam2048@gmail.com> | 2023-12-17 14:50:23 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-17 14:50:23 -0500 |
| commit | bcd74a81a96aa234d790c8f23ea8d610b2a148db (patch) | |
| tree | 1e2f4d66cc8d56354c4925d139f115534aab2ebe /Source/Core/VideoBackends/Vulkan/ObjectCache.cpp | |
| parent | 559ea0593cb157f99e0ff5dc223acf6d2736d17d (diff) | |
| parent | ac862b04ab8445ad83b04b642c3922ddfc675e29 (diff) | |
Merge pull request #12370 from iwubcode/more_samplers
VideoBackends / VideoCommon: update max pixel shader samplers from 8 to 16
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/ObjectCache.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/ObjectCache.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/ObjectCache.cpp b/Source/Core/VideoBackends/Vulkan/ObjectCache.cpp index 3a226b7177..c32365f3fc 100644 --- a/Source/Core/VideoBackends/Vulkan/ObjectCache.cpp +++ b/Source/Core/VideoBackends/Vulkan/ObjectCache.cpp @@ -121,10 +121,24 @@ bool ObjectCache::CreateDescriptorSetLayouts() VK_SHADER_STAGE_GEOMETRY_BIT}, }}; - static const std::array<VkDescriptorSetLayoutBinding, 1> standard_sampler_bindings{{ - {0, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, - static_cast<u32>(VideoCommon::MAX_PIXEL_SHADER_SAMPLERS), VK_SHADER_STAGE_FRAGMENT_BIT}, - }}; + constexpr u32 MAX_PIXEL_SAMPLER_ARRAY_SIZE = 8; + constexpr u32 TOTAL_PIXEL_SAMPLER_BINDINGS = + 1 + (VideoCommon::MAX_PIXEL_SHADER_SAMPLERS - MAX_PIXEL_SAMPLER_ARRAY_SIZE); + static_assert(VideoCommon::MAX_PIXEL_SHADER_SAMPLERS == 16, "Update descriptor sampler bindings"); + + static const std::array<VkDescriptorSetLayoutBinding, TOTAL_PIXEL_SAMPLER_BINDINGS> + standard_sampler_bindings{{ + {0, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, MAX_PIXEL_SAMPLER_ARRAY_SIZE, + VK_SHADER_STAGE_FRAGMENT_BIT}, + {8, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT}, + {9, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT}, + {10, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT}, + {11, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT}, + {12, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT}, + {13, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT}, + {14, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT}, + {15, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT}, + }}; // The dynamic veretex loader's vertex buffer must be last here, for similar reasons static const std::array<VkDescriptorSetLayoutBinding, 2> standard_ssbo_bindings{{ |
