mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 08:10:09 +01:00
compiler/types: Assert non-zero alignments in get_explicit_type_for_size_align
Reviewed-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
This commit is contained in:
parent
ef68f740a6
commit
0021d3ae87
1 changed files with 2 additions and 0 deletions
|
|
@ -2479,6 +2479,7 @@ glsl_type::get_explicit_type_for_size_align(glsl_type_size_align_func type_info,
|
|||
return this;
|
||||
} else if (this->is_vector()) {
|
||||
type_info(this, size, alignment);
|
||||
assert(*alignment > 0);
|
||||
assert(*alignment % explicit_type_scalar_byte_size(this) == 0);
|
||||
return glsl_type::get_instance(this->base_type, this->vector_elements,
|
||||
1, 0, false, *alignment);
|
||||
|
|
@ -2532,6 +2533,7 @@ glsl_type::get_explicit_type_for_size_align(glsl_type_size_align_func type_info,
|
|||
|
||||
*size = this->matrix_columns * stride;
|
||||
/* Matrix and column alignments match. See glsl_type::column_type() */
|
||||
assert(col_align > 0);
|
||||
*alignment = col_align;
|
||||
return glsl_type::get_instance(this->base_type, this->vector_elements,
|
||||
this->matrix_columns, stride, false, *alignment);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue