Otherwise, the padding bits remain undefined, which leads to valgrind
errors when storing the gl_shader_variable in the disk cache.
v2: use rzalloc instead of an explicit padding member variable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
bool use_implicit_location, int location,
const glsl_type *outermost_struct_type)
{
- gl_shader_variable *out = ralloc(shProg, struct gl_shader_variable);
+ /* Allocate zero-initialized memory to ensure that bitfield padding
+ * is zero.
+ */
+ gl_shader_variable *out = rzalloc(shProg, struct gl_shader_variable);
if (!out)
return NULL;