From 0f1ead7b5366470dfd834e68b7b62305ac1602a8 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 15 Apr 2020 11:48:13 +0200 Subject: radv: handle NULL vertex bindings With VK_EXT_robustness2, an element of pBuffers can be NULL. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_cmd_buffer.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index a2526186e76..38c71dcd3ec 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -3453,19 +3453,22 @@ void radv_CmdBindVertexBuffers( assert(firstBinding + bindingCount <= MAX_VBS); for (uint32_t i = 0; i < bindingCount; i++) { + RADV_FROM_HANDLE(radv_buffer, buffer, pBuffers[i]); uint32_t idx = firstBinding + i; if (!changed && - (vb[idx].buffer != radv_buffer_from_handle(pBuffers[i]) || + (vb[idx].buffer != buffer || vb[idx].offset != pOffsets[i])) { changed = true; } - vb[idx].buffer = radv_buffer_from_handle(pBuffers[i]); + vb[idx].buffer = buffer; vb[idx].offset = pOffsets[i]; - radv_cs_add_buffer(cmd_buffer->device->ws, cmd_buffer->cs, - vb[idx].buffer->bo); + if (buffer) { + radv_cs_add_buffer(cmd_buffer->device->ws, + cmd_buffer->cs, vb[idx].buffer->bo); + } } if (!changed) { -- cgit v1.2.3