diff options
author | jvanverth <jvanverth@google.com> | 2014-12-16 05:45:49 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-16 05:45:49 -0800 |
commit | bc02bf0ee4221604796cd6d0394ca3af60c0a579 (patch) | |
tree | 221d145542531d8f66e793df845785f392b1714e | |
parent | af7aac81b4c2b789eee94701b70ac2de0361f2bc (diff) |
Change desktop and ES 3.0 to always use sized internal texture formats.
Review URL: https://codereview.chromium.org/806943002
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index 0efb7ebdd0..34a2a537bf 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -558,17 +558,10 @@ bool GrGpuGL::uploadTexData(const GrSurfaceDesc& desc, GrGLenum externalFormat = 0x0; // suprress warning GrGLenum externalType = 0x0;// suprress warning - // glTexStorage requires sized internal formats on both desktop and ES. ES2 requires an unsized - // format for glTexImage, unlike ES3 and desktop. However, we allow the driver to decide the - // size of the internal format whenever possible and so only use a sized internal format when - // using texture storage. - bool useSizedFormat = useTexStorage; - // Many versions of the ES3 drivers on various platforms will not accept GL_RED in - // glTexImage2D for the internal format but will accept GL_R8. - if (kGLES_GrGLStandard == this->glStandard() && this->glVersion() >= GR_GL_VER(3, 0) && - kAlpha_8_GrPixelConfig == dataConfig) { - useSizedFormat = true; - } + // glTexStorage requires sized internal formats on both desktop and ES. + // ES2 requires an unsized format for glTexImage. On ES3 and desktop we default to sized. + bool useSizedFormat = useTexStorage || kGL_GrGLStandard == this->glStandard() || + this->glVersion() >= GR_GL_VER(3, 0); if (!this->configToGLFormats(dataConfig, useSizedFormat, &internalFormat, &externalFormat, &externalType)) { return false; |