mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 11:38:05 +02:00
glsl: fix glsl_get_word_size_align_bytes
this was copypasted from the wrong function. fixes on asahi KHR-Single-GL46.arrays_of_arrays_gl.SubroutineArgumentAliasing4_var_type_index_13 Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> Reviewed-by: Mary Guillemard <mary@mary.zone> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32871>
This commit is contained in:
parent
38c4548290
commit
09b5608607
1 changed files with 10 additions and 5 deletions
|
|
@ -3771,7 +3771,7 @@ glsl_get_natural_size_align_bytes(const glsl_type *type,
|
|||
|
||||
/**
|
||||
* Returns a byte size/alignment for a type where each array element or struct
|
||||
* field is aligned to 16 bytes.
|
||||
* field is aligned to 4 bytes.
|
||||
*/
|
||||
void
|
||||
glsl_get_word_size_align_bytes(const glsl_type *type,
|
||||
|
|
@ -3797,9 +3797,9 @@ glsl_get_word_size_align_bytes(const glsl_type *type,
|
|||
case GLSL_TYPE_DOUBLE:
|
||||
case GLSL_TYPE_UINT64:
|
||||
case GLSL_TYPE_INT64: {
|
||||
unsigned N = glsl_get_bit_size(type) / 8;
|
||||
*size = 16 * (type->matrix_columns - 1) + N * type->vector_elements;
|
||||
*align = 4;
|
||||
unsigned N = MAX2(glsl_get_bit_size(type) / 8, 4);
|
||||
*size = N * glsl_get_components(type);
|
||||
*align = N;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -3814,12 +3814,17 @@ glsl_get_word_size_align_bytes(const glsl_type *type,
|
|||
case GLSL_TYPE_SAMPLER:
|
||||
case GLSL_TYPE_TEXTURE:
|
||||
case GLSL_TYPE_IMAGE:
|
||||
/* Bindless samplers and images. */
|
||||
*size = 8;
|
||||
*align = 8;
|
||||
break;
|
||||
|
||||
case GLSL_TYPE_COOPERATIVE_MATRIX:
|
||||
case GLSL_TYPE_ATOMIC_UINT:
|
||||
case GLSL_TYPE_SUBROUTINE:
|
||||
case GLSL_TYPE_VOID:
|
||||
case GLSL_TYPE_ERROR:
|
||||
unreachable("type does not make sense for glsl_get_vec4_size_align_bytes()");
|
||||
unreachable("type does not have a natural size");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue