Add an AssertOnShaderCompileFailure GrContextOption
Part of a multi-step plan:
1) Add this option (which is *not* GL specific).
2) Disable this in Chromium at context-creation.
3) Finish adding the shader error handler, with default
behavior controlled via this flag, and remove Chromium
driver checks from the corresponding code at the same time.
Change-Id: I7e50c8404a05c1f291f187cf48481d0cbb34066a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211646
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index ddd3525..d7ac7e4 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -91,11 +91,13 @@
SkTDArray<GrGLuint>* shaderIds,
const SkSL::Program::Inputs& inputs) {
GrGLGpu* gpu = this->gpu();
+ bool assertOnCompileFailure = gpu->getContext()->priv().options().fAssertOnShaderCompileFailure;
GrGLuint shaderId = GrGLCompileAndAttachShader(gpu->glContext(),
programId,
type,
glsl,
- gpu->stats());
+ gpu->stats(),
+ assertOnCompileFailure);
if (!shaderId) {
return false;
}