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

Side by Side Diff: src/gpu/gl/GrGLProgram.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/effects/GrTextureDomain.cpp ('k') | src/gpu/gl/GrGLProgram.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 2011 Google Inc. 2 * Copyright 2011 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 8
9 #ifndef GrGLProgram_DEFINED 9 #ifndef GrGLProgram_DEFINED
10 #define GrGLProgram_DEFINED 10 #define GrGLProgram_DEFINED
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 protected: 99 protected:
100 typedef GrGLSLProgramDataManager::UniformHandle UniformHandle; 100 typedef GrGLSLProgramDataManager::UniformHandle UniformHandle;
101 typedef GrGLProgramDataManager::UniformInfoArray UniformInfoArray; 101 typedef GrGLProgramDataManager::UniformInfoArray UniformInfoArray;
102 typedef GrGLProgramDataManager::VaryingInfoArray VaryingInfoArray; 102 typedef GrGLProgramDataManager::VaryingInfoArray VaryingInfoArray;
103 103
104 GrGLProgram(GrGLGpu*, 104 GrGLProgram(GrGLGpu*,
105 const GrProgramDesc&, 105 const GrProgramDesc&,
106 const BuiltinUniformHandles&, 106 const BuiltinUniformHandles&,
107 GrGLuint programID, 107 GrGLuint programID,
108 const UniformInfoArray&, 108 const UniformInfoArray&,
109 const SkTArray<GrGLSampler>&,
109 const VaryingInfoArray&, // used for NVPR only currently 110 const VaryingInfoArray&, // used for NVPR only currently
110 GrGLSLPrimitiveProcessor* geometryProcessor, 111 GrGLSLPrimitiveProcessor* geometryProcessor,
111 GrGLSLXferProcessor* xferProcessor, 112 GrGLSLXferProcessor* xferProcessor,
112 const GrGLSLFragProcs& fragmentProcessors, 113 const GrGLSLFragProcs& fragmentProcessors);
113 SkTArray<UniformHandle>* passSamplerUniforms);
114 114
115 // A helper to loop over effects, set the transforms (via subclass) and bind textures 115 // A helper to loop over effects, set the transforms (via subclass) and bind textures
116 void setFragmentData(const GrPrimitiveProcessor&, const GrPipeline&, int* ne xtSamplerIdx); 116 void setFragmentData(const GrPrimitiveProcessor&, const GrPipeline&, int* ne xtSamplerIdx);
117 void setTransformData(const GrPrimitiveProcessor&, const GrFragmentProcessor &, int index); 117 void setTransformData(const GrPrimitiveProcessor&, const GrFragmentProcessor &, int index);
118 118
119 // Helper for setData() that sets the view matrix and loads the render targe t height uniform 119 // Helper for setData() that sets the view matrix and loads the render targe t height uniform
120 void setRenderTargetState(const GrPrimitiveProcessor&, const GrPipeline&); 120 void setRenderTargetState(const GrPrimitiveProcessor&, const GrPipeline&);
121 121
122 // Helper for setData() that binds textures and texel buffers to the appropr iate texture units 122 // Helper for setData() that binds textures and texel buffers to the appropr iate texture units
123 void bindTextures(const GrProcessor&, bool allowSRGBInputs, int* nextSampler Idx); 123 void bindTextures(const GrProcessor&, bool allowSRGBInputs, int* nextSampler Idx);
124 124
125 // these reflect the current values of uniforms (GL uniform values travel wi th program) 125 // these reflect the current values of uniforms (GL uniform values travel wi th program)
126 RenderTargetState fRenderTargetState; 126 RenderTargetState fRenderTargetState;
127 BuiltinUniformHandles fBuiltinUniformHandles; 127 BuiltinUniformHandles fBuiltinUniformHandles;
128 GrGLuint fProgramID; 128 GrGLuint fProgramID;
129 129
130 // the installed effects 130 // the installed effects
131 SkAutoTDelete<GrGLSLPrimitiveProcessor> fGeometryProcessor; 131 SkAutoTDelete<GrGLSLPrimitiveProcessor> fGeometryProcessor;
132 SkAutoTDelete<GrGLSLXferProcessor> fXferProcessor; 132 SkAutoTDelete<GrGLSLXferProcessor> fXferProcessor;
133 GrGLSLFragProcs fFragmentProcessors; 133 GrGLSLFragProcs fFragmentProcessors;
134 134
135 GrProgramDesc fDesc; 135 GrProgramDesc fDesc;
136 GrGLGpu* fGpu; 136 GrGLGpu* fGpu;
137 GrGLProgramDataManager fProgramDataManager; 137 GrGLProgramDataManager fProgramDataManager;
138 SkTArray<UniformHandle> fSamplerUniforms;
139 138
140 friend class GrGLProgramBuilder; 139 friend class GrGLProgramBuilder;
141 140
142 typedef SkRefCnt INHERITED; 141 typedef SkRefCnt INHERITED;
143 }; 142 };
144 143
145 #endif 144 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrTextureDomain.cpp ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698