From: Jason Ekstrand Date: Mon, 11 Jan 2016 18:54:26 +0000 (-0800) Subject: anv/pipeline: Only delete functions for SPIR-V shaders X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b8ec48ee76adda4b643fb153507ac72942ecbe26;p=mesa.git anv/pipeline: Only delete functions for SPIR-V shaders We can assume that direct NIR shaders only have one entrypoint --- diff --git a/src/vulkan/anv_pipeline.c b/src/vulkan/anv_pipeline.c index 53c7d1f8b74..9054d76892d 100644 --- a/src/vulkan/anv_pipeline.c +++ b/src/vulkan/anv_pipeline.c @@ -125,6 +125,14 @@ anv_shader_compile_to_nir(struct anv_device *device, nir_inline_functions(nir); nir_validate_shader(nir); + /* Pick off the single entrypoint that we want */ + foreach_list_typed_safe(nir_function, func, node, &nir->functions) { + if (func != entry_point) + exec_node_remove(&func->node); + } + assert(exec_list_length(&nir->functions) == 1); + entry_point->name = ralloc_strdup(entry_point, "main"); + nir_lower_system_values(nir); nir_validate_shader(nir); } @@ -132,13 +140,6 @@ anv_shader_compile_to_nir(struct anv_device *device, /* Vulkan uses the separate-shader linking model */ nir->info.separate_shader = true; - /* Pick off the single entrypoint that we want */ - foreach_list_typed_safe(nir_function, func, node, &nir->functions) { - if (func != entry_point) - exec_node_remove(&func->node); - } - assert(exec_list_length(&nir->functions) == 1); - nir = brw_preprocess_nir(nir, compiler->scalar_stage[stage]); nir_shader_gather_info(nir, entry_point->impl);