Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Side by Side Diff: src/gpu/gl/GrGLProgramDataManager.h

Issue 1885863004: Refactor how we store and use samplers in Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove unneeded assert Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLProgram.cpp ('k') | src/gpu/gl/GrGLProgramDataManager.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 GrGLProgramDataManager_DEFINED 8 #ifndef GrGLProgramDataManager_DEFINED
9 #define GrGLProgramDataManager_DEFINED 9 #define GrGLProgramDataManager_DEFINED
10 10
11 #include "glsl/GrGLSLProgramDataManager.h" 11 #include "glsl/GrGLSLProgramDataManager.h"
12 12
13 #include "GrAllocator.h" 13 #include "GrAllocator.h"
14 #include "gl/GrGLSampler.h"
14 #include "gl/GrGLTypes.h" 15 #include "gl/GrGLTypes.h"
15 #include "glsl/GrGLSLShaderVar.h" 16 #include "glsl/GrGLSLShaderVar.h"
16 17
17 #include "SkTArray.h" 18 #include "SkTArray.h"
18 19
19 class GrGLGpu; 20 class GrGLGpu;
20 class SkMatrix; 21 class SkMatrix;
21 class GrGLProgram; 22 class GrGLProgram;
22 23
23 /** Manages the resources used by a shader program. 24 /** Manages the resources used by a shader program.
(...skipping 15 matching lines...) Expand all
39 40
40 // This uses an allocator rather than array so that the GrGLSLShaderVars don 't move in memory 41 // This uses an allocator rather than array so that the GrGLSLShaderVars don 't move in memory
41 // after they are inserted. Users of GrGLShaderBuilder get refs to the vars and ptrs to their 42 // after they are inserted. Users of GrGLShaderBuilder get refs to the vars and ptrs to their
42 // name strings. Otherwise, we'd have to hand out copies. 43 // name strings. Otherwise, we'd have to hand out copies.
43 typedef GrTAllocator<UniformInfo> UniformInfoArray; 44 typedef GrTAllocator<UniformInfo> UniformInfoArray;
44 typedef GrTAllocator<VaryingInfo> VaryingInfoArray; 45 typedef GrTAllocator<VaryingInfo> VaryingInfoArray;
45 46
46 GrGLProgramDataManager(GrGLGpu*, GrGLuint programID, const UniformInfoArray& , 47 GrGLProgramDataManager(GrGLGpu*, GrGLuint programID, const UniformInfoArray& ,
47 const VaryingInfoArray&); 48 const VaryingInfoArray&);
48 49
50
51 void setSamplers(const SkTArray<GrGLSampler>& samplers) const;
52
49 /** Functions for uploading uniform values. The varities ending in v can be used to upload to an 53 /** Functions for uploading uniform values. The varities ending in v can be used to upload to an
50 * array of uniforms. arrayCount must be <= the array count of the uniform. 54 * array of uniforms. arrayCount must be <= the array count of the uniform.
51 */ 55 */
52 void setSampler(UniformHandle, int texUnit) const;
53
54 void set1f(UniformHandle, float v0) const override; 56 void set1f(UniformHandle, float v0) const override;
55 void set1fv(UniformHandle, int arrayCount, const float v[]) const override; 57 void set1fv(UniformHandle, int arrayCount, const float v[]) const override;
56 void set2f(UniformHandle, float, float) const override; 58 void set2f(UniformHandle, float, float) const override;
57 void set2fv(UniformHandle, int arrayCount, const float v[]) const override; 59 void set2fv(UniformHandle, int arrayCount, const float v[]) const override;
58 void set3f(UniformHandle, float, float, float) const override; 60 void set3f(UniformHandle, float, float, float) const override;
59 void set3fv(UniformHandle, int arrayCount, const float v[]) const override; 61 void set3fv(UniformHandle, int arrayCount, const float v[]) const override;
60 void set4f(UniformHandle, float, float, float, float) const override; 62 void set4f(UniformHandle, float, float, float, float) const override;
61 void set4fv(UniformHandle, int arrayCount, const float v[]) const override; 63 void set4fv(UniformHandle, int arrayCount, const float v[]) const override;
62 // matrices are column-major, the first three upload a single matrix, the la tter three upload 64 // matrices are column-major, the first three upload a single matrix, the la tter three upload
63 // arrayCount matrices into a uniform array. 65 // arrayCount matrices into a uniform array.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 106
105 SkTArray<Uniform, true> fUniforms; 107 SkTArray<Uniform, true> fUniforms;
106 SkTArray<PathProcVarying, true> fPathProcVaryings; 108 SkTArray<PathProcVarying, true> fPathProcVaryings;
107 GrGLGpu* fGpu; 109 GrGLGpu* fGpu;
108 GrGLuint fProgramID; 110 GrGLuint fProgramID;
109 111
110 typedef GrGLSLProgramDataManager INHERITED; 112 typedef GrGLSLProgramDataManager INHERITED;
111 }; 113 };
112 114
113 #endif 115 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgram.cpp ('k') | src/gpu/gl/GrGLProgramDataManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698