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)); |
} |
} |