diff options
author | benjaminwagner <benjaminwagner@google.com> | 2016-02-12 15:20:55 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-12 15:20:55 -0800 |
commit | 1751dc74f95a409fdb8cdc5c4efae20b1c39509a (patch) | |
tree | 62983890f134f6d020a5e67cb07677758438cb94 /src | |
parent | deabdb5b9712de9e3c6bbb9aa68ec2f20df80a8e (diff) |
Revert of Add infastructure for gl_SampleMask (patchset #6 id:100001 of https://codereview.chromium.org/1690963003/ )
Reason for revert:
Several bots failing with error 'invalid profile "es" for version 320'.
Original issue's description:
> Add infastructure for gl_SampleMask
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1690963003
>
> Committed: https://skia.googlesource.com/skia/+/533cefe5b9c7cec2592fc7ca00ee4cf69a26c094
TBR=egdaniel@google.com,bsalomon@google.com,cdalton@nvidia.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1693113002
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 26 | ||||
-rwxr-xr-x | src/gpu/gl/GrGLGLSL.cpp | 11 | ||||
-rw-r--r-- | src/gpu/glsl/GrGLSL.cpp | 2 | ||||
-rw-r--r-- | src/gpu/glsl/GrGLSL.h | 8 | ||||
-rwxr-xr-x | src/gpu/glsl/GrGLSLCaps.cpp | 6 | ||||
-rwxr-xr-x | src/gpu/glsl/GrGLSLCaps.h | 12 | ||||
-rw-r--r-- | src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp | 35 | ||||
-rw-r--r-- | src/gpu/glsl/GrGLSLFragmentShaderBuilder.h | 4 | ||||
-rw-r--r-- | src/gpu/glsl/GrGLSLShaderBuilder.cpp | 10 | ||||
-rw-r--r-- | src/gpu/glsl/GrGLSLShaderBuilder.h | 5 |
10 files changed, 17 insertions, 102 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 8d207eb00d..6dc5ee8c4f 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -553,19 +553,9 @@ const char* get_glsl_version_decl_string(GrGLStandard standard, GrGLSLGeneration return "#version 330 compatibility\n"; } } - case k400_GrGLSLGeneration: - SkASSERT(kGL_GrGLStandard == standard); - if (isCoreProfile) { - return "#version 400\n"; - } else { - return "#version 400 compatibility\n"; - } case k310es_GrGLSLGeneration: SkASSERT(kGLES_GrGLStandard == standard); return "#version 310 es\n"; - case k320es_GrGLSLGeneration: - SkASSERT(kGLES_GrGLStandard == standard); - return "#version 320 es\n"; } return "<no version>"; } @@ -607,22 +597,6 @@ void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo) { glslCaps->fBindlessTextureSupport = ctxInfo.hasExtension("GL_NV_bindless_texture"); if (kGL_GrGLStandard == standard) { - glslCaps->fSampleVariablesSupport = ctxInfo.glslGeneration() >= k400_GrGLSLGeneration; - } else { - if (ctxInfo.glslGeneration() >= k320es_GrGLSLGeneration) { - glslCaps->fSampleVariablesSupport = true; - } else if (ctxInfo.hasExtension("GL_OES_sample_variables")) { - glslCaps->fSampleVariablesSupport = true; - glslCaps->fSampleVariablesExtensionString = "GL_OES_sample_variables"; - } - } - - if (glslCaps->fSampleVariablesSupport) { - glslCaps->fSampleMaskOverrideCoverageSupport = - ctxInfo.hasExtension("GL_NV_sample_mask_override_coverage"); - } - - if (kGL_GrGLStandard == standard) { glslCaps->fFlatInterpolationSupport = ctxInfo.glslGeneration() >= k130_GrGLSLGeneration; } else { glslCaps->fFlatInterpolationSupport = diff --git a/src/gpu/gl/GrGLGLSL.cpp b/src/gpu/gl/GrGLGLSL.cpp index 4aaa6f87d6..98a2386161 100755 --- a/src/gpu/gl/GrGLGLSL.cpp +++ b/src/gpu/gl/GrGLGLSL.cpp @@ -19,9 +19,7 @@ bool GrGLGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation switch (gl->fStandard) { case kGL_GrGLStandard: SkASSERT(ver >= GR_GLSL_VER(1,10)); - if (ver >= GR_GLSL_VER(4,00)) { - *generation = k400_GrGLSLGeneration; - } else if (ver >= GR_GLSL_VER(3,30)) { + if (ver >= GR_GLSL_VER(3,30)) { *generation = k330_GrGLSLGeneration; } else if (ver >= GR_GLSL_VER(1,50)) { *generation = k150_GrGLSLGeneration; @@ -35,11 +33,10 @@ bool GrGLGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation return true; case kGLES_GrGLStandard: SkASSERT(ver >= GR_GL_VER(1,00)); - if (ver >= GR_GLSL_VER(3,2)) { - *generation = k320es_GrGLSLGeneration; - } else if (ver >= GR_GLSL_VER(3,1)) { + if (ver >= GR_GLSL_VER(3,1)) { *generation = k310es_GrGLSLGeneration; - } else if (ver >= GR_GLSL_VER(3,0)) { + } + else if (ver >= GR_GLSL_VER(3,0)) { *generation = k330_GrGLSLGeneration; } else { *generation = k110_GrGLSLGeneration; diff --git a/src/gpu/glsl/GrGLSL.cpp b/src/gpu/glsl/GrGLSL.cpp index bec4784db2..2de81ddd60 100644 --- a/src/gpu/glsl/GrGLSL.cpp +++ b/src/gpu/glsl/GrGLSL.cpp @@ -17,9 +17,7 @@ bool GrGLSLSupportsNamedFragmentShaderOutputs(GrGLSLGeneration gen) { case k140_GrGLSLGeneration: case k150_GrGLSLGeneration: case k330_GrGLSLGeneration: - case k400_GrGLSLGeneration: case k310es_GrGLSLGeneration: - case k320es_GrGLSLGeneration: return true; } return false; diff --git a/src/gpu/glsl/GrGLSL.h b/src/gpu/glsl/GrGLSL.h index b13113a289..6fc8f83c7a 100644 --- a/src/gpu/glsl/GrGLSL.h +++ b/src/gpu/glsl/GrGLSL.h @@ -37,17 +37,9 @@ enum GrGLSLGeneration { */ k330_GrGLSLGeneration, /** - * Desktop GLSL 4.00 - */ - k400_GrGLSLGeneration, - /** * ES GLSL 3.10 only TODO Make GLSLCap objects to make this more granular */ k310es_GrGLSLGeneration, - /** - * ES GLSL 3.20 - */ - k320es_GrGLSLGeneration, }; bool GrGLSLSupportsNamedFragmentShaderOutputs(GrGLSLGeneration); diff --git a/src/gpu/glsl/GrGLSLCaps.cpp b/src/gpu/glsl/GrGLSLCaps.cpp index 7116f5deb0..ba99be57e2 100755 --- a/src/gpu/glsl/GrGLSLCaps.cpp +++ b/src/gpu/glsl/GrGLSLCaps.cpp @@ -23,13 +23,10 @@ GrGLSLCaps::GrGLSLCaps(const GrContextOptions& options) { fCanUseAnyFunctionInShader = true; fCanUseMinAndAbsTogether = true; fMustForceNegatedAtanParamToFloat = false; - fSampleVariablesSupport = false; - fSampleMaskOverrideCoverageSupport = false; fFlatInterpolationSupport = false; fNoPerspectiveInterpolationSupport = false; fVersionDeclString = nullptr; fShaderDerivativeExtensionString = nullptr; - fSampleVariablesExtensionString = nullptr; fFragCoordConventionsExtensionString = nullptr; fSecondaryOutputExtensionString = nullptr; fExternalTextureExtensionString = nullptr; @@ -64,9 +61,6 @@ SkString GrGLSLCaps::dump() const { r.appendf("Can use min() and abs() together: %s\n", (fCanUseMinAndAbsTogether ? "YES" : "NO")); r.appendf("Must force negated atan param to float: %s\n", (fMustForceNegatedAtanParamToFloat ? "YES" : "NO")); - r.appendf("Sample variables support: %s\n", (fSampleVariablesSupport ? "YES" : "NO")); - r.appendf("Sample mask override coverage support: %s\n", (fSampleMaskOverrideCoverageSupport ? - "YES" : "NO")); r.appendf("Flat interpolation support: %s\n", (fFlatInterpolationSupport ? "YES" : "NO")); r.appendf("No perspective interpolation support: %s\n", (fNoPerspectiveInterpolationSupport ? "YES" : "NO")); diff --git a/src/gpu/glsl/GrGLSLCaps.h b/src/gpu/glsl/GrGLSLCaps.h index ee0fbff4b9..2f87f66850 100755 --- a/src/gpu/glsl/GrGLSLCaps.h +++ b/src/gpu/glsl/GrGLSLCaps.h @@ -54,10 +54,6 @@ public: bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; } - bool sampleVariablesSupport() const { return fSampleVariablesSupport; } - - bool sampleMaskOverrideCoverageSupport() const { return fSampleMaskOverrideCoverageSupport; } - bool flatInterpolationSupport() const { return fFlatInterpolationSupport; } bool noperspectiveInterpolationSupport() const { return fNoPerspectiveInterpolationSupport; } @@ -92,11 +88,6 @@ public: SkASSERT(this->shaderDerivativeSupport()); return fShaderDerivativeExtensionString; } - - const char* sampleVariablesExtensionString() const { - SkASSERT(this->sampleVariablesSupport()); - return fSampleVariablesExtensionString; - } // Returns the string of an extension that will do all necessary coord transfomations needed // when reading the fragment position. If such an extension does not exisits, this function @@ -155,8 +146,6 @@ private: bool fBindlessTextureSupport : 1; bool fUsesPrecisionModifiers : 1; bool fCanUseAnyFunctionInShader : 1; - bool fSampleVariablesSupport : 1; - bool fSampleMaskOverrideCoverageSupport : 1; bool fFlatInterpolationSupport : 1; bool fNoPerspectiveInterpolationSupport : 1; @@ -167,7 +156,6 @@ private: const char* fVersionDeclString; const char* fShaderDerivativeExtensionString; - const char* fSampleVariablesExtensionString; const char* fFragCoordConventionsExtensionString; const char* fSecondaryOutputExtensionString; const char* fExternalTextureExtensionString; diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp index 903b03af95..8651827841 100644 --- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp +++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp @@ -77,46 +77,25 @@ GrGLSLFragmentShaderBuilder::GrGLSLFragmentShaderBuilder(GrGLSLProgramBuilder* p } bool GrGLSLFragmentShaderBuilder::enableFeature(GLSLFeature feature) { - const GrGLSLCaps& glslCaps = *fProgramBuilder->glslCaps(); switch (feature) { - case kStandardDerivatives_GLSLFeature: - if (!glslCaps.shaderDerivativeSupport()) { + case kStandardDerivatives_GLSLFeature: { + if (!fProgramBuilder->glslCaps()->shaderDerivativeSupport()) { return false; } - if (const char* extension = glslCaps.shaderDerivativeExtensionString()) { + const char* extension = fProgramBuilder->glslCaps()->shaderDerivativeExtensionString(); + if (extension) { this->addFeature(1 << kStandardDerivatives_GLSLFeature, extension); } return true; - case kPixelLocalStorage_GLSLFeature: + } + case kPixelLocalStorage_GLSLFeature: { if (fProgramBuilder->glslCaps()->pixelLocalStorageSize() <= 0) { return false; } this->addFeature(1 << kPixelLocalStorage_GLSLFeature, "GL_EXT_shader_pixel_local_storage"); return true; - case kSampleVariables_GLSLFeature: - if (!glslCaps.sampleVariablesSupport()) { - return false; - } - if (const char* extension = glslCaps.sampleVariablesExtensionString()) { - this->addFeature(1 << kSampleVariables_GLSLFeature, extension); - } - return true; - case kSampleMaskOverrideCoverage_GLSLFeature: - if (!glslCaps.sampleMaskOverrideCoverageSupport()) { - return false; - } - if (!this->enableFeature(kSampleVariables_GLSLFeature)) { - return false; - } - if (this->addFeature(1 << kSampleMaskOverrideCoverage_GLSLFeature, - "GL_NV_sample_mask_override_coverage")) { - // Redeclare gl_SampleMask with layout(override_coverage) if we haven't already. - fOutputs.push_back().set(kInt_GrSLType, GrShaderVar::kOut_TypeModifier, - "gl_SampleMask", 1, kHigh_GrSLPrecision, - "override_coverage"); - } - return true; + } default: SkFAIL("Unexpected GLSLFeature requested."); return false; diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h index d8ff148cab..a437a194ca 100644 --- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h +++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h @@ -33,9 +33,7 @@ public: */ enum GLSLFeature { kStandardDerivatives_GLSLFeature = kLastGLSLPrivateFeature + 1, - kPixelLocalStorage_GLSLFeature, - kSampleVariables_GLSLFeature, - kSampleMaskOverrideCoverage_GLSLFeature + kPixelLocalStorage_GLSLFeature }; /** diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.cpp b/src/gpu/glsl/GrGLSLShaderBuilder.cpp index 30bf86d210..c94a85534f 100644 --- a/src/gpu/glsl/GrGLSLShaderBuilder.cpp +++ b/src/gpu/glsl/GrGLSLShaderBuilder.cpp @@ -112,13 +112,11 @@ void GrGLSLShaderBuilder::appendTextureLookupAndModulate(const char* modulation, this->codeAppend((GrGLSLExpr4(modulation) * GrGLSLExpr4(lookup)).c_str()); } -bool GrGLSLShaderBuilder::addFeature(uint32_t featureBit, const char* extensionName) { - if (featureBit & fFeaturesAddedMask) { - return false; +void GrGLSLShaderBuilder::addFeature(uint32_t featureBit, const char* extensionName) { + if (!(featureBit & fFeaturesAddedMask)) { + this->extensions().appendf("#extension %s: require\n", extensionName); + fFeaturesAddedMask |= featureBit; } - this->extensions().appendf("#extension %s: require\n", extensionName); - fFeaturesAddedMask |= featureBit; - return true; } void GrGLSLShaderBuilder::appendDecls(const VarArray& vars, SkString* out) const { diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.h b/src/gpu/glsl/GrGLSLShaderBuilder.h index 4ec78243a9..bc3b4ca717 100644 --- a/src/gpu/glsl/GrGLSLShaderBuilder.h +++ b/src/gpu/glsl/GrGLSLShaderBuilder.h @@ -151,17 +151,14 @@ protected: kBlendFuncExtended_GLSLPrivateFeature, kExternalTexture_GLSLPrivateFeature, kFramebufferFetch_GLSLPrivateFeature, - kSampleMaskOverrideCoverage_GLSLPrivateFeature, kNoPerspectiveInterpolation_GLSLPrivateFeature, kLastGLSLPrivateFeature = kNoPerspectiveInterpolation_GLSLPrivateFeature }; /* * A general function which enables an extension in a shader if the feature bit is not present - * - * @return true if the feature bit was not yet present, false otherwise. */ - bool addFeature(uint32_t featureBit, const char* extensionName); + void addFeature(uint32_t featureBit, const char* extensionName); enum InterfaceQualifier { kOut_InterfaceQualifier, |