Index: src/gpu/gl/builders/GrGLProgramBuilder.cpp |
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp |
index a0dd555587f7a466f98bbfa48769443c1e6b8843..55ebf6890feac394f5bff386ca0a3f103ca67f55 100644 |
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp |
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp |
@@ -217,11 +217,14 @@ void GrGLProgramBuilder::emitSamplers(const GrEffect& 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, GrGLEffect::TextureSampler, |
- (samplers[t].fUniform, effect.textureAccess(t))); |
+ (samplers[t].fUniform, ta)); |
} |
} |