aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-06-22 12:31:31 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-22 12:31:32 -0700
commitc1f56b518218d1caa65d6b7101bebf0d28c02a92 (patch)
tree94f644bf6201616b4f3b31356ef7b34c7903603a /src
parentefbffedd68636e94d4379e84a2585bce80f6fb8f (diff)
fix for calling bindFragDataLocation on OpenGL 2.1
Diffstat (limited to 'src')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp5
-rw-r--r--src/gpu/gl/GrGLCaps.h3
-rw-r--r--src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp4
3 files changed, 9 insertions, 3 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index c7dc862864..b23619d8b6 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -47,6 +47,7 @@ GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions,
fUseNonVBOVertexAndIndexDynamicData = false;
fIsCoreProfile = false;
fFullClearIsFree = false;
+ fBindFragDataLocationSupport = false;
fReadPixelsSupportedCache.reset();
@@ -270,6 +271,10 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
fMultisampleDisableSupport = false;
}
+ if (kGL_GrGLStandard == standard && version >= GR_GL_VER(3, 0)) {
+ fBindFragDataLocationSupport = true;
+ }
+
/**************************************************************************
* GrShaderCaps fields
**************************************************************************/
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 1f5d6c2650..3d3319968f 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -257,6 +257,8 @@ public:
bool fullClearIsFree() const { return fFullClearIsFree; }
+ bool bindFragDataLocationSupport() const { return fBindFragDataLocationSupport; }
+
/**
* Returns a string containing the caps info.
*/
@@ -367,6 +369,7 @@ private:
bool fUseNonVBOVertexAndIndexDynamicData : 1;
bool fIsCoreProfile : 1;
bool fFullClearIsFree : 1;
+ bool fBindFragDataLocationSupport : 1;
struct ReadPixelsSupportedFormat {
GrGLenum fFormat;
diff --git a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
index e6c07c2cdb..557cdbfa58 100644
--- a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
@@ -264,9 +264,7 @@ bool GrGLFragmentShaderBuilder::compileAndAttachShaders(GrGLuint programId,
}
void GrGLFragmentShaderBuilder::bindFragmentShaderLocations(GrGLuint programID) {
- // ES 3.00 requires custom color output but doesn't support bindFragDataLocation
- if (fHasCustomColorOutput &&
- kGLES_GrGLStandard != fProgramBuilder->gpu()->ctxInfo().standard()) {
+ if (fHasCustomColorOutput && fProgramBuilder->gpu()->glCaps().bindFragDataLocationSupport()) {
GL_CALL(BindFragDataLocation(programID, 0, declared_color_output_name()));
}
if (fHasSecondaryOutput) {