spirv/nir: Add more stage asserts
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 22 Oct 2015 01:00:05 +0000 (18:00 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 22 Oct 2015 01:00:05 +0000 (18:00 -0700)
src/glsl/nir/spirv_to_nir.c

index 74de2e855d1ed034348515113542467f5c53fdfd..c9133f741c65a56ef3c4faef2d36f309274d9736 100644 (file)
@@ -2470,6 +2470,7 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
          break;
 
       case SpvExecutionModeEarlyFragmentTests:
+         assert(b->shader->stage == MESA_SHADER_FRAGMENT);
          b->shader->info.fs.early_fragment_tests = true;
          break;
 
@@ -2479,15 +2480,19 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
          break;
 
       case SpvExecutionModeDepthReplacing:
+         assert(b->shader->stage == MESA_SHADER_FRAGMENT);
          b->shader->info.fs.depth_layout = FRAG_DEPTH_LAYOUT_ANY;
          break;
       case SpvExecutionModeDepthGreater:
+         assert(b->shader->stage == MESA_SHADER_FRAGMENT);
          b->shader->info.fs.depth_layout = FRAG_DEPTH_LAYOUT_GREATER;
          break;
       case SpvExecutionModeDepthLess:
+         assert(b->shader->stage == MESA_SHADER_FRAGMENT);
          b->shader->info.fs.depth_layout = FRAG_DEPTH_LAYOUT_LESS;
          break;
       case SpvExecutionModeDepthUnchanged:
+         assert(b->shader->stage == MESA_SHADER_FRAGMENT);
          b->shader->info.fs.depth_layout = FRAG_DEPTH_LAYOUT_UNCHANGED;
          break;