Commit 5474304a by Mohan Maiya Committed by Commit Bot

Vulkan: Handle overflow in maxCombinedUniformComponents computation

Certain vendors support large number of uniform buffer components. The calculation of maxCombinedUniformComponents overflows when captured in a 32bit lvalue. Update it to a 64bit variable. Bug: angleproject:4788 Tests: dEQP-GLES3.functional.state_query.integers64.max_combined* Change-Id: I355910218c56347c98a5dfa7359b00be7b40871a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2264849 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent ea706304
...@@ -446,8 +446,9 @@ void RendererVk::ensureCapsInitialized() const ...@@ -446,8 +446,9 @@ void RendererVk::ensureCapsInitialized() const
// There is no additional limit to the combined number of components. We can have up to a // There is no additional limit to the combined number of components. We can have up to a
// maximum number of uniform buffers, each having the maximum number of components. Note that // maximum number of uniform buffers, each having the maximum number of components. Note that
// this limit includes both components in and out of uniform buffers. // this limit includes both components in and out of uniform buffers.
const uint32_t maxCombinedUniformComponents = const uint64_t maxCombinedUniformComponents =
(maxPerStageUniformBuffers + kReservedPerStageDefaultUniformBindingCount) * static_cast<uint64_t>(maxPerStageUniformBuffers +
kReservedPerStageDefaultUniformBindingCount) *
maxUniformComponents; maxUniformComponents;
for (gl::ShaderType shaderType : gl::AllShaderTypes()) for (gl::ShaderType shaderType : gl::AllShaderTypes())
{ {
......
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