Remove PLS support from SkSL

Change-Id: I885149c73be63c223ac88a697ffe046a7f8384d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372116
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2021-02-18 12:44:57 -05:00 committed by Skia Commit-Bot
parent 26f4962b3f
commit 9cb3f98191
12 changed files with 795 additions and 958 deletions

View File

@ -1,11 +1,9 @@
const in out uniform flat noperspective readonly writeonly coherent volatile restrict buffer
sk_has_side_effects __pixel_localEXT __pixel_local_inEXT __pixel_local_outEXT varying inline
sk_has_side_effects varying inline
void func1() {}
void func2(const in out uniform flat noperspective readonly writeonly coherent volatile restrict
buffer sk_has_side_effects __pixel_localEXT __pixel_local_inEXT __pixel_local_outEXT
varying inline float test) {}
buffer sk_has_side_effects varying inline float test) {}
const in out uniform flat noperspective readonly writeonly coherent volatile restrict buffer
sk_has_side_effects __pixel_localEXT __pixel_local_inEXT __pixel_local_outEXT varying inline
float var;
sk_has_side_effects varying inline float var;

View File

@ -389,8 +389,7 @@ bool ProgramUsage::isDead(const Variable& v) const {
Modifiers::kVarying_Flag))) {
return false;
}
return !counts.fWrite || (!counts.fRead && !(modifiers.fFlags &
(Modifiers::kPLS_Flag | Modifiers::kPLSOut_Flag)));
return !counts.fWrite || !counts.fRead;
}
int ProgramUsage::get(const FunctionDeclaration& f) const {

View File

@ -1101,15 +1101,6 @@ void GLSLCodeGenerator::writeModifiers(const Modifiers& modifiers,
if (modifiers.fFlags & Modifiers::kConst_Flag) {
this->write("const ");
}
if (modifiers.fFlags & Modifiers::kPLS_Flag) {
this->write("__pixel_localEXT ");
}
if (modifiers.fFlags & Modifiers::kPLSIn_Flag) {
this->write("__pixel_local_inEXT ");
}
if (modifiers.fFlags & Modifiers::kPLSOut_Flag) {
this->write("__pixel_local_outEXT ");
}
switch (modifiers.fLayout.fFormat) {
case Layout::Format::kUnspecified:
break;

View File

@ -420,13 +420,11 @@ void IRGenerator::checkVarDeclaration(int offset, const Modifiers& modifiers, co
}
int permitted = Modifiers::kConst_Flag;
if (storage == Variable::Storage::kGlobal) {
permitted |= Modifiers::kIn_Flag | Modifiers::kOut_Flag | Modifiers::kUniform_Flag |
Modifiers::kFlat_Flag | Modifiers::kVarying_Flag |
Modifiers::kNoPerspective_Flag | Modifiers::kPLS_Flag |
Modifiers::kPLSIn_Flag | Modifiers::kPLSOut_Flag |
Modifiers::kRestrict_Flag | Modifiers::kVolatile_Flag |
Modifiers::kReadOnly_Flag | Modifiers::kWriteOnly_Flag |
Modifiers::kCoherent_Flag | Modifiers::kBuffer_Flag;
permitted |=
Modifiers::kIn_Flag | Modifiers::kOut_Flag | Modifiers::kUniform_Flag |
Modifiers::kFlat_Flag | Modifiers::kVarying_Flag | Modifiers::kNoPerspective_Flag |
Modifiers::kRestrict_Flag | Modifiers::kVolatile_Flag | Modifiers::kReadOnly_Flag |
Modifiers::kWriteOnly_Flag | Modifiers::kCoherent_Flag | Modifiers::kBuffer_Flag;
}
this->checkModifiers(offset, modifiers, permitted);
}
@ -1048,9 +1046,6 @@ void IRGenerator::checkModifiers(int offset, const Modifiers& modifiers, int per
CHECK(Modifiers::kRestrict_Flag, "restrict")
CHECK(Modifiers::kBuffer_Flag, "buffer")
CHECK(Modifiers::kHasSideEffects_Flag, "sk_has_side_effects")
CHECK(Modifiers::kPLS_Flag, "__pixel_localEXT")
CHECK(Modifiers::kPLSIn_Flag, "__pixel_local_inEXT")
CHECK(Modifiers::kPLSOut_Flag, "__pixel_local_outEXT")
CHECK(Modifiers::kVarying_Flag, "varying")
CHECK(Modifiers::kInline_Flag, "inline")
SkASSERT(flags == 0);

File diff suppressed because it is too large Load Diff

View File

@ -49,9 +49,6 @@ struct Token {
TK_BUFFER,
TK_INLINE,
TK_HASSIDEEFFECTS,
TK_PLS,
TK_PLSIN,
TK_PLSOUT,
TK_VARYING,
TK_STRUCT,
TK_LAYOUT,

View File

@ -56,9 +56,6 @@ static int parse_modifier_token(Token::Kind token) {
case Token::Kind::TK_RESTRICT: return Modifiers::kRestrict_Flag;
case Token::Kind::TK_BUFFER: return Modifiers::kBuffer_Flag;
case Token::Kind::TK_HASSIDEEFFECTS: return Modifiers::kHasSideEffects_Flag;
case Token::Kind::TK_PLS: return Modifiers::kPLS_Flag;
case Token::Kind::TK_PLSIN: return Modifiers::kPLSIn_Flag;
case Token::Kind::TK_PLSOUT: return Modifiers::kPLSOut_Flag;
case Token::Kind::TK_VARYING: return Modifiers::kVarying_Flag;
case Token::Kind::TK_INLINE: return Modifiers::kInline_Flag;
default: return 0;
@ -1081,8 +1078,7 @@ Layout Parser::layout() {
}
/* layout? (UNIFORM | CONST | IN | OUT | INOUT | LOWP | MEDIUMP | HIGHP | FLAT | NOPERSPECTIVE |
READONLY | WRITEONLY | COHERENT | VOLATILE | RESTRICT | BUFFER | PLS | PLSIN |
PLSOUT | VARYING | INLINE)* */
READONLY | WRITEONLY | COHERENT | VOLATILE | RESTRICT | BUFFER | VARYING | INLINE)* */
Modifiers Parser::modifiers() {
Layout layout = this->layout();
int flags = 0;

File diff suppressed because it is too large Load Diff

View File

@ -1326,7 +1326,7 @@ static uint8_t SKSL_INCLUDE_sksl_public[] = {19,2,
40,139,1,2,
1,
39,
49,138,1,0,3,0,1,2,59,
49,138,1,0,3,0,1,2,56,
21,
40,123,0,155,0,2,
39,
@ -1344,7 +1344,7 @@ static uint8_t SKSL_INCLUDE_sksl_public[] = {19,2,
40,142,1,2,
1,
39,
49,141,1,0,3,0,1,2,59,
49,141,1,0,3,0,1,2,56,
21,
40,115,0,147,0,2,
39,

View File

@ -33,11 +33,8 @@ struct Modifiers {
kRestrict_Flag = 1 << 10,
kBuffer_Flag = 1 << 11,
kHasSideEffects_Flag = 1 << 12,
kPLS_Flag = 1 << 13,
kPLSIn_Flag = 1 << 14,
kPLSOut_Flag = 1 << 15,
kVarying_Flag = 1 << 16,
kInline_Flag = 1 << 17,
kVarying_Flag = 1 << 13,
kInline_Flag = 1 << 14,
};
Modifiers()
@ -83,15 +80,6 @@ struct Modifiers {
if (fFlags & kHasSideEffects_Flag) {
result += "sk_has_side_effects ";
}
if (fFlags & kPLS_Flag) {
result += "__pixel_localEXT ";
}
if (fFlags & kPLSIn_Flag) {
result += "__pixel_local_inEXT ";
}
if (fFlags & kPLSOut_Flag) {
result += "__pixel_local_outEXT ";
}
if (fFlags & kVarying_Flag) {
result += "varying ";
}

View File

@ -42,9 +42,6 @@ RESTRICT = "restrict"
BUFFER = "buffer"
INLINE = "inline"
HASSIDEEFFECTS = "sk_has_side_effects"
PLS = "__pixel_localEXT"
PLSIN = "__pixel_local_inEXT"
PLSOUT = "__pixel_local_outEXT"
VARYING = "varying"
STRUCT = "struct"
LAYOUT = "layout"

View File

@ -12,28 +12,22 @@ error: 3: 'coherent' is not permitted here
error: 3: 'volatile' is not permitted here
error: 3: 'restrict' is not permitted here
error: 3: 'buffer' is not permitted here
error: 3: '__pixel_localEXT' is not permitted here
error: 3: '__pixel_local_inEXT' is not permitted here
error: 3: '__pixel_local_outEXT' is not permitted here
error: 3: 'varying' is not permitted here
error: 7: 'const' is not permitted here
error: 7: 'uniform' is not permitted here
error: 7: 'flat' is not permitted here
error: 7: 'noperspective' is not permitted here
error: 7: 'readonly' is not permitted here
error: 7: 'writeonly' is not permitted here
error: 7: 'coherent' is not permitted here
error: 7: 'volatile' is not permitted here
error: 7: 'restrict' is not permitted here
error: 7: 'buffer' is not permitted here
error: 7: 'sk_has_side_effects' is not permitted here
error: 7: '__pixel_localEXT' is not permitted here
error: 7: '__pixel_local_inEXT' is not permitted here
error: 7: '__pixel_local_outEXT' is not permitted here
error: 7: 'varying' is not permitted here
error: 7: 'inline' is not permitted here
error: 11: 'in uniform' variables only permitted within fragment processors
error: 11: 'varying' is only permitted in runtime effects
error: 11: 'sk_has_side_effects' is not permitted here
error: 11: 'inline' is not permitted here
36 errors
error: 6: 'const' is not permitted here
error: 6: 'uniform' is not permitted here
error: 6: 'flat' is not permitted here
error: 6: 'noperspective' is not permitted here
error: 6: 'readonly' is not permitted here
error: 6: 'writeonly' is not permitted here
error: 6: 'coherent' is not permitted here
error: 6: 'volatile' is not permitted here
error: 6: 'restrict' is not permitted here
error: 6: 'buffer' is not permitted here
error: 6: 'sk_has_side_effects' is not permitted here
error: 6: 'varying' is not permitted here
error: 6: 'inline' is not permitted here
error: 9: 'in uniform' variables only permitted within fragment processors
error: 9: 'varying' is only permitted in runtime effects
error: 9: 'sk_has_side_effects' is not permitted here
error: 9: 'inline' is not permitted here
30 errors