diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-23 17:02:38 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-07-25 06:34:21 -0700 |
commit | 5534fdb7bf6d7d377318724fbe480ead1e0962c3 (patch) | |
tree | 2dc6c2884122fcfabcc558d5bcd14ce72a396ab0 /src/gallium/drivers/panfrost/pan_assemble.c | |
parent | 4508f43eed5a4528f0e8ca9d1cfcdc78857043e0 (diff) |
panfrost: Compute I/O counts from shader_info
...rather than exposing it in the vendored compiler region.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_assemble.c')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_assemble.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c index 8ccf9125a43..c724489da3c 100644 --- a/src/gallium/drivers/panfrost/pan_assemble.c +++ b/src/gallium/drivers/panfrost/pan_assemble.c @@ -87,10 +87,21 @@ panfrost_shader_compile(struct panfrost_context *ctx, struct mali_shader_meta *m memcpy(state->sysval, program.sysvals, sizeof(state->sysval[0]) * state->sysval_count); meta->midgard1.uniform_count = MIN2(program.uniform_count, program.uniform_cutoff); - meta->attribute_count = program.attribute_count; - meta->varying_count = program.varying_count; meta->midgard1.work_count = program.work_register_count; + switch (s->info.stage) { + case MESA_SHADER_VERTEX: + meta->attribute_count = util_bitcount64(s->info.inputs_read); + meta->varying_count = util_bitcount64(s->info.outputs_written); + break; + case MESA_SHADER_FRAGMENT: + meta->attribute_count = 0; + meta->varying_count = util_bitcount64(s->info.inputs_read); + break; + default: + unreachable("Unknown shader state"); + } + state->can_discard = s->info.fs.uses_discard; state->writes_point_size = s->info.outputs_written & VARYING_SLOT_PSIZ; state->reads_point_coord = s->info.inputs_read & VARYING_SLOT_PNTC; @@ -106,7 +117,7 @@ panfrost_shader_compile(struct panfrost_context *ctx, struct mali_shader_meta *m unsigned default_vec4_swizzle = panfrost_get_default_swizzle(4); /* Iterate the varyings and emit the corresponding descriptor */ - for (unsigned i = 0; i < program.varying_count; ++i) { + for (unsigned i = 0; i < meta->varying_count; ++i) { unsigned location = program.varyings[i]; /* Default to a vec4 varying */ |