Commit b77a6c25 by Mohan Maiya Committed by Angle LUCI CQ

Vulkan: Avoid using VK_WHOLE_SIZE when using dynamic offsets

Binding descriptor sets that use VK_WHOLE_SIZE with a dynamic offset results in the VUID-vkCmdBindDescriptorSets-pDescriptorSets-01979 validation error. Updated the updateDefaultUniformsDescriptorSet function to use the uniform's size instead of using VK_WHOLE_SIZE. Bug: angleproject:5924 Tests: dEQP-GLES31.functional.shaders.multisample_interpolation.* SimpleStateChangeTest.UniformUpdateTest*Vulkan UniformTestES3.MatrixUniformUpload*Vulkan Change-Id: Ie4633af61d59a9401f599d336a5b9040cdf18004 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2950309Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 33b5ff4c
......@@ -170,6 +170,7 @@ Samsung Electronics, Inc.
Jeff Vigil
Kevin Jung
Kyeongmin Kim
Mahmoud Kharsa
Minkyu Jeong
Mohan Maiya
Peter Mowry
......
......@@ -1056,7 +1056,8 @@ angle::Result ProgramExecutableVk::createPipelineLayout(
contextVk, driverUniformsSetDesc, DescriptorSetIndex::Internal,
mDescriptorSetLayouts[DescriptorSetIndex::Internal].get().getHandle()));
mDynamicUniformDescriptorOffsets.resize(glExecutable.getLinkedShaderStageCount());
mDynamicUniformDescriptorOffsets.clear();
mDynamicUniformDescriptorOffsets.resize(glExecutable.getLinkedShaderStageCount(), 0);
return angle::Result::Continue;
}
......@@ -1115,15 +1116,19 @@ void ProgramExecutableVk::updateDefaultUniformsDescriptorSet(
VkWriteDescriptorSet &writeInfo = contextVk->allocWriteDescriptorSet();
VkDescriptorBufferInfo &bufferInfo = contextVk->allocDescriptorBufferInfo();
// Size is set to the size of the empty buffer for shader statges with no uniform data,
// otherwise it is set to the total size of the uniform data in the current shader stage
VkDeviceSize size = defaultUniformBlock.uniformData.size();
vk::BufferHelper *bufferHelper = defaultUniformBuffer;
if (defaultUniformBlock.uniformData.empty())
{
bufferHelper = &contextVk->getEmptyBuffer();
bufferHelper->retain(&contextVk->getResourceUseList());
size = bufferHelper->getSize();
}
WriteBufferDescriptorSetBinding(
*bufferHelper, 0, VK_WHOLE_SIZE, mDescriptorSets[DescriptorSetIndex::UniformsAndXfb],
*bufferHelper, 0, size, mDescriptorSets[DescriptorSetIndex::UniformsAndXfb],
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, info.binding, 0, 0, &bufferInfo, &writeInfo);
}
......
......@@ -171,8 +171,6 @@ constexpr const char *kSkippedMessages[] = {
// http://anglebug.com/5331
"VUID-VkSubpassDescriptionDepthStencilResolve-depthResolveMode-parameter",
"VUID-VkSubpassDescriptionDepthStencilResolve-stencilResolveMode-parameter",
// https://crbug.com/1183542
"VUID-vkCmdBindDescriptorSets-pDescriptorSets-01979",
// https://issuetracker.google.com/175584609
"VUID-vkCmdDraw-None-04584",
"VUID-vkCmdDrawIndexed-None-04584",
......
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