OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrGLSLUniformHandler_DEFINED | 8 #ifndef GrGLSLUniformHandler_DEFINED |
9 #define GrGLSLUniformHandler_DEFINED | 9 #define GrGLSLUniformHandler_DEFINED |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 visibility is a bitfield of GrShaderFlag values indicating from which sh
aders the uniform | 25 visibility is a bitfield of GrShaderFlag values indicating from which sh
aders the uniform |
26 should be accessible. At least one bit must be set. Geometry shader unif
orms are not | 26 should be accessible. At least one bit must be set. Geometry shader unif
orms are not |
27 supported at this time. The actual uniform name will be mangled. If outN
ame is not nullptr | 27 supported at this time. The actual uniform name will be mangled. If outN
ame is not nullptr |
28 then it will refer to the final uniform name after return. Use the addUn
iformArray variant | 28 then it will refer to the final uniform name after return. Use the addUn
iformArray variant |
29 to add an array of uniforms. */ | 29 to add an array of uniforms. */ |
30 UniformHandle addUniform(uint32_t visibility, | 30 UniformHandle addUniform(uint32_t visibility, |
31 GrSLType type, | 31 GrSLType type, |
32 GrSLPrecision precision, | 32 GrSLPrecision precision, |
33 const char* name, | 33 const char* name, |
34 const char** outName = nullptr) { | 34 const char** outName = nullptr) { |
35 SkASSERT(!GrSLTypeIsSamplerType(type)); | 35 SkASSERT(!GrSLTypeIsCombinedSamplerType(type)); |
36 return this->addUniformArray(visibility, type, precision, name, 0, outNa
me); | 36 return this->addUniformArray(visibility, type, precision, name, 0, outNa
me); |
37 } | 37 } |
38 | 38 |
39 UniformHandle addUniformArray(uint32_t visibility, | 39 UniformHandle addUniformArray(uint32_t visibility, |
40 GrSLType type, | 40 GrSLType type, |
41 GrSLPrecision precision, | 41 GrSLPrecision precision, |
42 const char* name, | 42 const char* name, |
43 int arrayCount, | 43 int arrayCount, |
44 const char** outName = nullptr) { | 44 const char** outName = nullptr) { |
45 SkASSERT(!GrSLTypeIsSamplerType(type)); | 45 SkASSERT(!GrSLTypeIsCombinedSamplerType(type)); |
46 return this->internalAddUniformArray(visibility, type, precision, name,
true, arrayCount, | 46 return this->internalAddUniformArray(visibility, type, precision, name,
true, arrayCount, |
47 outName); | 47 outName); |
48 } | 48 } |
49 | 49 |
50 virtual const GrGLSLShaderVar& getUniformVariable(UniformHandle u) const = 0
; | 50 virtual const GrGLSLShaderVar& getUniformVariable(UniformHandle u) const = 0
; |
51 | 51 |
52 /** | 52 /** |
53 * Shortcut for getUniformVariable(u).c_str() | 53 * Shortcut for getUniformVariable(u).c_str() |
54 */ | 54 */ |
55 virtual const char* getUniformCStr(UniformHandle u) const = 0; | 55 virtual const char* getUniformCStr(UniformHandle u) const = 0; |
(...skipping 29 matching lines...) Expand all Loading... |
85 bool mangleName, | 85 bool mangleName, |
86 int arrayCount, | 86 int arrayCount, |
87 const char** outName) = 0; | 87 const char** outName) = 0; |
88 | 88 |
89 virtual void appendUniformDecls(GrShaderFlags visibility, SkString*) const =
0; | 89 virtual void appendUniformDecls(GrShaderFlags visibility, SkString*) const =
0; |
90 | 90 |
91 friend class GrGLSLProgramBuilder; | 91 friend class GrGLSLProgramBuilder; |
92 }; | 92 }; |
93 | 93 |
94 #endif | 94 #endif |
OLD | NEW |