diff options
author | 2018-06-08 22:11:51 +0000 | |
---|---|---|
committer | 2018-06-08 23:01:44 +0000 | |
commit | 09c9400695c87be11f0ef5268e0f6efce0e62831 (patch) | |
tree | 59c13e0fb383447404057866c40443450d530cf9 /src/gpu/gl | |
parent | 8060a73cf5d4adeaaf10ef39afbb5537ae3d92f4 (diff) |
Reland "Reland "Require mips to be allocated at texture creation time and disable late allocations.""
This reverts commit 01422bc8eff0c317b9c234b3b4f5a82f1011dfce.
Reason for revert: follow on change may be ready
Original change's description:
> 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>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: Ic3df69f65a89962b21cdb50ee436a29fd121ab1f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/133740
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, 13 insertions, 9 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index e20d0137e9..4f9b63fd62 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -1338,12 +1338,15 @@ 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()) { @@ -1742,17 +1745,16 @@ void GrGLCaps::initConfigTable(const GrContextOptions& contextOptions, grayRedInfo.fSwizzle = GrSwizzle::RRRA(); grayRedInfo.fFlags = ConfigInfo::kTextureable_Flag; -#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)) { + // 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) { // 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. - fConfigTable[kGray_8_GrPixelConfig].fFlags |= allRenderFlags; + grayLumInfo.fFlags |= ConfigInfo::kFBOColorAttachment_Flag;; } -#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 e258eaa57d..1596dfd9de 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 renderable so we can attach it to an FBO. - return this->isConfigRenderable(config, false); + // the same config, we need that config to be bindable to an FBO. + return this->canConfigBeFBOColorAttachment(config); } bool canConfigBeFBOColorAttachment(GrPixelConfig config) const { diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 42a8992d4d..f37356454a 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -2858,6 +2858,8 @@ 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; |