OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrGLProgramBuilder_DEFINED | 8 #ifndef GrGLProgramBuilder_DEFINED |
9 #define GrGLProgramBuilder_DEFINED | 9 #define GrGLProgramBuilder_DEFINED |
10 | 10 |
11 #include "GrGLFragmentShaderBuilder.h" | 11 #include "GrGLFragmentShaderBuilder.h" |
12 #include "GrGLGeometryShaderBuilder.h" | 12 #include "GrGLGeometryShaderBuilder.h" |
13 #include "GrGLVertexShaderBuilder.h" | 13 #include "GrGLVertexShaderBuilder.h" |
14 #include "../GrGLProgramDataManager.h" | 14 #include "glsl/GrGLSLProgramDataManager.h" |
15 #include "../GrGLPrimitiveProcessor.h" | 15 #include "../GrGLPrimitiveProcessor.h" |
16 #include "../GrGLXferProcessor.h" | 16 #include "../GrGLXferProcessor.h" |
17 #include "../../GrPipeline.h" | 17 #include "../../GrPipeline.h" |
18 | 18 |
19 class GrFragmentProcessor; | 19 class GrFragmentProcessor; |
20 class GrGLSLCaps; | 20 class GrGLSLCaps; |
21 | 21 |
22 // Enough precision to represent 1 / 2048 accurately in printf | 22 // Enough precision to represent 1 / 2048 accurately in printf |
23 #define GR_SIGNIFICANT_POW2_DECIMAL_DIG 11 | 23 #define GR_SIGNIFICANT_POW2_DECIMAL_DIG 11 |
24 | 24 |
(...skipping 10 matching lines...) Expand all Loading... |
35 class GrGLUniformBuilder { | 35 class GrGLUniformBuilder { |
36 public: | 36 public: |
37 enum ShaderVisibility { | 37 enum ShaderVisibility { |
38 kVertex_Visibility = 1 << kVertex_GrShaderType, | 38 kVertex_Visibility = 1 << kVertex_GrShaderType, |
39 kGeometry_Visibility = 1 << kGeometry_GrShaderType, | 39 kGeometry_Visibility = 1 << kGeometry_GrShaderType, |
40 kFragment_Visibility = 1 << kFragment_GrShaderType, | 40 kFragment_Visibility = 1 << kFragment_GrShaderType, |
41 }; | 41 }; |
42 | 42 |
43 virtual ~GrGLUniformBuilder() {} | 43 virtual ~GrGLUniformBuilder() {} |
44 | 44 |
45 typedef GrGLProgramDataManager::UniformHandle UniformHandle; | 45 typedef GrGLSLProgramDataManager::UniformHandle UniformHandle; |
46 typedef GrGLProgramDataManager::SeparableVaryingHandle SeparableVaryingHandl
e; | 46 typedef GrGLProgramDataManager::SeparableVaryingHandle SeparableVaryingHandl
e; |
47 | 47 |
48 /** Add a uniform variable to the current program, that has visibility in on
e or more shaders. | 48 /** Add a uniform variable to the current program, that has visibility in on
e or more shaders. |
49 visibility is a bitfield of ShaderVisibility values indicating from whic
h shaders the | 49 visibility is a bitfield of ShaderVisibility values indicating from whic
h shaders the |
50 uniform should be accessible. At least one bit must be set. Geometry sha
der uniforms are not | 50 uniform should be accessible. At least one bit must be set. Geometry sha
der uniforms are not |
51 supported at this time. The actual uniform name will be mangled. If outN
ame is not nullptr then | 51 supported at this time. The actual uniform name will be mangled. If outN
ame is not nullptr then |
52 it will refer to the final uniform name after return. Use the addUniform
Array variant to add | 52 it will refer to the final uniform name after return. Use the addUniform
Array variant to add |
53 an array of uniforms. */ | 53 an array of uniforms. */ |
54 UniformHandle addUniform(uint32_t visibility, | 54 UniformHandle addUniform(uint32_t visibility, |
55 GrSLType type, | 55 GrSLType type, |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 GrGLPrimitiveProcessor::TransformsOut fOutCoords; | 404 GrGLPrimitiveProcessor::TransformsOut fOutCoords; |
405 SkTArray<UniformHandle> fSamplerUniforms; | 405 SkTArray<UniformHandle> fSamplerUniforms; |
406 SeparableVaryingInfoArray fSeparableVaryingInfos; | 406 SeparableVaryingInfoArray fSeparableVaryingInfos; |
407 | 407 |
408 friend class GrGLShaderBuilder; | 408 friend class GrGLShaderBuilder; |
409 friend class GrGLVertexBuilder; | 409 friend class GrGLVertexBuilder; |
410 friend class GrGLFragmentShaderBuilder; | 410 friend class GrGLFragmentShaderBuilder; |
411 friend class GrGLGeometryBuilder; | 411 friend class GrGLGeometryBuilder; |
412 }; | 412 }; |
413 #endif | 413 #endif |
OLD | NEW |