anv/cmd_buffer: Advance the address when initializing clear colors
authorJason Ekstrand <jason.ekstrand@intel.com>
Sun, 12 Nov 2017 06:03:45 +0000 (22:03 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 17 Nov 2017 19:32:21 +0000 (11:32 -0800)
Found by inspection

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: mesa-stable@lists.freedesktop.org
src/intel/vulkan/genX_cmd_buffer.c

index fbb5706606a7812143de2c59b6492a20036f180e..53d8d6604355a87c62786d9450f38654e2da8c89 100644 (file)
@@ -557,12 +557,13 @@ init_fast_clear_state_entry(struct anv_cmd_buffer *cmd_buffer,
    /* Other combinations of auxiliary buffers and platforms require specific
     * values in the clear value dword(s).
     */
+   struct anv_address addr =
+      get_fast_clear_state_address(cmd_buffer->device, image, aspect, level,
+                                   FAST_CLEAR_STATE_FIELD_CLEAR_COLOR);
    unsigned i = 0;
    for (; i < cmd_buffer->device->isl_dev.ss.clear_value_size; i += 4) {
       anv_batch_emit(&cmd_buffer->batch, GENX(MI_STORE_DATA_IMM), sdi) {
-         sdi.Address =
-            get_fast_clear_state_address(cmd_buffer->device, image, aspect, level,
-                                         FAST_CLEAR_STATE_FIELD_CLEAR_COLOR);
+         sdi.Address = addr;
 
          if (GEN_GEN >= 9) {
             /* MCS buffers on SKL+ can only have 1/0 clear colors. */
@@ -586,6 +587,8 @@ init_fast_clear_state_entry(struct anv_cmd_buffer *cmd_buffer,
             sdi.ImmediateData = 0;
          }
       }
+
+      addr.offset += 4;
    }
 }