From 5d1fc2580819a3855248fbce94b46ff4b65f1e8e Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 27 May 2020 20:25:37 +0430 Subject: [PATCH] wined3d: Use wined3d_buffer_vk_get_buffer_info() when binding the Vulkan index buffer. Since it updates "bo_user.valid". Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/context_vk.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c index 5ca22bd1137..5cb04310d67 100644 --- a/dlls/wined3d/context_vk.c +++ b/dlls/wined3d/context_vk.c @@ -2920,16 +2920,18 @@ VkCommandBuffer wined3d_context_vk_apply_draw_state(struct wined3d_context_vk *c if (wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_INDEXBUFFER) && state->index_buffer) { - struct wined3d_bo_vk *bo = &wined3d_buffer_vk(state->index_buffer)->bo; + struct wined3d_buffer_vk *buffer_vk = wined3d_buffer_vk(state->index_buffer); + const VkDescriptorBufferInfo *buffer_info; VkIndexType idx_type; if (state->index_format == WINED3DFMT_R16_UINT) idx_type = VK_INDEX_TYPE_UINT16; else idx_type = VK_INDEX_TYPE_UINT32; - wined3d_context_vk_reference_bo(context_vk, bo); - VK_CALL(vkCmdBindIndexBuffer(vk_command_buffer, bo->vk_buffer, - bo->buffer_offset + state->index_offset, idx_type)); + buffer_info = wined3d_buffer_vk_get_buffer_info(buffer_vk); + wined3d_context_vk_reference_bo(context_vk, &buffer_vk->bo); + VK_CALL(vkCmdBindIndexBuffer(vk_command_buffer, buffer_info->buffer, + buffer_info->offset + state->index_offset, idx_type)); } if (wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_PIXEL)) -- 2.11.4.GIT