From 8713b88332e25105eda702540eaef7ada731f1fb Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Thu, 26 Oct 2017 15:15:47 -0400 Subject: Add workaround for Gallium TexImage internalFormat for Alpha8 Bug: skia: Change-Id: I1e243d8c58b533bcbbc446d189d76fda5c61b3fb Reviewed-on: https://skia-review.googlesource.com/64067 Reviewed-by: Robert Phillips Commit-Queue: Greg Daniel --- src/gpu/gl/GrGLCaps.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 9d031ce4ad..fd35827e80 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -2142,6 +2142,14 @@ void GrGLCaps::initConfigTable(const GrContextOptions& contextOptions, fConfigTable[i].fFormats.fSizedInternalFormat : fConfigTable[i].fFormats.fBaseInternalFormat; } + // Gallium llvmpipe renderer on ES 3.0 does not have R8 so we use Alpha for + // kAlpha_8_GrPixelConfig. Alpha8 is not a valid signed internal format so we must use the base + // internal format for that config when doing TexImage calls. + if(kGalliumLLVM_GrGLRenderer == ctxInfo.renderer()) { + fConfigTable[kAlpha_8_GrPixelConfig].fFormats.fInternalFormatTexImage = + fConfigTable[kAlpha_8_GrPixelConfig].fFormats.fBaseInternalFormat; + } + // OpenGL ES 2.0 + GL_EXT_sRGB allows GL_SRGB_ALPHA to be specified as the // param to Tex(Sub)Image. ES 2.0 requires the and params to match. // Thus, on ES 2.0 we will use GL_SRGB_ALPHA as the param. -- cgit v1.2.3