glsl: use the correct parent when allocating program data members
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 8 Nov 2017 00:34:10 +0000 (11:34 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 9 Nov 2017 01:07:48 +0000 (12:07 +1100)
Cc: "17.2 17.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/glsl/link_atomics.cpp
src/compiler/glsl/link_uniforms.cpp
src/compiler/glsl/linker.cpp
src/compiler/glsl/shader_cache.cpp

index d26e62a35b389df7cc5ff6af414484392d8f9604..d4a6eed639fb8bceb0efb695fc37efa9002de6e1 100644 (file)
@@ -207,7 +207,7 @@ link_assign_atomic_counter_resources(struct gl_context *ctx,
    active_atomic_buffer *abs =
       find_active_atomic_counters(ctx, prog, &num_buffers);
 
-   prog->data->AtomicBuffers = rzalloc_array(prog, gl_active_atomic_buffer,
+   prog->data->AtomicBuffers = rzalloc_array(prog->data, gl_active_atomic_buffer,
                                              num_buffers);
    prog->data->NumAtomicBuffers = num_buffers;
 
@@ -270,7 +270,7 @@ link_assign_atomic_counter_resources(struct gl_context *ctx,
          struct gl_program *gl_prog = prog->_LinkedShaders[j]->Program;
          gl_prog->info.num_abos = num_atomic_buffers[j];
          gl_prog->sh.AtomicBuffers =
-            rzalloc_array(prog, gl_active_atomic_buffer *,
+            rzalloc_array(gl_prog, gl_active_atomic_buffer *,
                           num_atomic_buffers[j]);
 
          unsigned intra_stage_idx = 0;
index 3da015eb7fd245df7d482bb85f6a074ab4f487a8..30c48b94fce960dcb824e21e06ed83dd50454fac 100644 (file)
@@ -1333,7 +1333,7 @@ link_assign_uniform_storage(struct gl_context *ctx,
 
    union gl_constant_value *data;
    if (prog->data->UniformStorage == NULL) {
-      prog->data->UniformStorage = rzalloc_array(prog,
+      prog->data->UniformStorage = rzalloc_array(prog->data,
                                                  struct gl_uniform_storage,
                                                  prog->data->NumUniformStorage);
       data = rzalloc_array(prog->data->UniformStorage,
index cb2a6c7892a6401eadc6fb043e34327852afb352..d6f9c2d91ff605be31c8566c032c087ebed367ec 100644 (file)
@@ -1201,8 +1201,8 @@ interstage_cross_validate_uniform_blocks(struct gl_shader_program *prog,
       }
 
       for (unsigned int j = 0; j < sh_num_blocks; j++) {
-         int index = link_cross_validate_uniform_block(prog, &blks, num_blks,
-                                                       sh_blks[j]);
+         int index = link_cross_validate_uniform_block(prog->data, &blks,
+                                                       num_blks, sh_blks[j]);
 
          if (index == -1) {
             linker_error(prog, "buffer block `%s' has mismatching "
@@ -3610,7 +3610,7 @@ add_program_resource(struct gl_shader_program *prog,
       return true;
 
    prog->data->ProgramResourceList =
-      reralloc(prog,
+      reralloc(prog->data,
                prog->data->ProgramResourceList,
                gl_program_resource,
                prog->data->NumProgramResourceList + 1);
index 89da19914fe8f8135a5aaf83af1a3806d721e06a..da1c72d42da2d96cfb96df860880158abfc4ef43 100644 (file)
@@ -499,7 +499,7 @@ read_uniforms(struct blob_reader *metadata, struct gl_shader_program *prog)
    prog->data->NumUniformStorage = blob_read_uint32(metadata);
    prog->data->NumUniformDataSlots = blob_read_uint32(metadata);
 
-   uniforms = rzalloc_array(prog, struct gl_uniform_storage,
+   uniforms = rzalloc_array(prog->data, struct gl_uniform_storage,
                             prog->data->NumUniformStorage);
    prog->data->UniformStorage = uniforms;
 
@@ -955,7 +955,7 @@ read_program_resource_list(struct blob_reader *metadata,
    prog->data->NumProgramResourceList = blob_read_uint32(metadata);
 
    prog->data->ProgramResourceList =
-      ralloc_array(prog, gl_program_resource,
+      ralloc_array(prog->data, gl_program_resource,
                    prog->data->NumProgramResourceList);
 
    for (unsigned i = 0; i < prog->data->NumProgramResourceList; i++) {