Module: Mesa
Branch: main
Commit: 057133927b4e777af9cd1625ac4fc0ce7f7be51a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=057133927b4e777af9cd1625ac4fc0ce7f7be51a

Author: Thomas H.P. Andersen <pho...@gmail.com>
Date:   Fri Oct  6 20:15:21 2023 +0200

nvk: VK_EXT_pipeline_creation_cache_control

dEQP-VK.pipeline.monolithic.creation_cache_control.*

Test run totals:
  Passed:        16/18 (88.9%)
  Failed:        0/18 (0.0%)
  Not supported: 2/18 (11.1%)
  Warnings:      0/18 (0.0%)
  Waived:        0/18 (0.0%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25550>

---

 src/nouveau/vulkan/nvk_compute_pipeline.c  | 6 ++++++
 src/nouveau/vulkan/nvk_graphics_pipeline.c | 6 ++++++
 src/nouveau/vulkan/nvk_physical_device.c   | 2 ++
 3 files changed, 14 insertions(+)

diff --git a/src/nouveau/vulkan/nvk_compute_pipeline.c 
b/src/nouveau/vulkan/nvk_compute_pipeline.c
index e9567fc3773..b901b8bcb96 100644
--- a/src/nouveau/vulkan/nvk_compute_pipeline.c
+++ b/src/nouveau/vulkan/nvk_compute_pipeline.c
@@ -198,6 +198,12 @@ nvk_compute_pipeline_create(struct nvk_device *dev,
    }
 
    if (!cache_obj) {
+      if (pCreateInfo->flags &
+          VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT) {
+         result = VK_PIPELINE_COMPILE_REQUIRED;
+         goto fail;
+      }
+
       nir_shader *nir;
       result = nvk_shader_stage_to_nir(dev, &pCreateInfo->stage, &robustness,
                                        cache, NULL, &nir);
diff --git a/src/nouveau/vulkan/nvk_graphics_pipeline.c 
b/src/nouveau/vulkan/nvk_graphics_pipeline.c
index a1c2b77ddf9..a3911e4eab3 100644
--- a/src/nouveau/vulkan/nvk_graphics_pipeline.c
+++ b/src/nouveau/vulkan/nvk_graphics_pipeline.c
@@ -243,6 +243,12 @@ nvk_graphics_pipeline_create(struct nvk_device *dev,
             pipeline_feedback.flags |=
                
VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT;
       }
+
+      if (!cache_objs[stage] &&
+          pCreateInfo->flags & 
VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT) {
+         result = VK_PIPELINE_COMPILE_REQUIRED;
+         goto fail;
+      }
    }
 
    for (gl_shader_stage stage = 0; stage < MESA_SHADER_STAGES; stage++) {
diff --git a/src/nouveau/vulkan/nvk_physical_device.c 
b/src/nouveau/vulkan/nvk_physical_device.c
index 273d782a066..0a520a0777c 100644
--- a/src/nouveau/vulkan/nvk_physical_device.c
+++ b/src/nouveau/vulkan/nvk_physical_device.c
@@ -174,6 +174,7 @@ nvk_get_device_extensions(const struct nvk_instance 
*instance,
       .EXT_mutable_descriptor_type = true,
       .EXT_non_seamless_cube_map = true,
       .EXT_pci_bus_info = info->type == NV_DEVICE_TYPE_DIS,
+      .EXT_pipeline_creation_cache_control = true,
       .EXT_pipeline_creation_feedback = true,
       .EXT_physical_device_drm = true,
       .EXT_primitive_topology_list_restart = true,
@@ -325,6 +326,7 @@ nvk_get_device_features(const struct nv_device_info *info,
       .robustImageAccess = true,
       .inlineUniformBlock = true,
       .descriptorBindingInlineUniformBlockUpdateAfterBind = true,
+      .pipelineCreationCacheControl = true,
       .privateData = true,
       .shaderDemoteToHelperInvocation = true,
       .shaderTerminateInvocation = true,

Reply via email to