1 /* 2 * Copyright 2024 Google LLC 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef SKSL_SPIRVVALIDATOR 9 #define SKSL_SPIRVVALIDATOR 10 11 #include <string_view> 12 13 namespace SkSL { 14 15 class ErrorReporter; 16 17 // SPIRV issues will cause an SkDEBUGFAILF to be triggered with the error message 18 // and false will be returned (i.e. invalid SPIRV is a fatal issue in debug builds). 19 bool ValidateSPIRV(ErrorReporter&, std::string_view); 20 21 // SPIRV issues will be sent to the provided ErrorReporter along with a disassembly 22 // of the code. This will also return false, but not be fatal in debug builds. 23 bool ValidateSPIRVAndDissassemble(ErrorReporter&, std::string_view); 24 25 } // namespace SkSL 26 27 #endif 28