diff options
author | Jordan Justen <[email protected]> | 2016-01-30 00:49:31 -0800 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2016-01-30 09:10:54 -0800 |
commit | 8e48ff3ad669cc3ace7dfdbe22e6bf3dbde938a8 (patch) | |
tree | 514a92b5e42238c6be0c80da0c05f373cab7fedb /src/vulkan | |
parent | ab0d8608d269e9bc872f489eee50bc616bd6e076 (diff) |
anv/gen7: Set SLM size in interface descriptor
Signed-off-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/vulkan')
-rw-r--r-- | src/vulkan/gen7_cmd_buffer.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/vulkan/gen7_cmd_buffer.c b/src/vulkan/gen7_cmd_buffer.c index e4a35388170..091faad7c51 100644 --- a/src/vulkan/gen7_cmd_buffer.c +++ b/src/vulkan/gen7_cmd_buffer.c @@ -294,6 +294,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, GEN7_INTERFACE_DESCRIPTOR_DATA, 64, @@ -304,6 +314,7 @@ flush_compute_descriptor_set(struct anv_cmd_buffer *cmd_buffer) push_constant_regs, .ConstantURBEntryReadOffset = 0, .BarrierEnable = cs_prog_data->uses_barrier, + .SharedLocalMemorySize = slm_size, .NumberofThreadsinGPGPUThreadGroup = pipeline->cs_thread_width_max); |