From: Mike Blumenkrantz Date: Mon, 6 Mar 2023 19:16:56 +0000 (-0500) Subject: lavapipe: split out spirv compile of shaders X-Git-Tag: upstream/23.3.3~11924 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2af3476639ee7406968b27d12066af9d7aa97bf6;p=platform%2Fupstream%2Fmesa.git lavapipe: split out spirv compile of shaders Reviewed-by: Dave Airlie Part-of: --- diff --git a/src/gallium/frontends/lavapipe/lvp_pipeline.c b/src/gallium/frontends/lavapipe/lvp_pipeline.c index 1288223..aa45d27 100644 --- a/src/gallium/frontends/lavapipe/lvp_pipeline.c +++ b/src/gallium/frontends/lavapipe/lvp_pipeline.c @@ -355,14 +355,11 @@ lvp_shader_optimize(nir_shader *nir) } static VkResult -lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline, - const VkPipelineShaderStageCreateInfo *sinfo) +compile_spirv(struct lvp_device *pdevice, const VkPipelineShaderStageCreateInfo *sinfo, nir_shader **nir) { - struct lvp_device *pdevice = pipeline->device; gl_shader_stage stage = vk_to_mesa_shader_stage(sinfo->stage); assert(stage <= MESA_SHADER_COMPUTE && stage != MESA_SHADER_NONE); VkResult result; - nir_shader *nir; const struct spirv_to_nir_options spirv_options = { .environment = NIR_SPIRV_VULKAN, @@ -417,7 +414,19 @@ lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline, result = vk_pipeline_shader_stage_to_nir(&pdevice->vk, sinfo, &spirv_options, pdevice->physical_device->drv_options[stage], - NULL, &nir); + NULL, nir); + return result; +} + +static VkResult +lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline, + const VkPipelineShaderStageCreateInfo *sinfo) +{ + struct lvp_device *pdevice = pipeline->device; + gl_shader_stage stage = vk_to_mesa_shader_stage(sinfo->stage); + assert(stage <= MESA_SHADER_COMPUTE && stage != MESA_SHADER_NONE); + nir_shader *nir; + VkResult result = compile_spirv(pdevice, sinfo, &nir); if (result != VK_SUCCESS) return result;