diff --git a/src/gallium/drivers/llvmpipe/lp_state_cs.c b/src/gallium/drivers/llvmpipe/lp_state_cs.c index d41f5199fce..414a1cd7190 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_cs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_cs.c @@ -438,6 +438,7 @@ llvmpipe_create_compute_state(struct pipe_context *pipe, shader->no = cs_no++; shader->base.type = templ->ir_type; + shader->req_local_mem = templ->req_local_mem; if (templ->ir_type == PIPE_SHADER_IR_NIR_SERIALIZED) { struct blob_reader reader; const struct pipe_binary_program_header *hdr = templ->prog; @@ -447,6 +448,7 @@ llvmpipe_create_compute_state(struct pipe_context *pipe, shader->base.type = PIPE_SHADER_IR_NIR; pipe->screen->finalize_nir(pipe->screen, shader->base.ir.nir, false); + shader->req_local_mem += ((struct nir_shader *)shader->base.ir.nir)->info.cs.shared_size; } else if (templ->ir_type == PIPE_SHADER_IR_NIR) shader->base.ir.nir = (struct nir_shader *)templ->prog; @@ -460,7 +462,6 @@ llvmpipe_create_compute_state(struct pipe_context *pipe, nir_tgsi_scan_shader(shader->base.ir.nir, &shader->info.base, false); } - shader->req_local_mem = templ->req_local_mem; make_empty_list(&shader->variants); nr_samplers = shader->info.base.file_max[TGSI_FILE_SAMPLER] + 1;