llvmpipe: make sure to initialize the lp_setup_context slots with the default values

As 0 is an actual valid value, this can lead to issues when we actually want to use them.

This fixes `spec@arb_cull_distance@basic-cull-3` crashes for instance.

Cc: mesa-stable

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25152>
(cherry picked from commit 010147cd64)
This commit is contained in:
Corentin Noël 2023-09-11 16:53:03 +02:00 committed by Eric Engestrom
parent 29908aa493
commit 6b4cde8ead
2 changed files with 6 additions and 1 deletions

View file

@ -2596,7 +2596,7 @@
"description": "llvmpipe: make sure to initialize the lp_setup_context slots with the default values",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -1546,6 +1546,11 @@ lp_setup_create(struct pipe_context *pipe,
lp_setup_init_vbuf(setup);
setup->psize_slot = -1;
setup->viewport_index_slot = -1;
setup->layer_slot = -1;
setup->face_slot = -1;
/* Used only in update_state():
*/
setup->pipe = pipe;