From 1bfccadae265a2ec0e5adfcc8fe98bee07b73835 Mon Sep 17 00:00:00 2001 From: "twiz@google.com" Date: Thu, 2 Aug 2012 17:32:25 +0000 Subject: Early out the texture key generation if there is no texture passed to the GrGLShaderBuilder::keyForTextureAccess. Under normal circumstances, there will always be a passed texture. However, when running in the unit tests, CustomStages are constructed without a texture input. Review URL: https://codereview.appspot.com/6450083 git-svn-id: http://skia.googlecode.com/svn/trunk@4924 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/gpu/gl/GrGLShaderBuilder.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gpu/gl/GrGLShaderBuilder.cpp') diff --git a/src/gpu/gl/GrGLShaderBuilder.cpp b/src/gpu/gl/GrGLShaderBuilder.cpp index 0d2a1ecf44..7171029f5b 100644 --- a/src/gpu/gl/GrGLShaderBuilder.cpp +++ b/src/gpu/gl/GrGLShaderBuilder.cpp @@ -180,6 +180,11 @@ void GrGLShaderBuilder::emitCustomTextureLookup(SamplerMode samplerMode, GrCustomStage::StageKey GrGLShaderBuilder::KeyForTextureAccess(const GrTextureAccess& access, const GrGLCaps& caps) { GrCustomStage::StageKey key = 0; + + if (!access.getTexture()) { + return key; + } + // Assume that swizzle support implies that we never have to modify a shader to adjust // for texture format/swizzle settings. if (caps.textureSwizzleSupport()) { -- cgit v1.2.3