summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2022-03-14 12:26:15 -0400
committerMarge Bot <emma+marge@anholt.net>2022-03-16 04:46:06 +0000
commitb7fbaf924d8d9742390ab3cbc362d87849612aa4 (patch)
tree804b10cacf9d059c0b1fb061faa3a8ffb844f594
parent9bce87849089ede5f2de7f2e8dff219650cabcc8 (diff)
lavapipe: EXT_pipeline_creation_cache_control
again, technically passing is still passing Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15379>
-rw-r--r--src/gallium/frontends/lavapipe/lvp_device.c7
-rw-r--r--src/gallium/frontends/lavapipe/lvp_pipeline.c35
-rw-r--r--src/gallium/frontends/lavapipe/lvp_pipeline_cache.c1
3 files changed, 32 insertions, 11 deletions
diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c
index 95965bc7c7f..91ed60d37b6 100644
--- a/src/gallium/frontends/lavapipe/lvp_device.c
+++ b/src/gallium/frontends/lavapipe/lvp_device.c
@@ -145,6 +145,7 @@ static const struct vk_device_extension_table lvp_device_extensions_supported =
.EXT_index_type_uint8 = true,
.EXT_multi_draw = true,
.EXT_pipeline_creation_feedback = true,
+ .EXT_pipeline_creation_cache_control = true,
.EXT_post_depth_coverage = true,
.EXT_private_data = true,
.EXT_primitive_topology_list_restart = true,
@@ -694,6 +695,12 @@ VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceFeatures2(
features->privateData = true;
break;
}
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: {
+ VkPhysicalDevicePipelineCreationCacheControlFeatures *features =
+ (VkPhysicalDevicePipelineCreationCacheControlFeatures *)ext;
+ features->pipelineCreationCacheControl = true;
+ break;
+ }
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: {
VkPhysicalDeviceLineRasterizationFeaturesEXT *features =
(VkPhysicalDeviceLineRasterizationFeaturesEXT *)ext;
diff --git a/src/gallium/frontends/lavapipe/lvp_pipeline.c b/src/gallium/frontends/lavapipe/lvp_pipeline.c
index 91375d4b11a..a183561d671 100644
--- a/src/gallium/frontends/lavapipe/lvp_pipeline.c
+++ b/src/gallium/frontends/lavapipe/lvp_pipeline.c
@@ -1118,16 +1118,23 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateGraphicsPipelines(
unsigned i = 0;
for (; i < count; i++) {
- VkResult r;
- r = lvp_graphics_pipeline_create(_device,
- pipelineCache,
- &pCreateInfos[i],
- pAllocator, &pPipelines[i]);
+ VkResult r = VK_PIPELINE_COMPILE_REQUIRED;
+ if (!(pCreateInfos[i].flags & VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT))
+ r = lvp_graphics_pipeline_create(_device,
+ pipelineCache,
+ &pCreateInfos[i],
+ pAllocator, &pPipelines[i]);
if (r != VK_SUCCESS) {
result = r;
pPipelines[i] = VK_NULL_HANDLE;
+ if (pCreateInfos[i].flags & VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT)
+ break;
}
}
+ if (result != VK_SUCCESS) {
+ for (; i < count; i++)
+ pPipelines[i] = VK_NULL_HANDLE;
+ }
return result;
}
@@ -1217,16 +1224,24 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateComputePipelines(
unsigned i = 0;
for (; i < count; i++) {
- VkResult r;
- r = lvp_compute_pipeline_create(_device,
- pipelineCache,
- &pCreateInfos[i],
- pAllocator, &pPipelines[i]);
+ VkResult r = VK_PIPELINE_COMPILE_REQUIRED;
+ if (!(pCreateInfos[i].flags & VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT))
+ r = lvp_compute_pipeline_create(_device,
+ pipelineCache,
+ &pCreateInfos[i],
+ pAllocator, &pPipelines[i]);
if (r != VK_SUCCESS) {
result = r;
pPipelines[i] = VK_NULL_HANDLE;
+ if (pCreateInfos[i].flags & VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT)
+ break;
}
}
+ if (result != VK_SUCCESS) {
+ for (; i < count; i++)
+ pPipelines[i] = VK_NULL_HANDLE;
+ }
+
return result;
}
diff --git a/src/gallium/frontends/lavapipe/lvp_pipeline_cache.c b/src/gallium/frontends/lavapipe/lvp_pipeline_cache.c
index 4fff7eaf401..6e578724eb4 100644
--- a/src/gallium/frontends/lavapipe/lvp_pipeline_cache.c
+++ b/src/gallium/frontends/lavapipe/lvp_pipeline_cache.c
@@ -33,7 +33,6 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreatePipelineCache(
struct lvp_pipeline_cache *cache;
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO);
- assert(pCreateInfo->flags == 0);
cache = vk_alloc2(&device->vk.alloc, pAllocator,
sizeof(*cache), 8,