Index: src/gpu/gl/GrGLProgramEffects.cpp |
diff --git a/src/gpu/gl/GrGLProgramEffects.cpp b/src/gpu/gl/GrGLProgramEffects.cpp |
index 369ec1076030f25e8abccf694006692abb1fbf3a..222fa3c3d12db91d5bd43474d3b3cd7f83852b10 100644 |
--- a/src/gpu/gl/GrGLProgramEffects.cpp |
+++ b/src/gpu/gl/GrGLProgramEffects.cpp |
@@ -215,11 +215,12 @@ void GrGLProgramEffects::emitSamplers(GrGLProgramBuilder* builder, |
SkString name; |
for (int t = 0; t < numTextures; ++t) { |
name.printf("Sampler%d", t); |
+ const GrTextureAccess& textureAccess = effect->textureAccess(t); |
samplers[t].fUniform = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
- kSampler2D_GrSLType, |
- name.c_str()); |
+ SkToBool(textureAccess.getTexture()->desc().fFlags & k3DTexture_GrTextureFlagBit) ? |
+ kSampler3D_GrSLType : kSampler2D_GrSLType, name.c_str()); |
SkNEW_APPEND_TO_TARRAY(outSamplers, TextureSampler, |
- (samplers[t].fUniform, effect->textureAccess(t))); |
+ (samplers[t].fUniform, textureAccess)); |
} |
} |