Revert "Rename gl_SampleMask to sk_SampleMask"
This reverts commit 23716d42f730c62b3e198310a5cc1b324f6de4e1.
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>
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
index 7402464..85dc827 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
@@ -105,15 +105,15 @@
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(
diff --git a/src/sksl/SkSLCompiler.h b/src/sksl/SkSLCompiler.h
index 8bc010d..7ef368d 100644
--- a/src/sksl/SkSLCompiler.h
+++ b/src/sksl/SkSLCompiler.h
@@ -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
diff --git a/src/sksl/SkSLGLSLCodeGenerator.cpp b/src/sksl/SkSLGLSLCodeGenerator.cpp
index 573510c..df7c0b0 100644
--- a/src/sksl/SkSLGLSLCodeGenerator.cpp
+++ b/src/sksl/SkSLGLSLCodeGenerator.cpp
@@ -796,10 +796,6 @@
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;
diff --git a/src/sksl/SkSLUtil.h b/src/sksl/SkSLUtil.h
index da8c101..60057b6 100644
--- a/src/sksl/SkSLUtil.h
+++ b/src/sksl/SkSLUtil.h
@@ -377,12 +377,6 @@
result->fRemovePowWithConstantExponent = true;
return result;
}
-
- static sk_sp<GrShaderCaps> SampleMaskSupport() {
- sk_sp<GrShaderCaps> result = Default();
- result->fSampleVariablesSupport = true;
- return result;
- }
};
#endif
diff --git a/src/sksl/sksl_fp.inc b/src/sksl/sksl_fp.inc
index 645ec76..0608230 100644
--- a/src/sksl/sksl_fp.inc
+++ b/src/sksl/sksl_fp.inc
@@ -4,7 +4,6 @@
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=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;
diff --git a/src/sksl/sksl_frag.inc b/src/sksl/sksl_frag.inc
index 72b4177..5bc5f55 100644
--- a/src/sksl/sksl_frag.inc
+++ b/src/sksl/sksl_frag.inc
@@ -6,12 +6,13 @@
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;