From c0b9b20ba65a5105f31d0641c7e892d7b14983d9 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Tue, 20 Aug 2013 12:22:48 +0000 Subject: [PATCH] Changed rules about sized internal formats on GLES3. R=jvanverth@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/22823006 git-svn-id: http://skia.googlecode.com/svn/trunk@10806 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/gpu/gl/GrGLUtil.cpp | 3 +++ src/gpu/gl/GrGLUtil.h | 1 + src/gpu/gl/GrGpuGL.cpp | 13 +++++++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp index 8440c57..99efeaf 100644 --- a/src/gpu/gl/GrGLUtil.cpp +++ b/src/gpu/gl/GrGLUtil.cpp @@ -206,6 +206,9 @@ GrGLVendor GrGLGetVendorFromString(const char* vendorString) { if (0 == strcmp(vendorString, "Intel")) { return kIntel_GrGLVendor; } + if (0 == strcmp(vendorString, "Qualcomm")) { + return kQualcomm_GrGLVendor; + } } return kOther_GrGLVendor; } diff --git a/src/gpu/gl/GrGLUtil.h b/src/gpu/gl/GrGLUtil.h index b8a96e5..9a82b0b 100644 --- a/src/gpu/gl/GrGLUtil.h +++ b/src/gpu/gl/GrGLUtil.h @@ -23,6 +23,7 @@ enum GrGLVendor { kARM_GrGLVendor, kImagination_GrGLVendor, kIntel_GrGLVendor, + kQualcomm_GrGLVendor, kOther_GrGLVendor }; diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index c95edb7..c10df6c 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -610,9 +610,14 @@ bool GrGpuGL::uploadTexData(const GrGLTexture::Desc& desc, GrGLenum internalFormat; GrGLenum externalFormat; GrGLenum externalType; - // glTexStorage requires sized internal formats on both desktop and ES. ES - // glTexImage requires an unsized format. - if (!this->configToGLFormats(dataConfig, useTexStorage, &internalFormat, + // glTexStorage requires sized internal formats on both desktop and ES. ES2 + // requires an unsized format for glTexImage. ES3 has relaxed this restriction. + // Qualcomm Adreno drivers seem to have issues with the relaxed ES3 rules. + bool useSizedInternalFormat = useTexStorage || + kDesktop_GrGLBinding == this->glBinding() || + (this->glVersion() >= GR_GL_VER(3,0) && + kQualcomm_GrGLVendor != this->glContext().info().vendor()); + if (!this->configToGLFormats(dataConfig, useSizedInternalFormat, &internalFormat, &externalFormat, &externalType)) { return false; } @@ -809,7 +814,7 @@ bool GrGpuGL::createRenderTargetObjects(int width, int height, if (!desc->fRTFBOID || !desc->fMSColorRenderbufferID || !this->configToGLFormats(desc->fConfig, - // GLES requires sized internal formats + // ES2 and ES3 require sized internal formats for rb storage. kES_GrGLBinding == this->glBinding(), &msColorFormat, NULL, -- 2.7.4