KhronosGroup/Vulkan-ValidationLayers

Binding a buffer with VK_BUFFER_USAGE_VERTEX_BUFFER_BIT as a storage buffer using push descriptors doesn't produce validation errors

zeux opened this issue · 3 comments

zeux commented

My code was creating a buffer with VkBufferCreateInfo::usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT and then using push descriptors to set it as follows:

	VkWriteDescriptorSet descriptors[1] = {};
	descriptors[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
	descriptors[0].dstBinding = 0;
	descriptors[0].descriptorCount = 1;
	descriptors[0].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
	descriptors[0].pBufferInfo = &vbInfo;

	vkCmdPushDescriptorSetKHR(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, triangleLayout, 0, ARRAYSIZE(descriptors), descriptors);

Validation layers produced no errors. This looks incorrect to me - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER should require that the buffer is created with VK_BUFFER_USAGE_STORAGE_BUFFER_BIT.

PushDescriptor validation is highly incomplete. On my list right behind template descriptor update validation.

PR addressing this issue under review #460

merged