diff options
author | Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> | 2019-10-15 15:56:15 -0400 |
---|---|---|
committer | Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> | 2019-10-15 21:41:11 -0400 |
commit | 9c0915ba4ac3c813056124ca59c87be9c89ef1c6 (patch) | |
tree | c64a0b8cdb8d50e8b9fe08c9b4a6976432e4b62e /src | |
parent | a6867fb3fd9188eda49cb9f68e2b6da774b8a0c8 (diff) |
pan/midgard: Allow non-contiguous masks in UBO lowering
We don't really need to impose this condition, but we do need to cope
with the slightly more general case.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/panfrost/midgard/mir_promote_uniforms.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/panfrost/midgard/mir_promote_uniforms.c b/src/panfrost/midgard/mir_promote_uniforms.c index 428710e5154..5e31cb446bb 100644 --- a/src/panfrost/midgard/mir_promote_uniforms.c +++ b/src/panfrost/midgard/mir_promote_uniforms.c @@ -87,18 +87,13 @@ midgard_promote_uniforms(compiler_context *ctx, unsigned promoted_count) bool needs_move = ins->dest & IS_REG; needs_move |= mir_special_index(ctx, ins->dest); - /* Ensure this is a contiguous X-bound mask. It should be since - * we haven't done RA and per-component masked UBO reads don't - * make much sense. */ - - assert(((ins->mask + 1) & ins->mask) == 0); - /* Check the component count from the mask so we can setup a * swizzle appropriately when promoting. The idea is to ensure * the component count is preserved so RA can be smarter if we * need to spill */ - unsigned nr_components = util_bitcount(ins->mask); + unsigned mask = ins->mask; + unsigned nr_components = sizeof(mask)*8 - __builtin_clz(mask); if (needs_move) { midgard_instruction mov = v_mov(promoted, blank_alu_src, ins->dest); |