aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-10-01 06:28:11 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-10-01 06:28:11 -0700
commit7bdd70ab9162980f3173c98c48234f9f345665a3 (patch)
treeac07ed63f43f43f6cd7f2c9d25574c18dd02b804 /src/gpu/gl
parent7b60c2cd1af1f5834a32fc7f68b2ce1e70d12613 (diff)
Fix for 2056
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp3
-rw-r--r--src/gpu/gl/GrGLCaps.h3
-rw-r--r--src/gpu/gl/builders/GrGLProgramBuilder.cpp3
3 files changed, 7 insertions, 2 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index b97022f2d7..c9703b16f8 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -304,6 +304,8 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
}
}
+ fBindUniformLocationSupport = ctxInfo.hasExtension("GL_CHROMIUM_bind_uniform_location");
+
#ifdef SK_BUILD_FOR_WIN
// We're assuming that on Windows Chromium we're using ANGLE.
bool isANGLE = kANGLE_GrGLDriver == ctxInfo.driver() ||
@@ -1113,6 +1115,7 @@ SkString GrGLCaps::dump() const {
r.appendf("SRGB write contol: %s\n", (fSRGBWriteControl ? "YES" : "NO"));
r.appendf("RGBA 8888 pixel ops are slow: %s\n", (fRGBA8888PixelsOpsAreSlow ? "YES" : "NO"));
r.appendf("Partial FBO read is slow: %s\n", (fPartialFBOReadIsSlow ? "YES" : "NO"));
+ r.appendf("Bind uniform location support: %s\n", (fBindUniformLocationSupport ? "YES" : "NO"));
return r;
}
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 80a3577db3..105549fc4e 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -236,6 +236,8 @@ public:
bool bindFragDataLocationSupport() const { return fBindFragDataLocationSupport; }
+ bool bindUniformLocationSupport() const { return fBindUniformLocationSupport; }
+
/**
* Is there support for enabling/disabling sRGB writes for sRGB-capable color attachments?
* If false this does not mean sRGB is not supported but rather that if it is supported
@@ -360,6 +362,7 @@ private:
bool fSRGBWriteControl : 1;
bool fRGBA8888PixelsOpsAreSlow : 1;
bool fPartialFBOReadIsSlow : 1;
+ bool fBindUniformLocationSupport : 1;
struct ReadPixelsSupportedFormat {
GrGLenum fFormat;
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index 491c34b79b..c410523a9b 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -421,8 +421,7 @@ GrGLProgram* GrGLProgramBuilder::finalize() {
}
void GrGLProgramBuilder::bindProgramResourceLocations(GrGLuint programID) {
- bool usingBindUniform = fGpu->glInterface()->fFunctions.fBindUniformLocation != nullptr;
- if (usingBindUniform) {
+ if (fGpu->glCaps().bindUniformLocationSupport()) {
int count = fUniforms.count();
for (int i = 0; i < count; ++i) {
GL_CALL(BindUniformLocation(programID, i, fUniforms[i].fVariable.c_str()));