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

Unified Diff: src/gpu/gl/builders/GrGLProgramBuilder.cpp

Issue 580863004: Adding 3D lut color filter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added generationID for 3D texture key Created 6 years, 3 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
Index: src/gpu/gl/builders/GrGLProgramBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index 909ac76d62f73a2bd096f6ab12b0a1551c1280e9..91142e22534a7ffa2897d1088b59b78e2790d852 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -219,11 +219,14 @@ void GrGLProgramBuilder::emitSamplers(const GrProcessor& effect,
SkString name;
for (int t = 0; t < numTextures; ++t) {
name.printf("Sampler%d", t);
+ const GrTextureAccess& ta = effect.textureAccess(t);
+ const GrTexture* tex = ta.getTexture();
+ bool is3D = (tex != NULL) && (tex->desc().fDepth > 0);
samplers[t].fUniform = this->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kSampler2D_GrSLType,
+ is3D ? kSampler3D_GrSLType : kSampler2D_GrSLType,
name.c_str());
SkNEW_APPEND_TO_TARRAY(outSamplers, GrGLProcessor::TextureSampler,
- (samplers[t].fUniform, effect.textureAccess(t)));
+ (samplers[t].fUniform, ta));
}
}

Powered by Google App Engine
This is Rietveld 408576698