panfrost: Extend attribute_count for vertex builtins

They stretch beyond the usual limit for attributes so are included
implicitly.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
Alyssa Rosenzweig 2019-12-19 13:39:14 -05:00
parent 306800d747
commit 8781378224
1 changed files with 10 additions and 0 deletions

View File

@ -96,10 +96,20 @@ panfrost_shader_compile(
meta->midgard1.uniform_count = MIN2(program.uniform_count, program.uniform_cutoff);
meta->midgard1.work_count = program.work_register_count;
bool vertex_id = s->info.system_values_read & (1 << SYSTEM_VALUE_VERTEX_ID);
bool instance_id = s->info.system_values_read & (1 << SYSTEM_VALUE_INSTANCE_ID);
switch (stage) {
case MESA_SHADER_VERTEX:
meta->attribute_count = util_bitcount64(s->info.inputs_read);
meta->varying_count = util_bitcount64(s->info.outputs_written);
if (vertex_id)
meta->attribute_count = MAX2(meta->attribute_count, PAN_VERTEX_ID + 1);
if (instance_id)
meta->attribute_count = MAX2(meta->attribute_count, PAN_INSTANCE_ID + 1);
break;
case MESA_SHADER_FRAGMENT:
meta->attribute_count = 0;