anv: consolidate DestroyPipeline for graphics and graphics_lib

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29011>
This commit is contained in:
Iván Briano 2024-05-01 12:14:02 -07:00 committed by Marge Bot
parent 6223388c73
commit a24ed1146d

View file

@ -327,24 +327,14 @@ void anv_DestroyPipeline(
ANV_RMV(resource_destroy, device, pipeline);
switch (pipeline->type) {
case ANV_PIPELINE_GRAPHICS:
case ANV_PIPELINE_GRAPHICS_LIB: {
struct anv_graphics_lib_pipeline *gfx_pipeline =
anv_pipeline_to_graphics_lib(pipeline);
struct anv_graphics_base_pipeline *gfx_pipeline =
anv_pipeline_to_graphics_base(pipeline);
for (unsigned s = 0; s < ARRAY_SIZE(gfx_pipeline->base.shaders); s++) {
if (gfx_pipeline->base.shaders[s])
anv_shader_bin_unref(device, gfx_pipeline->base.shaders[s]);
}
break;
}
case ANV_PIPELINE_GRAPHICS: {
struct anv_graphics_pipeline *gfx_pipeline =
anv_pipeline_to_graphics(pipeline);
for (unsigned s = 0; s < ARRAY_SIZE(gfx_pipeline->base.shaders); s++) {
if (gfx_pipeline->base.shaders[s])
anv_shader_bin_unref(device, gfx_pipeline->base.shaders[s]);
for (unsigned s = 0; s < ARRAY_SIZE(gfx_pipeline->shaders); s++) {
if (gfx_pipeline->shaders[s])
anv_shader_bin_unref(device, gfx_pipeline->shaders[s]);
}
break;
}