diff options
author | 2018-06-08 22:01:16 +0000 | |
---|---|---|
committer | 2018-06-08 22:01:23 +0000 | |
commit | 01422bc8eff0c317b9c234b3b4f5a82f1011dfce (patch) | |
tree | 35231fa8629686043413de7e96012985f158eaf5 /src/gpu/gl | |
parent | e8b38ab432faf419a6cc092082c34c233800ccea (diff) |
Revert "Reland "Require mips to be allocated at texture creation time and disable late allocations.""
This reverts commit 9eb36b9eb8e81e970e02fa985ae82fe64de0a8f0.
Reason for revert: Alpha8 isn't renderable on es2 so we end up dropping draws on certain A8 mip requests
Original change's description:
> Reland "Require mips to be allocated at texture creation time and disable late allocations."
>
> This reverts commit 0c78238e2991c95b6fb3c945d4ad2b5d941ae21b.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Revert "Require mips to be allocated at texture creation time and disable late allocations."
> >
> > This reverts commit cd2c3f9055452d413d6be7ea6dc63fd1922fe994.
> >
> > Reason for revert: Looks to be causing angle failures on initial clear test
> >
> > Original change's description:
> > > Require mips to be allocated at texture creation time and disable late allocations.
> > >
> > > If we get a non-mipped texture for a draw that wants to be use mip map filter, we
> > > will copy the texture into a new mipped texture.
> > >
> > > Clean up of unused code in the GPU backends for reallocating for mips will be done
> > > in a follow up CL.
> > >
> > > Bug: skia:
> > > Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188
> > > Reviewed-on: https://skia-review.googlesource.com/132830
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> >
> >
> > Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:
> > Reviewed-on: https://skia-review.googlesource.com/133041
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> Bug: skia:
> Change-Id: I004447a5f1ec72c3be2318ddea803f57efb12ea4
> Reviewed-on: https://skia-review.googlesource.com/133340
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: I9e9718d380c4d9927ec39e46008750ab7396391f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/133680
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 16 | ||||
-rw-r--r-- | src/gpu/gl/GrGLCaps.h | 4 | ||||
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 2 |
3 files changed, 9 insertions, 13 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 4f9b63fd62..e20d0137e9 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -1338,15 +1338,12 @@ void GrGLCaps::initConfigTable(const GrContextOptions& contextOptions, bool disableR8TexStorageForANGLEGL = false; bool disableSRGBRenderWithMSAAForMacAMD = false; bool disableRGB8ForMali400 = false; - bool disableGrayLumFBOForMesa = false; if (!contextOptions.fDisableDriverCorrectnessWorkarounds) { // ARB_texture_rg is part of OpenGL 3.0, but osmesa doesn't support GL_RED // and GL_RG on FBO textures. disableTextureRedForMesa = kOSMesa_GrGLRenderer == ctxInfo.renderer(); - disableGrayLumFBOForMesa = kOSMesa_GrGLRenderer == ctxInfo.renderer(); - bool isX86PowerVR = false; #if defined(SK_CPU_X86) if (kPowerVRRogue_GrGLRenderer == ctxInfo.renderer()) { @@ -1745,16 +1742,17 @@ void GrGLCaps::initConfigTable(const GrContextOptions& contextOptions, grayRedInfo.fSwizzle = GrSwizzle::RRRA(); grayRedInfo.fFlags = ConfigInfo::kTextureable_Flag; - // Leaving Gray8 as non-renderable, to keep things simple and match raster. However, we do - // enable the FBOColorAttachment_Flag so that we can bind it to an FBO for copies. - grayRedInfo.fFlags |= ConfigInfo::kFBOColorAttachment_Flag;; - if (kStandard_MSFBOType == this->msFBOType() && kGL_GrGLStandard == standard && - !disableGrayLumFBOForMesa) { +#if 0 // Leaving Gray8 as non-renderable, to keep things simple and match raster. Needs to be + // updated to support Gray8_as_Lum and Gray8_as_red if this is ever enabled. + if (this->textureRedSupport() || + (kDesktop_ARB_MSFBOType == this->msFBOType() && + ctxInfo.renderer() != kOSMesa_GrGLRenderer)) { // desktop ARB extension/3.0+ supports LUMINANCE8 as renderable. // However, osmesa fails if it used even when GL_ARB_framebuffer_object is present. // Core profile removes LUMINANCE8 support, but we should have chosen R8 in that case. - grayLumInfo.fFlags |= ConfigInfo::kFBOColorAttachment_Flag;; + fConfigTable[kGray_8_GrPixelConfig].fFlags |= allRenderFlags; } +#endif if (texStorageSupported && !isCommandBufferES2) { if (!disableR8TexStorageForANGLEGL) { grayLumInfo.fFlags |= ConfigInfo::kCanUseTexStorage_Flag; diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h index 1596dfd9de..e258eaa57d 100644 --- a/src/gpu/gl/GrGLCaps.h +++ b/src/gpu/gl/GrGLCaps.h @@ -123,8 +123,8 @@ public: // In GL we have three ways to be able to copy. CopyTexImage, blit, and draw. CopyTexImage // requires the src to be an FBO attachment, blit requires both src and dst to be FBO // attachments, and draw requires the dst to be an FBO attachment. Thus to copy from and to - // the same config, we need that config to be bindable to an FBO. - return this->canConfigBeFBOColorAttachment(config); + // the same config, we need that config to be renderable so we can attach it to an FBO. + return this->isConfigRenderable(config, false); } bool canConfigBeFBOColorAttachment(GrPixelConfig config) const { diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index e420a09b7f..533c6b4a4a 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -2833,8 +2833,6 @@ void GrGLGpu::generateMipmaps(const GrSamplerState& params, GrGLTexture* texture return; } - SkASSERT(texture->texturePriv().mipMapped() == GrMipMapped::kYes); - // If the mips aren't dirty, we're done: if (!texture->texturePriv().mipMapsAreDirty()) { return; |