aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar rmistry <rmistry@google.com>2014-10-17 05:14:28 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-17 05:14:28 -0700
commit79b2b1fb12202d22411b607a095cb26c6e4fe8b7 (patch)
tree423995795f6a85d0b91d12ca375c9c384303d9c6 /src/gpu
parent4ce01d606da7e08199c4c4d72781043bb77d38ec (diff)
Revert of Support GLSL es 3.00 (patchset #5 id:80001 of https://codereview.chromium.org/659443007/)
Reason for revert: Trying to fix DEPS roll failure: https://codereview.chromium.org/660113002/ Link to failing builds: http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/29578 http://build.chromium.org/p/tryserver.blink/builders/linux_blink_dbg/builds/29354 Original issue's description: > Support GLSL es 3.00 > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/62372bcc6abe3537dac98dd9b9172cf3b85afa2b TBR=bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/661603009
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp6
-rw-r--r--src/gpu/gl/GrGLContext.cpp10
-rw-r--r--src/gpu/gl/GrGLSL.cpp24
-rw-r--r--src/gpu/gl/GrGLSL.h8
-rw-r--r--src/gpu/gl/GrGLShaderVar.h3
-rw-r--r--src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp13
6 files changed, 13 insertions, 51 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index b4cfad354a..2fe38479de 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -199,10 +199,9 @@ bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
// can change based on which render target is bound
fTwoFormatLimit = kGLES_GrGLStandard == standard;
- // Frag Coords Convention support is not part of ES
// Known issue on at least some Intel platforms:
// http://code.google.com/p/skia/issues/detail?id=946
- if (kIntel_GrGLVendor != ctxInfo.vendor() && kGLES_GrGLStandard != standard) {
+ if (kIntel_GrGLVendor != ctxInfo.vendor()) {
fFragCoordsConventionSupport = ctxInfo.glslGeneration() >= k150_GrGLSLGeneration ||
ctxInfo.hasExtension("GL_ARB_fragment_coord_conventions");
}
@@ -369,8 +368,7 @@ bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
fGeometryShaderSupport = ctxInfo.version() >= GR_GL_VER(3,2) &&
ctxInfo.glslGeneration() >= k150_GrGLSLGeneration;
} else {
- fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0) ||
- ctxInfo.hasExtension("GL_OES_standard_derivatives");
+ fShaderDerivativeSupport = ctxInfo.hasExtension("GL_OES_standard_derivatives");
}
if (GrGLCaps::kES_IMG_MsToTexture_MSFBOType == fMSFBOType) {
diff --git a/src/gpu/gl/GrGLContext.cpp b/src/gpu/gl/GrGLContext.cpp
index fc8b195fd3..537363493f 100644
--- a/src/gpu/gl/GrGLContext.cpp
+++ b/src/gpu/gl/GrGLContext.cpp
@@ -47,16 +47,6 @@ bool GrGLContextInfo::initialize(const GrGLInterface* interface) {
fVendor = GrGLGetVendor(interface);
- /*
- * Qualcomm drivers have a horrendous bug with some drivers. Though they claim to
- * support GLES 3.00, some perfectly valid GLSL300 shaders will only compile with
- * #version 100, and will fail to compile with #version 300 es. In the long term, we
- * need to lock this down to a specific driver version.
- */
- if (kQualcomm_GrGLVendor == fVendor) {
- fGLSLGeneration = k110_GrGLSLGeneration;
- }
-
fRenderer = GrGLGetRendererFromString(renderer);
fIsMesa = GrGLIsMesaFromVersionString(ver);
diff --git a/src/gpu/gl/GrGLSL.cpp b/src/gpu/gl/GrGLSL.cpp
index 34c805e21f..866a0d13d3 100644
--- a/src/gpu/gl/GrGLSL.cpp
+++ b/src/gpu/gl/GrGLSL.cpp
@@ -18,9 +18,7 @@ bool GrGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation)
switch (gl->fStandard) {
case kGL_GrGLStandard:
SkASSERT(ver >= GR_GLSL_VER(1,10));
- if (ver >= GR_GLSL_VER(3,30)) {
- *generation = k330_GrGLSLGeneration;
- } else if (ver >= GR_GLSL_VER(1,50)) {
+ if (ver >= GR_GLSL_VER(1,50)) {
*generation = k150_GrGLSLGeneration;
} else if (ver >= GR_GLSL_VER(1,40)) {
*generation = k140_GrGLSLGeneration;
@@ -31,15 +29,9 @@ bool GrGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation)
}
return true;
case kGLES_GrGLStandard:
+ // version 1.00 of ES GLSL based on ver 1.20 of desktop GLSL
SkASSERT(ver >= GR_GL_VER(1,00));
- if (ver >= GR_GLSL_VER(3,1)) {
- *generation = k310es_GrGLSLGeneration;
- }
- else if (ver >= GR_GLSL_VER(3,0)) {
- *generation = k330_GrGLSLGeneration;
- } else {
- *generation = k110_GrGLSLGeneration;
- }
+ *generation = k110_GrGLSLGeneration;
return true;
default:
SkFAIL("Unknown GL Standard");
@@ -71,16 +63,6 @@ const char* GrGetGLSLVersionDecl(const GrGLContextInfo& info) {
} else {
return "#version 150 compatibility\n";
}
- case k330_GrGLSLGeneration:
- if (kGLES_GrGLStandard == info.standard()) {
- return "#version 300 es\n";
- } else {
- SkASSERT(kGL_GrGLStandard == info.standard());
- return "#version 330 compatibility\n";
- }
- case k310es_GrGLSLGeneration:
- SkASSERT(kGLES_GrGLStandard == info.standard());
- return "#version 310 es\n";
default:
SkFAIL("Unknown GL version.");
return ""; // suppress warning
diff --git a/src/gpu/gl/GrGLSL.h b/src/gpu/gl/GrGLSL.h
index b031a40a61..3cbce9c546 100644
--- a/src/gpu/gl/GrGLSL.h
+++ b/src/gpu/gl/GrGLSL.h
@@ -35,14 +35,6 @@ enum GrGLSLGeneration {
* Desktop GLSL 1.50
*/
k150_GrGLSLGeneration,
- /**
- * Desktop GLSL 3.30, and ES GLSL 3.00
- */
- k330_GrGLSLGeneration,
- /**
- * ES GLSL 3.10 only TODO Make GLSLCap objects to make this more granular
- */
- k310es_GrGLSLGeneration,
};
/**
diff --git a/src/gpu/gl/GrGLShaderVar.h b/src/gpu/gl/GrGLShaderVar.h
index c7514f55bc..8e7e36e232 100644
--- a/src/gpu/gl/GrGLShaderVar.h
+++ b/src/gpu/gl/GrGLShaderVar.h
@@ -159,7 +159,8 @@ public:
out->append("layout(origin_upper_left) ");
}
if (this->getTypeModifier() != kNone_TypeModifier) {
- out->append(TypeModifierString(this->getTypeModifier(), ctxInfo.glslGeneration()));
+ out->append(TypeModifierString(this->getTypeModifier(),
+ ctxInfo.glslGeneration()));
out->append(" ");
}
out->append(PrecisionString(fPrecision, ctxInfo.standard()));
diff --git a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
index 5d5741ef9b..488d07b8db 100644
--- a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
@@ -42,7 +42,8 @@ static void append_default_precision_qualifier(GrGLShaderVar::Precision p,
}
GrGLFragmentShaderBuilder::DstReadKey
-GrGLFragmentShaderBuilder::KeyForDstRead(const GrTexture* dstCopy, const GrGLCaps& caps) {
+GrGLFragmentShaderBuilder::KeyForDstRead(const GrTexture* dstCopy,
+ const GrGLCaps& caps) {
uint32_t key = kYesDstRead_DstReadKeyBit;
if (caps.fbFetchSupport()) {
return key;
@@ -60,7 +61,8 @@ GrGLFragmentShaderBuilder::KeyForDstRead(const GrTexture* dstCopy, const GrGLCap
}
GrGLFragmentShaderBuilder::FragPosKey
-GrGLFragmentShaderBuilder::KeyForFragmentPosition(const GrRenderTarget* dst, const GrGLCaps&) {
+GrGLFragmentShaderBuilder::KeyForFragmentPosition(const GrRenderTarget* dst,
+ const GrGLCaps&) {
if (kTopLeft_GrSurfaceOrigin == dst->origin()) {
return kTopLeftFragPosRead_FragPosKey;
} else {
@@ -86,8 +88,7 @@ bool GrGLFragmentShaderBuilder::enableFeature(GLSLFeature feature) {
if (!gpu->glCaps().shaderDerivativeSupport()) {
return false;
}
- if (kGLES_GrGLStandard == gpu->glStandard() &&
- k110_GrGLSLGeneration == gpu->glslGeneration()) {
+ if (kGLES_GrGLStandard == gpu->glStandard()) {
this->addFeature(1 << kStandardDerivatives_GLSLFeature,
"GL_OES_standard_derivatives");
}
@@ -325,9 +326,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) {
GL_CALL(BindFragDataLocation(programID, 0, declared_color_output_name()));
}
if (fHasSecondaryOutput) {