Commit 37968133 by Yuly Novikov Committed by Commit Bot

Vulkan: limit max texture bindings by physical device limits

Already limited by IMPLEMENTATION_MAX_ACTIVE_TEXTURES, but Nexus 5X doesn't support that many. BUG=angleproject:2314 Change-Id: I43b530ba25e9cf7055e74525f479fb10cc7394a2 Reviewed-on: https://chromium-review.googlesource.com/882443 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 49886899
...@@ -933,12 +933,13 @@ vk::Error RendererVk::initGraphicsPipelineLayout() ...@@ -933,12 +933,13 @@ vk::Error RendererVk::initGraphicsPipelineLayout()
mGraphicsDescriptorSetLayouts.push_back(std::move(uniformLayout)); mGraphicsDescriptorSetLayouts.push_back(std::move(uniformLayout));
} }
std::array<VkDescriptorSetLayoutBinding, gl::IMPLEMENTATION_MAX_ACTIVE_TEXTURES> // TODO(lucferron): expose this limitation to GL in Context Caps
textureBindings; std::vector<VkDescriptorSetLayoutBinding> textureBindings(
std::min<size_t>(mPhysicalDeviceProperties.limits.maxPerStageDescriptorSamplers,
gl::IMPLEMENTATION_MAX_ACTIVE_TEXTURES));
// TODO(jmadill): This approach might not work well for texture arrays. // TODO(jmadill): This approach might not work well for texture arrays.
for (uint32_t textureIndex = 0; textureIndex < gl::IMPLEMENTATION_MAX_ACTIVE_TEXTURES; for (uint32_t textureIndex = 0; textureIndex < textureBindings.size(); ++textureIndex)
++textureIndex)
{ {
VkDescriptorSetLayoutBinding &layoutBinding = textureBindings[textureIndex]; VkDescriptorSetLayoutBinding &layoutBinding = textureBindings[textureIndex];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment