From b110445bb8ff753fa4db65d317413b795cec008d Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 30 Jan 2023 20:12:00 -0600 Subject: [PATCH] nvk: Return a VkResult from nvk_shader_upload() Part-of: --- src/nouveau/vulkan/nvk_compute_pipeline.c | 6 +++++- src/nouveau/vulkan/nvk_graphics_pipeline.c | 4 +++- src/nouveau/vulkan/nvk_shader.c | 4 +++- src/nouveau/vulkan/nvk_shader.h | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/nouveau/vulkan/nvk_compute_pipeline.c b/src/nouveau/vulkan/nvk_compute_pipeline.c index 0fc6b86e7f9..a8a053cebb2 100644 --- a/src/nouveau/vulkan/nvk_compute_pipeline.c +++ b/src/nouveau/vulkan/nvk_compute_pipeline.c @@ -108,7 +108,11 @@ nvk_compute_pipeline_create(struct nvk_device *device, if (result != VK_SUCCESS) goto fail; - nvk_shader_upload(device, &pipeline->base.shaders[MESA_SHADER_COMPUTE]); + result = nvk_shader_upload(device, + &pipeline->base.shaders[MESA_SHADER_COMPUTE]); + if (result != VK_SUCCESS) + goto fail; + gv100_compute_setup_launch_desc_template(pipeline->qmd_template, &pipeline->base.shaders[MESA_SHADER_COMPUTE]); *pPipeline = nvk_pipeline_to_handle(&pipeline->base); return VK_SUCCESS; diff --git a/src/nouveau/vulkan/nvk_graphics_pipeline.c b/src/nouveau/vulkan/nvk_graphics_pipeline.c index 4e4d89b1798..dc620ce32e6 100644 --- a/src/nouveau/vulkan/nvk_graphics_pipeline.c +++ b/src/nouveau/vulkan/nvk_graphics_pipeline.c @@ -239,7 +239,9 @@ nvk_graphics_pipeline_create(struct nvk_device *device, if (result != VK_SUCCESS) goto fail; - nvk_shader_upload(device, &pipeline->base.shaders[stage]); + result = nvk_shader_upload(device, &pipeline->base.shaders[stage]); + if (result != VK_SUCCESS) + goto fail; } struct nv_push push; diff --git a/src/nouveau/vulkan/nvk_shader.c b/src/nouveau/vulkan/nvk_shader.c index 514a0b1b68f..03539086a1f 100644 --- a/src/nouveau/vulkan/nvk_shader.c +++ b/src/nouveau/vulkan/nvk_shader.c @@ -711,7 +711,7 @@ nvk_compile_nir(struct nvk_physical_device *device, nir_shader *nir, return VK_SUCCESS; } -void +VkResult nvk_shader_upload(struct nvk_device *dev, struct nvk_shader *shader) { uint32_t hdr_size = 0; @@ -741,4 +741,6 @@ nvk_shader_upload(struct nvk_device *dev, struct nvk_shader *shader) if (debug_get_bool_option("NV50_PROG_DEBUG", false)) nvk_shader_dump(shader); #endif + + return VK_SUCCESS; } diff --git a/src/nouveau/vulkan/nvk_shader.h b/src/nouveau/vulkan/nvk_shader.h index b649dee5758..35c4584975b 100644 --- a/src/nouveau/vulkan/nvk_shader.h +++ b/src/nouveau/vulkan/nvk_shader.h @@ -102,6 +102,6 @@ VkResult nvk_compile_nir(struct nvk_physical_device *device, nir_shader *nir, struct nvk_shader *shader); -void +VkResult nvk_shader_upload(struct nvk_device *dev, struct nvk_shader *shader); #endif