diff options
author | bsalomon <bsalomon@google.com> | 2014-07-17 10:50:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-07-17 10:50:59 -0700 |
commit | e904c09a3a9c701e8d91f2f6ee161feda7615d90 (patch) | |
tree | d16bb75440bbad4bda8e07f0d6d23b9c9061e6c4 /src/gpu/gl/GrGpuGL.cpp | |
parent | e57452debd6a1f92641af4ca09bc2227476fff10 (diff) |
Fix alpha textures in NV ES3 contexts on Windows.
Make unit tests iterate over all the rendering GL context types rather than using kNative.
Fix the extension printing when gStartupSpew is set.
R=jvanverth@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/398183002
Diffstat (limited to 'src/gpu/gl/GrGpuGL.cpp')
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index 52e3c33601..b62129fe87 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -137,9 +137,7 @@ GrGpuGL::GrGpuGL(const GrGLContext& ctx, GrContext* context) GrPrintf("------ RENDERER %s\n", renderer); GrPrintf("------ VERSION %s\n", version); GrPrintf("------ EXTENSIONS\n"); -#if 0 // TODO: Reenable this after GrGLInterface's extensions can be accessed safely. - ctx.extensions().print(); -#endif + ctx.extensions().print(); GrPrintf("\n"); GrPrintf(this->glCaps().dump().c_str()); } @@ -574,13 +572,21 @@ bool GrGpuGL::uploadTexData(const GrGLTexture::Desc& desc, } GrGLenum internalFormat; - GrGLenum externalFormat; - GrGLenum externalType; + 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. - if (!this->configToGLFormats(dataConfig, useTexStorage, &internalFormat, + bool useSizedFormat = useTexStorage; + // At least some versions of the desktop ES3 drivers for NVIDIA won't accept GL_RED in + // glTexImage2D for the internal format but will accept GL_R8. + if (!useSizedFormat && kNVIDIA_GrGLVendor == this->glContext().vendor() && + kGLES_GrGLStandard == this->glStandard() && this->glVersion() >= GR_GL_VER(3, 0)) { + useSizedFormat = true; + } + if (!this->configToGLFormats(dataConfig, useSizedFormat, &internalFormat, &externalFormat, &externalType)) { return false; } |