aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-10-26 15:15:47 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-26 20:17:37 +0000
commit8713b88332e25105eda702540eaef7ada731f1fb (patch)
treeaa8580e2ed0b0b394c137d12f95442af3cb92ca3
parentec56f277ffcc8380b4924eef0d0942ed708d7fc9 (diff)
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 <robertphillips@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
-rw-r--r--src/gpu/gl/GrGLCaps.cpp8
1 files changed, 8 insertions, 0 deletions
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 <format>
// param to Tex(Sub)Image. ES 2.0 requires the <internalFormat> and <format> params to match.
// Thus, on ES 2.0 we will use GL_SRGB_ALPHA as the <format> param.