mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-19 21:28:50 +00:00
c/main: Normalize comp_layer_renderer_destroy convention.
This commit is contained in:
parent
ffe458fdba
commit
04c9a7d892
|
@ -638,8 +638,15 @@ _destroy_framebuffer(struct comp_layer_renderer *self, uint32_t i)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
comp_layer_renderer_destroy(struct comp_layer_renderer *self)
|
comp_layer_renderer_destroy(struct comp_layer_renderer **ptr_clr)
|
||||||
{
|
{
|
||||||
|
if (ptr_clr == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
struct comp_layer_renderer *self = *ptr_clr;
|
||||||
|
if (self == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
struct vk_bundle *vk = self->vk;
|
struct vk_bundle *vk = self->vk;
|
||||||
|
|
||||||
if (vk->device == VK_NULL_HANDLE)
|
if (vk->device == VK_NULL_HANDLE)
|
||||||
|
@ -670,6 +677,8 @@ comp_layer_renderer_destroy(struct comp_layer_renderer *self)
|
||||||
vk_buffer_destroy(&self->vertex_buffer, vk);
|
vk_buffer_destroy(&self->vertex_buffer, vk);
|
||||||
|
|
||||||
vk->vkDestroyPipelineCache(vk->device, self->pipeline_cache, NULL);
|
vk->vkDestroyPipelineCache(vk->device, self->pipeline_cache, NULL);
|
||||||
|
free(self);
|
||||||
|
*ptr_clr = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -70,8 +70,13 @@ struct comp_layer_renderer
|
||||||
struct comp_layer_renderer *
|
struct comp_layer_renderer *
|
||||||
comp_layer_renderer_create(struct vk_bundle *vk, struct comp_shaders *s, VkExtent2D extent, VkFormat format);
|
comp_layer_renderer_create(struct vk_bundle *vk, struct comp_shaders *s, VkExtent2D extent, VkFormat format);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Destroy the layer renderer and set the pointer to NULL.
|
||||||
|
*
|
||||||
|
* @public @memberof comp_layer_renderer
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
comp_layer_renderer_destroy(struct comp_layer_renderer *self);
|
comp_layer_renderer_destroy(struct comp_layer_renderer **ptr_clr);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Perform draw calls for the layers.
|
* Perform draw calls for the layers.
|
||||||
|
|
|
@ -850,9 +850,7 @@ renderer_destroy(struct comp_renderer *r)
|
||||||
r->semaphores.render_complete = VK_NULL_HANDLE;
|
r->semaphores.render_complete = VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
comp_layer_renderer_destroy(r->lr);
|
comp_layer_renderer_destroy(&(r->lr));
|
||||||
|
|
||||||
free(r->lr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue