/* only remove generated tcs during parent tes destruction */
if (stage == MESA_SHADER_TESS_EVAL && shader->non_fs.generated_tcs)
prog->shaders[MESA_SHADER_TESS_CTRL] = NULL;
- for (unsigned int i = 0; i < ARRAY_SIZE(shader->non_fs.generated_gs); i++) {
- for (int j = 0; j < ARRAY_SIZE(shader->non_fs.generated_gs[0]); j++) {
- if (stage != MESA_SHADER_FRAGMENT && shader->non_fs.generated_gs[i][j])
- prog->shaders[MESA_SHADER_GEOMETRY] = NULL;
- }
+ if (stage != MESA_SHADER_FRAGMENT &&
+ prog->shaders[MESA_SHADER_GEOMETRY] &&
+ prog->shaders[MESA_SHADER_GEOMETRY]->non_fs.parent ==
+ shader) {
+ prog->shaders[MESA_SHADER_GEOMETRY] = NULL;
}
zink_gfx_program_reference(screen, &prog, NULL);
}
if (ctx->gfx_stages[stage]->non_fs.is_generated)
ctx->inlinable_uniforms_valid_mask &= ~BITFIELD_BIT(MESA_SHADER_GEOMETRY);
- for (int i = 0; i < ARRAY_SIZE(shader->non_fs.generated_gs); i++) {
- for (int j = 0; j < ARRAY_SIZE(shader->non_fs.generated_gs[0]); j++) {
- if (ctx->gfx_stages[stage]->non_fs.generated_gs[i][j] &&
- ctx->gfx_stages[MESA_SHADER_GEOMETRY] ==
- ctx->gfx_stages[stage]->non_fs.generated_gs[i][j]) {
- assert(stage != MESA_SHADER_GEOMETRY); /* let's not keep recursing! */
- bind_gfx_stage(ctx, MESA_SHADER_GEOMETRY, NULL);
- ctx->is_generated_gs_bound = false;
- ctx->inlinable_uniforms_valid_mask &= ~BITFIELD_BIT(MESA_SHADER_GEOMETRY);
- }
- }
+ if (ctx->gfx_stages[MESA_SHADER_GEOMETRY] &&
+ ctx->gfx_stages[MESA_SHADER_GEOMETRY]->non_fs.parent ==
+ ctx->gfx_stages[stage]) {
+ ctx->base.bind_gs_state(&ctx->base, NULL);
+ ctx->is_generated_gs_bound = false;
+ ctx->inlinable_uniforms_valid_mask &= ~BITFIELD_BIT(MESA_SHADER_GEOMETRY);
}
}
shader->sinfo.so_info = ctx->gfx_stages[prev_vertex_stage]->sinfo.so_info;
}
- bind_gfx_stage(ctx, MESA_SHADER_GEOMETRY,
- ctx->gfx_stages[prev_vertex_stage]->non_fs.generated_gs[ctx->gfx_pipeline_state.gfx_prim_mode][zink_prim_type]);
+ ctx->base.bind_gs_state(&ctx->base,
+ ctx->gfx_stages[prev_vertex_stage]->non_fs.generated_gs[ctx->gfx_pipeline_state.gfx_prim_mode][zink_prim_type]);
ctx->is_generated_gs_bound = true;
}
ctx->gfx_pipeline_state.dyn_state3.pv_last});
} else if (ctx->gfx_stages[MESA_SHADER_GEOMETRY] &&
ctx->gfx_stages[MESA_SHADER_GEOMETRY]->non_fs.is_generated)
- bind_gfx_stage(ctx, MESA_SHADER_GEOMETRY, NULL);
+ ctx->base.bind_gs_state(&ctx->base, NULL);
}