Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/wined3d/context_vk.c | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+)
diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c index e6dc5ea568b..47bbaed792a 100644 --- a/dlls/wined3d/context_vk.c +++ b/dlls/wined3d/context_vk.c @@ -2032,6 +2032,7 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte || wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_STREAMSRC) || wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX))) { + struct wined3d_shader_signature *signature = &state->shader[WINED3D_SHADER_TYPE_VERTEX]->input_signature; wined3d_stream_info_from_declaration(&stream_info, state, d3d_info); divisor_count = 0; for (i = 0, mask = 0, attribute_count = 0, binding_count = 0; i < ARRAY_SIZE(stream_info.elements); ++i) @@ -2071,6 +2072,46 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte } }
+ if (attribute_count < signature->element_count) + { + uint32_t null_binding; + for (i = 0; i < ARRAY_SIZE(state->streams); ++i) + { + if (!state->streams[i].buffer) + { + null_binding = i; + break; + } + } + + if (i == ARRAY_SIZE(state->streams)) + ERR("No streams left for a null buffer binding."); + else + { + VkVertexInputBindingDescription *b; + b = &key->bindings[binding_count++]; + b->binding = null_binding; + b->stride = 0; + b->inputRate = VK_VERTEX_INPUT_RATE_VERTEX; + + for (i = 0; i < signature->element_count; ++i) + { + struct wined3d_shader_signature_element *element = &signature->elements[i]; + uint32_t location = element->register_idx; + VkVertexInputAttributeDescription *a; + + if ((stream_info.use_map & (1 << location))) + continue; + + a = &key->attributes[attribute_count++]; + a->location = location; + a->binding = null_binding; + a->format = VK_FORMAT_R32G32B32A32_UINT; + a->offset = 0; + } + } + } + key->input_desc.pNext = NULL; key->input_desc.vertexBindingDescriptionCount = binding_count; key->input_desc.vertexAttributeDescriptionCount = attribute_count;