The heuristic expecting the entrypoint to be named 'main' was causing false warnings for modules with only a single shader that happen to use another name. We now count entrypoints before triggering this warning.
Signed-off-by: Robert Bragg <[email protected]> --- src/compiler/spirv/spirv_to_nir.c | 6 ++++++ src/compiler/spirv/vtn_private.h | 1 + src/intel/vulkan/anv_pipeline.c | 4 ---- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 9c5d331..6adeaa6 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -2507,6 +2507,8 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode, unsigned name_words; entry_point->name = vtn_string_literal(b, &w[3], count - 3, &name_words); + b->n_entry_points++; + if (strcmp(entry_point->name, b->entry_point_name) != 0 || stage_for_execution_model(w[1]) != b->entry_point_stage) break; @@ -2995,6 +2997,10 @@ spirv_to_nir(const uint32_t *words, size_t word_count, return NULL; } + if (b->n_entry_points > 1) { + vtn_warn("FINISHME: Multiple shaders per module not really supported"); + } + b->shader = nir_shader_create(NULL, stage, options, NULL); /* Set shader info defaults */ diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h index 6f34f09..5746898 100644 --- a/src/compiler/spirv/vtn_private.h +++ b/src/compiler/spirv/vtn_private.h @@ -377,6 +377,7 @@ struct vtn_builder { gl_shader_stage entry_point_stage; const char *entry_point_name; struct vtn_value *entry_point; + int n_entry_points; bool origin_upper_left; bool pixel_center_integer; diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 0aac711..9600cd3 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -90,10 +90,6 @@ anv_shader_compile_to_nir(struct anv_device *device, gl_shader_stage stage, const VkSpecializationInfo *spec_info) { - if (strcmp(entrypoint_name, "main") != 0) { - anv_finishme("Multiple shaders per module not really supported"); - } - const struct brw_compiler *compiler = device->instance->physicalDevice.compiler; const nir_shader_compiler_options *nir_options = -- 2.10.1 _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
