diff --git a/src/reader/spirv/parser.cc b/src/reader/spirv/parser.cc index bcbc19349e..0f71d997a0 100644 --- a/src/reader/spirv/parser.cc +++ b/src/reader/spirv/parser.cc @@ -45,6 +45,9 @@ Program Parse(const std::vector& input) { ProgramBuilder output; CloneContext(&output, &program_with_disjoint_ast, false).Clone(); auto program = Program(std::move(output)); + if (!program.IsValid()) { + return program; + } // If the generated program contains matrices with a custom MatrixStride // attribute then we need to decompose these into an array of vectors