bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 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 | |
egdaniel | 0d3f061 | 2015-10-21 10:45:48 -0700 | [diff] [blame] | 8 | #ifndef GrGLSLShaderVar_DEFINED |
| 9 | #define GrGLSLShaderVar_DEFINED |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 10 | |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 11 | #include "GrShaderVar.h" |
egdaniel | f529439 | 2015-10-21 07:14:17 -0700 | [diff] [blame] | 12 | #include "../glsl/GrGLSL.h" |
| 13 | #include "../glsl/GrGLSLCaps.h" |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 14 | |
tomhudson@google.com | da66898 | 2011-12-07 15:06:29 +0000 | [diff] [blame] | 15 | #define USE_UNIFORM_FLOAT_ARRAYS true |
| 16 | |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 17 | /** |
| 18 | * Represents a variable in a shader |
| 19 | */ |
egdaniel | 0d3f061 | 2015-10-21 10:45:48 -0700 | [diff] [blame] | 20 | class GrGLSLShaderVar : public GrShaderVar { |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 21 | public: |
tomhudson@google.com | 086e535 | 2011-12-08 14:44:10 +0000 | [diff] [blame] | 22 | /** |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 23 | * Defaults to a float with no precision specifier |
| 24 | */ |
egdaniel | 0d3f061 | 2015-10-21 10:45:48 -0700 | [diff] [blame] | 25 | GrGLSLShaderVar() |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 26 | : GrShaderVar() |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 27 | , fUseUniformFloatArrays(USE_UNIFORM_FLOAT_ARRAYS) { |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 28 | } |
| 29 | |
egdaniel | 0d3f061 | 2015-10-21 10:45:48 -0700 | [diff] [blame] | 30 | GrGLSLShaderVar(const char* name, GrSLType type, int arrayCount = kNonArray, |
| 31 | GrSLPrecision precision = kDefault_GrSLPrecision) |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 32 | : GrShaderVar(name, type, arrayCount, precision) |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 33 | , fUseUniformFloatArrays(USE_UNIFORM_FLOAT_ARRAYS) { |
tfarina@chromium.org | f6de475 | 2013-08-17 00:02:59 +0000 | [diff] [blame] | 34 | SkASSERT(kVoid_GrSLType != type); |
bsalomon@google.com | a1bf0ff | 2012-08-07 17:36:29 +0000 | [diff] [blame] | 35 | fUseUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS; |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 36 | } |
| 37 | |
egdaniel | 0d3f061 | 2015-10-21 10:45:48 -0700 | [diff] [blame] | 38 | GrGLSLShaderVar(const char* name, GrSLType type, TypeModifier typeModifier, |
| 39 | int arrayCount = kNonArray, GrSLPrecision precision = kDefault_GrSLPrecision) |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 40 | : GrShaderVar(name, type, typeModifier, arrayCount, precision) |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 41 | , fUseUniformFloatArrays(USE_UNIFORM_FLOAT_ARRAYS) { |
| 42 | SkASSERT(kVoid_GrSLType != type); |
| 43 | } |
| 44 | |
egdaniel | 0d3f061 | 2015-10-21 10:45:48 -0700 | [diff] [blame] | 45 | GrGLSLShaderVar(const GrShaderVar& var) |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 46 | : GrShaderVar(var) |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 47 | , fUseUniformFloatArrays(USE_UNIFORM_FLOAT_ARRAYS) { |
| 48 | SkASSERT(kVoid_GrSLType != var.getType()); |
bsalomon@google.com | a1bf0ff | 2012-08-07 17:36:29 +0000 | [diff] [blame] | 49 | } |
| 50 | |
egdaniel | 0d3f061 | 2015-10-21 10:45:48 -0700 | [diff] [blame] | 51 | GrGLSLShaderVar(const GrGLSLShaderVar& var) |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 52 | : GrShaderVar(var.c_str(), var.getType(), var.getTypeModifier(), |
| 53 | var.getArrayCount(), var.getPrecision()) |
bsalomon@google.com | a1bf0ff | 2012-08-07 17:36:29 +0000 | [diff] [blame] | 54 | , fUseUniformFloatArrays(var.fUseUniformFloatArrays) { |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 55 | SkASSERT(kVoid_GrSLType != var.getType()); |
bsalomon@google.com | a1bf0ff | 2012-08-07 17:36:29 +0000 | [diff] [blame] | 56 | } |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 57 | |
| 58 | /** |
| 59 | * Values for array count that have special meaning. We allow 1-sized arrays. |
| 60 | */ |
| 61 | enum { |
| 62 | kNonArray = 0, // not an array |
| 63 | kUnsizedArray = -1, // an unsized array (declared with []) |
| 64 | }; |
| 65 | |
| 66 | /** |
| 67 | * Sets as a non-array. |
| 68 | */ |
tomhudson@google.com | 168e634 | 2012-04-18 17:49:20 +0000 | [diff] [blame] | 69 | void set(GrSLType type, |
tomhudson@google.com | 086e535 | 2011-12-08 14:44:10 +0000 | [diff] [blame] | 70 | TypeModifier typeModifier, |
bsalomon@google.com | f0a104e | 2012-07-10 17:51:07 +0000 | [diff] [blame] | 71 | const SkString& name, |
bsalomon | c0bd648 | 2014-12-09 10:04:14 -0800 | [diff] [blame] | 72 | GrSLPrecision precision = kDefault_GrSLPrecision, |
egdaniel | ae47418 | 2016-01-21 11:19:52 -0800 | [diff] [blame] | 73 | const char* layoutQualifier = nullptr, |
tomhudson@google.com | da66898 | 2011-12-07 15:06:29 +0000 | [diff] [blame] | 74 | bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) { |
tfarina@chromium.org | f6de475 | 2013-08-17 00:02:59 +0000 | [diff] [blame] | 75 | SkASSERT(kVoid_GrSLType != type); |
ethannicholas | 2279325 | 2016-01-30 09:59:10 -0800 | [diff] [blame] | 76 | SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type)); |
robertphillips | 46d36f0 | 2015-01-18 08:14:14 -0800 | [diff] [blame] | 77 | INHERITED::set(type, name, typeModifier, precision); |
egdaniel | ae47418 | 2016-01-21 11:19:52 -0800 | [diff] [blame] | 78 | fLayoutQualifier = layoutQualifier; |
tomhudson@google.com | da66898 | 2011-12-07 15:06:29 +0000 | [diff] [blame] | 79 | fUseUniformFloatArrays = useUniformFloatArrays; |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Sets as a non-array. |
| 84 | */ |
tomhudson@google.com | 168e634 | 2012-04-18 17:49:20 +0000 | [diff] [blame] | 85 | void set(GrSLType type, |
tomhudson@google.com | 086e535 | 2011-12-08 14:44:10 +0000 | [diff] [blame] | 86 | TypeModifier typeModifier, |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 87 | const char* name, |
bsalomon | c0bd648 | 2014-12-09 10:04:14 -0800 | [diff] [blame] | 88 | GrSLPrecision precision = kDefault_GrSLPrecision, |
egdaniel | ae47418 | 2016-01-21 11:19:52 -0800 | [diff] [blame] | 89 | const char* layoutQualifier = nullptr, |
tomhudson@google.com | da66898 | 2011-12-07 15:06:29 +0000 | [diff] [blame] | 90 | bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) { |
tfarina@chromium.org | f6de475 | 2013-08-17 00:02:59 +0000 | [diff] [blame] | 91 | SkASSERT(kVoid_GrSLType != type); |
ethannicholas | 2279325 | 2016-01-30 09:59:10 -0800 | [diff] [blame] | 92 | SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type)); |
robertphillips | 46d36f0 | 2015-01-18 08:14:14 -0800 | [diff] [blame] | 93 | INHERITED::set(type, name, typeModifier, precision); |
egdaniel | ae47418 | 2016-01-21 11:19:52 -0800 | [diff] [blame] | 94 | fLayoutQualifier = layoutQualifier; |
tomhudson@google.com | da66898 | 2011-12-07 15:06:29 +0000 | [diff] [blame] | 95 | fUseUniformFloatArrays = useUniformFloatArrays; |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Set all var options |
| 100 | */ |
tomhudson@google.com | 168e634 | 2012-04-18 17:49:20 +0000 | [diff] [blame] | 101 | void set(GrSLType type, |
tomhudson@google.com | 086e535 | 2011-12-08 14:44:10 +0000 | [diff] [blame] | 102 | TypeModifier typeModifier, |
bsalomon@google.com | f0a104e | 2012-07-10 17:51:07 +0000 | [diff] [blame] | 103 | const SkString& name, |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 104 | int count, |
bsalomon | c0bd648 | 2014-12-09 10:04:14 -0800 | [diff] [blame] | 105 | GrSLPrecision precision = kDefault_GrSLPrecision, |
egdaniel | ae47418 | 2016-01-21 11:19:52 -0800 | [diff] [blame] | 106 | const char* layoutQualifier = nullptr, |
tomhudson@google.com | da66898 | 2011-12-07 15:06:29 +0000 | [diff] [blame] | 107 | bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) { |
tfarina@chromium.org | f6de475 | 2013-08-17 00:02:59 +0000 | [diff] [blame] | 108 | SkASSERT(kVoid_GrSLType != type); |
ethannicholas | 2279325 | 2016-01-30 09:59:10 -0800 | [diff] [blame] | 109 | SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type)); |
robertphillips | 46d36f0 | 2015-01-18 08:14:14 -0800 | [diff] [blame] | 110 | INHERITED::set(type, name, typeModifier, precision, count); |
egdaniel | ae47418 | 2016-01-21 11:19:52 -0800 | [diff] [blame] | 111 | fLayoutQualifier = layoutQualifier; |
tomhudson@google.com | da66898 | 2011-12-07 15:06:29 +0000 | [diff] [blame] | 112 | fUseUniformFloatArrays = useUniformFloatArrays; |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 113 | } |
| 114 | |
| 115 | /** |
| 116 | * Set all var options |
| 117 | */ |
tomhudson@google.com | 168e634 | 2012-04-18 17:49:20 +0000 | [diff] [blame] | 118 | void set(GrSLType type, |
tomhudson@google.com | 086e535 | 2011-12-08 14:44:10 +0000 | [diff] [blame] | 119 | TypeModifier typeModifier, |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 120 | const char* name, |
| 121 | int count, |
bsalomon | c0bd648 | 2014-12-09 10:04:14 -0800 | [diff] [blame] | 122 | GrSLPrecision precision = kDefault_GrSLPrecision, |
egdaniel | ae47418 | 2016-01-21 11:19:52 -0800 | [diff] [blame] | 123 | const char* layoutQualifier = nullptr, |
tomhudson@google.com | da66898 | 2011-12-07 15:06:29 +0000 | [diff] [blame] | 124 | bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) { |
tfarina@chromium.org | f6de475 | 2013-08-17 00:02:59 +0000 | [diff] [blame] | 125 | SkASSERT(kVoid_GrSLType != type); |
ethannicholas | 2279325 | 2016-01-30 09:59:10 -0800 | [diff] [blame] | 126 | SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type)); |
robertphillips | 46d36f0 | 2015-01-18 08:14:14 -0800 | [diff] [blame] | 127 | INHERITED::set(type, name, typeModifier, precision, count); |
egdaniel | ae47418 | 2016-01-21 11:19:52 -0800 | [diff] [blame] | 128 | fLayoutQualifier = layoutQualifier; |
tomhudson@google.com | da66898 | 2011-12-07 15:06:29 +0000 | [diff] [blame] | 129 | fUseUniformFloatArrays = useUniformFloatArrays; |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | /** |
egdaniel | 07caf56 | 2016-01-21 15:21:48 -0800 | [diff] [blame] | 133 | * Set the layout qualifier |
| 134 | */ |
| 135 | void setLayoutQualifier(const char* layoutQualifier) { |
| 136 | fLayoutQualifier = layoutQualifier; |
| 137 | } |
| 138 | |
| 139 | /** |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 140 | * Write a declaration of this variable to out. |
| 141 | */ |
egdaniel | f529439 | 2015-10-21 07:14:17 -0700 | [diff] [blame] | 142 | void appendDecl(const GrGLSLCaps* glslCaps, SkString* out) const { |
ethannicholas | 2279325 | 2016-01-30 09:59:10 -0800 | [diff] [blame] | 143 | SkASSERT(kDefault_GrSLPrecision == fPrecision || GrSLTypeIsNumeric(fType)); |
egdaniel | ae47418 | 2016-01-21 11:19:52 -0800 | [diff] [blame] | 144 | if (!fLayoutQualifier.isEmpty()) { |
| 145 | out->appendf("layout(%s) ", fLayoutQualifier.c_str()); |
bsalomon@google.com | 5fa2107 | 2012-10-25 14:57:46 +0000 | [diff] [blame] | 146 | } |
tomhudson@google.com | 086e535 | 2011-12-08 14:44:10 +0000 | [diff] [blame] | 147 | if (this->getTypeModifier() != kNone_TypeModifier) { |
ethannicholas | 2279325 | 2016-01-30 09:59:10 -0800 | [diff] [blame] | 148 | if (GrSLTypeIsIntType(fType) && (this->getTypeModifier() == kVaryingIn_TypeModifier || |
| 149 | this->getTypeModifier() == kVaryingOut_TypeModifier)) { |
| 150 | out->append("flat "); |
| 151 | } |
| 152 | out->append(TypeModifierString(glslCaps, this->getTypeModifier())); |
| 153 | out->append(" "); |
tomhudson@google.com | 086e535 | 2011-12-08 14:44:10 +0000 | [diff] [blame] | 154 | } |
tomhudson@google.com | 168e634 | 2012-04-18 17:49:20 +0000 | [diff] [blame] | 155 | GrSLType effectiveType = this->getType(); |
ethannicholas | 2279325 | 2016-01-30 09:59:10 -0800 | [diff] [blame] | 156 | if (effectiveType != kBool_GrSLType) { |
| 157 | out->append(PrecisionString(glslCaps, fPrecision)); |
| 158 | } |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 159 | if (this->isArray()) { |
| 160 | if (this->isUnsizedArray()) { |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 161 | out->appendf("%s %s[]", |
bsalomon@google.com | 018f179 | 2013-04-18 19:36:09 +0000 | [diff] [blame] | 162 | GrGLSLTypeString(effectiveType), |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 163 | this->getName().c_str()); |
| 164 | } else { |
tfarina@chromium.org | f6de475 | 2013-08-17 00:02:59 +0000 | [diff] [blame] | 165 | SkASSERT(this->getArrayCount() > 0); |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 166 | out->appendf("%s %s[%d]", |
bsalomon@google.com | 018f179 | 2013-04-18 19:36:09 +0000 | [diff] [blame] | 167 | GrGLSLTypeString(effectiveType), |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 168 | this->getName().c_str(), |
| 169 | this->getArrayCount()); |
| 170 | } |
| 171 | } else { |
| 172 | out->appendf("%s %s", |
bsalomon@google.com | 018f179 | 2013-04-18 19:36:09 +0000 | [diff] [blame] | 173 | GrGLSLTypeString(effectiveType), |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 174 | this->getName().c_str()); |
| 175 | } |
| 176 | } |
| 177 | |
bsalomon@google.com | f0a104e | 2012-07-10 17:51:07 +0000 | [diff] [blame] | 178 | void appendArrayAccess(int index, SkString* out) const { |
tomhudson@google.com | da66898 | 2011-12-07 15:06:29 +0000 | [diff] [blame] | 179 | out->appendf("%s[%d]%s", |
| 180 | this->getName().c_str(), |
| 181 | index, |
| 182 | fUseUniformFloatArrays ? "" : ".x"); |
| 183 | } |
| 184 | |
bsalomon@google.com | f0a104e | 2012-07-10 17:51:07 +0000 | [diff] [blame] | 185 | void appendArrayAccess(const char* indexName, SkString* out) const { |
tomhudson@google.com | da66898 | 2011-12-07 15:06:29 +0000 | [diff] [blame] | 186 | out->appendf("%s[%s]%s", |
| 187 | this->getName().c_str(), |
| 188 | indexName, |
| 189 | fUseUniformFloatArrays ? "" : ".x"); |
| 190 | } |
| 191 | |
egdaniel | f529439 | 2015-10-21 07:14:17 -0700 | [diff] [blame] | 192 | static const char* PrecisionString(const GrGLSLCaps* glslCaps, GrSLPrecision p) { |
commit-bot@chromium.org | 344cf45 | 2013-06-17 14:19:01 +0000 | [diff] [blame] | 193 | // Desktop GLSL has added precision qualifiers but they don't do anything. |
egdaniel | f529439 | 2015-10-21 07:14:17 -0700 | [diff] [blame] | 194 | if (glslCaps->usesPrecisionModifiers()) { |
commit-bot@chromium.org | 344cf45 | 2013-06-17 14:19:01 +0000 | [diff] [blame] | 195 | switch (p) { |
bsalomon | c0bd648 | 2014-12-09 10:04:14 -0800 | [diff] [blame] | 196 | case kLow_GrSLPrecision: |
commit-bot@chromium.org | 344cf45 | 2013-06-17 14:19:01 +0000 | [diff] [blame] | 197 | return "lowp "; |
bsalomon | c0bd648 | 2014-12-09 10:04:14 -0800 | [diff] [blame] | 198 | case kMedium_GrSLPrecision: |
commit-bot@chromium.org | 344cf45 | 2013-06-17 14:19:01 +0000 | [diff] [blame] | 199 | return "mediump "; |
bsalomon | c0bd648 | 2014-12-09 10:04:14 -0800 | [diff] [blame] | 200 | case kHigh_GrSLPrecision: |
commit-bot@chromium.org | 344cf45 | 2013-06-17 14:19:01 +0000 | [diff] [blame] | 201 | return "highp "; |
commit-bot@chromium.org | 344cf45 | 2013-06-17 14:19:01 +0000 | [diff] [blame] | 202 | default: |
commit-bot@chromium.org | 88cb22b | 2014-04-30 14:17:00 +0000 | [diff] [blame] | 203 | SkFAIL("Unexpected precision type."); |
commit-bot@chromium.org | 344cf45 | 2013-06-17 14:19:01 +0000 | [diff] [blame] | 204 | } |
| 205 | } |
| 206 | return ""; |
| 207 | } |
| 208 | |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 209 | private: |
egdaniel | f529439 | 2015-10-21 07:14:17 -0700 | [diff] [blame] | 210 | static const char* TypeModifierString(const GrGLSLCaps* glslCaps, TypeModifier t) { |
| 211 | GrGLSLGeneration gen = glslCaps->generation(); |
tomhudson@google.com | 086e535 | 2011-12-08 14:44:10 +0000 | [diff] [blame] | 212 | switch (t) { |
| 213 | case kNone_TypeModifier: |
| 214 | return ""; |
tomhudson@google.com | 086e535 | 2011-12-08 14:44:10 +0000 | [diff] [blame] | 215 | case kIn_TypeModifier: |
bsalomon@google.com | 77cf460 | 2013-04-22 21:05:48 +0000 | [diff] [blame] | 216 | return "in"; |
| 217 | case kInOut_TypeModifier: |
| 218 | return "inout"; |
| 219 | case kOut_TypeModifier: |
| 220 | return "out"; |
tomhudson@google.com | 086e535 | 2011-12-08 14:44:10 +0000 | [diff] [blame] | 221 | case kUniform_TypeModifier: |
| 222 | return "uniform"; |
| 223 | case kAttribute_TypeModifier: |
bsalomon@google.com | e55fd0f | 2012-02-10 15:56:06 +0000 | [diff] [blame] | 224 | return k110_GrGLSLGeneration == gen ? "attribute" : "in"; |
bsalomon@google.com | 77cf460 | 2013-04-22 21:05:48 +0000 | [diff] [blame] | 225 | case kVaryingIn_TypeModifier: |
| 226 | return k110_GrGLSLGeneration == gen ? "varying" : "in"; |
| 227 | case kVaryingOut_TypeModifier: |
| 228 | return k110_GrGLSLGeneration == gen ? "varying" : "out"; |
tomhudson@google.com | 086e535 | 2011-12-08 14:44:10 +0000 | [diff] [blame] | 229 | default: |
commit-bot@chromium.org | 88cb22b | 2014-04-30 14:17:00 +0000 | [diff] [blame] | 230 | SkFAIL("Unknown shader variable type modifier."); |
tomhudson@google.com | 086e535 | 2011-12-08 14:44:10 +0000 | [diff] [blame] | 231 | return ""; // suppress warning |
| 232 | } |
| 233 | } |
| 234 | |
tomhudson@google.com | da66898 | 2011-12-07 15:06:29 +0000 | [diff] [blame] | 235 | /// Work around driver bugs on some hardware that don't correctly |
| 236 | /// support uniform float [] |
| 237 | bool fUseUniformFloatArrays; |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 238 | |
egdaniel | ae47418 | 2016-01-21 11:19:52 -0800 | [diff] [blame] | 239 | SkString fLayoutQualifier; |
| 240 | |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 241 | typedef GrShaderVar INHERITED; |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 242 | }; |
| 243 | |
| 244 | #endif |