radv: Add pipeline type.

I want to keep pointers that need to be freed in the union and need
to figure out the type a destruction time. This seems more reliable
than checking the shader array in case we destroy mid-creation (i.e.
on failure).

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12592>
This commit is contained in:
Bas Nieuwenhuizen
2021-07-31 23:42:32 +02:00
committed by Marge Bot
parent f5362742b9
commit 080400e43c
2 changed files with 9 additions and 0 deletions

View File

@@ -5608,6 +5608,7 @@ radv_graphics_pipeline_create(VkDevice _device, VkPipelineCache _cache,
return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY);
vk_object_base_init(&device->vk, &pipeline->base, VK_OBJECT_TYPE_PIPELINE);
pipeline->type = RADV_PIPELINE_GRAPHICS;
result = radv_pipeline_init(pipeline, device, cache, pCreateInfo, extra);
if (result != VK_SUCCESS) {
@@ -5754,6 +5755,7 @@ radv_compute_pipeline_create(VkDevice _device, VkPipelineCache _cache,
return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY);
vk_object_base_init(&device->vk, &pipeline->base, VK_OBJECT_TYPE_PIPELINE);
pipeline->type = RADV_PIPELINE_COMPUTE;
pipeline->device = device;
pipeline->graphics.last_vgt_api_stage = MESA_SHADER_NONE;