Revert "Rename sampleVariablesSupport() to sampleMaskSupport()"

This reverts commit 766b4c9c21.

Reason for revert: GMs and bots

Original change's description:
> Rename sampleVariablesSupport() to sampleMaskSupport()
> 
> We have only implemented support for the sample mask. Renaming the cap
> to reflect that.
> 
> Change-Id: I10b5923c7464093187336016963a8ac51ebd54f5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249932
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>

TBR=egdaniel@google.com,csmartdalton@google.com,ethannicholas@google.com

Change-Id: I712169e86ee479bffd71d6665710f731d6c0e042
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250179
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2019-10-23 12:26:55 +00:00 committed by Skia Commit-Bot
parent 8e3e431dad
commit d9ddd07554
11 changed files with 26 additions and 26 deletions

View File

@ -262,8 +262,8 @@ DrawResult SampleLocationsGM::onDraw(
*errorMsg = "Requires support for sample locations.";
return DrawResult::kSkip;
}
if (!ctx->priv().caps()->shaderCaps()->sampleMaskSupport()) {
*errorMsg = "Requires support for sample mask.";
if (!ctx->priv().caps()->shaderCaps()->sampleVariablesSupport()) {
*errorMsg = "Requires support for sample variables.";
return DrawResult::kSkip;
}
if (rtc->numSamples() <= 1 && !ctx->priv().caps()->mixedSamplesSupport()) {

View File

@ -46,8 +46,8 @@ GrShaderCaps::GrShaderCaps(const GrContextOptions& options) {
fFlatInterpolationSupport = false;
fPreferFlatInterpolation = false;
fNoPerspectiveInterpolationSupport = false;
fSampleMaskSupport = false;
fSampleMaskStencilSupport = false;
fSampleVariablesSupport = false;
fSampleVariablesStencilSupport = false;
fExternalTextureSupport = false;
fVertexIDSupport = false;
fFPManipulationSupport = false;
@ -123,9 +123,9 @@ void GrShaderCaps::dumpJSON(SkJSONWriter* writer) const {
writer->appendBool("Flat interpolation support", fFlatInterpolationSupport);
writer->appendBool("Prefer flat interpolation", fPreferFlatInterpolation);
writer->appendBool("No perspective interpolation support", fNoPerspectiveInterpolationSupport);
writer->appendBool("Sample mask support", fSampleMaskSupport);
writer->appendBool("Sample mask stencil support [workaround]",
fSampleMaskStencilSupport);
writer->appendBool("Sample variables support", fSampleVariablesSupport);
writer->appendBool("Sample variables stencil support [workaround]",
fSampleVariablesStencilSupport);
writer->appendBool("External texture support", fExternalTextureSupport);
writer->appendBool("sk_VertexID support", fVertexIDSupport);
writer->appendBool("Floating point manipulation support", fFPManipulationSupport);

View File

@ -71,11 +71,11 @@ public:
bool noperspectiveInterpolationSupport() const { return fNoPerspectiveInterpolationSupport; }
// Can we use sample variables everywhere?
bool sampleMaskSupport() const { return fSampleMaskSupport; }
bool sampleVariablesSupport() const { return fSampleVariablesSupport; }
// Can we use sample variables when rendering to stencil? (This is a workaround for platforms
// where sample variables are broken in general, but seem to work when rendering to stencil.)
bool sampleMaskStencilSupport() const { return fSampleMaskStencilSupport; }
bool sampleVariablesStencilSupport() const { return fSampleVariablesStencilSupport; }
bool externalTextureSupport() const { return fExternalTextureSupport; }
@ -222,7 +222,7 @@ public:
}
const char* sampleVariablesExtensionString() const {
SkASSERT(this->sampleMaskSupport() || this->sampleMaskStencilSupport());
SkASSERT(this->sampleVariablesSupport() || this->sampleVariablesStencilSupport());
return fSampleVariablesExtensionString;
}
@ -250,8 +250,8 @@ private:
bool fFlatInterpolationSupport : 1;
bool fPreferFlatInterpolation : 1;
bool fNoPerspectiveInterpolationSupport : 1;
bool fSampleMaskSupport : 1;
bool fSampleMaskStencilSupport : 1;
bool fSampleVariablesSupport : 1;
bool fSampleVariablesStencilSupport : 1;
bool fExternalTextureSupport : 1;
bool fVertexIDSupport : 1;
bool fFPManipulationSupport : 1;

View File

@ -43,7 +43,7 @@ bool GrCoverageCountingPathRenderer::IsSupported(const GrCaps& caps, CoverageTyp
if (!caps.driverBlacklistMSAACCPR() &&
caps.internalMultisampleCount(defaultA8Format) > 1 &&
caps.sampleLocationsSupport() &&
shaderCaps.sampleMaskStencilSupport()) {
shaderCaps.sampleVariablesStencilSupport()) {
if (coverageType) {
*coverageType = CoverageType::kA8_Multisample;
}

View File

@ -839,23 +839,23 @@ void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli
} // Not sure for WebGL
if (GR_IS_GR_GL(standard)) {
shaderCaps->fSampleMaskSupport = ctxInfo.glslGeneration() >= k400_GrGLSLGeneration;
shaderCaps->fSampleVariablesSupport = ctxInfo.glslGeneration() >= k400_GrGLSLGeneration;
} else if (GR_IS_GR_GL_ES(standard)) {
if (ctxInfo.glslGeneration() >= k320es_GrGLSLGeneration) {
shaderCaps->fSampleMaskSupport = true;
shaderCaps->fSampleVariablesSupport = true;
} else if (ctxInfo.hasExtension("GL_OES_sample_variables")) {
shaderCaps->fSampleMaskSupport = true;
shaderCaps->fSampleVariablesSupport = true;
shaderCaps->fSampleVariablesExtensionString = "GL_OES_sample_variables";
}
}
shaderCaps->fSampleMaskStencilSupport = shaderCaps->fSampleMaskSupport;
shaderCaps->fSampleVariablesStencilSupport = shaderCaps->fSampleVariablesSupport;
if (kQualcomm_GrGLVendor == ctxInfo.vendor() || kATI_GrGLVendor == ctxInfo.vendor()) {
// FIXME: The sample mask round rect op draws nothing on several Adreno and Radeon bots.
// Other ops that use sample mask while rendering to stencil seem to work fine. Temporarily
// disable sample mask on color buffers while we investigate.
// http://skbug.com/8921
shaderCaps->fSampleMaskSupport = false;
shaderCaps->fSampleVariablesSupport = false;
}
shaderCaps->fVersionDeclString = get_glsl_version_decl_string(standard,

View File

@ -94,7 +94,7 @@ const char* GrGLSLFragmentShaderBuilder::sampleOffsets() {
void GrGLSLFragmentShaderBuilder::maskOffMultisampleCoverage(
const char* mask, ScopeFlags scopeFlags) {
const GrShaderCaps& shaderCaps = *fProgramBuilder->shaderCaps();
if (!shaderCaps.sampleMaskSupport() && !shaderCaps.sampleMaskStencilSupport()) {
if (!shaderCaps.sampleVariablesSupport() && !shaderCaps.sampleVariablesStencilSupport()) {
SkDEBUGFAIL("Attempted to mask sample coverage without support.");
return;
}

View File

@ -34,8 +34,8 @@ public:
fShaderCaps->fMaxFragmentSamplers = options.fMaxFragmentSamplers;
fShaderCaps->fShaderDerivativeSupport = options.fShaderDerivativeSupport;
fShaderCaps->fDualSourceBlendingSupport = options.fDualSourceBlendingSupport;
fShaderCaps->fSampleMaskSupport = true;
fShaderCaps->fSampleMaskStencilSupport = true;
fShaderCaps->fSampleVariablesSupport = true;
fShaderCaps->fSampleVariablesStencilSupport = true;
this->applyOptionsOverrides(contextOptions);
}

View File

@ -47,7 +47,7 @@ std::unique_ptr<GrFillRRectOp> GrFillRRectOp::Make(
}
} else {
if (GrAAType::kMSAA == aaType) {
if (!caps.sampleLocationsSupport() || !caps.shaderCaps()->sampleMaskSupport()) {
if (!caps.sampleLocationsSupport() || !caps.shaderCaps()->sampleVariablesSupport()) {
return nullptr;
}
}

View File

@ -797,7 +797,7 @@ void GLSLCodeGenerator::writeVariableReference(const VariableReference& ref) {
this->write(fProgram.fSettings.fFlipY ? "(!gl_FrontFacing)" : "gl_FrontFacing");
break;
case SK_SAMPLEMASK_BUILTIN:
SkASSERT(fProgram.fSettings.fCaps->sampleMaskSupport());
SkASSERT(fProgram.fSettings.fCaps->sampleVariablesSupport());
this->write("gl_SampleMask");
break;
case SK_VERTEXID_BUILTIN:

View File

@ -126,7 +126,7 @@ static void fill_caps(const SKSL_CAPS_CLASS& caps,
CAP(fbFetchNeedsCustomOutput);
CAP(flatInterpolationSupport);
CAP(noperspectiveInterpolationSupport);
CAP(sampleMaskSupport);
CAP(sampleVariablesSupport);
CAP(externalTextureSupport);
CAP(mustEnableAdvBlendEqs);
CAP(mustEnableSpecificAdvBlendEqs);

View File

@ -96,7 +96,7 @@ public:
return true;
}
bool sampleMaskSupport() const {
bool sampleVariablesSupport() const {
return true;
}
@ -380,7 +380,7 @@ public:
static sk_sp<GrShaderCaps> SampleMaskSupport() {
sk_sp<GrShaderCaps> result = Default();
result->fSampleMaskSupport = true;
result->fSampleVariablesSupport = true;
return result;
}
};