Remove dead vs inputs in spir-v, and don't bind corresponding vbo #1029
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes a validation error about vkCmdSetVertexInputEXT(). If the V#
corresponding to an input semantic has size 0, BindVertexBuffers() won't
bind any buffer and wont add vulkan BindingInfo/AttributeInfo for that semantic.
Detect and remove dead vs inputs from the vs spirv so there aren't spirv Input vars without vertex input info.
Ideally when the buffer is empty, the spirv attribute should be dead.
Seen this happen because of empty V#s with dst_sel == 0001
example
[Render.Vulkan] [thread GPU_CommandProc, tid=456257] vk_platform.cpp:DebugUtilsCallback:68: VUID-vkCmdDrawIndexed-Input-07939: Validation Error: [ VUID-vkCmdDrawIndexed-Input-07939 ] Object 0: handle = 0xe5f5e400000015b9, name = vs_0x9e267629561c22fe_0, type = VK_OBJECT_TYPE_SHADER_MODULE; | MessageID = 0x8d9172cc | vkCmdDrawIndexed(): Vertex shader uses input at location 4, but it was not provided with vkCmdSetVertexInputEXT(). The Vulkan spec states: If there is a shader object bound to the VK_SHADER_STAGE_VERTEX_BIT stage or the bound graphics pipeline state was created with the VK_DYNAMIC_STATE_VERTEX_INPUT_EXT dynamic state enabled then all variables with the Input storage class decorated with Location in the Vertex Execution Model OpEntryPoint must contain a location in VkVertexInputAttributeDescription2EXT::location (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-Input-07939)