kernel->v = v;
kernel->bin = v->bin;
- memcpy(kernel->base.local_size, kernel->info.local_size, sizeof(kernel->base.local_size));
+ kernel->base.local_size[0] = v->local_size[0];
+ kernel->base.local_size[1] = v->local_size[0];
+ kernel->base.local_size[2] = v->local_size[0];
kernel->base.num_bufs = kernel->info.num_bufs;
memcpy(kernel->base.buf_sizes, kernel->info.buf_sizes, sizeof(kernel->base.buf_sizes));
info->numwg = INVALID_REG;
+ /* Provide a default local_size in case the shader doesn't set it, so that
+ * we don't crash at least.
+ */
+ v->local_size[0] = v->local_size[1] = v->local_size[2] = 1;
+
v->ir = ir3_parse(v, info, in);
if (!v->ir)
goto error;
#define MAX_BUFS 4
struct ir3_kernel_info {
- uint32_t local_size[3];
uint32_t num_bufs;
uint32_t buf_sizes[MAX_BUFS]; /* size in dwords */
ctx->s->info.fs.needs_quad_helper_invocations)
so->need_pixlod = true;
+ if (so->type == MESA_SHADER_COMPUTE) {
+ so->local_size[0] = ctx->s->info.cs.local_size[0];
+ so->local_size[1] = ctx->s->info.cs.local_size[1];
+ so->local_size[2] = ctx->s->info.cs.local_size[2];
+ so->local_size_variable = ctx->s->info.cs.local_size_variable;
+ }
+
out:
if (ret) {
if (so->ir)
| T_HEX { $$ = $1; }
localsize_header: T_A_LOCALSIZE const_val ',' const_val ',' const_val {
- info->local_size[0] = $2;
- info->local_size[1] = $4;
- info->local_size[2] = $6;
+ variant->local_size[0] = $2;
+ variant->local_size[1] = $4;
+ variant->local_size[2] = $6;
}
const_header: T_A_CONST '(' T_CONSTANT ')' const_val ',' const_val ',' const_val ',' const_val {
/* texture sampler pre-dispatches */
uint32_t num_sampler_prefetch;
struct ir3_sampler_prefetch sampler_prefetch[IR3_MAX_SAMPLER_PREFETCH];
+
+ uint16_t local_size[3];
+ bool local_size_variable;
};
static inline const char *
tu_setup_pvtmem(dev, pipeline, &pvtmem, v->pvtmem_size, v->pvtmem_per_wave);
for (int i = 0; i < 3; i++)
- pipeline->compute.local_size[i] = v->shader->nir->info.cs.local_size[i];
+ pipeline->compute.local_size[i] = v->local_size[i];
struct tu_cs prog_cs;
tu_cs_begin_sub_stream(&pipeline->cs, 512, &prog_cs);