mesa/src/compiler
Erik Faye-Lund 742dace825 glsl: do not allow implicit casts of unsized array initializers
The GLSL 4.6 specification (section 4.1.14. "Implicit Conversions")
says:

  "There are no implicit array or structure conversions. For
   example, an array of int cannot be implicitly converted to an
   array of float."

So let's add a check in place when assigning array initializers to
implicitly sized arrays, to avoid incorrectly allowing code on the
form:

int[] foo = float[](1.0, 2.0, 3.0)

This fixes the following dEQP test-cases:
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_float_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_uint_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.int_to_uint_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.uint_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es31.invalid.arrays.uint_to_float_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_float_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_uint_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.int_to_uint_fragment
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.uint_to_float_vertex
- dEQP-GLES31.functional.shaders.implicit_conversions.es32.invalid.arrays.uint_to_float_fragment

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2018-11-02 11:10:36 +01:00
..
glsl glsl: do not allow implicit casts of unsized array initializers 2018-11-02 11:10:36 +01:00
nir nir: allow propagation of if evaluation for bcsel 2018-11-02 15:56:34 +11:00
spirv spirv: Pass SSA values through functions 2018-10-30 11:22:44 -05:00
.gitignore nir/spirv: Remove a duplicate spirv2nir from .gitignore 2016-10-04 07:43:15 -07:00
Android.glsl.gen.mk Android: clean-up trailing '\' in make variables 2017-03-22 17:52:06 +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 Android: fix a missing nir_intrinsics.h error 2018-07-21 08:50:23 +02:00
Android.nir.mk android: fix libmesa_nir build 2017-07-21 08:47:56 +03:00
blob.c compiler/blob: Add blob_skip_bytes 2018-07-09 23:02:33 -07:00
blob.h compiler/blob: Add blob_skip_bytes 2018-07-09 23:02:33 -07:00
builtin_type_macros.h glsl_types: vec8/vec16 support 2018-03-25 10:42:54 -04:00
glsl_types.cpp glsl: add has_implicit_uint_to_int_conversion()-helper 2018-11-02 11:10:36 +01:00
glsl_types.h nir: add 16bit type information to glsl types 2018-07-23 23:16:25 +02:00
Makefile.am configure: allow building with python3 2018-10-31 19:15:50 +00:00
Makefile.glsl.am configure: allow building with python3 2018-10-31 19:15:50 +00:00
Makefile.nir.am nir: Add test file for vars related passes 2018-10-15 17:29:46 -07:00
Makefile.sources nir: Add a pass for gathering transform feedback info 2018-10-29 17:09:08 +01:00
Makefile.spirv.am spirv: autotools: add vtn_gather_types_c.py in distribution tarball 2018-04-10 10:37:46 +02:00
meson.build meson: Build with Python 3 2018-08-10 15:15:09 -07:00
nir_types.cpp nir/types: Add a wrapper for coordinate_components 2018-08-29 14:04:02 -05:00
nir_types.h nir/types: Add a wrapper for coordinate_components 2018-08-29 14:04:02 -05:00
SConscript spirv: Fix building with SCons 2018-03-30 14:33:03 -06:00
SConscript.glsl mesa: Remove prog_hash_table.c 2016-09-12 10:48:35 +10: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 SYSTEM_VALUE_VARYING_COORD 2018-08-14 17:59:02 -04:00
shader_enums.h nir: Use a bitfield for image access qualifiers 2018-08-29 14:04:02 -05:00
shader_info.h compiler: Move double_inputs to gl_program::DualSlotInputs 2018-09-06 16:07:50 -05:00