mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
panfrost: Make instancing code more obvious
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11123>
This commit is contained in:
parent
552fdc7ea4
commit
4b52b0841f
1 changed files with 12 additions and 11 deletions
|
|
@ -1724,23 +1724,24 @@ panfrost_emit_vertex_data(struct panfrost_batch *batch,
|
|||
|
||||
unsigned hw_divisor = ctx->padded_count * divisor;
|
||||
|
||||
/* If there's a divisor(=1) but no instancing, we want every
|
||||
* attribute to be the same */
|
||||
if (ctx->instance_count <= 1) {
|
||||
/* Per-instance would be every attribute equal */
|
||||
if (divisor)
|
||||
stride = 0;
|
||||
|
||||
if (divisor && ctx->instance_count == 1)
|
||||
stride = 0;
|
||||
|
||||
if (!divisor || ctx->instance_count <= 1) {
|
||||
pan_pack(bufs + k, ATTRIBUTE_BUFFER, cfg) {
|
||||
if (ctx->instance_count > 1) {
|
||||
cfg.type = MALI_ATTRIBUTE_TYPE_1D_MODULUS;
|
||||
cfg.divisor = ctx->padded_count;
|
||||
}
|
||||
|
||||
cfg.pointer = addr;
|
||||
cfg.stride = stride;
|
||||
cfg.size = size;
|
||||
}
|
||||
} else if (!divisor) {
|
||||
pan_pack(bufs + k, ATTRIBUTE_BUFFER, cfg) {
|
||||
cfg.type = MALI_ATTRIBUTE_TYPE_1D_MODULUS;
|
||||
cfg.pointer = addr;
|
||||
cfg.stride = stride;
|
||||
cfg.size = size;
|
||||
cfg.divisor = ctx->padded_count;
|
||||
}
|
||||
} else if (util_is_power_of_two_or_zero(hw_divisor)) {
|
||||
pan_pack(bufs + k, ATTRIBUTE_BUFFER, cfg) {
|
||||
cfg.type = MALI_ATTRIBUTE_TYPE_1D_POT_DIVISOR;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue