mesa/glsl: copy num_images to gl_program
authorTimothy Arceri <timothy.arceri@collabora.com>
Thu, 27 Oct 2016 03:47:09 +0000 (14:47 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Thu, 17 Nov 2016 01:52:24 +0000 (12:52 +1100)
We should be able to free gl_linked_shader after linking in order to
do so we need to switch to getting values from gl_program instead.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/compiler/glsl/glsl_to_nir.cpp
src/mesa/main/shaderapi.c

index 096ab4c5e2a3098b727ef4bdb3de44f365997d76..fef89f9272a33a589fa5abbb379845bb4f4c1209 100644 (file)
@@ -151,7 +151,6 @@ glsl_to_nir(const struct gl_shader_program *shader_prog,
    shader->info->num_ubos = sh->NumUniformBlocks;
    shader->info->num_abos = shader_prog->NumAtomicBuffers;
    shader->info->num_ssbos = sh->NumShaderStorageBlocks;
-   shader->info->num_images = sh->NumImages;
    shader->info->uses_clip_distance_out =
       sh->Program->ClipDistanceArraySize != 0;
    shader->info->separate_shader = shader_prog->SeparateShader;
index be3c203617d57f52a0c4146302e726ac1d6a4ead..4d64ae58a98b693a1386ee595a89b67ef6aec4f0 100644 (file)
@@ -2165,6 +2165,8 @@ _mesa_copy_linked_program_data(const struct gl_shader_program *src,
 
    struct gl_program *dst = dst_sh->Program;
 
+   dst->info.num_images = dst_sh->NumImages;
+
    switch (dst_sh->Stage) {
    case MESA_SHADER_VERTEX:
       dst->ClipDistanceArraySize = src->Vert.ClipDistanceArraySize;