diff options
author | Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> | 2019-12-19 13:39:14 -0500 |
---|---|---|
committer | Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> | 2019-12-24 22:55:04 -0500 |
commit | 8781378224d5072e328c39c5b16acb7549654be7 (patch) | |
tree | 7cfd19775a10f13f37daf9505bae88c25285eae6 /src/gallium/drivers/panfrost | |
parent | 306800d747bcf210baa84594cdbdca21e435ddd9 (diff) |
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>
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_assemble.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c index 54c5ba79700..6928f33faae 100644 --- a/src/gallium/drivers/panfrost/pan_assemble.c +++ b/src/gallium/drivers/panfrost/pan_assemble.c @@ -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; |