diff --git a/src/sksl/SkSLCPPCodeGenerator.cpp b/src/sksl/SkSLCPPCodeGenerator.cpp index 67cbe36ee7..5f9b8219e7 100644 --- a/src/sksl/SkSLCPPCodeGenerator.cpp +++ b/src/sksl/SkSLCPPCodeGenerator.cpp @@ -110,26 +110,6 @@ void CPPCodeGenerator::writeBinaryExpression(const BinaryExpression& b, } } -void CPPCodeGenerator::writeIndexExpression(const IndexExpression& i) { - const Expression& base = *i.fBase; - if (base.fKind == Expression::kVariableReference_Kind) { - int builtin = base.as().fVariable.fModifiers.fLayout.fBuiltin; - if (SK_TEXTURESAMPLERS_BUILTIN == builtin) { - this->write("%s"); - if (i.fIndex->fKind != Expression::kIntLiteral_Kind) { - fErrors.error(i.fIndex->fOffset, - "index into sk_TextureSamplers must be an integer literal"); - return; - } - int64_t index = i.fIndex->as().fValue; - fFormatArgs.push_back(" fragBuilder->getProgramBuilder()->samplerVariable(" - "args.fTexSamplers[" + to_string(index) + "])"); - return; - } - } - INHERITED::writeIndexExpression(i); -} - static String default_value(const Type& type) { if (type.fName == "bool") { return "false"; diff --git a/src/sksl/SkSLCPPCodeGenerator.h b/src/sksl/SkSLCPPCodeGenerator.h index 4973f212e4..4edb106c9e 100644 --- a/src/sksl/SkSLCPPCodeGenerator.h +++ b/src/sksl/SkSLCPPCodeGenerator.h @@ -37,8 +37,6 @@ private: void writeBinaryExpression(const BinaryExpression& b, Precedence parentPrecedence) override; - void writeIndexExpression(const IndexExpression& i) override; - void writeIntLiteral(const IntLiteral& i) override; void writeSwizzle(const Swizzle& swizzle) override; diff --git a/src/sksl/SkSLCompiler.h b/src/sksl/SkSLCompiler.h index 9828768b49..d41378dcfe 100644 --- a/src/sksl/SkSLCompiler.h +++ b/src/sksl/SkSLCompiler.h @@ -27,7 +27,6 @@ #define SK_FRAGCOLOR_BUILTIN 10001 #define SK_IN_BUILTIN 10002 #define SK_OUTCOLOR_BUILTIN 10004 -#define SK_TEXTURESAMPLERS_BUILTIN 10006 #define SK_OUT_BUILTIN 10007 #define SK_LASTFRAGCOLOR_BUILTIN 10008 #define SK_MAIN_COORDS_BUILTIN 10009 diff --git a/src/sksl/generated/sksl_fp.dehydrated.sksl b/src/sksl/generated/sksl_fp.dehydrated.sksl index 682ab88680..203b702608 100644 --- a/src/sksl/generated/sksl_fp.dehydrated.sksl +++ b/src/sksl/generated/sksl_fp.dehydrated.sksl @@ -1,2 +1,2 @@ -static constexpr size_t SKSL_INCLUDE_sksl_fp_LENGTH = 1724; -static uint8_t SKSL_INCLUDE_sksl_fp[1724] = {149,1,14,71,114,67,108,105,112,69,100,103,101,84,121,112,101,12,80,77,67,111,110,118,101,114,115,105,111,110,12,115,107,95,70,114,97,103,67,111,111,114,100,6,102,108,111,97,116,52,5,102,108,111,97,116,15,115,107,95,67,108,105,112,68,105,115,116,97,110,99,101,3,105,110,116,13,115,107,95,83,97,109,112,108,101,77,97,115,107,15,103,108,95,76,97,115,116,70,114,97,103,68,97,116,97,16,103,108,95,76,97,115,116,70,114,97,103,67,111,108,111,114,5,104,97,108,102,52,19,103,108,95,76,97,115,116,70,114,97,103,67,111,108,111,114,65,82,77,24,103,108,95,83,101,99,111,110,100,97,114,121,70,114,97,103,67,111,108,111,114,69,88,84,11,115,107,95,79,117,116,67,111,108,111,114,9,115,97,109,112,108,101,114,50,68,18,115,107,95,84,101,120,116,117,114,101,83,97,109,112,108,101,114,115,8,115,107,95,87,105,100,116,104,4,104,97,108,102,9,115,107,95,72,101,105,103,104,116,2,102,112,17,102,114,97,103,109,101,110,116,80,114,111,99,101,115,115,111,114,6,115,97,109,112,108,101,9,116,114,97,110,115,102,111,114,109,8,102,108,111,97,116,51,120,51,6,99,111,111,114,100,115,6,102,108,111,97,116,50,5,105,110,112,117,116,9,116,114,97,110,115,102,114,111,109,7,107,70,105,108,108,66,87,7,107,70,105,108,108,65,65,14,107,73,110,118,101,114,115,101,70,105,108,108,66,87,14,107,73,110,118,101,114,115,101,70,105,108,108,65,65,5,107,76,97,115,116,9,107,84,111,80,114,101,109,117,108,11,107,84,111,85,110,112,114,101,109,117,108,16,107,80,77,67,111,110,118,101,114,115,105,111,110,67,110,116,40,72,0,14,1,0,2,0,14,2,0,17,0,44,3,0,28,5,15,0,2,30,0,41,4,0,43,0,0,0,5,0,41,6,0,50,0,1,44,7,0,28,5,3,0,0,56,0,39,5,0,0,0,8,0,41,9,0,72,0,1,44,10,0,28,5,20,0,4,76,0,39,8,0,0,0,11,0,39,4,0,1,44,12,0,28,5,15,39,0,90,0,39,11,0,0,44,13,0,28,5,15,39,0,106,0,41,14,0,123,0,0,44,15,0,28,5,15,39,0,129,0,39,14,0,0,44,16,0,28,5,15,39,0,149,0,39,14,0,0,44,17,0,28,5,20,39,4,174,0,39,14,0,0,0,18,0,41,19,0,186,0,0,44,20,0,28,5,22,39,0,196,0,39,18,0,0,44,21,0,28,5,27,39,0,215,0,41,22,0,224,0,0,44,23,0,28,5,28,39,0,229,0,39,22,0,0,44,24,0,9,239,0,41,25,0,242,0,3,22,26,0,9,4,1,1,24,0,39,14,0,44,27,0,9,239,0,39,25,0,3,44,28,0,9,11,1,41,29,0,21,1,3,43,30,0,2,39,26,0,22,31,0,9,4,1,2,27,0,28,0,39,14,0,39,31,0,44,32,0,9,239,0,39,25,0,3,44,33,0,9,30,1,41,34,0,37,1,3,43,35,0,3,39,26,0,39,31,0,22,36,0,9,4,1,2,32,0,33,0,39,14,0,39,36,0,44,37,0,9,239,0,39,25,0,3,44,38,0,9,44,1,39,14,0,3,43,39,0,4,39,26,0,39,31,0,39,36,0,22,40,0,9,4,1,2,37,0,38,0,39,14,0,39,40,0,44,41,0,9,239,0,39,25,0,3,44,42,0,9,44,1,39,14,0,3,44,43,0,9,11,1,39,29,0,3,43,44,0,5,39,26,0,39,31,0,39,36,0,39,40,0,22,45,0,9,4,1,3,41,0,42,0,43,0,39,14,0,39,45,0,44,46,0,9,239,0,39,25,0,3,44,47,0,9,44,1,39,14,0,3,44,48,0,9,30,1,39,34,0,3,43,49,0,6,39,26,0,39,31,0,39,36,0,39,40,0,39,45,0,22,50,0,9,4,1,3,46,0,47,0,48,0,39,14,0,39,50,0,30,51,0,39,25,0,44,52,0,9,239,0,39,51,0,3,43,53,0,7,39,26,0,39,31,0,39,36,0,39,40,0,39,45,0,39,50,0,22,54,0,9,4,1,1,52,0,39,14,0,39,54,0,30,55,0,39,25,0,44,56,0,9,239,0,39,55,0,3,44,57,0,9,11,1,39,29,0,3,43,58,0,8,39,26,0,39,31,0,39,36,0,39,40,0,39,45,0,39,50,0,39,54,0,22,59,0,9,4,1,2,56,0,57,0,39,14,0,39,59,0,30,60,0,39,25,0,44,61,0,9,239,0,39,60,0,3,44,62,0,9,30,1,39,34,0,3,43,63,0,9,39,26,0,39,31,0,39,36,0,39,40,0,39,45,0,39,50,0,39,54,0,39,59,0,22,64,0,9,4,1,2,61,0,62,0,39,14,0,39,64,0,30,65,0,39,25,0,44,66,0,9,239,0,39,65,0,3,44,67,0,9,44,1,39,14,0,3,43,68,0,10,39,26,0,39,31,0,39,36,0,39,40,0,39,45,0,39,50,0,39,54,0,39,59,0,39,64,0,22,69,0,9,4,1,2,66,0,67,0,39,14,0,39,69,0,30,70,0,39,25,0,44,71,0,9,239,0,39,70,0,3,44,72,0,9,44,1,39,14,0,3,44,73,0,9,50,1,39,29,0,3,43,74,0,11,39,26,0,39,31,0,39,36,0,39,40,0,39,45,0,39,50,0,39,54,0,39,59,0,39,64,0,39,69,0,22,75,0,9,4,1,3,71,0,72,0,73,0,39,14,0,39,75,0,30,76,0,39,25,0,44,77,0,9,239,0,39,76,0,3,44,78,0,9,44,1,39,14,0,3,44,79,0,9,30,1,39,34,0,3,43,80,0,12,39,26,0,39,31,0,39,36,0,39,40,0,39,45,0,39,50,0,39,54,0,39,59,0,39,64,0,39,69,0,39,75,0,22,81,0,9,4,1,3,77,0,78,0,79,0,39,14,0,39,81,0,14,0,2,0,0,0,17,0,1,0,106,0,9,0,129,0,10,0,90,0,8,0,149,0,11,0,4,1,70,0,56,0,4,0,30,0,2,0,229,0,16,0,174,0,12,0,76,0,6,0,196,0,14,0,215,0,15,0,12,13,13,2,0,40,5,0,44,82,0,28,8,1,60,1,39,1,0,0,44,83,0,28,8,1,68,1,39,1,0,0,44,84,0,28,8,1,76,1,39,1,0,0,44,85,0,28,8,1,91,1,39,1,0,0,44,86,0,28,8,1,106,1,39,1,0,0,5,0,68,1,1,0,60,1,0,0,91,1,3,0,76,1,2,0,106,1,4,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,13,17,0,40,3,0,44,87,0,28,8,1,112,1,39,2,0,0,44,88,0,28,8,1,122,1,39,2,0,0,44,89,0,28,8,1,134,1,39,2,0,0,3,0,134,1,2,0,112,1,0,0,122,1,1,0,0,0,0,0,1,0,0,0,2,0,0,0,46,39,4,0,1,45,3,0,0,48,46,39,6,0,1,45,7,0,1,26,1,0,0,0,48,46,39,9,0,1,45,10,0,1,26,1,0,0,0,48,46,39,4,0,1,45,12,0,1,26,1,0,0,0,48,46,39,14,0,1,45,13,0,0,48,46,39,14,0,1,45,15,0,0,48,46,39,14,0,1,45,16,0,0,48,46,39,14,0,1,45,17,0,0,48,46,39,18,0,1,45,20,0,0,48,46,39,22,0,1,45,21,0,0,48,46,39,22,0,1,45,23,0,0,48,}; +static constexpr size_t SKSL_INCLUDE_sksl_fp_LENGTH = 1658; +static uint8_t SKSL_INCLUDE_sksl_fp[1658] = {120,1,14,71,114,67,108,105,112,69,100,103,101,84,121,112,101,12,80,77,67,111,110,118,101,114,115,105,111,110,12,115,107,95,70,114,97,103,67,111,111,114,100,6,102,108,111,97,116,52,5,102,108,111,97,116,15,115,107,95,67,108,105,112,68,105,115,116,97,110,99,101,3,105,110,116,13,115,107,95,83,97,109,112,108,101,77,97,115,107,15,103,108,95,76,97,115,116,70,114,97,103,68,97,116,97,16,103,108,95,76,97,115,116,70,114,97,103,67,111,108,111,114,5,104,97,108,102,52,19,103,108,95,76,97,115,116,70,114,97,103,67,111,108,111,114,65,82,77,24,103,108,95,83,101,99,111,110,100,97,114,121,70,114,97,103,67,111,108,111,114,69,88,84,11,115,107,95,79,117,116,67,111,108,111,114,8,115,107,95,87,105,100,116,104,4,104,97,108,102,9,115,107,95,72,101,105,103,104,116,2,102,112,17,102,114,97,103,109,101,110,116,80,114,111,99,101,115,115,111,114,6,115,97,109,112,108,101,9,116,114,97,110,115,102,111,114,109,8,102,108,111,97,116,51,120,51,6,99,111,111,114,100,115,6,102,108,111,97,116,50,5,105,110,112,117,116,9,116,114,97,110,115,102,114,111,109,7,107,70,105,108,108,66,87,7,107,70,105,108,108,65,65,14,107,73,110,118,101,114,115,101,70,105,108,108,66,87,14,107,73,110,118,101,114,115,101,70,105,108,108,65,65,5,107,76,97,115,116,9,107,84,111,80,114,101,109,117,108,11,107,84,111,85,110,112,114,101,109,117,108,16,107,80,77,67,111,110,118,101,114,115,105,111,110,67,110,116,40,70,0,14,1,0,2,0,14,2,0,17,0,44,3,0,28,5,15,0,2,30,0,41,4,0,43,0,0,0,5,0,41,6,0,50,0,1,44,7,0,28,5,3,0,0,56,0,39,5,0,0,0,8,0,41,9,0,72,0,1,44,10,0,28,5,20,0,4,76,0,39,8,0,0,0,11,0,39,4,0,1,44,12,0,28,5,15,39,0,90,0,39,11,0,0,44,13,0,28,5,15,39,0,106,0,41,14,0,123,0,0,44,15,0,28,5,15,39,0,129,0,39,14,0,0,44,16,0,28,5,15,39,0,149,0,39,14,0,0,44,17,0,28,5,20,39,4,174,0,39,14,0,0,44,18,0,28,5,27,39,0,186,0,41,19,0,195,0,0,44,20,0,28,5,28,39,0,200,0,39,19,0,0,44,21,0,9,210,0,41,22,0,213,0,3,22,23,0,9,231,0,1,21,0,39,14,0,44,24,0,9,210,0,39,22,0,3,44,25,0,9,238,0,41,26,0,248,0,3,43,27,0,2,39,23,0,22,28,0,9,231,0,2,24,0,25,0,39,14,0,39,28,0,44,29,0,9,210,0,39,22,0,3,44,30,0,9,1,1,41,31,0,8,1,3,43,32,0,3,39,23,0,39,28,0,22,33,0,9,231,0,2,29,0,30,0,39,14,0,39,33,0,44,34,0,9,210,0,39,22,0,3,44,35,0,9,15,1,39,14,0,3,43,36,0,4,39,23,0,39,28,0,39,33,0,22,37,0,9,231,0,2,34,0,35,0,39,14,0,39,37,0,44,38,0,9,210,0,39,22,0,3,44,39,0,9,15,1,39,14,0,3,44,40,0,9,238,0,39,26,0,3,43,41,0,5,39,23,0,39,28,0,39,33,0,39,37,0,22,42,0,9,231,0,3,38,0,39,0,40,0,39,14,0,39,42,0,44,43,0,9,210,0,39,22,0,3,44,44,0,9,15,1,39,14,0,3,44,45,0,9,1,1,39,31,0,3,43,46,0,6,39,23,0,39,28,0,39,33,0,39,37,0,39,42,0,22,47,0,9,231,0,3,43,0,44,0,45,0,39,14,0,39,47,0,30,48,0,39,22,0,44,49,0,9,210,0,39,48,0,3,43,50,0,7,39,23,0,39,28,0,39,33,0,39,37,0,39,42,0,39,47,0,22,51,0,9,231,0,1,49,0,39,14,0,39,51,0,30,52,0,39,22,0,44,53,0,9,210,0,39,52,0,3,44,54,0,9,238,0,39,26,0,3,43,55,0,8,39,23,0,39,28,0,39,33,0,39,37,0,39,42,0,39,47,0,39,51,0,22,56,0,9,231,0,2,53,0,54,0,39,14,0,39,56,0,30,57,0,39,22,0,44,58,0,9,210,0,39,57,0,3,44,59,0,9,1,1,39,31,0,3,43,60,0,9,39,23,0,39,28,0,39,33,0,39,37,0,39,42,0,39,47,0,39,51,0,39,56,0,22,61,0,9,231,0,2,58,0,59,0,39,14,0,39,61,0,30,62,0,39,22,0,44,63,0,9,210,0,39,62,0,3,44,64,0,9,15,1,39,14,0,3,43,65,0,10,39,23,0,39,28,0,39,33,0,39,37,0,39,42,0,39,47,0,39,51,0,39,56,0,39,61,0,22,66,0,9,231,0,2,63,0,64,0,39,14,0,39,66,0,30,67,0,39,22,0,44,68,0,9,210,0,39,67,0,3,44,69,0,9,15,1,39,14,0,3,44,70,0,9,21,1,39,26,0,3,43,71,0,11,39,23,0,39,28,0,39,33,0,39,37,0,39,42,0,39,47,0,39,51,0,39,56,0,39,61,0,39,66,0,22,72,0,9,231,0,3,68,0,69,0,70,0,39,14,0,39,72,0,30,73,0,39,22,0,44,74,0,9,210,0,39,73,0,3,44,75,0,9,15,1,39,14,0,3,44,76,0,9,1,1,39,31,0,3,43,77,0,12,39,23,0,39,28,0,39,33,0,39,37,0,39,42,0,39,47,0,39,51,0,39,56,0,39,61,0,39,66,0,39,72,0,22,78,0,9,231,0,3,74,0,75,0,76,0,39,14,0,39,78,0,13,0,2,0,0,0,17,0,1,0,106,0,9,0,129,0,10,0,90,0,8,0,149,0,11,0,231,0,68,0,56,0,4,0,30,0,2,0,200,0,14,0,174,0,12,0,76,0,6,0,186,0,13,0,12,12,13,2,0,40,5,0,44,79,0,28,8,1,31,1,39,1,0,0,44,80,0,28,8,1,39,1,39,1,0,0,44,81,0,28,8,1,47,1,39,1,0,0,44,82,0,28,8,1,62,1,39,1,0,0,44,83,0,28,8,1,77,1,39,1,0,0,5,0,39,1,1,0,31,1,0,0,62,1,3,0,47,1,2,0,77,1,4,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,13,17,0,40,3,0,44,84,0,28,8,1,83,1,39,2,0,0,44,85,0,28,8,1,93,1,39,2,0,0,44,86,0,28,8,1,105,1,39,2,0,0,3,0,105,1,2,0,83,1,0,0,93,1,1,0,0,0,0,0,1,0,0,0,2,0,0,0,46,39,4,0,1,45,3,0,0,48,46,39,6,0,1,45,7,0,1,26,1,0,0,0,48,46,39,9,0,1,45,10,0,1,26,1,0,0,0,48,46,39,4,0,1,45,12,0,1,26,1,0,0,0,48,46,39,14,0,1,45,13,0,0,48,46,39,14,0,1,45,15,0,0,48,46,39,14,0,1,45,16,0,0,48,46,39,14,0,1,45,17,0,0,48,46,39,19,0,1,45,18,0,0,48,46,39,19,0,1,45,20,0,0,48,}; diff --git a/src/sksl/sksl_fp_raw.sksl b/src/sksl/sksl_fp_raw.sksl index 86043b1c37..377bfe7576 100644 --- a/src/sksl/sksl_fp_raw.sksl +++ b/src/sksl/sksl_fp_raw.sksl @@ -17,7 +17,6 @@ layout(builtin=9999) half4 gl_LastFragColorARM; layout(builtin=9999) half4 gl_SecondaryFragColorEXT; layout(builtin=10004) out half4 sk_OutColor; -layout(builtin=10006) sampler2D[] sk_TextureSamplers; layout(builtin=10011) half sk_Width; layout(builtin=10012) half sk_Height;