mesa/src/compiler
Jason Ekstrand a0b82c24b6 nir/glsl: Add an explicit_alignment field to glsl_type
When creating explicit type, the alignment information is lost, thus
forcing explicit type users to recalculate the alignment using the same
size_align() function. Let's add a new field to cache this information.

Only structs, matrices, and vectors have and explicit alignment.  Arrays
alignment is implicitly set to its element alignment and matrices are
required to have an alignment that matches that of its vector columns.
the concept of alignment simply doesn't apply to other types.

We make the strategic choice to not allow explicit alignments on
scalars.  This is for a couple of reasons:

 1. There are no cases today where we use explicit types where we want
    any other alignment for scalars than natural alignment.

 2. Vectors don't have a component alignment that's separate from the
    explicit_alignment so it's impossible to get an explicitly aligned
    scalar type which is the component of the explicitly aligned vector
    type.

This choice may cause problems if we ever want to use explicitly laid
out types for things like varyings where we sometimes want vec4
alignment of scalars.  We can deal with that when the time comes.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6472>
2020-09-03 18:02:50 +00:00
..
glsl compiler: add INTERP_MODE_COLOR for radeonsi 2020-09-02 23:03:00 -04:00
nir nir: Don't bail too early in lower_mem_constant_vars 2020-09-03 18:02:50 +00:00
spirv spirv: Propagate packed information to glsl_type 2020-09-03 18:02:50 +00:00
Android.glsl.gen.mk Android: Fixes for Q and R 2020-07-15 20:49:24 +00:00
Android.glsl.mk android: glsl: build shader cache sources 2017-02-20 16:30:37 +00:00
Android.mk Android: glsl: add rules to generate ir_expression*.h header files 2016-09-06 15:58:55 +01:00
Android.nir.gen.mk nir: Add missing dependency in Android.nir.gen.mk 2019-08-19 09:53:18 +03:00
Android.nir.mk android: fix libmesa_nir build 2017-07-21 08:47:56 +03:00
builtin_type_macros.h nir/vtn: Add support for kernel images to SPIRV-to-NIR. 2020-08-31 21:17:39 +00:00
glsl_types.cpp nir/glsl: Add an explicit_alignment field to glsl_type 2020-09-03 18:02:50 +00:00
glsl_types.h nir/glsl: Add an explicit_alignment field to glsl_type 2020-09-03 18:02:50 +00:00
Makefile.sources nir: Add a lowering pass for backends wanting load_ubo with vec4 offsets. 2020-08-24 09:53:35 -07:00
meson.build spirv: add some tests for volatile/available/visible 2020-09-01 17:15:22 +00:00
nir_types.cpp nir/glsl: Add an explicit_alignment field to glsl_type 2020-09-03 18:02:50 +00:00
nir_types.h nir/glsl: Add an explicit_alignment field to glsl_type 2020-09-03 18:02:50 +00:00
SConscript spirv: Fix building with SCons 2018-03-30 14:33:03 -06:00
SConscript.glsl Move compiler.h and imports.h/c from src/mesa/main into src/util 2020-03-27 21:00:09 +00:00
SConscript.nir nir: mako all the intrinsics 2018-03-27 08:36:37 -04:00
SConscript.spirv spirv: Fix building with SCons 2018-03-30 14:33:03 -06:00
shader_enums.c compiler: add INTERP_MODE_COLOR for radeonsi 2020-09-02 23:03:00 -04:00
shader_enums.h compiler: add INTERP_MODE_COLOR for radeonsi 2020-09-02 23:03:00 -04:00
shader_info.h nir/vtn: Convert constant samplers to variables with data 2020-08-31 21:17:39 +00:00