diff options
author | Samuel Pitoiset <[email protected]> | 2020-04-15 11:48:13 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-29 07:29:54 +0000 |
commit | 0f1ead7b5366470dfd834e68b7b62305ac1602a8 (patch) | |
tree | 178d230830ed3073c27a9bae170488b794312b70 /src/amd/vulkan | |
parent | c1ef225d18332ed4800191d686dc1527e8156544 (diff) |
radv: handle NULL vertex bindings
With VK_EXT_robustness2, an element of pBuffers can be NULL.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4775>
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 11 |
1 files changed, 7 insertions, 4 deletions
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) { |