You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the Vulkan Documentation states , with the extension enabled, vertex attributes can be loaded from arbitrary buffer alignments. It allows binding a vertex buffer at offset=7 for a user with dynamic vertex input active. However, after enabling this extension, validation layer will still complain about the alignment issue.
Here is a simple example that you can use to reproduce this bug, I modified based on vertex_dynamic_state vulkan sample, I call vkCmdBindVertexBuffers with offset=7.
After that, the validation layer would complain:
[error] 615493573 - VUID-vkCmdDrawIndexed-None-02721: Validation Error: [ VUID-vkCmdDrawIndexed-None-02721 ] Object 0: handle = 0x7323f50000000048, type = VK_OBJECT_TYPE_BUFFER; Object 1: handle = 0x72303f0000000052, type = VK_OBJECT_TYPE_PIPELINE; | MessageID = 0x24afafc5 | vkCmdDrawIndexed(): Format VK_FORMAT_R32G32B32_SFLOAT has an alignment of 4 but the alignment of attribAddress (43) is not aligned in pVertexAttributeDescriptions[0](binding=0 location=0) where attribAddress = vertex buffer offset (7) + binding stride (36) + attribute offset (0). The Vulkan spec states: If robustBufferAccess is not enabled, and that pipeline was created without enabling VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT for vertexInputs, then for a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description (https://vulkan.lunarg.com/doc/view/1.3.290.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDrawIndexed-None-02721)
Possible cause
In layers/cc_pipeline_graphics.cpp, line 4104, function ValidateDrawPipelineVertexAttribute doesn't check if feature VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT is enabled, it judges the address of vertex attribute aligned or not. If not, log an error.
bool CoreChecks::ValidateDrawPipelineVertexAttribute(const vvl::CommandBuffer &cb_state, const vvl::Pipeline &pipeline,
const vvl::DrawDispatchVuid &vuid) const {
...
// Verify vertex attribute address alignment
for (uint32_t i = 0; i < vertex_attribute_descriptions.size(); i++) {
...
if (SafeModulo(attrib_address, vtx_attrib_req_alignment) != 0) {
const LogObjectList objlist(buffer_state->Handle(), pipeline.Handle());
skip |= LogError(vuid.vertex_binding_attribute_02721, objlist, vuid.loc(),
"Format %s has an alignment of %" PRIu64 " but the alignment of attribAddress (%" PRIu64
") is not aligned in pVertexAttributeDescriptions[%" PRIu32
"]"
"(binding=%" PRIu32 " location=%" PRIu32 ") where attribAddress = vertex buffer offset (%" PRIu64
") + binding stride (%" PRIu64 ") + attribute offset (%" PRIu64 ").",
string_VkFormat(attribute_format), vtx_attrib_req_alignment, attrib_address, i, vertex_binding,
attribute_description.location, vertex_buffer_offset, vertex_buffer_stride, attribute_offset);
}
}
return skip;
}
The text was updated successfully, but these errors were encountered:
Problem Statement
As the Vulkan Documentation states , with the extension enabled, vertex attributes can be loaded from arbitrary buffer alignments. It allows binding a vertex buffer at offset=7 for a user with dynamic vertex input active. However, after enabling this extension, validation layer will still complain about the alignment issue.
Here is a simple example that you can use to reproduce this bug, I modified based on vertex_dynamic_state vulkan sample, I call
vkCmdBindVertexBuffers
withoffset=7
.After that, the validation layer would complain:
[error] 615493573 - VUID-vkCmdDrawIndexed-None-02721: Validation Error: [ VUID-vkCmdDrawIndexed-None-02721 ] Object 0: handle = 0x7323f50000000048, type = VK_OBJECT_TYPE_BUFFER; Object 1: handle = 0x72303f0000000052, type = VK_OBJECT_TYPE_PIPELINE; | MessageID = 0x24afafc5 | vkCmdDrawIndexed(): Format VK_FORMAT_R32G32B32_SFLOAT has an alignment of 4 but the alignment of attribAddress (43) is not aligned in pVertexAttributeDescriptions[0](binding=0 location=0) where attribAddress = vertex buffer offset (7) + binding stride (36) + attribute offset (0). The Vulkan spec states: If robustBufferAccess is not enabled, and that pipeline was created without enabling VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT for vertexInputs, then for a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description (https://vulkan.lunarg.com/doc/view/1.3.290.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDrawIndexed-None-02721)
Possible cause
In
layers/cc_pipeline_graphics.cpp
, line 4104, functionValidateDrawPipelineVertexAttribute
doesn't check if featureVkPhysicalDeviceLegacyVertexAttributesFeaturesEXT
is enabled, it judges the address of vertex attribute aligned or not. If not, log an error.The text was updated successfully, but these errors were encountered: