summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>2022-01-06 15:58:17 +0200
committerMarge Bot <emma+marge@anholt.net>2022-01-07 17:28:11 +0000
commit1d40d53e03d33e0595016a95d645bd489ee95365 (patch)
tree881374a4f5445601446d4ebaeb28a42f1b1564c1
parent8685a505e7424cac55127d354e0a7ab64d54ac7b (diff)
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>
-rw-r--r--src/intel/vulkan/genX_state.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/intel/vulkan/genX_state.c b/src/intel/vulkan/genX_state.c
index 7177b9c136c..e2ec6ffc823 100644
--- a/src/intel/vulkan/genX_state.c
+++ b/src/intel/vulkan/genX_state.c
@@ -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