ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 7 | |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 8 | #ifndef SKSL_CONTEXT |
| 9 | #define SKSL_CONTEXT |
| 10 | |
| 11 | #include "ir/SkSLType.h" |
ethannicholas | 22f939e | 2016-10-13 13:25:34 -0700 | [diff] [blame] | 12 | #include "ir/SkSLExpression.h" |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 13 | |
| 14 | namespace SkSL { |
| 15 | |
| 16 | /** |
| 17 | * Contains compiler-wide objects, which currently means the core types. |
| 18 | */ |
| 19 | class Context { |
| 20 | public: |
| 21 | Context() |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 22 | : fInvalid_Type(new Type(String("<INVALID>"))) |
| 23 | , fVoid_Type(new Type(String("void"))) |
| 24 | , fDouble_Type(new Type(String("double"), true)) |
Ethan Nicholas | 5af9ea3 | 2017-07-28 15:19:46 -0400 | [diff] [blame] | 25 | , fDouble2_Type(new Type(String("double2"), *fDouble_Type, 2)) |
| 26 | , fDouble3_Type(new Type(String("double3"), *fDouble_Type, 3)) |
| 27 | , fDouble4_Type(new Type(String("double4"), *fDouble_Type, 4)) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 28 | , fFloat_Type(new Type(String("float"), true, { fDouble_Type.get() })) |
Ethan Nicholas | 5af9ea3 | 2017-07-28 15:19:46 -0400 | [diff] [blame] | 29 | , fFloat2_Type(new Type(String("float2"), *fFloat_Type, 2)) |
| 30 | , fFloat3_Type(new Type(String("float3"), *fFloat_Type, 3)) |
| 31 | , fFloat4_Type(new Type(String("float4"), *fFloat_Type, 4)) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 32 | , fUInt_Type(new Type(String("uint"), true, { fFloat_Type.get(), fDouble_Type.get() })) |
Ethan Nicholas | 5af9ea3 | 2017-07-28 15:19:46 -0400 | [diff] [blame] | 33 | , fUInt2_Type(new Type(String("uint2"), *fUInt_Type, 2)) |
| 34 | , fUInt3_Type(new Type(String("uint3"), *fUInt_Type, 3)) |
| 35 | , fUInt4_Type(new Type(String("uint4"), *fUInt_Type, 4)) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 36 | , fInt_Type(new Type(String("int"), true, { fUInt_Type.get(), fFloat_Type.get(), |
Ethan Nicholas | 9e1138d | 2016-11-21 10:39:35 -0500 | [diff] [blame] | 37 | fDouble_Type.get() })) |
Ethan Nicholas | 5af9ea3 | 2017-07-28 15:19:46 -0400 | [diff] [blame] | 38 | , fInt2_Type(new Type(String("int2"), *fInt_Type, 2)) |
| 39 | , fInt3_Type(new Type(String("int3"), *fInt_Type, 3)) |
| 40 | , fInt4_Type(new Type(String("int4"), *fInt_Type, 4)) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 41 | , fBool_Type(new Type(String("bool"), false)) |
Ethan Nicholas | 5af9ea3 | 2017-07-28 15:19:46 -0400 | [diff] [blame] | 42 | , fBool2_Type(new Type(String("bool2"), *fBool_Type, 2)) |
| 43 | , fBool3_Type(new Type(String("bool3"), *fBool_Type, 3)) |
| 44 | , fBool4_Type(new Type(String("bool4"), *fBool_Type, 4)) |
| 45 | , fFloat2x2_Type(new Type(String("float2x2"), *fFloat_Type, 2, 2)) |
| 46 | , fFloat2x3_Type(new Type(String("float2x3"), *fFloat_Type, 2, 3)) |
| 47 | , fFloat2x4_Type(new Type(String("float2x4"), *fFloat_Type, 2, 4)) |
| 48 | , fFloat3x2_Type(new Type(String("float3x2"), *fFloat_Type, 3, 2)) |
| 49 | , fFloat3x3_Type(new Type(String("float3x3"), *fFloat_Type, 3, 3)) |
| 50 | , fFloat3x4_Type(new Type(String("float3x4"), *fFloat_Type, 3, 4)) |
| 51 | , fFloat4x2_Type(new Type(String("float4x2"), *fFloat_Type, 4, 2)) |
| 52 | , fFloat4x3_Type(new Type(String("float4x3"), *fFloat_Type, 4, 3)) |
| 53 | , fFloat4x4_Type(new Type(String("float4x4"), *fFloat_Type, 4, 4)) |
| 54 | , fDouble2x2_Type(new Type(String("double2x2"), *fFloat_Type, 2, 2)) |
| 55 | , fDouble2x3_Type(new Type(String("double2x3"), *fFloat_Type, 2, 3)) |
| 56 | , fDouble2x4_Type(new Type(String("double2x4"), *fFloat_Type, 2, 4)) |
| 57 | , fDouble3x2_Type(new Type(String("double3x2"), *fFloat_Type, 3, 2)) |
| 58 | , fDouble3x3_Type(new Type(String("double3x3"), *fFloat_Type, 3, 3)) |
| 59 | , fDouble3x4_Type(new Type(String("double3x4"), *fFloat_Type, 3, 4)) |
| 60 | , fDouble4x2_Type(new Type(String("double4x2"), *fFloat_Type, 4, 2)) |
| 61 | , fDouble4x3_Type(new Type(String("double4x3"), *fFloat_Type, 4, 3)) |
| 62 | , fDouble4x4_Type(new Type(String("double4x4"), *fFloat_Type, 4, 4)) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 63 | , fSampler1D_Type(new Type(String("sampler1D"), SpvDim1D, false, false, false, true)) |
| 64 | , fSampler2D_Type(new Type(String("sampler2D"), SpvDim2D, false, false, false, true)) |
| 65 | , fSampler3D_Type(new Type(String("sampler3D"), SpvDim3D, false, false, false, true)) |
| 66 | , fSamplerExternalOES_Type(new Type(String("samplerExternalOES"), SpvDim2D, false, false, |
Ethan Nicholas | 9e1138d | 2016-11-21 10:39:35 -0500 | [diff] [blame] | 67 | false, true)) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 68 | , fSamplerCube_Type(new Type(String("samplerCube"), SpvDimCube, false, false, false, true)) |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 69 | , fSampler2DRect_Type(new Type(String("sampler2DRect"), SpvDimRect, false, false, false, true)) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 70 | , fSampler1DArray_Type(new Type(String("sampler1DArray"))) |
| 71 | , fSampler2DArray_Type(new Type(String("sampler2DArray"))) |
| 72 | , fSamplerCubeArray_Type(new Type(String("samplerCubeArray"))) |
Ethan Nicholas | 0187ae6 | 2017-05-03 11:03:44 -0400 | [diff] [blame] | 73 | , fSamplerBuffer_Type(new Type(String("samplerBuffer"), SpvDimBuffer, false, false, false, |
| 74 | true)) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 75 | , fSampler2DMS_Type(new Type(String("sampler2DMS"))) |
| 76 | , fSampler2DMSArray_Type(new Type(String("sampler2DMSArray"))) |
| 77 | , fSampler1DShadow_Type(new Type(String("sampler1DShadow"))) |
| 78 | , fSampler2DShadow_Type(new Type(String("sampler2DShadow"))) |
| 79 | , fSamplerCubeShadow_Type(new Type(String("samplerCubeShadow"))) |
| 80 | , fSampler2DRectShadow_Type(new Type(String("sampler2DRectShadow"))) |
| 81 | , fSampler1DArrayShadow_Type(new Type(String("sampler1DArrayShadow"))) |
| 82 | , fSampler2DArrayShadow_Type(new Type(String("sampler2DArrayShadow"))) |
| 83 | , fSamplerCubeArrayShadow_Type(new Type(String("samplerCubeArrayShadow"))) |
Brian Salomon | 2a51de8 | 2016-11-16 12:06:01 -0500 | [diff] [blame] | 84 | |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 85 | // Related to below FIXME, gsampler*s don't currently expand to cover integer case. |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 86 | , fISampler2D_Type(new Type(String("isampler2D"), SpvDim2D, false, false, false, true)) |
Brian Salomon | 2a51de8 | 2016-11-16 12:06:01 -0500 | [diff] [blame] | 87 | |
| 88 | // FIXME express these as "gimage2D" that expand to image2D, iimage2D, and uimage2D. |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 89 | , fImage2D_Type(new Type(String("image2D"), SpvDim2D, false, false, false, true)) |
| 90 | , fIImage2D_Type(new Type(String("iimage2D"), SpvDim2D, false, false, false, true)) |
Brian Salomon | 2a51de8 | 2016-11-16 12:06:01 -0500 | [diff] [blame] | 91 | |
Greg Daniel | 64773e6 | 2016-11-22 09:44:03 -0500 | [diff] [blame] | 92 | // FIXME express these as "gsubpassInput" that expand to subpassInput, isubpassInput, |
| 93 | // and usubpassInput. |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 94 | , fSubpassInput_Type(new Type(String("subpassInput"), SpvDimSubpassData, false, false, |
Greg Daniel | 64773e6 | 2016-11-22 09:44:03 -0500 | [diff] [blame] | 95 | false, false)) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 96 | , fSubpassInputMS_Type(new Type(String("subpassInputMS"), SpvDimSubpassData, false, false, |
Greg Daniel | 64773e6 | 2016-11-22 09:44:03 -0500 | [diff] [blame] | 97 | true, false)) |
| 98 | |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 99 | // FIXME figure out what we're supposed to do with the gsampler et al. types) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 100 | , fGSampler1D_Type(new Type(String("$gsampler1D"), static_type(*fSampler1D_Type))) |
| 101 | , fGSampler2D_Type(new Type(String("$gsampler2D"), static_type(*fSampler2D_Type))) |
| 102 | , fGSampler3D_Type(new Type(String("$gsampler3D"), static_type(*fSampler3D_Type))) |
| 103 | , fGSamplerCube_Type(new Type(String("$gsamplerCube"), static_type(*fSamplerCube_Type))) |
| 104 | , fGSampler2DRect_Type(new Type(String("$gsampler2DRect"), static_type(*fSampler2DRect_Type))) |
| 105 | , fGSampler1DArray_Type(new Type(String("$gsampler1DArray"), |
Ethan Nicholas | 9e1138d | 2016-11-21 10:39:35 -0500 | [diff] [blame] | 106 | static_type(*fSampler1DArray_Type))) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 107 | , fGSampler2DArray_Type(new Type(String("$gsampler2DArray"), |
Ethan Nicholas | 9e1138d | 2016-11-21 10:39:35 -0500 | [diff] [blame] | 108 | static_type(*fSampler2DArray_Type))) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 109 | , fGSamplerCubeArray_Type(new Type(String("$gsamplerCubeArray"), |
Ethan Nicholas | 9e1138d | 2016-11-21 10:39:35 -0500 | [diff] [blame] | 110 | static_type(*fSamplerCubeArray_Type))) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 111 | , fGSamplerBuffer_Type(new Type(String("$gsamplerBuffer"), static_type(*fSamplerBuffer_Type))) |
| 112 | , fGSampler2DMS_Type(new Type(String("$gsampler2DMS"), static_type(*fSampler2DMS_Type))) |
| 113 | , fGSampler2DMSArray_Type(new Type(String("$gsampler2DMSArray"), |
Ethan Nicholas | 9e1138d | 2016-11-21 10:39:35 -0500 | [diff] [blame] | 114 | static_type(*fSampler2DMSArray_Type))) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 115 | , fGSampler2DArrayShadow_Type(new Type(String("$gsampler2DArrayShadow"), |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 116 | static_type(*fSampler2DArrayShadow_Type))) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 117 | , fGSamplerCubeArrayShadow_Type(new Type(String("$gsamplerCubeArrayShadow"), |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 118 | static_type(*fSamplerCubeArrayShadow_Type))) |
Ethan Nicholas | 5af9ea3 | 2017-07-28 15:19:46 -0400 | [diff] [blame] | 119 | , fGenType_Type(new Type(String("$genType"), { fFloat_Type.get(), fFloat2_Type.get(), |
| 120 | fFloat3_Type.get(), fFloat4_Type.get() })) |
| 121 | , fGenDType_Type(new Type(String("$genDType"), { fDouble_Type.get(), fDouble2_Type.get(), |
| 122 | fDouble3_Type.get(), fDouble4_Type.get() })) |
| 123 | , fGenIType_Type(new Type(String("$genIType"), { fInt_Type.get(), fInt2_Type.get(), |
| 124 | fInt3_Type.get(), fInt4_Type.get() })) |
| 125 | , fGenUType_Type(new Type(String("$genUType"), { fUInt_Type.get(), fUInt2_Type.get(), |
| 126 | fUInt3_Type.get(), fUInt4_Type.get() })) |
| 127 | , fGenBType_Type(new Type(String("$genBType"), { fBool_Type.get(), fBool2_Type.get(), |
| 128 | fBool3_Type.get(), fBool4_Type.get() })) |
| 129 | , fMat_Type(new Type(String("$mat"), { fFloat2x2_Type.get(), fFloat2x3_Type.get(), |
| 130 | fFloat2x4_Type.get(), fFloat3x2_Type.get(), |
| 131 | fFloat3x3_Type.get(), fFloat3x4_Type.get(), |
| 132 | fFloat4x2_Type.get(), fFloat4x3_Type.get(), |
| 133 | fFloat4x4_Type.get(), fDouble2x2_Type.get(), |
| 134 | fDouble2x3_Type.get(), fDouble2x4_Type.get(), |
| 135 | fDouble3x2_Type.get(), fDouble3x3_Type.get(), |
| 136 | fDouble3x4_Type.get(), fDouble4x2_Type.get(), |
| 137 | fDouble4x3_Type.get(), fDouble4x4_Type.get() })) |
| 138 | , fVec_Type(new Type(String("$vec"), { fInvalid_Type.get(), fFloat2_Type.get(), |
| 139 | fFloat3_Type.get(), fFloat4_Type.get() })) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 140 | , fGVec_Type(new Type(String("$gvec"))) |
Ethan Nicholas | 5af9ea3 | 2017-07-28 15:19:46 -0400 | [diff] [blame] | 141 | , fGVec2_Type(new Type(String("$gfloat2"))) |
| 142 | , fGVec3_Type(new Type(String("$gfloat3"))) |
| 143 | , fGVec4_Type(new Type(String("$gfloat4"), static_type(*fFloat4_Type))) |
| 144 | , fDVec_Type(new Type(String("$dvec"), { fInvalid_Type.get(), fDouble2_Type.get(), |
| 145 | fDouble3_Type.get(), fDouble4_Type.get() })) |
| 146 | , fIVec_Type(new Type(String("$ivec"), { fInvalid_Type.get(), fInt2_Type.get(), |
| 147 | fInt3_Type.get(), fInt4_Type.get() })) |
| 148 | , fUVec_Type(new Type(String("$uvec"), { fInvalid_Type.get(), fUInt2_Type.get(), |
| 149 | fUInt3_Type.get(), fUInt4_Type.get() })) |
| 150 | , fBVec_Type(new Type(String("$bvec"), { fInvalid_Type.get(), fBool2_Type.get(), |
| 151 | fBool3_Type.get(), fBool4_Type.get() })) |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 152 | , fSkCaps_Type(new Type(String("$sk_Caps"))) |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 153 | , fSkArgs_Type(new Type(String("$sk_Args"))) |
| 154 | , fColorSpaceXform_Type(new Type(String("colorSpaceXform"), *fFloat_Type, 4, 4)) |
ethannicholas | 22f939e | 2016-10-13 13:25:34 -0700 | [diff] [blame] | 155 | , fDefined_Expression(new Defined(*fInvalid_Type)) {} |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 156 | |
| 157 | static std::vector<const Type*> static_type(const Type& t) { |
Greg Daniel | 64773e6 | 2016-11-22 09:44:03 -0500 | [diff] [blame] | 158 | return { &t, &t, &t, &t }; |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 159 | } |
| 160 | |
ethannicholas | 471e894 | 2016-10-28 09:02:46 -0700 | [diff] [blame] | 161 | const std::unique_ptr<Type> fInvalid_Type; |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 162 | const std::unique_ptr<Type> fVoid_Type; |
| 163 | |
| 164 | const std::unique_ptr<Type> fDouble_Type; |
Ethan Nicholas | 5af9ea3 | 2017-07-28 15:19:46 -0400 | [diff] [blame] | 165 | const std::unique_ptr<Type> fDouble2_Type; |
| 166 | const std::unique_ptr<Type> fDouble3_Type; |
| 167 | const std::unique_ptr<Type> fDouble4_Type; |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 168 | |
| 169 | const std::unique_ptr<Type> fFloat_Type; |
Ethan Nicholas | 5af9ea3 | 2017-07-28 15:19:46 -0400 | [diff] [blame] | 170 | const std::unique_ptr<Type> fFloat2_Type; |
| 171 | const std::unique_ptr<Type> fFloat3_Type; |
| 172 | const std::unique_ptr<Type> fFloat4_Type; |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 173 | |
| 174 | const std::unique_ptr<Type> fUInt_Type; |
Ethan Nicholas | 5af9ea3 | 2017-07-28 15:19:46 -0400 | [diff] [blame] | 175 | const std::unique_ptr<Type> fUInt2_Type; |
| 176 | const std::unique_ptr<Type> fUInt3_Type; |
| 177 | const std::unique_ptr<Type> fUInt4_Type; |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 178 | |
| 179 | const std::unique_ptr<Type> fInt_Type; |
Ethan Nicholas | 5af9ea3 | 2017-07-28 15:19:46 -0400 | [diff] [blame] | 180 | const std::unique_ptr<Type> fInt2_Type; |
| 181 | const std::unique_ptr<Type> fInt3_Type; |
| 182 | const std::unique_ptr<Type> fInt4_Type; |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 183 | |
| 184 | const std::unique_ptr<Type> fBool_Type; |
Ethan Nicholas | 5af9ea3 | 2017-07-28 15:19:46 -0400 | [diff] [blame] | 185 | const std::unique_ptr<Type> fBool2_Type; |
| 186 | const std::unique_ptr<Type> fBool3_Type; |
| 187 | const std::unique_ptr<Type> fBool4_Type; |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 188 | |
Ethan Nicholas | 5af9ea3 | 2017-07-28 15:19:46 -0400 | [diff] [blame] | 189 | const std::unique_ptr<Type> fFloat2x2_Type; |
| 190 | const std::unique_ptr<Type> fFloat2x3_Type; |
| 191 | const std::unique_ptr<Type> fFloat2x4_Type; |
| 192 | const std::unique_ptr<Type> fFloat3x2_Type; |
| 193 | const std::unique_ptr<Type> fFloat3x3_Type; |
| 194 | const std::unique_ptr<Type> fFloat3x4_Type; |
| 195 | const std::unique_ptr<Type> fFloat4x2_Type; |
| 196 | const std::unique_ptr<Type> fFloat4x3_Type; |
| 197 | const std::unique_ptr<Type> fFloat4x4_Type; |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 198 | |
Ethan Nicholas | 5af9ea3 | 2017-07-28 15:19:46 -0400 | [diff] [blame] | 199 | const std::unique_ptr<Type> fDouble2x2_Type; |
| 200 | const std::unique_ptr<Type> fDouble2x3_Type; |
| 201 | const std::unique_ptr<Type> fDouble2x4_Type; |
| 202 | const std::unique_ptr<Type> fDouble3x2_Type; |
| 203 | const std::unique_ptr<Type> fDouble3x3_Type; |
| 204 | const std::unique_ptr<Type> fDouble3x4_Type; |
| 205 | const std::unique_ptr<Type> fDouble4x2_Type; |
| 206 | const std::unique_ptr<Type> fDouble4x3_Type; |
| 207 | const std::unique_ptr<Type> fDouble4x4_Type; |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 208 | |
| 209 | const std::unique_ptr<Type> fSampler1D_Type; |
| 210 | const std::unique_ptr<Type> fSampler2D_Type; |
| 211 | const std::unique_ptr<Type> fSampler3D_Type; |
ethannicholas | 5961bc9 | 2016-10-12 06:39:56 -0700 | [diff] [blame] | 212 | const std::unique_ptr<Type> fSamplerExternalOES_Type; |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 213 | const std::unique_ptr<Type> fSamplerCube_Type; |
| 214 | const std::unique_ptr<Type> fSampler2DRect_Type; |
| 215 | const std::unique_ptr<Type> fSampler1DArray_Type; |
| 216 | const std::unique_ptr<Type> fSampler2DArray_Type; |
| 217 | const std::unique_ptr<Type> fSamplerCubeArray_Type; |
| 218 | const std::unique_ptr<Type> fSamplerBuffer_Type; |
| 219 | const std::unique_ptr<Type> fSampler2DMS_Type; |
| 220 | const std::unique_ptr<Type> fSampler2DMSArray_Type; |
| 221 | const std::unique_ptr<Type> fSampler1DShadow_Type; |
| 222 | const std::unique_ptr<Type> fSampler2DShadow_Type; |
| 223 | const std::unique_ptr<Type> fSamplerCubeShadow_Type; |
| 224 | const std::unique_ptr<Type> fSampler2DRectShadow_Type; |
| 225 | const std::unique_ptr<Type> fSampler1DArrayShadow_Type; |
| 226 | const std::unique_ptr<Type> fSampler2DArrayShadow_Type; |
| 227 | const std::unique_ptr<Type> fSamplerCubeArrayShadow_Type; |
| 228 | |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 229 | const std::unique_ptr<Type> fISampler2D_Type; |
| 230 | |
Brian Salomon | 2a51de8 | 2016-11-16 12:06:01 -0500 | [diff] [blame] | 231 | const std::unique_ptr<Type> fImage2D_Type; |
| 232 | const std::unique_ptr<Type> fIImage2D_Type; |
| 233 | |
Greg Daniel | 64773e6 | 2016-11-22 09:44:03 -0500 | [diff] [blame] | 234 | const std::unique_ptr<Type> fSubpassInput_Type; |
| 235 | const std::unique_ptr<Type> fSubpassInputMS_Type; |
| 236 | |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 237 | const std::unique_ptr<Type> fGSampler1D_Type; |
| 238 | const std::unique_ptr<Type> fGSampler2D_Type; |
| 239 | const std::unique_ptr<Type> fGSampler3D_Type; |
| 240 | const std::unique_ptr<Type> fGSamplerCube_Type; |
| 241 | const std::unique_ptr<Type> fGSampler2DRect_Type; |
| 242 | const std::unique_ptr<Type> fGSampler1DArray_Type; |
| 243 | const std::unique_ptr<Type> fGSampler2DArray_Type; |
| 244 | const std::unique_ptr<Type> fGSamplerCubeArray_Type; |
| 245 | const std::unique_ptr<Type> fGSamplerBuffer_Type; |
| 246 | const std::unique_ptr<Type> fGSampler2DMS_Type; |
| 247 | const std::unique_ptr<Type> fGSampler2DMSArray_Type; |
| 248 | const std::unique_ptr<Type> fGSampler2DArrayShadow_Type; |
| 249 | const std::unique_ptr<Type> fGSamplerCubeArrayShadow_Type; |
| 250 | |
| 251 | const std::unique_ptr<Type> fGenType_Type; |
| 252 | const std::unique_ptr<Type> fGenDType_Type; |
| 253 | const std::unique_ptr<Type> fGenIType_Type; |
| 254 | const std::unique_ptr<Type> fGenUType_Type; |
| 255 | const std::unique_ptr<Type> fGenBType_Type; |
| 256 | |
| 257 | const std::unique_ptr<Type> fMat_Type; |
| 258 | |
| 259 | const std::unique_ptr<Type> fVec_Type; |
| 260 | |
| 261 | const std::unique_ptr<Type> fGVec_Type; |
| 262 | const std::unique_ptr<Type> fGVec2_Type; |
| 263 | const std::unique_ptr<Type> fGVec3_Type; |
| 264 | const std::unique_ptr<Type> fGVec4_Type; |
| 265 | const std::unique_ptr<Type> fDVec_Type; |
| 266 | const std::unique_ptr<Type> fIVec_Type; |
| 267 | const std::unique_ptr<Type> fUVec_Type; |
| 268 | |
| 269 | const std::unique_ptr<Type> fBVec_Type; |
| 270 | |
Ethan Nicholas | 3605ace | 2016-11-21 15:59:48 -0500 | [diff] [blame] | 271 | const std::unique_ptr<Type> fSkCaps_Type; |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 272 | const std::unique_ptr<Type> fSkArgs_Type; |
| 273 | const std::unique_ptr<Type> fColorSpaceXform_Type; |
Ethan Nicholas | 3605ace | 2016-11-21 15:59:48 -0500 | [diff] [blame] | 274 | |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 275 | // dummy expression used to mark that a variable has a value during dataflow analysis (when it |
ethannicholas | 22f939e | 2016-10-13 13:25:34 -0700 | [diff] [blame] | 276 | // could have several different values, or the analyzer is otherwise unable to assign it a |
| 277 | // specific expression) |
| 278 | const std::unique_ptr<Expression> fDefined_Expression; |
| 279 | |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 280 | private: |
ethannicholas | 22f939e | 2016-10-13 13:25:34 -0700 | [diff] [blame] | 281 | class Defined : public Expression { |
| 282 | public: |
| 283 | Defined(const Type& type) |
| 284 | : INHERITED(Position(), kDefined_Kind, type) {} |
| 285 | |
Ethan Nicholas | cb67096 | 2017-04-20 19:31:52 -0400 | [diff] [blame] | 286 | bool hasSideEffects() const override { |
| 287 | return false; |
| 288 | } |
ethannicholas | 22f939e | 2016-10-13 13:25:34 -0700 | [diff] [blame] | 289 | |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 290 | String description() const override { |
| 291 | return String("<defined>"); |
| 292 | } |
| 293 | |
ethannicholas | 22f939e | 2016-10-13 13:25:34 -0700 | [diff] [blame] | 294 | typedef Expression INHERITED; |
| 295 | }; |
ethannicholas | d598f79 | 2016-07-25 10:08:54 -0700 | [diff] [blame] | 296 | }; |
| 297 | |
| 298 | } // namespace |
| 299 | |
| 300 | #endif |