mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 16:20:13 +01:00
pan/mdg: Bounds check swizzle writing globals
Fixes scheduler hang in: dEQP-GLES31.functional.shaders.opaque_type_indexing.ubo.const_literal_compute Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6516>
This commit is contained in:
parent
2486fe6761
commit
41184f89eb
1 changed files with 9 additions and 0 deletions
|
|
@ -1357,6 +1357,15 @@ emit_global(
|
|||
mir_set_offset(ctx, &ins, offset, is_shared);
|
||||
mir_set_intr_mask(instr, &ins, is_read);
|
||||
|
||||
/* Set a valid swizzle for masked out components */
|
||||
assert(ins.mask);
|
||||
unsigned first_component = __builtin_ffs(ins.mask) - 1;
|
||||
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(ins.swizzle[0]); ++i) {
|
||||
if (!(ins.mask & (1 << i)))
|
||||
ins.swizzle[0][i] = first_component;
|
||||
}
|
||||
|
||||
emit_mir_instruction(ctx, ins);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue