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/GrShaderCaps.h" 9 #include "src/gpu/glsl/GrGLSL.h" 10 GrGLSLTypeString(GrSLType t)11const char* GrGLSLTypeString(GrSLType t) { 12 switch (t) { 13 case kVoid_GrSLType: return "void"; 14 case kBool_GrSLType: return "bool"; 15 case kBool2_GrSLType: return "bool2"; 16 case kBool3_GrSLType: return "bool3"; 17 case kBool4_GrSLType: return "bool4"; 18 case kShort_GrSLType: return "short"; 19 case kShort2_GrSLType: return "short2"; 20 case kShort3_GrSLType: return "short3"; 21 case kShort4_GrSLType: return "short4"; 22 case kUShort_GrSLType: return "ushort"; 23 case kUShort2_GrSLType: return "ushort2"; 24 case kUShort3_GrSLType: return "ushort3"; 25 case kUShort4_GrSLType: return "ushort4"; 26 case kFloat_GrSLType: return "float"; 27 case kFloat2_GrSLType: return "float2"; 28 case kFloat3_GrSLType: return "float3"; 29 case kFloat4_GrSLType: return "float4"; 30 case kFloat2x2_GrSLType: return "float2x2"; 31 case kFloat3x3_GrSLType: return "float3x3"; 32 case kFloat4x4_GrSLType: return "float4x4"; 33 case kHalf_GrSLType: return "half"; 34 case kHalf2_GrSLType: return "half2"; 35 case kHalf3_GrSLType: return "half3"; 36 case kHalf4_GrSLType: return "half4"; 37 case kHalf2x2_GrSLType: return "half2x2"; 38 case kHalf3x3_GrSLType: return "half3x3"; 39 case kHalf4x4_GrSLType: return "half4x4"; 40 case kInt_GrSLType: return "int"; 41 case kInt2_GrSLType: return "int2"; 42 case kInt3_GrSLType: return "int3"; 43 case kInt4_GrSLType: return "int4"; 44 case kUInt_GrSLType: return "uint"; 45 case kUInt2_GrSLType: return "uint2"; 46 case kUInt3_GrSLType: return "uint3"; 47 case kUInt4_GrSLType: return "uint4"; 48 case kTexture2DSampler_GrSLType: return "sampler2D"; 49 case kTextureExternalSampler_GrSLType: return "samplerExternalOES"; 50 case kTexture2DRectSampler_GrSLType: return "sampler2DRect"; 51 case kTexture2D_GrSLType: return "texture2D"; 52 case kSampler_GrSLType: return "sampler"; 53 case kInput_GrSLType: return "subpassInput"; 54 } 55 SK_ABORT("Unknown shader var type."); 56 } 57