diff options
author | Jason Ekstrand <[email protected]> | 2019-04-24 02:21:01 -0500 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2019-08-12 22:56:07 +0000 |
commit | 67cb55ad118fec14651cba9f27bbbe6f76d7603f (patch) | |
tree | 27680da7c68eaffdc9af28897e91d7064337d0c4 /src | |
parent | fec4bdff404bc30135f450cb3546bd6d193348cf (diff) |
anv: Add a ralloc context to anv_pipeline
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/vulkan/anv_pipeline.c | 5 | ||||
-rw-r--r-- | src/intel/vulkan/anv_private.h | 2 | ||||
-rw-r--r-- | src/intel/vulkan/genX_pipeline.c | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 1d0226676f6..fc492844cce 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -297,6 +297,9 @@ void anv_DestroyPipeline( anv_reloc_list_finish(&pipeline->batch_relocs, pAllocator ? pAllocator : &device->alloc); + + ralloc_free(pipeline->mem_ctx); + if (pipeline->blend_state.map) anv_state_pool_free(&device->dynamic_state_pool, pipeline->blend_state); @@ -1794,6 +1797,7 @@ anv_pipeline_init(struct anv_pipeline *pipeline, pipeline->batch.relocs = &pipeline->batch_relocs; pipeline->batch.status = VK_SUCCESS; + pipeline->mem_ctx = ralloc_context(NULL); pipeline->flags = pCreateInfo->flags; copy_non_dynamic_state(pipeline, pCreateInfo); @@ -1822,6 +1826,7 @@ anv_pipeline_init(struct anv_pipeline *pipeline, result = anv_pipeline_compile_graphics(pipeline, cache, pCreateInfo); if (result != VK_SUCCESS) { + ralloc_free(pipeline->mem_ctx); anv_reloc_list_finish(&pipeline->batch_relocs, alloc); return result; } diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index ad2de7fae76..5682e838abf 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -2802,6 +2802,8 @@ struct anv_pipeline { anv_cmd_dirty_mask_t dynamic_state_mask; struct anv_dynamic_state dynamic_state; + void * mem_ctx; + VkPipelineCreateFlags flags; struct anv_subpass * subpass; diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c index 0fc25f8f9ff..e0e723c13a4 100644 --- a/src/intel/vulkan/genX_pipeline.c +++ b/src/intel/vulkan/genX_pipeline.c @@ -2226,6 +2226,7 @@ compute_pipeline_create( pipeline->batch.relocs = &pipeline->batch_relocs; pipeline->batch.status = VK_SUCCESS; + pipeline->mem_ctx = ralloc_context(NULL); pipeline->flags = pCreateInfo->flags; /* When we free the pipeline, we detect stages based on the NULL status @@ -2242,6 +2243,7 @@ compute_pipeline_create( pCreateInfo->stage.pName, pCreateInfo->stage.pSpecializationInfo); if (result != VK_SUCCESS) { + ralloc_free(pipeline->mem_ctx); vk_free2(&device->alloc, pAllocator, pipeline); return result; } |