1 /* 2 * Copyright 2011 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 */ 7 8 #include "src/gpu/glsl/GrGLSL.h" 9 GrGLSLTypeString(SkSLType t)10const char* GrGLSLTypeString(SkSLType t) { 11 switch (t) { 12 case SkSLType::kVoid: return "void"; 13 case SkSLType::kBool: return "bool"; 14 case SkSLType::kBool2: return "bool2"; 15 case SkSLType::kBool3: return "bool3"; 16 case SkSLType::kBool4: return "bool4"; 17 case SkSLType::kShort: return "short"; 18 case SkSLType::kShort2: return "short2"; 19 case SkSLType::kShort3: return "short3"; 20 case SkSLType::kShort4: return "short4"; 21 case SkSLType::kUShort: return "ushort"; 22 case SkSLType::kUShort2: return "ushort2"; 23 case SkSLType::kUShort3: return "ushort3"; 24 case SkSLType::kUShort4: return "ushort4"; 25 case SkSLType::kFloat: return "float"; 26 case SkSLType::kFloat2: return "float2"; 27 case SkSLType::kFloat3: return "float3"; 28 case SkSLType::kFloat4: return "float4"; 29 case SkSLType::kFloat2x2: return "float2x2"; 30 case SkSLType::kFloat3x3: return "float3x3"; 31 case SkSLType::kFloat4x4: return "float4x4"; 32 case SkSLType::kHalf: return "half"; 33 case SkSLType::kHalf2: return "half2"; 34 case SkSLType::kHalf3: return "half3"; 35 case SkSLType::kHalf4: return "half4"; 36 case SkSLType::kHalf2x2: return "half2x2"; 37 case SkSLType::kHalf3x3: return "half3x3"; 38 case SkSLType::kHalf4x4: return "half4x4"; 39 case SkSLType::kInt: return "int"; 40 case SkSLType::kInt2: return "int2"; 41 case SkSLType::kInt3: return "int3"; 42 case SkSLType::kInt4: return "int4"; 43 case SkSLType::kUInt: return "uint"; 44 case SkSLType::kUInt2: return "uint2"; 45 case SkSLType::kUInt3: return "uint3"; 46 case SkSLType::kUInt4: return "uint4"; 47 case SkSLType::kTexture2DSampler: return "sampler2D"; 48 case SkSLType::kTextureExternalSampler: return "samplerExternalOES"; 49 case SkSLType::kTexture2DRectSampler: return "sampler2DRect"; 50 case SkSLType::kTexture2D: return "texture2D"; 51 case SkSLType::kSampler: return "sampler"; 52 case SkSLType::kInput: return "subpassInput"; 53 } 54 SK_ABORT("Unknown shader var type."); 55 } 56