mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
spirv: Fix stride calculation when lowering Workgroup to offsets
Use alignment to calculate the stride associated with the pointer
types. That stride is used when the pointers are casted to arrays.
Note that size alone is not sufficient, e.g. struct { vec2 a; vec1 b;
} will have element an element size of 12 bytes, but the stride needs
to be 16 bytes to respect the 8 byte alignment.
Fixes: 050eb6389a "spirv: Ignore ArrayStride in OpPtrAccessChain for Workgroup"
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 026cfa1099)
This commit is contained in:
parent
f24507425b
commit
6ba4ce97b7
1 changed files with 1 additions and 1 deletions
|
|
@ -1432,7 +1432,7 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,
|
|||
val->type->align = align;
|
||||
|
||||
/* Override any ArrayStride previously set. */
|
||||
val->type->stride = size;
|
||||
val->type->stride = vtn_align_u32(size, align);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue