nir/spirv_to_nir: Use a minimum of 1 for GS invocations
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 15 Dec 2015 02:12:57 +0000 (18:12 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Tue, 15 Dec 2015 02:23:14 +0000 (18:23 -0800)
glslang is giving us 0, which causes the SIMD8 GS compile to hit an
assert.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
src/glsl/nir/spirv_to_nir.c

index e101e1edcb0c6fea6ec92228a8d693e58d1404f5..a8f3016e05026318a2203f39b7925a690258ddb9 100644 (file)
@@ -3075,7 +3075,7 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
 
       case SpvExecutionModeInvocations:
          assert(b->shader->stage == MESA_SHADER_GEOMETRY);
-         b->shader->info.gs.invocations = w[3];
+         b->shader->info.gs.invocations = MAX2(1, w[3]);
          break;
 
       case SpvExecutionModeDepthReplacing: