*/
void
nir_build_program_resource_list(struct gl_context *ctx,
- struct gl_shader_program *prog)
+ struct gl_shader_program *prog,
+ bool rebuild_resourse_list)
{
/* Rebuild resource list. */
- if (prog->data->ProgramResourceList) {
+ if (prog->data->ProgramResourceList && rebuild_resourse_list) {
ralloc_free(prog->data->ProgramResourceList);
prog->data->ProgramResourceList = NULL;
prog->data->NumProgramResourceList = 0;
struct gl_shader_program *prog);
void nir_build_program_resource_list(struct gl_context *ctx,
- struct gl_shader_program *prog);
+ struct gl_shader_program *prog,
+ bool rebuild_resourse_list);
void gl_nir_link_assign_atomic_counter_resources(struct gl_context *ctx,
struct gl_shader_program *prog);
*/
void
build_program_resource_list(struct gl_context *ctx,
- struct gl_shader_program *shProg)
+ struct gl_shader_program *shProg,
+ bool add_packed_varyings_only)
{
/* Rebuild resource list. */
if (shProg->data->ProgramResourceList) {
return;
}
+ if (add_packed_varyings_only)
+ return;
+
if (!add_fragdata_arrays(ctx, shProg, resource_set))
return;
extern void
build_program_resource_list(struct gl_context *ctx,
- struct gl_shader_program *shProg);
+ struct gl_shader_program *shProg,
+ bool add_packed_varyings_only);
extern long
parse_program_resource_name(const GLchar *name,
/* SPIR-V programs build its resource list from linked NIR shaders. */
if (!shProg->data->spirv)
- build_program_resource_list(ctx, shProg);
+ build_program_resource_list(ctx, shProg, false);
else
- nir_build_program_resource_list(ctx, shProg);
+ nir_build_program_resource_list(ctx, shProg, true);
for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders); stage++) {
struct gl_linked_shader *shader = shProg->_LinkedShaders[stage];
}
}
- build_program_resource_list(ctx, prog);
+ build_program_resource_list(ctx, prog, false);
return prog->data->LinkStatus;
}
validate_ir_tree(ir);
}
- build_program_resource_list(ctx, prog);
+ build_program_resource_list(ctx, prog, use_nir);
if (use_nir)
return st_link_nir(ctx, prog);
if (!gl_nir_link(ctx, shader_program, &opts))
return GL_FALSE;
- nir_build_program_resource_list(ctx, shader_program);
+ nir_build_program_resource_list(ctx, shader_program, true);
for (unsigned i = 0; i < num_shaders; i++) {
struct gl_linked_shader *shader = linked_shader[i];
linked_shader[i + 1]->Program->nir);
}
+ if (!shader_program->data->spirv)
+ nir_build_program_resource_list(ctx, shader_program, false);
+
for (unsigned i = 0; i < num_shaders; i++) {
struct gl_linked_shader *shader = linked_shader[i];
nir_shader *nir = shader->Program->nir;