anv/cmd_buffer: Gen 8 requires 64 byte alignment for push constant data
authorJordan Justen <jordan.l.justen@intel.com>
Mon, 14 Dec 2015 23:24:11 +0000 (15:24 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Mon, 14 Dec 2015 23:39:07 +0000 (15:39 -0800)
See MEDIA_CURBE_LOAD, CURBE Data Start Address & CURBE Total Data Length

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
src/vulkan/anv_cmd_buffer.c

index fa6943689d8d60390c6143db016199ef593a4d56..4dc3704ebf336d9197568eecf6d38622dc83d6a4 100644 (file)
@@ -947,10 +947,14 @@ anv_cmd_buffer_cs_push_constants(struct anv_cmd_buffer *cmd_buffer)
    const unsigned threads = pipeline->cs_thread_width_max;
    const unsigned total_push_constants_size =
       reg_aligned_constant_size * threads;
+   const unsigned push_constant_alignment =
+      cmd_buffer->device->info.gen < 8 ? 32 : 64;
+   const unsigned aligned_total_push_constants_size =
+      ALIGN(total_push_constants_size, push_constant_alignment);
    struct anv_state state =
       anv_cmd_buffer_alloc_dynamic_state(cmd_buffer,
-                                         total_push_constants_size,
-                                         32 /* bottom 5 bits MBZ */);
+                                         aligned_total_push_constants_size,
+                                         push_constant_alignment);
 
    /* Walk through the param array and fill the buffer with data */
    uint32_t *u32_map = state.map;