nir/spirv: Set a default number of invocations for geometry shaders
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 30 Mar 2016 03:29:07 +0000 (20:29 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 30 Mar 2016 03:30:27 +0000 (20:30 -0700)
The SPIR-V spec says geometry shaders are supposed to have one invocation
by default.  The execution mode is only required if there are multiple
invocations.

src/compiler/nir/spirv/spirv_to_nir.c

index 663f41fa876f46c9bfc2797ba386d1969d05cfbb..948454494fa327407bb84b7c0b9dfd551ba0afe8 100644 (file)
@@ -2676,6 +2676,9 @@ spirv_to_nir(const uint32_t *words, size_t word_count,
 
    b->shader = nir_shader_create(NULL, stage, options);
 
+   /* Set shader info defaults */
+   b->shader->info.gs.invocations = 1;
+
    /* Parse execution modes */
    vtn_foreach_execution_mode(b, b->entry_point,
                               vtn_handle_execution_mode, NULL);