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

Unified Diff: src/gpu/gl/GrGLProgram.cpp

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLProgram.h ('k') | src/gpu/gl/GrGLProgramDataManager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgram.cpp
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 6a433e17c5a5bbd4228402a179d4a3a9c3b51236..c270858ec3cf82b3ed1b4184b849c550f0ae85db 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -31,11 +31,11 @@ GrGLProgram::GrGLProgram(GrGLGpu* gpu,
const BuiltinUniformHandles& builtinUniforms,
GrGLuint programID,
const UniformInfoArray& uniforms,
+ const SkTArray<GrGLSampler>& samplers,
const VaryingInfoArray& pathProcVaryings,
GrGLSLPrimitiveProcessor* geometryProcessor,
GrGLSLXferProcessor* xferProcessor,
- const GrGLSLFragProcs& fragmentProcessors,
- SkTArray<UniformHandle>* passSamplerUniforms)
+ const GrGLSLFragProcs& fragmentProcessors)
: fBuiltinUniformHandles(builtinUniforms)
, fProgramID(programID)
, fGeometryProcessor(geometryProcessor)
@@ -44,12 +44,9 @@ GrGLProgram::GrGLProgram(GrGLGpu* gpu,
, fDesc(desc)
, fGpu(gpu)
, fProgramDataManager(gpu, programID, uniforms, pathProcVaryings) {
- fSamplerUniforms.swap(passSamplerUniforms);
// Assign texture units to sampler uniforms one time up front.
GL_CALL(UseProgram(fProgramID));
- for (int i = 0; i < fSamplerUniforms.count(); i++) {
- fProgramDataManager.setSampler(fSamplerUniforms[i], i);
- }
+ fProgramDataManager.setSamplers(samplers);
}
GrGLProgram::~GrGLProgram() {
« no previous file with comments | « src/gpu/gl/GrGLProgram.h ('k') | src/gpu/gl/GrGLProgramDataManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698