From: Neil Roberts Date: Wed, 10 Jul 2019 11:01:38 +0000 (+0200) Subject: glsl: Add a constructor for glsl_struct_field to specify the precision X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=74d71dac20f151fb3904ee83f6e6159a491dc9db;p=mesa.git glsl: Add a constructor for glsl_struct_field to specify the precision Adds a third constructor to glsl_struct_field which has an extra parameter to specify the precision. Reviewed-by: Eric Anholt --- diff --git a/src/compiler/glsl_types.h b/src/compiler/glsl_types.h index 439dccaf933..40f148a2171 100644 --- a/src/compiler/glsl_types.h +++ b/src/compiler/glsl_types.h @@ -1245,23 +1245,31 @@ struct glsl_struct_field { unsigned implicit_sized_array:1; #ifdef __cplusplus -#define DEFAULT_CONSTRUCTORS(_type, _name) \ +#define DEFAULT_CONSTRUCTORS(_type, _precision, _name) \ type(_type), name(_name), location(-1), offset(-1), xfb_buffer(0), \ xfb_stride(0), interpolation(0), centroid(0), \ sample(0), matrix_layout(GLSL_MATRIX_LAYOUT_INHERITED), patch(0), \ - precision(GLSL_PRECISION_NONE), memory_read_only(0), \ + precision(_precision), memory_read_only(0), \ memory_write_only(0), memory_coherent(0), memory_volatile(0), \ memory_restrict(0), image_format(0), explicit_xfb_buffer(0), \ implicit_sized_array(0) + glsl_struct_field(const struct glsl_type *_type, + int _precision, + const char *_name) + : DEFAULT_CONSTRUCTORS(_type, _precision, _name) + { + /* empty */ + } + glsl_struct_field(const struct glsl_type *_type, const char *_name) - : DEFAULT_CONSTRUCTORS(_type, _name) + : DEFAULT_CONSTRUCTORS(_type, GLSL_PRECISION_NONE, _name) { /* empty */ } glsl_struct_field() - : DEFAULT_CONSTRUCTORS(NULL, NULL) + : DEFAULT_CONSTRUCTORS(NULL, GLSL_PRECISION_NONE, NULL) { /* empty */ }