anv: don't leave anv_batch fields undefined

Because the extend_cb vfunc is not initialized, there is a risk that
the emission code calls into a random pointer.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14418>
This commit is contained in:
Lionel Landwerlin 2022-01-06 15:58:17 +02:00 committed by Marge Bot
parent 8685a505e7
commit 1d40d53e03

View file

@ -159,11 +159,12 @@ static VkResult
init_render_queue_state(struct anv_queue *queue)
{
struct anv_device *device = queue->device;
struct anv_batch batch;
uint32_t cmds[64];
batch.start = batch.next = cmds;
batch.end = (void *) cmds + sizeof(cmds);
struct anv_batch batch = {
.start = cmds,
.next = cmds,
.end = (void *) cmds + sizeof(cmds),
};
anv_batch_emit(&batch, GENX(PIPELINE_SELECT), ps) {
#if GFX_VER >= 9