aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/builders/GrGLProgramBuilder.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-05-15 11:00:58 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-15 15:41:01 +0000
commite334c596546c7ec79f2b0e55b3a1c2839a94f352 (patch)
treee84c3c7209693de32ec8722d09d6e1bafbee74ad /src/gpu/gl/builders/GrGLProgramBuilder.cpp
parent63cef6b8c11b8f5d5584a13929e218f520a49669 (diff)
Attempt to work around iOS varying limit in GLPrograms test
Dump shaders when linking fails. Bug: skia:6627 Change-Id: I7f1df4be039eb56d990aa64c58c8dd2a22d97dbe Reviewed-on: https://skia-review.googlesource.com/16867 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/gl/builders/GrGLProgramBuilder.cpp')
-rw-r--r--src/gpu/gl/builders/GrGLProgramBuilder.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index 79cb2cab83..f63e56b7d1 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -19,7 +19,6 @@
#include "SkTraceEvent.h"
#include "gl/GrGLGpu.h"
#include "gl/GrGLProgram.h"
-#include "gl/GrGLSLPrettyPrint.h"
#include "gl/builders/GrGLShaderStringBuilder.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLGeometryProcessor.h"
@@ -158,7 +157,24 @@ GrGLProgram* GrGLProgramBuilder::finalize() {
checkLinked = true;
#endif
if (checkLinked) {
- checkLinkStatus(programID);
+ if (!this->checkLinkStatus(programID)) {
+ SkDebugf("VS:\n");
+ GrGLPrintShader(fGpu->glContext(), GR_GL_VERTEX_SHADER, fVS.fCompilerStrings.begin(),
+ fVS.fCompilerStringLengths.begin(), fVS.fCompilerStrings.count(),
+ settings);
+ if (primProc.willUseGeoShader()) {
+ SkDebugf("\nGS:\n");
+ GrGLPrintShader(fGpu->glContext(), GR_GL_GEOMETRY_SHADER,
+ fGS.fCompilerStrings.begin(), fGS.fCompilerStringLengths.begin(),
+ fGS.fCompilerStrings.count(), settings);
+ }
+ SkDebugf("\nFS:\n");
+ GrGLPrintShader(fGpu->glContext(), GR_GL_FRAGMENT_SHADER, fFS.fCompilerStrings.begin(),
+ fFS.fCompilerStringLengths.begin(), fFS.fCompilerStrings.count(),
+ settings);
+ SkDEBUGFAIL("");
+ return nullptr;
+ }
}
this->resolveProgramResourceLocations(programID);
@@ -197,6 +213,7 @@ bool GrGLProgramBuilder::checkLinkStatus(GrGLuint programID) {
GrGLint linked = GR_GL_INIT_ZERO;
GL_CALL(GetProgramiv(programID, GR_GL_LINK_STATUS, &linked));
if (!linked) {
+ SkDebugf("Program linking failed.\n");
GrGLint infoLen = GR_GL_INIT_ZERO;
GL_CALL(GetProgramiv(programID, GR_GL_INFO_LOG_LENGTH, &infoLen));
SkAutoMalloc log(sizeof(char)*(infoLen+1)); // outside if for debugger
@@ -210,7 +227,6 @@ bool GrGLProgramBuilder::checkLinkStatus(GrGLuint programID) {
(char*)log.get()));
SkDebugf("%s", (char*)log.get());
}
- SkDEBUGFAIL("Error linking program");
GL_CALL(DeleteProgram(programID));
programID = 0;
}