<div dir="ltr"><div>I'm pretty sure we can actually just delete the finishme.  There are CTS tests that do multiple shaders per module and we pass them.<br></div>--Jason<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 4, 2016 at 8:34 AM, Robert Bragg <span dir="ltr"><<a href="mailto:robert@sixbynine.org" target="_blank">robert@sixbynine.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The heuristic expecting the entrypoint to be named 'main' was causing<br>
false warnings for modules with only a single shader that happen to use<br>
another name. We now count entrypoints before triggering this warning.<br>
<br>
Signed-off-by: Robert Bragg <<a href="mailto:robert@sixbynine.org">robert@sixbynine.org</a>><br>
---<br>
 src/compiler/spirv/spirv_to_<wbr>nir.c | 6 ++++++<br>
 src/compiler/spirv/vtn_<wbr>private.h  | 1 +<br>
 src/intel/vulkan/anv_pipeline.<wbr>c   | 4 ----<br>
 3 files changed, 7 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/compiler/spirv/spirv_to_<wbr>nir.c b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
index 9c5d331..6adeaa6 100644<br>
--- a/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
+++ b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
@@ -2507,6 +2507,8 @@ vtn_handle_preamble_<wbr>instruction(struct vtn_builder *b, SpvOp opcode,<br>
       unsigned name_words;<br>
       entry_point->name = vtn_string_literal(b, &w[3], count - 3, &name_words);<br>
<br>
+      b->n_entry_points++;<br>
+<br>
       if (strcmp(entry_point->name, b->entry_point_name) != 0 ||<br>
           stage_for_execution_model(w[1]<wbr>) != b->entry_point_stage)<br>
          break;<br>
@@ -2995,6 +2997,10 @@ spirv_to_nir(const uint32_t *words, size_t word_count,<br>
       return NULL;<br>
    }<br>
<br>
+   if (b->n_entry_points > 1) {<br>
+      vtn_warn("FINISHME: Multiple shaders per module not really supported");<br>
+   }<br>
+<br>
    b->shader = nir_shader_create(NULL, stage, options, NULL);<br>
<br>
    /* Set shader info defaults */<br>
diff --git a/src/compiler/spirv/vtn_<wbr>private.h b/src/compiler/spirv/vtn_<wbr>private.h<br>
index 6f34f09..5746898 100644<br>
--- a/src/compiler/spirv/vtn_<wbr>private.h<br>
+++ b/src/compiler/spirv/vtn_<wbr>private.h<br>
@@ -377,6 +377,7 @@ struct vtn_builder {<br>
    gl_shader_stage entry_point_stage;<br>
    const char *entry_point_name;<br>
    struct vtn_value *entry_point;<br>
+   int n_entry_points;<br>
    bool origin_upper_left;<br>
    bool pixel_center_integer;<br>
<br>
diff --git a/src/intel/vulkan/anv_<wbr>pipeline.c b/src/intel/vulkan/anv_<wbr>pipeline.c<br>
index 0aac711..9600cd3 100644<br>
--- a/src/intel/vulkan/anv_<wbr>pipeline.c<br>
+++ b/src/intel/vulkan/anv_<wbr>pipeline.c<br>
@@ -90,10 +90,6 @@ anv_shader_compile_to_nir(<wbr>struct anv_device *device,<br>
                           gl_shader_stage stage,<br>
                           const VkSpecializationInfo *spec_info)<br>
 {<br>
-   if (strcmp(entrypoint_name, "main") != 0) {<br>
-      anv_finishme("Multiple shaders per module not really supported");<br>
-   }<br>
-<br>
    const struct brw_compiler *compiler =<br>
       device->instance-><wbr>physicalDevice.compiler;<br>
    const nir_shader_compiler_options *nir_options =<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.10.1<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>