anv: initialize 3DMESH_1D.ExtendedParameter0 when ExtendedParameter0Present
authorMarcin Ślusarz <marcin.slusarz@intel.com>
Fri, 8 Apr 2022 08:58:33 +0000 (10:58 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 12 Apr 2022 09:10:31 +0000 (09:10 +0000)
When IndirectParameterEnable==true it's not actually used by the hardware,
but if it's not initialized and INTEL_DEBUG=bat is set, then Valgrind complains.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15850>

src/intel/vulkan/genX_cmd_buffer.c

index 4679bca..a094c71 100644 (file)
@@ -5115,10 +5115,12 @@ emit_indirect_3dmesh_1d(struct anv_batch *batch,
                         bool uses_drawid)
 {
    uint32_t len = GENX(3DMESH_1D_length) + uses_drawid;
-   anv_batch_emitn(batch, len, GENX(3DMESH_1D),
+   uint32_t *dw = anv_batch_emitn(batch, len, GENX(3DMESH_1D),
                    .PredicateEnable           = predicate_enable,
                    .IndirectParameterEnable   = true,
                    .ExtendedParameter0Present = uses_drawid);
+   if (uses_drawid)
+      dw[len - 1] = 0;
 }
 
 void