mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
nouveau/nir: Use natural alignment for scalars
We used to request vec4 alignment for everything on the nir codepath,
but this triggers an assertion failure since a0b82c24b6, which prohibits
vec4 alignment on scalars. Since requiring vec4 alignment on scalars is a
little silly anyway, this patch relaxes the alignment to naturally aligned
for scalars.
Fixes about 27 crashing tests in piglit and deqp on kepler, including eg
piglit/tests/spec/glsl-1.30/execution/fs-large-local-array.shader_test
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13883>
This commit is contained in:
parent
698343edc5
commit
17de0841ae
1 changed files with 8 additions and 4 deletions
|
|
@ -64,11 +64,15 @@ function_temp_type_info(const struct glsl_type *type, unsigned *size, unsigned *
|
|||
{
|
||||
assert(glsl_type_is_vector_or_scalar(type));
|
||||
|
||||
unsigned comp_size = glsl_type_is_boolean(type) ? 4 : glsl_get_bit_size(type) / 8;
|
||||
unsigned length = glsl_get_vector_elements(type);
|
||||
if (glsl_type_is_scalar(type)) {
|
||||
glsl_get_natural_size_align_bytes(type, size, align);
|
||||
} else {
|
||||
unsigned comp_size = glsl_type_is_boolean(type) ? 4 : glsl_get_bit_size(type) / 8;
|
||||
unsigned length = glsl_get_vector_elements(type);
|
||||
|
||||
*size = comp_size * length;
|
||||
*align = 0x10;
|
||||
*size = comp_size * length;
|
||||
*align = 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
class Converter : public ConverterCommon
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue