summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-12-19 16:26:43 -0500
committerAlyssa Rosenzweig <[email protected]>2019-12-24 19:48:57 -0500
commit8a576726734bb214e5af3587b7544d93f81fe260 (patch)
tree2a3096906f1768374a1f02aa09d249bf9ac19807 /src/gallium
parentddcd68f52b487cd71e08e2120ab5d962a0116cc8 (diff)
panfrost: Factor batch/resource out of instancing routines
They don't need them; this will allow us to move the code into encoder/ which in turn will make the messy Gallium code less scary. Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/panfrost/pan_attributes.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/gallium/drivers/panfrost/pan_attributes.c b/src/gallium/drivers/panfrost/pan_attributes.c
index 473026cb8a0..4fa3546f3a3 100644
--- a/src/gallium/drivers/panfrost/pan_attributes.c
+++ b/src/gallium/drivers/panfrost/pan_attributes.c
@@ -165,23 +165,11 @@ panfrost_padded_vertex_count(
static unsigned
panfrost_vertex_instanced(
- struct panfrost_batch *batch,
- struct panfrost_resource *rsrc,
+ unsigned padded_count,
+ unsigned instance_shift, unsigned instance_odd,
unsigned divisor,
- union mali_attr *attrs,
- mali_ptr addr,
- unsigned vertex_count,
- unsigned instance_count)
+ union mali_attr *attrs)
{
- /* First, grab the padded vertex count */
-
- struct pan_shift_odd o = {
- .shift = batch->ctx->payloads[PIPE_SHADER_FRAGMENT].instance_shift,
- .odd = batch->ctx->payloads[PIPE_SHADER_FRAGMENT].instance_odd,
- };
-
- unsigned padded_count = batch->ctx->padded_count;
-
/* Depending if there is an instance divisor or not, packing varies.
* When there is a divisor, the hardware-level divisor is actually the
* product of the instance divisor and the padded count */
@@ -193,8 +181,8 @@ panfrost_vertex_instanced(
* the modulus */
attrs->elements |= MALI_ATTR_MODULO;
- attrs->shift = o.shift;
- attrs->extra_flags = o.odd;
+ attrs->shift = instance_shift;
+ attrs->extra_flags = instance_odd;
return 1;
} else if (util_is_power_of_two_or_zero(hw_divisor)) {
@@ -337,8 +325,11 @@ panfrost_emit_vertex_data(struct panfrost_batch *batch)
/* Normal, non-instanced attributes */
attrs[k++].elements |= MALI_ATTR_LINEAR;
} else {
- k += panfrost_vertex_instanced(
- batch, rsrc, divisor, &attrs[k], addr, vertex_count, instanced_count);
+ unsigned instance_shift = batch->ctx->payloads[PIPE_SHADER_FRAGMENT].instance_shift;
+ unsigned instance_odd = batch->ctx->payloads[PIPE_SHADER_FRAGMENT].instance_odd;
+
+ k += panfrost_vertex_instanced(batch->ctx->padded_count,
+ instance_shift, instance_odd, divisor, &attrs[k]);
}
}