{
struct zink_rasterizer_hw_state *hw_rast_state = (void*)state;
VkPipelineVertexInputStateCreateInfo vertex_input_state;
- if (!screen->info.have_EXT_vertex_input_dynamic_state) {
+ if (!screen->info.have_EXT_vertex_input_dynamic_state || !state->element_state->num_attribs) {
memset(&vertex_input_state, 0, sizeof(vertex_input_state));
vertex_input_state.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
vertex_input_state.pVertexBindingDescriptions = state->element_state->b.bindings;
dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_VIEWPORT;
dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_SCISSOR;
}
- if (screen->info.have_EXT_vertex_input_dynamic_state)
- dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_VERTEX_INPUT_EXT;
- else if (screen->info.have_EXT_extended_dynamic_state)
- dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT;
+ if (state->element_state->num_attribs) {
+ if (screen->info.have_EXT_vertex_input_dynamic_state)
+ dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_VERTEX_INPUT_EXT;
+ else if (screen->info.have_EXT_extended_dynamic_state)
+ dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT;
+ }
if (screen->info.have_EXT_extended_dynamic_state2)
dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT;
pci.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
pci.layout = prog->base.layout;
pci.renderPass = state->render_pass->render_pass;
- if (!screen->info.have_EXT_vertex_input_dynamic_state)
+ if (!screen->info.have_EXT_vertex_input_dynamic_state || !state->element_state->num_attribs)
pci.pVertexInputState = &vertex_input_state;
pci.pInputAssemblyState = &primitive_state;
pci.pRasterizationState = &rast_state;