void
_mesa_associate_uniform_storage(struct gl_context *ctx,
struct gl_shader_program *shader_program,
- struct gl_program_parameter_list *params)
+ struct gl_program_parameter_list *params,
+ bool propagate_to_storage)
{
/* After adding each uniform to the parameter list, connect the storage for
* the parameter with the tracking structure used by the API for the
* data from the linker's backing store. This will cause values from
* initializers in the source code to be copied over.
*/
- _mesa_propagate_uniforms_to_driver_storage(storage,
- 0,
- MAX2(1, storage->array_elements));
+ if (propagate_to_storage) {
+ unsigned array_elements = MAX2(1, storage->array_elements);
+ _mesa_propagate_uniforms_to_driver_storage(storage, 0,
+ array_elements);
+ }
last_location = location;
}
* prog->ParameterValues to get reallocated (e.g., anything that adds a
* program constant) has to happen before creating this linkage.
*/
- _mesa_associate_uniform_storage(ctx, shader_program, prog->Parameters);
+ _mesa_associate_uniform_storage(ctx, shader_program, prog->Parameters,
+ true);
if (!shader_program->data->LinkStatus) {
goto fail_exit;
}
void
_mesa_associate_uniform_storage(struct gl_context *ctx,
struct gl_shader_program *shader_program,
- struct gl_program_parameter_list *params);
+ struct gl_program_parameter_list *params,
+ bool propagate_to_storage);
#ifdef __cplusplus
}
* prog->ParameterValues to get reallocated (e.g., anything that adds a
* program constant) has to happen before creating this linkage.
*/
- _mesa_associate_uniform_storage(ctx, shader_program, prog->Parameters);
+ _mesa_associate_uniform_storage(ctx, shader_program, prog->Parameters,
+ true);
struct st_vertex_program *stvp;
struct st_fragment_program *stfp;
* prog->ParameterValues to get reallocated (e.g., anything that adds a
* program constant) has to happen before creating this linkage.
*/
- _mesa_associate_uniform_storage(ctx, shader_program, prog->Parameters);
+ _mesa_associate_uniform_storage(ctx, shader_program, prog->Parameters,
+ true);
if (!shader_program->data->LinkStatus) {
free_glsl_to_tgsi_visitor(v);
_mesa_reference_program(ctx, &shader->Program, NULL);