anv/gen8: Set SLM size in interface descriptor
authorJordan Justen <jordan.l.justen@intel.com>
Sat, 9 Jan 2016 09:28:40 +0000 (01:28 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Thu, 21 Jan 2016 08:31:29 +0000 (00:31 -0800)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
src/vulkan/gen8_cmd_buffer.c

index d4d01ea151bc6edd1afab9ea77aec9b64ccda242..096ced5694fd7c90432e7b1bffa5c61054cef481 100644 (file)
@@ -588,6 +588,16 @@ flush_compute_descriptor_set(struct anv_cmd_buffer *cmd_buffer)
                      .CURBEDataStartAddress = push_state.offset);
    }
 
+   assert(prog_data->total_shared <= 64 * 1024);
+   uint32_t slm_size = 0;
+   if (prog_data->total_shared > 0) {
+      /* slm_size is in 4k increments, but must be a power of 2. */
+      slm_size = 4 * 1024;
+      while (slm_size < prog_data->total_shared)
+         slm_size <<= 1;
+      slm_size /= 4 * 1024;
+   }
+
    struct anv_state state =
       anv_state_pool_emit(&device->dynamic_state_pool,
                           GENX(INTERFACE_DESCRIPTOR_DATA), 64,
@@ -600,6 +610,7 @@ flush_compute_descriptor_set(struct anv_cmd_buffer *cmd_buffer)
                           .ConstantIndirectURBEntryReadLength = push_constant_regs,
                           .ConstantURBEntryReadOffset = 0,
                           .BarrierEnable = cs_prog_data->uses_barrier,
+                          .SharedLocalMemorySize = slm_size,
                           .NumberofThreadsinGPGPUThreadGroup =
                              pipeline->cs_thread_width_max);