From 71ed8c5aa69c3edbd6ecb1e658824e6954b36d58 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 14 Oct 2020 14:56:19 -0700 Subject: [PATCH] iris: Fix doubling of shared local memory (SLM) sizes. Commit 67ee9c5f5537fe85357556a4322a07253d13a697 added support for using the `pipe_compute_state::req_local_mem` field, because Clover can have a run-time specified size that isn't baked into the shaders. However, it started adding the static size from the shader to the dynamic state-supplied size. The Mesa state tracker fills out req_local_mem to prog->Base.info.cs.shared_size, which is exactly what we fill out prog_data->total_shared to be. Effectively, this meant that we double-counted the same SLM requirements, doubling our space requirements. Fixes a 10% performance regression in Synmark2's OglCSDof test. Reviewed-by: Jason Ekstrand Part-of: --- src/gallium/drivers/iris/iris_state.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 37faf5fada5..514ace36507 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -6742,12 +6742,9 @@ iris_upload_gpgpu_walker(struct iris_context *ice, IRIS_STAGE_DIRTY_CS)) { uint32_t desc[GENX(INTERFACE_DESCRIPTOR_DATA_length)]; - unsigned slm_size = prog_data->total_shared; - if (ish->kernel_shared_size) - slm_size = ALIGN(slm_size, 8) + ish->kernel_shared_size; - iris_pack_state(GENX(INTERFACE_DESCRIPTOR_DATA), desc, idd) { - idd.SharedLocalMemorySize = encode_slm_size(GEN_GEN, slm_size); + idd.SharedLocalMemorySize = + encode_slm_size(GEN_GEN, ish->kernel_shared_size); idd.KernelStartPointer = KSP(shader) + brw_cs_prog_data_prog_offset(cs_prog_data, simd_size); idd.SamplerStatePointer = shs->sampler_table.offset;