mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 13:38:06 +02:00
compiler: Allow the explicit_stride of aoa types to be zero
The explicit stride doesn't have to be defined to aoa and therefore can be
zero in some cases, like in arrays of arrays of uniform blocks.
Resolves crash with spec@arb_gl_spirv@execution@ubo@aoa-2.shader_test piglit test for virgl.
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23648>
(cherry picked from commit bc2828a436)
This commit is contained in:
parent
e1e7e7bf17
commit
1e149d37df
2 changed files with 2 additions and 2 deletions
|
|
@ -436,7 +436,7 @@
|
|||
"description": "compiler: Allow the explicit_stride of aoa types to be zero",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2495,7 +2495,7 @@ glsl_type::explicit_size(bool align_to_stride) const
|
|||
|
||||
assert(this->length > 0);
|
||||
unsigned elem_size = align_to_stride ? this->explicit_stride : this->fields.array->explicit_size();
|
||||
assert(this->explicit_stride >= elem_size);
|
||||
assert(this->explicit_stride == 0 || this->explicit_stride >= elem_size);
|
||||
|
||||
return this->explicit_stride * (this->length - 1) + elem_size;
|
||||
} else if (this->is_matrix()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue