From 30883adfb82f7ec9cf195370c32b606a4244010f Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 11 Jan 2016 10:33:12 -0800 Subject: [PATCH] nir/spirv: Get rid of a bunch of stage asserts Since we may have multiple entrypoints from different stages, we don't know what stage we are actually in so these asserts are invalid. --- src/glsl/nir/spirv/spirv_to_nir.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/glsl/nir/spirv/spirv_to_nir.c b/src/glsl/nir/spirv/spirv_to_nir.c index d72846f7197..26c2e58b9c3 100644 --- a/src/glsl/nir/spirv/spirv_to_nir.c +++ b/src/glsl/nir/spirv/spirv_to_nir.c @@ -866,21 +866,6 @@ set_mode_system_value(nir_variable_mode *mode) *mode = nir_var_system_value; } -static void -validate_per_vertex_mode(struct vtn_builder *b, nir_variable_mode mode) -{ - switch (b->shader->stage) { - case MESA_SHADER_VERTEX: - assert(mode == nir_var_shader_out); - break; - case MESA_SHADER_GEOMETRY: - assert(mode == nir_var_shader_out || mode == nir_var_shader_in); - break; - default: - assert(!"Invalid shader stage"); - } -} - static void vtn_get_builtin_location(struct vtn_builder *b, SpvBuiltIn builtin, int *location, @@ -889,15 +874,12 @@ vtn_get_builtin_location(struct vtn_builder *b, switch (builtin) { case SpvBuiltInPosition: *location = VARYING_SLOT_POS; - validate_per_vertex_mode(b, *mode); break; case SpvBuiltInPointSize: *location = VARYING_SLOT_PSIZ; - validate_per_vertex_mode(b, *mode); break; case SpvBuiltInClipDistance: *location = VARYING_SLOT_CLIP_DIST0; /* XXX CLIP_DIST1? */ - validate_per_vertex_mode(b, *mode); break; case SpvBuiltInCullDistance: /* XXX figure this out */ @@ -932,17 +914,14 @@ vtn_get_builtin_location(struct vtn_builder *b, unreachable("no tessellation support"); case SpvBuiltInFragCoord: *location = VARYING_SLOT_POS; - assert(b->shader->stage == MESA_SHADER_FRAGMENT); assert(*mode == nir_var_shader_in); break; case SpvBuiltInPointCoord: *location = VARYING_SLOT_PNTC; - assert(b->shader->stage == MESA_SHADER_FRAGMENT); assert(*mode == nir_var_shader_in); break; case SpvBuiltInFrontFacing: *location = VARYING_SLOT_FACE; - assert(b->shader->stage == MESA_SHADER_FRAGMENT); assert(*mode == nir_var_shader_in); break; case SpvBuiltInSampleId: @@ -959,7 +938,6 @@ vtn_get_builtin_location(struct vtn_builder *b, break; case SpvBuiltInFragDepth: *location = FRAG_RESULT_DEPTH; - assert(b->shader->stage == MESA_SHADER_FRAGMENT); assert(*mode == nir_var_shader_out); break; case SpvBuiltInNumWorkgroups: -- 2.30.2