diff options
author | Jason Ekstrand <[email protected]> | 2018-06-29 17:29:35 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-07-02 13:07:06 -0700 |
commit | 76fdc8a85c630ee66902cbe8568d81fc116c1b3e (patch) | |
tree | 5c881e741fbeee407c05b39d90c1cab3f8ddfb3d /src/intel/vulkan/genX_pipeline.c | |
parent | d1c778b362d3ccf203f33095bee2af45dc8cde9a (diff) |
anv: Use a default pipeline cache if none is specified
If a client is dumb enough to not specify a pipeline cache, give it a
default. We have to create one anyway for blorp so we may as well let
the client cache shaders in it.
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/intel/vulkan/genX_pipeline.c')
-rw-r--r-- | src/intel/vulkan/genX_pipeline.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c index 197899fb2e3..3e9c4bbc21e 100644 --- a/src/intel/vulkan/genX_pipeline.c +++ b/src/intel/vulkan/genX_pipeline.c @@ -1694,6 +1694,10 @@ genX(graphics_pipeline_create)( assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO); + /* Use the default pipeline cache if none is specified */ + if (cache == NULL && device->instance->pipeline_cache_enabled) + cache = &device->default_pipeline_cache; + pipeline = vk_alloc2(&device->alloc, pAllocator, sizeof(*pipeline), 8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); if (pipeline == NULL) @@ -1778,6 +1782,10 @@ compute_pipeline_create( assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO); + /* Use the default pipeline cache if none is specified */ + if (cache == NULL && device->instance->pipeline_cache_enabled) + cache = &device->default_pipeline_cache; + pipeline = vk_alloc2(&device->alloc, pAllocator, sizeof(*pipeline), 8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); if (pipeline == NULL) |