aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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) {