Allocate UniformDataDefaults and fill in the data defaults when
linking a SPIR-V program. Among other things, this allows program
serialization to work.
It allows the following piglit test (when run on SPIR-V mode) to pass:
spec/arb_get_program_binary/execution/uniform-after-restore.shader_test
v2: use memcpy to initialize UniformDataDefaults
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
}
}
}
+ memcpy(prog->data->UniformDataDefaults, prog->data->UniformDataSlots,
+ sizeof(union gl_constant_value) * prog->data->NumUniformDataSlots);
+
}
}
prog->data->UniformDataSlots = data;
+ prog->data->UniformDataDefaults =
+ rzalloc_array(prog->data->UniformStorage,
+ union gl_constant_value, prog->data->NumUniformDataSlots);
+
unsigned data_pos = 0;
/* Reserve all the explicit locations of the active uniforms. */