mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
glsl: Add a macro for the default values for glsl_struct_field
There are two constructors for glsl_struct_field with different parameters. Instead of repeating them for both constructors, this patch adds a convenience macro. This will make it easier to add a third constructor in a later patch. Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
ca6ee488e9
commit
014be60398
1 changed files with 12 additions and 14 deletions
|
|
@ -1245,29 +1245,27 @@ struct glsl_struct_field {
|
|||
|
||||
unsigned implicit_sized_array:1;
|
||||
#ifdef __cplusplus
|
||||
#define DEFAULT_CONSTRUCTORS(_type, _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), \
|
||||
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, const char *_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),
|
||||
memory_write_only(0), memory_coherent(0), memory_volatile(0),
|
||||
memory_restrict(0), image_format(0), explicit_xfb_buffer(0),
|
||||
implicit_sized_array(0)
|
||||
: DEFAULT_CONSTRUCTORS(_type, _name)
|
||||
{
|
||||
/* empty */
|
||||
}
|
||||
|
||||
glsl_struct_field()
|
||||
: type(NULL), name(NULL), location(-1), offset(-1), xfb_buffer(0),
|
||||
xfb_stride(0), interpolation(0), centroid(0),
|
||||
sample(0), matrix_layout(0), patch(0),
|
||||
precision(0), 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)
|
||||
: DEFAULT_CONSTRUCTORS(NULL, NULL)
|
||||
{
|
||||
/* empty */
|
||||
}
|
||||
#undef DEFAULT_CONSTRUCTORS
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue