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