aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
authorGravatar Alexis Hetu <sugoi@google.com>2018-03-15 10:08:42 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-15 14:51:06 +0000
commit0e90f9849a7ba4c745478694f0b2c99736561830 (patch)
tree0b131118c36c97513e1f152033de185c8e516d8c /src/gpu/gl
parent5d389c2359518d27e4de95f962e62a709aff1080 (diff)
Check GL_EXT_texture_format_BGRA8888 before GL_APPLE_texture_format_BGRA8888
When both GL_EXT_texture_format_BGRA8888 and GL_APPLE_texture_format_BGRA8888 extensions are present, the presence of GL_APPLE_texture_format_BGRA8888 was preventing GL_EXT_texture_format_BGRA8888 from allowing BGRA8888 to be used as a render target. By checking for GL_EXT_texture_format_BGRA8888 first, this solves the issue. The issue was encountered trying to run vr_pixeltests on top of SwiftShader on the bots with a version of SwiftShader exposing both extension strings. Change-Id: I446ec502a4703d24c24339708dcbbe9c334a7533 Reviewed-on: https://skia-review.googlesource.com/114495 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Alexis Hetu <sugoi@google.com>
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 4def7b7427..5134314fef 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -1445,7 +1445,19 @@ void GrGLCaps::initConfigTable(const GrContextOptions& contextOptions,
} else {
fConfigTable[kBGRA_8888_GrPixelConfig].fFormats.fBaseInternalFormat = GR_GL_BGRA;
fConfigTable[kBGRA_8888_GrPixelConfig].fFormats.fSizedInternalFormat = GR_GL_BGRA8;
- if (ctxInfo.hasExtension("GL_APPLE_texture_format_BGRA8888")) {
+ if (ctxInfo.hasExtension("GL_EXT_texture_format_BGRA8888")) {
+ fConfigTable[kBGRA_8888_GrPixelConfig].fFlags = ConfigInfo::kTextureable_Flag |
+ nonMSAARenderFlags;
+
+ if (ctxInfo.hasExtension("GL_EXT_texture_storage")) {
+ supportsBGRATexStorage = true;
+ }
+ if (ctxInfo.hasExtension("GL_CHROMIUM_renderbuffer_format_BGRA8888") &&
+ (this->usesMSAARenderBuffers() || this->fMSFBOType == kMixedSamples_MSFBOType)) {
+ fConfigTable[kBGRA_8888_GrPixelConfig].fFlags |=
+ ConfigInfo::kRenderableWithMSAA_Flag;
+ }
+ } else if (ctxInfo.hasExtension("GL_APPLE_texture_format_BGRA8888")) {
// This APPLE extension introduces complexity on ES2. It leaves the internal format
// as RGBA, but allows BGRA as the external format. From testing, it appears that the
// driver remembers the external format when the texture is created (with TexImage).
@@ -1458,18 +1470,6 @@ void GrGLCaps::initConfigTable(const GrContextOptions& contextOptions,
fConfigTable[kBGRA_8888_GrPixelConfig].fFlags = ConfigInfo::kTextureable_Flag;
supportsBGRATexStorage = true;
}
- } else if (ctxInfo.hasExtension("GL_EXT_texture_format_BGRA8888")) {
- fConfigTable[kBGRA_8888_GrPixelConfig].fFlags = ConfigInfo::kTextureable_Flag |
- nonMSAARenderFlags;
-
- if (ctxInfo.hasExtension("GL_EXT_texture_storage")) {
- supportsBGRATexStorage = true;
- }
- if (ctxInfo.hasExtension("GL_CHROMIUM_renderbuffer_format_BGRA8888") &&
- (this->usesMSAARenderBuffers() || this->fMSFBOType == kMixedSamples_MSFBOType)) {
- fConfigTable[kBGRA_8888_GrPixelConfig].fFlags |=
- ConfigInfo::kRenderableWithMSAA_Flag;
- }
}
}