Add tokens for highp/mediump/lowp.

At present, they aren't hooked up to anything. They will be made
functional in followup CLs.

Change-Id: I4bfc25eb4e19fce4c36ea0b55494bf37b2a9ee23
Bug: skia:12248
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430637
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
This commit is contained in:
John Stiles 2021-07-20 15:32:21 -04:00 committed by Skia Commit-Bot
parent a7a9443104
commit b6a7319f21
10 changed files with 957 additions and 880 deletions

View File

@ -343,6 +343,7 @@ sksl_shared_tests = [
"/sksl/shared/OutParamsNoInline.sksl", "/sksl/shared/OutParamsNoInline.sksl",
"/sksl/shared/OutParamsTricky.sksl", "/sksl/shared/OutParamsTricky.sksl",
"/sksl/shared/Overflow.sksl", "/sksl/shared/Overflow.sksl",
"/sksl/shared/PrecisionQualifiers.sksl",
"/sksl/shared/RectangleTexture.sksl", "/sksl/shared/RectangleTexture.sksl",
"/sksl/shared/ResizeMatrix.sksl", "/sksl/shared/ResizeMatrix.sksl",
"/sksl/shared/ResizeMatrixNonsquare.sksl", "/sksl/shared/ResizeMatrixNonsquare.sksl",

View File

@ -0,0 +1,9 @@
uniform half4 colorGreen;
half4 main(float2 coords) {
highp vec4 zero = 0;
mediump vec4 green = colorGreen;
lowp vec4 one = 1;
return green * one + zero;
}

File diff suppressed because it is too large Load Diff

View File

@ -47,6 +47,9 @@ struct Token {
TK_HASSIDEEFFECTS, TK_HASSIDEEFFECTS,
TK_STRUCT, TK_STRUCT,
TK_LAYOUT, TK_LAYOUT,
TK_HIGHP,
TK_MEDIUMP,
TK_LOWP,
TK_IDENTIFIER, TK_IDENTIFIER,
TK_DIRECTIVE, TK_DIRECTIVE,
TK_LPAREN, TK_LPAREN,

File diff suppressed because it is too large Load Diff

View File

@ -1327,7 +1327,7 @@ static uint8_t SKSL_INCLUDE_sksl_public[] = {4,2,
45,139,1,2, 45,139,1,2,
1, 1,
44, 44,
54,138,1,0,3,0,1,2,46, 54,138,1,0,3,0,1,2,49,
26, 26,
45,123,0,155,0,2, 45,123,0,155,0,2,
44, 44,
@ -1344,7 +1344,7 @@ static uint8_t SKSL_INCLUDE_sksl_public[] = {4,2,
45,142,1,2, 45,142,1,2,
1, 1,
44, 44,
54,141,1,0,3,0,1,2,46, 54,141,1,0,3,0,1,2,49,
26, 26,
45,115,0,147,0,2, 45,115,0,147,0,2,
44, 44,

View File

@ -39,6 +39,9 @@ NOINLINE = "noinline"
HASSIDEEFFECTS = "sk_has_side_effects" HASSIDEEFFECTS = "sk_has_side_effects"
STRUCT = "struct" STRUCT = "struct"
LAYOUT = "layout" LAYOUT = "layout"
HIGHP = "highp"
MEDIUMP = "mediump"
LOWP = "lowp"
IDENTIFIER = [a-zA-Z_$]([0-9]|[a-zA-Z_$])* IDENTIFIER = [a-zA-Z_$]([0-9]|[a-zA-Z_$])*
DIRECTIVE = #[a-zA-Z_$]([0-9]|[a-zA-Z_$])* DIRECTIVE = #[a-zA-Z_$]([0-9]|[a-zA-Z_$])*
LPAREN = "(" LPAREN = "("

View File

@ -0,0 +1,4 @@
### Compilation failed:
error: 4: expected expression, but found 'highp'
1 error

View File

@ -0,0 +1,4 @@
### Compilation failed:
error: 4: expected expression, but found 'highp'
1 error

View File

@ -0,0 +1,4 @@
### Compilation failed:
error: 4: expected expression, but found 'highp'
1 error