Browse Source

panfrost: Slight cleanup of Gallium's pan_attribute.c

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
master
Alyssa Rosenzweig 6 years ago
parent
commit
62ce9001c2
1 changed files with 2 additions and 5 deletions
  1. 2
    5
      src/gallium/drivers/panfrost/pan_attributes.c

+ 2
- 5
src/gallium/drivers/panfrost/pan_attributes.c View File

union mali_attr attrs[PIPE_MAX_ATTRIBS * 2]; union mali_attr attrs[PIPE_MAX_ATTRIBS * 2];
unsigned k = 0; unsigned k = 0;


unsigned vertex_count = ctx->vertex_count;
unsigned instanced_count = ctx->instance_count;

for (unsigned i = 0; i < so->num_elements; ++i) { for (unsigned i = 0; i < so->num_elements; ++i) {
/* We map a mali_attr to be 1:1 with the mali_attr_meta, which /* We map a mali_attr to be 1:1 with the mali_attr_meta, which
* means duplicating some vertex buffers (who cares? aside from * means duplicating some vertex buffers (who cares? aside from


unsigned divisor = elem->instance_divisor; unsigned divisor = elem->instance_divisor;


if (divisor && instanced_count == 1) {
if (divisor && ctx->instance_count == 1) {
/* Silly corner case where there's a divisor(=1) but /* Silly corner case where there's a divisor(=1) but
* there's no legitimate instancing. So we want *every* * there's no legitimate instancing. So we want *every*
* attribute to be the same. So set stride to zero so * attribute to be the same. So set stride to zero so
attrs[k].size = attrs[k].stride + chopped_addr; attrs[k].size = attrs[k].stride + chopped_addr;
attrs[k].stride = 0; attrs[k].stride = 0;
attrs[k++].elements |= MALI_ATTR_LINEAR; attrs[k++].elements |= MALI_ATTR_LINEAR;
} else if (instanced_count <= 1) {
} else if (ctx->instance_count <= 1) {
/* Normal, non-instanced attributes */ /* Normal, non-instanced attributes */
attrs[k++].elements |= MALI_ATTR_LINEAR; attrs[k++].elements |= MALI_ATTR_LINEAR;
} else { } else {

Loading…
Cancel
Save