Revert "Rename gl_SampleMask to sk_SampleMask"

This reverts commit 23716d42f7.

Reason for revert: red bots and GMs

Original change's description:
> Rename gl_SampleMask to sk_SampleMask
> 
> Change-Id: I3924c6f76edf310a984e4fd89478b00eeec69722
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249931
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

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

Change-Id: I74848e95972cf2c41cc28887e26214136ce79e08
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250180
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:28:36 +00:00 committed by Skia Commit-Bot
parent d9ddd07554
commit 40b815db97
7 changed files with 7 additions and 26 deletions

View File

@ -105,15 +105,15 @@ void GrGLSLFragmentShaderBuilder::maskOffMultisampleCoverage(
if (!fHasModifiedSampleMask) {
fHasModifiedSampleMask = true;
if (ScopeFlags::kTopLevel != scopeFlags) {
this->codePrependf("sk_SampleMask[0] = ~0;");
this->codePrependf("gl_SampleMask[0] = ~0;");
}
if (!(ScopeFlags::kInsideLoop & scopeFlags)) {
this->codeAppendf("sk_SampleMask[0] = (%s);", mask);
this->codeAppendf("gl_SampleMask[0] = (%s);", mask);
return;
}
}
this->codeAppendf("sk_SampleMask[0] &= (%s);", mask);
this->codeAppendf("gl_SampleMask[0] &= (%s);", mask);
}
void GrGLSLFragmentShaderBuilder::applyFnToMultisampleMask(

View File

@ -36,7 +36,6 @@
#define SK_HEIGHT_BUILTIN 10012
#define SK_FRAGCOORD_BUILTIN 15
#define SK_CLOCKWISE_BUILTIN 17
#define SK_SAMPLEMASK_BUILTIN 20
#define SK_VERTEXID_BUILTIN 42
#define SK_INSTANCEID_BUILTIN 43
#define SK_CLIPDISTANCE_BUILTIN 3

View File

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

View File

@ -377,12 +377,6 @@ public:
result->fRemovePowWithConstantExponent = true;
return result;
}
static sk_sp<GrShaderCaps> SampleMaskSupport() {
sk_sp<GrShaderCaps> result = Default();
result->fSampleVariablesSupport = true;
return result;
}
};
#endif

View File

@ -4,7 +4,6 @@ STRINGIFY(
layout(builtin=15) in float4 sk_FragCoord;
layout(builtin=3) float sk_ClipDistance[1];
layout(builtin=20) out int sk_SampleMask[1];
// 9999 is a temporary value that causes us to ignore these declarations beyond
// adding them to the symbol table. This works fine in GLSL (where they do not
@ -13,6 +12,8 @@ layout(builtin=20) out int sk_SampleMask[1];
layout(builtin=9999) float4 gl_LastFragData[1];
layout(builtin=9999) half4 gl_LastFragColor;
layout(builtin=9999) half4 gl_LastFragColorARM;
layout(builtin=9999) int gl_SampleMaskIn[1];
layout(builtin=9999) out int gl_SampleMask[1];
layout(builtin=9999) half4 gl_SecondaryFragColorEXT;
layout(builtin=10003) half4 sk_InColor;

View File

@ -6,12 +6,13 @@ STRINGIFY(
layout(builtin=15) in float4 sk_FragCoord;
layout(builtin=17) in bool sk_Clockwise; // Similar to gl_FrontFacing, but defined in device space.
layout(builtin=3) float sk_ClipDistance[1];
layout(builtin=20) out int sk_SampleMask[1];
// 9999 is a temporary value that causes us to ignore these declarations beyond
// adding them to the symbol table. This works fine in GLSL (where they do not
// require any further handling) but will fail in SPIR-V. We'll have a better
// solution for this soon.
layout(builtin=9999) int gl_SampleMaskIn[1];
layout(builtin=9999) out int gl_SampleMask[1];
layout(builtin=9999) out half4 gl_SecondaryFragColorEXT;
layout(location=0,index=0,builtin=10001) out half4 sk_FragColor;

View File

@ -1316,16 +1316,6 @@ DEF_TEST(SkSLClockwise, r) {
"}\n");
}
DEF_TEST(SkSLSampleMask, r) {
test(r,
"void main() { sk_SampleMask[0] |= 8; }",
*SkSL::ShaderCapsFactory::SampleMaskSupport(),
"#version 400\n"
"void main() {\n"
" gl_SampleMask[0] |= 8;\n"
"}\n");
}
DEF_TEST(SkSLVertexID, r) {
test(r,
"out int id; void main() { id = sk_VertexID; }",