зеркало из https://github.com/AvaloniaUI/angle.git
Vulkan: Fix overflow in maxCombinedUniformComponents
The value is capped to INT_MAX to avoid overflow when queried with glGetIntegerv(). Bug: angleproject:4554 Bug: angleproject:4788 Change-Id: I36d52fc608ef5adc2bc0b73e379db66cbfd9bb54 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2318046 Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
This commit is contained in:
Родитель
07ae186b5e
Коммит
3f851efa2a
|
@ -450,10 +450,13 @@ void RendererVk::ensureCapsInitialized() const
|
|||
// 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
|
||||
// this limit includes both components in and out of uniform buffers.
|
||||
//
|
||||
// This value is limited to INT_MAX to avoid overflow when queried from glGetIntegerv().
|
||||
const uint64_t maxCombinedUniformComponents =
|
||||
static_cast<uint64_t>(maxPerStageUniformBuffers +
|
||||
kReservedPerStageDefaultUniformBindingCount) *
|
||||
maxUniformComponents;
|
||||
std::min<uint64_t>(static_cast<uint64_t>(maxPerStageUniformBuffers +
|
||||
kReservedPerStageDefaultUniformBindingCount) *
|
||||
maxUniformComponents,
|
||||
std::numeric_limits<GLint>::max());
|
||||
for (gl::ShaderType shaderType : gl::AllShaderTypes())
|
||||
{
|
||||
mNativeCaps.maxCombinedShaderUniformComponents[shaderType] = maxCombinedUniformComponents;
|
||||
|
|
Загрузка…
Ссылка в новой задаче