mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
lavapipe: Fix DGC vertex buffer handling
Fixes:976dd26("lavapipe: NV_device_generated_commands") Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27019> (cherry picked from commit6d88c1bb6c)
This commit is contained in:
parent
484a051aaa
commit
6d1dae874d
2 changed files with 12 additions and 4 deletions
|
|
@ -1164,7 +1164,7 @@
|
||||||
"description": "lavapipe: Fix DGC vertex buffer handling",
|
"description": "lavapipe: Fix DGC vertex buffer handling",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 1,
|
"nomination_type": 1,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": "976dd26004ff6b52e14c031398edae840ded005a",
|
"because_sha": "976dd26004ff6b52e14c031398edae840ded005a",
|
||||||
"notes": null
|
"notes": null
|
||||||
|
|
|
||||||
|
|
@ -3872,7 +3872,7 @@ process_sequence(struct rendering_state *state,
|
||||||
}
|
}
|
||||||
case VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_NV: {
|
case VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_NV: {
|
||||||
VkBindVertexBufferIndirectCommandNV *data = input;
|
VkBindVertexBufferIndirectCommandNV *data = input;
|
||||||
cmd_size += sizeof(*cmd->u.bind_vertex_buffers.buffers) + sizeof(*cmd->u.bind_vertex_buffers.offsets);
|
cmd_size += sizeof(*cmd->u.bind_vertex_buffers2.buffers) + sizeof(*cmd->u.bind_vertex_buffers2.offsets);
|
||||||
cmd_size += sizeof(*cmd->u.bind_vertex_buffers2.sizes) + sizeof(*cmd->u.bind_vertex_buffers2.strides);
|
cmd_size += sizeof(*cmd->u.bind_vertex_buffers2.sizes) + sizeof(*cmd->u.bind_vertex_buffers2.strides);
|
||||||
if (max_size < size + cmd_size)
|
if (max_size < size + cmd_size)
|
||||||
abort();
|
abort();
|
||||||
|
|
@ -3881,12 +3881,20 @@ process_sequence(struct rendering_state *state,
|
||||||
cmd->u.bind_vertex_buffers2.binding_count = 1;
|
cmd->u.bind_vertex_buffers2.binding_count = 1;
|
||||||
|
|
||||||
cmd->u.bind_vertex_buffers2.buffers = (void*)cmdptr;
|
cmd->u.bind_vertex_buffers2.buffers = (void*)cmdptr;
|
||||||
cmd->u.bind_vertex_buffers2.offsets = (void*)(cmdptr + sizeof(*cmd->u.bind_vertex_buffers2.buffers));
|
uint32_t alloc_offset = sizeof(*cmd->u.bind_vertex_buffers2.buffers);
|
||||||
|
|
||||||
|
cmd->u.bind_vertex_buffers2.offsets = (void*)(cmdptr + alloc_offset);
|
||||||
|
alloc_offset += sizeof(*cmd->u.bind_vertex_buffers2.offsets);
|
||||||
|
|
||||||
|
cmd->u.bind_vertex_buffers2.sizes = (void*)(cmdptr + alloc_offset);
|
||||||
|
alloc_offset += sizeof(*cmd->u.bind_vertex_buffers2.sizes);
|
||||||
|
|
||||||
cmd->u.bind_vertex_buffers2.offsets[0] = 0;
|
cmd->u.bind_vertex_buffers2.offsets[0] = 0;
|
||||||
cmd->u.bind_vertex_buffers2.buffers[0] = data->bufferAddress ? get_buffer(state, (void*)(uintptr_t)data->bufferAddress, (size_t*)&cmd->u.bind_vertex_buffers2.offsets[0]) : VK_NULL_HANDLE;
|
cmd->u.bind_vertex_buffers2.buffers[0] = data->bufferAddress ? get_buffer(state, (void*)(uintptr_t)data->bufferAddress, (size_t*)&cmd->u.bind_vertex_buffers2.offsets[0]) : VK_NULL_HANDLE;
|
||||||
|
cmd->u.bind_vertex_buffers2.sizes[0] = data->size;
|
||||||
|
|
||||||
if (token->vertexDynamicStride) {
|
if (token->vertexDynamicStride) {
|
||||||
cmd->u.bind_vertex_buffers2.strides = (void*)(cmdptr + sizeof(*cmd->u.bind_vertex_buffers2.buffers) + sizeof(*cmd->u.bind_vertex_buffers2.offsets) + sizeof(*cmd->u.bind_vertex_buffers2.sizes));
|
cmd->u.bind_vertex_buffers2.strides = (void*)(cmdptr + alloc_offset);
|
||||||
cmd->u.bind_vertex_buffers2.strides[0] = data->stride;
|
cmd->u.bind_vertex_buffers2.strides[0] = data->stride;
|
||||||
} else {
|
} else {
|
||||||
cmd->u.bind_vertex_buffers2.strides = NULL;
|
cmd->u.bind_vertex_buffers2.strides = NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue