Commit 2e7603fc authored by Rob Clark's avatar Rob Clark 💬
Browse files

WIP: freedreno/ir3: Get req_local_mem from pipe_compute_state

mesa/st initializes req_local_mem to shader->info.shared_size.  But for
clover the shared size doesn't come from the shader.
parent e0d68a5c
Pipeline #396023 waiting for manual action with stages
...@@ -748,6 +748,7 @@ struct ir3_shader { ...@@ -748,6 +748,7 @@ struct ir3_shader {
/* for compute shaders: */ /* for compute shaders: */
struct { struct {
unsigned req_input_mem; /* in dwords */ unsigned req_input_mem; /* in dwords */
unsigned req_local_mem;
} cs; } cs;
}; };
......
...@@ -70,7 +70,7 @@ cs_program_emit(struct fd_context *ctx, struct fd_ringbuffer *ring, ...@@ -70,7 +70,7 @@ cs_program_emit(struct fd_context *ctx, struct fd_ringbuffer *ring,
COND(v->mergedregs, A6XX_SP_CS_CTRL_REG0_MERGEDREGS) | COND(v->mergedregs, A6XX_SP_CS_CTRL_REG0_MERGEDREGS) |
A6XX_SP_CS_CTRL_REG0_BRANCHSTACK(ir3_shader_branchstack_hw(v))); A6XX_SP_CS_CTRL_REG0_BRANCHSTACK(ir3_shader_branchstack_hw(v)));
uint32_t shared_size = MAX2(((int)v->shared_size - 1) / 1024, 1); uint32_t shared_size = MAX2(((int)v->shader->cs.req_local_mem - 1) / 1024, 1);
OUT_PKT4(ring, REG_A6XX_SP_CS_UNKNOWN_A9B1, 1); OUT_PKT4(ring, REG_A6XX_SP_CS_UNKNOWN_A9B1, 1);
OUT_RING(ring, A6XX_SP_CS_UNKNOWN_A9B1_SHARED_SIZE(shared_size) | OUT_RING(ring, A6XX_SP_CS_UNKNOWN_A9B1_SHARED_SIZE(shared_size) |
A6XX_SP_CS_UNKNOWN_A9B1_UNK6); A6XX_SP_CS_UNKNOWN_A9B1_UNK6);
......
...@@ -309,6 +309,7 @@ ir3_shader_compute_state_create(struct pipe_context *pctx, ...@@ -309,6 +309,7 @@ ir3_shader_compute_state_create(struct pipe_context *pctx,
struct ir3_shader *shader = ir3_shader_from_nir(compiler, nir, 0, NULL); struct ir3_shader *shader = ir3_shader_from_nir(compiler, nir, 0, NULL);
shader->cs.req_input_mem = align(cso->req_input_mem, 4) / 4; /* byte->dword */ shader->cs.req_input_mem = align(cso->req_input_mem, 4) / 4; /* byte->dword */
shader->cs.req_local_mem = cso->req_local_mem;
struct ir3_shader_state *hwcso = calloc(1, sizeof(*hwcso)); struct ir3_shader_state *hwcso = calloc(1, sizeof(*hwcso));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment