Add early_fragment_tests layout qualifier to SkSL

Bug: skia:11356
Change-Id: I16322e6396dc7e7c8c50ba1d39e07311cf3bd346
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376116
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This commit is contained in:
Brian Osman 2021-02-25 15:30:46 -05:00 committed by Skia Commit-Bot
parent db8340f15f
commit dc4f8cd7ea
10 changed files with 77 additions and 65 deletions

View File

@ -1,6 +1,7 @@
layout (
origin_upper_left,
override_coverage,
early_fragment_tests,
push_constant,
blend_support_all_equations,
tracked,
@ -21,6 +22,7 @@ layout (
origin_upper_left,
override_coverage,
early_fragment_tests,
push_constant,
blend_support_all_equations,
tracked,

View File

@ -95,6 +95,7 @@ void Parser::InitLayoutMap() {
TOKEN(INPUT_ATTACHMENT_INDEX, "input_attachment_index");
TOKEN(ORIGIN_UPPER_LEFT, "origin_upper_left");
TOKEN(OVERRIDE_COVERAGE, "override_coverage");
TOKEN(EARLY_FRAGMENT_TESTS, "early_fragment_tests");
TOKEN(BLEND_SUPPORT_ALL_EQUATIONS, "blend_support_all_equations");
TOKEN(PUSH_CONSTANT, "push_constant");
TOKEN(POINTS, "points");
@ -914,6 +915,9 @@ Layout Parser::layout() {
case LayoutToken::OVERRIDE_COVERAGE:
setFlag(Layout::kOverrideCoverage_Flag);
break;
case LayoutToken::EARLY_FRAGMENT_TESTS:
setFlag(Layout::kEarlyFragmentTests_Flag);
break;
case LayoutToken::PUSH_CONSTANT:
setFlag(Layout::kPushConstant_Flag);
break;

View File

@ -38,6 +38,7 @@ public:
INPUT_ATTACHMENT_INDEX,
ORIGIN_UPPER_LEFT,
OVERRIDE_COVERAGE,
EARLY_FRAGMENT_TESTS,
BLEND_SUPPORT_ALL_EQUATIONS,
PUSH_CONSTANT,
POINTS,

View File

@ -35,39 +35,39 @@ static uint8_t SKSL_INCLUDE_sksl_fp[] = {77,1,
15,2,0,17,0,
46,3,0,
30,
29,0,16,0,0,255,255,255,255,255,15,0,255,255,255,255,30,0,30,0,0,2,31,0,
29,0,32,0,0,255,255,255,255,255,15,0,255,255,255,255,30,0,30,0,0,2,31,0,
43,4,0,44,0,0,
0,5,0,
43,6,0,51,0,1,
46,7,0,
30,
29,0,16,0,0,255,255,255,255,255,20,0,255,255,255,255,30,0,30,0,0,4,55,0,
29,0,32,0,0,255,255,255,255,255,20,0,255,255,255,255,30,0,30,0,0,4,55,0,
40,5,0,0,
0,8,0,
40,4,0,1,
46,9,0,
30,
29,0,16,0,0,255,255,255,255,255,15,39,255,255,255,255,30,0,30,0,0,0,69,0,
29,0,32,0,0,255,255,255,255,255,15,39,255,255,255,255,30,0,30,0,0,0,69,0,
40,8,0,0,
46,10,0,
30,
29,0,16,0,0,255,255,255,255,255,15,39,255,255,255,255,30,0,30,0,0,0,85,0,
29,0,32,0,0,255,255,255,255,255,15,39,255,255,255,255,30,0,30,0,0,0,85,0,
43,11,0,102,0,0,
46,12,0,
30,
29,0,16,0,0,255,255,255,255,255,15,39,255,255,255,255,30,0,30,0,0,0,108,0,
29,0,32,0,0,255,255,255,255,255,15,39,255,255,255,255,30,0,30,0,0,0,108,0,
40,11,0,0,
46,13,0,
30,
29,0,16,0,0,255,255,255,255,255,15,39,255,255,255,255,30,0,30,0,0,0,128,0,
29,0,32,0,0,255,255,255,255,255,15,39,255,255,255,255,30,0,30,0,0,0,128,0,
40,11,0,0,
46,14,0,
30,
29,0,16,0,0,255,255,255,255,255,27,39,255,255,255,255,30,0,30,0,0,0,153,0,
29,0,32,0,0,255,255,255,255,255,27,39,255,255,255,255,30,0,30,0,0,0,153,0,
43,15,0,162,0,0,
46,16,0,
30,
29,0,16,0,0,255,255,255,255,255,28,39,255,255,255,255,30,0,30,0,0,0,167,0,
29,0,32,0,0,255,255,255,255,255,28,39,255,255,255,255,30,0,30,0,0,0,167,0,
40,15,0,0,
46,17,0,
9,177,0,

View File

@ -16,37 +16,37 @@ static uint8_t SKSL_INCLUDE_sksl_frag[] = {142,0,
42,9,0,
46,1,0,
30,
29,0,16,0,0,255,255,255,255,255,15,0,255,255,255,255,2,0,2,0,0,2,3,0,
29,0,32,0,0,255,255,255,255,255,15,0,255,255,255,255,2,0,2,0,0,2,3,0,
43,2,0,16,0,0,
46,3,0,
30,
29,0,16,0,0,255,255,255,255,255,17,0,255,255,255,255,2,0,2,0,0,2,23,0,
29,0,32,0,0,255,255,255,255,255,17,0,255,255,255,255,2,0,2,0,0,2,23,0,
43,4,0,36,0,0,
0,5,0,
43,6,0,41,0,1,
46,7,0,
30,
29,0,16,0,0,255,255,255,255,255,20,0,255,255,255,255,2,0,2,0,0,4,45,0,
29,0,32,0,0,255,255,255,255,255,20,0,255,255,255,255,2,0,2,0,0,4,45,0,
40,5,0,0,
46,8,0,
30,
29,0,16,0,0,255,255,255,255,255,15,39,255,255,255,255,2,0,2,0,0,4,59,0,
29,0,32,0,0,255,255,255,255,255,15,39,255,255,255,255,2,0,2,0,0,4,59,0,
43,9,0,84,0,0,
46,10,0,
30,
29,128,20,0,0,0,255,255,0,255,17,39,255,255,255,255,2,0,2,0,0,4,90,0,
29,0,41,0,0,0,255,255,0,255,17,39,255,255,255,255,2,0,2,0,0,4,90,0,
40,9,0,0,
46,11,0,
30,
29,0,16,0,0,255,255,255,255,255,24,39,255,255,255,255,2,0,2,0,0,0,103,0,
29,0,32,0,0,255,255,255,255,255,24,39,255,255,255,255,2,0,2,0,0,0,103,0,
40,9,0,0,
46,12,0,
30,
29,0,16,0,0,255,255,255,255,255,27,39,255,255,255,255,2,0,2,0,0,0,120,0,
29,0,32,0,0,255,255,255,255,255,27,39,255,255,255,255,2,0,2,0,0,0,120,0,
43,13,0,129,0,0,
46,14,0,
30,
29,0,16,0,0,255,255,255,255,255,28,39,255,255,255,255,2,0,2,0,0,0,134,0,
29,0,32,0,0,255,255,255,255,255,28,39,255,255,255,255,2,0,2,0,0,0,134,0,
40,13,0,0,8,0,
4,0,
1,0,

View File

@ -16,26 +16,26 @@ static uint8_t SKSL_INCLUDE_sksl_geom[] = {134,0,
42,12,0,
37,1,0,2,0,2,
30,
29,0,16,0,0,255,255,255,255,255,0,0,255,255,255,255,15,0,15,0,0,0,16,0,
29,0,32,0,0,255,255,255,255,255,0,0,255,255,255,255,15,0,15,0,0,0,16,0,
43,2,0,28,0,
30,
29,0,16,0,0,255,255,255,255,255,1,0,255,255,255,255,15,0,15,0,0,0,35,0,
29,0,32,0,0,255,255,255,255,255,1,0,255,255,255,255,15,0,15,0,0,0,35,0,
43,3,0,48,0,
46,4,0,
30,
29,0,16,0,0,255,255,255,255,255,18,39,255,255,255,255,15,0,15,0,0,2,54,0,
29,0,32,0,0,255,255,255,255,255,18,39,255,255,255,255,15,0,15,0,0,2,54,0,
0,5,0,
40,1,0,255,0,
37,6,0,2,0,2,
30,
29,0,16,0,0,255,255,255,255,255,0,0,255,255,255,255,15,0,15,0,0,0,16,0,
29,0,32,0,0,255,255,255,255,255,0,0,255,255,255,255,15,0,15,0,0,0,16,0,
40,2,0,
30,
29,0,16,0,0,255,255,255,255,255,1,0,255,255,255,255,15,0,15,0,0,0,35,0,
29,0,32,0,0,255,255,255,255,255,1,0,255,255,255,255,15,0,15,0,0,0,35,0,
40,3,0,
46,7,0,
30,
29,0,16,0,0,255,255,255,255,255,23,39,255,255,255,255,15,0,15,0,0,4,2,0,
29,0,32,0,0,255,255,255,255,255,23,39,255,255,255,255,15,0,15,0,0,4,2,0,
40,6,0,0,
17,7,0,0,
17,7,0,1,

View File

@ -13,7 +13,7 @@ static uint8_t SKSL_INCLUDE_sksl_runtime[] = {88,0,
42,11,0,
46,1,0,
30,
29,0,16,0,0,255,255,255,255,255,15,0,255,255,255,255,2,0,2,0,0,0,3,0,
29,0,32,0,0,255,255,255,255,255,15,0,255,255,255,255,2,0,2,0,0,0,3,0,
43,2,0,16,0,0,
46,3,0,
9,23,0,

View File

@ -11,10 +11,10 @@ static uint8_t SKSL_INCLUDE_sksl_vert[] = {82,0,
42,6,0,
37,1,0,2,0,2,
30,
29,0,16,0,0,255,255,255,255,255,0,0,255,255,255,255,15,0,15,0,0,0,16,0,
29,0,32,0,0,255,255,255,255,255,0,0,255,255,255,255,15,0,15,0,0,0,16,0,
43,2,0,28,0,
30,
29,0,16,0,0,255,255,255,255,255,1,0,255,255,255,255,15,0,15,0,0,0,35,0,
29,0,32,0,0,255,255,255,255,255,1,0,255,255,255,255,15,0,15,0,0,0,35,0,
43,3,0,48,0,
46,4,0,
30,
@ -24,11 +24,11 @@ static uint8_t SKSL_INCLUDE_sksl_vert[] = {82,0,
17,4,0,1,
46,5,0,
30,
29,0,16,0,0,255,255,255,255,255,42,0,255,255,255,255,15,0,15,0,0,2,54,0,
29,0,32,0,0,255,255,255,255,255,42,0,255,255,255,255,15,0,15,0,0,2,54,0,
43,6,0,66,0,0,
46,7,0,
30,
29,0,16,0,0,255,255,255,255,255,43,0,255,255,255,255,15,0,15,0,0,2,70,0,
29,0,32,0,0,255,255,255,255,255,43,0,255,255,255,255,15,0,15,0,0,2,70,0,
40,6,0,0,4,0,
5,0,
3,0,

View File

@ -22,26 +22,27 @@ struct Layout {
enum Flag {
kOriginUpperLeft_Flag = 1 << 0,
kOverrideCoverage_Flag = 1 << 1,
kPushConstant_Flag = 1 << 2,
kBlendSupportAllEquations_Flag = 1 << 3,
kTracked_Flag = 1 << 4,
kSRGBUnpremul_Flag = 1 << 5,
kKey_Flag = 1 << 6,
kEarlyFragmentTests_Flag = 1 << 2,
kPushConstant_Flag = 1 << 3,
kBlendSupportAllEquations_Flag = 1 << 4,
kTracked_Flag = 1 << 5,
kSRGBUnpremul_Flag = 1 << 6,
kKey_Flag = 1 << 7,
// These flags indicate if the qualifier appeared, regardless of the accompanying value.
kLocation_Flag = 1 << 7,
kOffset_Flag = 1 << 8,
kBinding_Flag = 1 << 9,
kIndex_Flag = 1 << 10,
kSet_Flag = 1 << 11,
kBuiltin_Flag = 1 << 12,
kInputAttachmentIndex_Flag = 1 << 13,
kPrimitive_Flag = 1 << 14,
kMaxVertices_Flag = 1 << 15,
kInvocations_Flag = 1 << 16,
kMarker_Flag = 1 << 17,
kWhen_Flag = 1 << 18,
kCType_Flag = 1 << 19,
kLocation_Flag = 1 << 8,
kOffset_Flag = 1 << 9,
kBinding_Flag = 1 << 10,
kIndex_Flag = 1 << 11,
kSet_Flag = 1 << 12,
kBuiltin_Flag = 1 << 13,
kInputAttachmentIndex_Flag = 1 << 14,
kPrimitive_Flag = 1 << 15,
kMaxVertices_Flag = 1 << 16,
kInvocations_Flag = 1 << 17,
kMarker_Flag = 1 << 18,
kWhen_Flag = 1 << 19,
kCType_Flag = 1 << 20,
};
enum Primitive {
@ -186,6 +187,9 @@ struct Layout {
if (fFlags & kOverrideCoverage_Flag) {
result += separator() + "override_coverage";
}
if (fFlags & kEarlyFragmentTests_Flag) {
result += separator() + "early_fragment_tests";
}
if (fFlags & kBlendSupportAllEquations_Flag) {
result += separator() + "blend_support_all_equations";
}

View File

@ -1,22 +1,23 @@
### Compilation failed:
error: 22: layout qualifier 'origin_upper_left' appears more than once
error: 23: layout qualifier 'override_coverage' appears more than once
error: 24: layout qualifier 'push_constant' appears more than once
error: 25: layout qualifier 'blend_support_all_equations' appears more than once
error: 26: layout qualifier 'tracked' appears more than once
error: 27: layout qualifier 'srgb_unpremul' appears more than once
error: 28: layout qualifier 'key' appears more than once
error: 29: layout qualifier 'location' appears more than once
error: 30: layout qualifier 'offset' appears more than once
error: 31: layout qualifier 'binding' appears more than once
error: 32: layout qualifier 'index' appears more than once
error: 33: layout qualifier 'set' appears more than once
error: 34: layout qualifier 'builtin' appears more than once
error: 35: layout qualifier 'input_attachment_index' appears more than once
error: 36: layout qualifier 'max_vertices' appears more than once
error: 37: layout qualifier 'invocations' appears more than once
error: 38: layout qualifier 'marker' appears more than once
error: 39: layout qualifier 'when' appears more than once
error: 40: layout qualifier 'ctype' appears more than once
19 errors
error: 23: layout qualifier 'origin_upper_left' appears more than once
error: 24: layout qualifier 'override_coverage' appears more than once
error: 25: layout qualifier 'early_fragment_tests' appears more than once
error: 26: layout qualifier 'push_constant' appears more than once
error: 27: layout qualifier 'blend_support_all_equations' appears more than once
error: 28: layout qualifier 'tracked' appears more than once
error: 29: layout qualifier 'srgb_unpremul' appears more than once
error: 30: layout qualifier 'key' appears more than once
error: 31: layout qualifier 'location' appears more than once
error: 32: layout qualifier 'offset' appears more than once
error: 33: layout qualifier 'binding' appears more than once
error: 34: layout qualifier 'index' appears more than once
error: 35: layout qualifier 'set' appears more than once
error: 36: layout qualifier 'builtin' appears more than once
error: 37: layout qualifier 'input_attachment_index' appears more than once
error: 38: layout qualifier 'max_vertices' appears more than once
error: 39: layout qualifier 'invocations' appears more than once
error: 40: layout qualifier 'marker' appears more than once
error: 41: layout qualifier 'when' appears more than once
error: 42: layout qualifier 'ctype' appears more than once
20 errors