The elements might not be initialized and we don't want random bytes
in the shader cache.
Discovered by valgrind.
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9360>
}
if (needSizeValues > paramList->SizeValues) {
+ unsigned oldSize = paramList->SizeValues;
paramList->SizeValues = needSizeValues + 16; /* alloc some extra */
paramList->ParameterValues = (gl_constant_value *)
*/
paramList->SizeValues * sizeof(gl_constant_value) +
12, 16);
+ /* The values are written to the shader cache, so clear them. */
+ memset(paramList->ParameterValues + oldSize, 0,
+ (paramList->SizeValues - oldSize) * sizeof(gl_constant_value));
}
}