mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
radv: fix a potential NULL pointer dereference when emitting VBOs
vkCmdBindVertexBuffers() -> draw with mesh shaders will just segfault. This sequence doesn't make real sense but it's possible. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41161>
This commit is contained in:
parent
782254b820
commit
ac52fb569a
1 changed files with 1 additions and 1 deletions
|
|
@ -6880,7 +6880,6 @@ radv_flush_vertex_descriptors(struct radv_cmd_buffer *cmd_buffer)
|
|||
{
|
||||
struct radv_shader *vs = radv_get_shader(cmd_buffer->state.shaders, MESA_SHADER_VERTEX);
|
||||
struct radv_device *device = radv_cmd_buffer_device(cmd_buffer);
|
||||
bool uses_dynamic_inputs = vs->info.vs.dynamic_inputs;
|
||||
struct radv_cmd_stream *cs = cmd_buffer->cs;
|
||||
|
||||
if (!vs)
|
||||
|
|
@ -6889,6 +6888,7 @@ radv_flush_vertex_descriptors(struct radv_cmd_buffer *cmd_buffer)
|
|||
if (!vs->info.vs.vb_desc_usage_mask)
|
||||
return;
|
||||
|
||||
bool uses_dynamic_inputs = vs->info.vs.dynamic_inputs;
|
||||
unsigned vb_desc_alloc_size =
|
||||
(uses_dynamic_inputs ? vs->info.vs.num_attributes : util_bitcount(vs->info.vs.vb_desc_usage_mask)) * 16;
|
||||
unsigned vb_offset;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue