radeonsi: turn an assertion into return in si_nir_store_output_tcs
authorMarek Olšák <marek.olsak@amd.com>
Sat, 18 Jan 2020 00:55:13 +0000 (19:55 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 20 Jan 2020 20:40:13 +0000 (15:40 -0500)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/gallium/drivers/radeonsi/si_shader_llvm_tess.c

index e809f287ff58030d40886f5e1d41fa711aea4792..cd0f136e95278bfe440bb56b4dcd2da30fbe6459 100644 (file)
@@ -593,9 +593,11 @@ static void si_nir_store_output_tcs(struct ac_shader_abi *abi,
                              var->data.location == VARYING_SLOT_TESS_LEVEL_INNER ||
                              var->data.location == VARYING_SLOT_TESS_LEVEL_OUTER;
 
-       assert((name == TGSI_SEMANTIC_PATCH ||
-               name == TGSI_SEMANTIC_TESSINNER ||
-               name == TGSI_SEMANTIC_TESSOUTER) == is_patch);
+       /* Invalid SPIR-V can cause this. */
+       if ((name == TGSI_SEMANTIC_PATCH ||
+            name == TGSI_SEMANTIC_TESSINNER ||
+            name == TGSI_SEMANTIC_TESSOUTER) != is_patch)
+               return;
 
        if (!is_patch) {
                stride = get_tcs_out_vertex_dw_stride(ctx);