diff options
author | 2017-05-31 15:59:40 +0000 | |
---|---|---|
committer | 2017-05-31 16:22:03 +0000 | |
commit | fdd117025fb846771e9e47cbf825d9071745fa98 (patch) | |
tree | c261dcfd2f3fd40a0c9a264d76c2d8f52f985bdc /src/gpu/gl | |
parent | 9c6645e787669e5af2b9de73d0a6d1cd4d77bbf0 (diff) |
Revert "Expand partial render target write pixels workaround."
This reverts commit 0cc507d22566bb7e28e5fe21e4b3fc7b682d86a2.
Reason for revert: Causing IntTextureText to fail on bots
Original change's description:
> Expand partial render target write pixels workaround.
>
> The workaround is extended in the following ways:
>
> 1) It now applies to any texture whose base level has *ever* been attached to a FBO.
> 2) It applies to Adreno 5xx in addition to Adreno 4xx
> 3) It applies in the atlas upload code path.
>
> This workaround (and a similar one) are narrowed to GLCaps rather than Caps.
>
> Bug: skia:
> Change-Id: Id600e9739bb97bf6766075ea2a987fd2039e53e5
> Reviewed-on: https://skia-review.googlesource.com/18150
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
>
TBR=bsalomon@google.com,robertphillips@google.com
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Change-Id: I53c8dd7ea7f614da57331470fcc24c6d84aba354
Reviewed-on: https://skia-review.googlesource.com/18229
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 13 | ||||
-rw-r--r-- | src/gpu/gl/GrGLCaps.h | 14 | ||||
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 36 | ||||
-rw-r--r-- | src/gpu/gl/GrGLTexture.h | 5 |
4 files changed, 11 insertions, 57 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 3eab060f89..df905a4f0f 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -56,8 +56,6 @@ GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions, fClearToBoundaryValuesIsBroken = false; fClearTextureSupport = false; fDrawArraysBaseVertexIsBroken = false; - fDisallowTexSubImageForTexturesEverBoundToFBO = false; - fUseDrawInsteadOfAllRenderTargetWrites = false; fBlitFramebufferFlags = kNoSupport_BlitFramebufferFlag; @@ -499,12 +497,12 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, } if (kAdreno4xx_GrGLRenderer == ctxInfo.renderer()) { - fDisallowTexSubImageForTexturesEverBoundToFBO = true; + fUseDrawInsteadOfPartialRenderTargetWrite = true; } // Texture uploads sometimes seem to be ignored to textures bound to FBOS on Tegra3. if (kTegra3_GrGLRenderer == ctxInfo.renderer()) { - fDisallowTexSubImageForTexturesEverBoundToFBO = true; + fUseDrawInsteadOfPartialRenderTargetWrite = true; fUseDrawInsteadOfAllRenderTargetWrites = true; } @@ -1255,10 +1253,6 @@ SkString GrGLCaps::dump() const { r.appendf("Texture swizzle support: %s\n", (fTextureSwizzleSupport ? "YES" : "NO")); r.appendf("BGRA to RGBA readback conversions are slow: %s\n", (fRGBAToBGRAReadbackConversionsAreSlow ? "YES" : "NO")); - r.appendf("Intermediate texture for partial updates of textures ever bound to FBOs: %s\n", - fDisallowTexSubImageForTexturesEverBoundToFBO ? "YES" : "NO"); - r.appendf("Intermediate texture for all updates of textures bound to FBOs: %s\n", - fUseDrawInsteadOfAllRenderTargetWrites ? "YES" : "NO"); r.append("Configs\n-------\n"); for (int i = 0; i < kGrPixelConfigCnt; ++i) { @@ -2153,7 +2147,4 @@ void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) { fAvoidInstancedDrawsToFPTargets = true; #endif } - if (options.fUseDrawInsteadOfPartialRenderTargetWrite) { - fUseDrawInsteadOfAllRenderTargetWrites = true; - } } diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h index 75a12d7762..b7273a08b1 100644 --- a/src/gpu/gl/GrGLCaps.h +++ b/src/gpu/gl/GrGLCaps.h @@ -368,18 +368,6 @@ public: // https://bugs.chromium.org/p/skia/issues/detail?id=6650 bool drawArraysBaseVertexIsBroken() const { return fDrawArraysBaseVertexIsBroken; } - // If true then we must use an intermediate surface to perform partial updates to a texture that - // has ever been bound to a FBO. - bool disallowTexSubImageForTexturesEverBoundToFBO() const { - return fDisallowTexSubImageForTexturesEverBoundToFBO; - } - - // Use an intermediate surface to write pixels (full or partial overwrite) to into a texture - // that is bound to an FBO. - bool useDrawInsteadOfAllRenderTargetWrites() const { - return fUseDrawInsteadOfAllRenderTargetWrites; - } - bool initDescForDstCopy(const GrRenderTargetProxy* src, GrSurfaceDesc* desc, bool* rectsMustMatch, bool* disallowSubrect) const override; @@ -454,8 +442,6 @@ private: bool fClearToBoundaryValuesIsBroken : 1; bool fClearTextureSupport : 1; bool fDrawArraysBaseVertexIsBroken : 1; - bool fDisallowTexSubImageForTexturesEverBoundToFBO : 1; - bool fUseDrawInsteadOfAllRenderTargetWrites : 1; uint32_t fBlitFramebufferFlags; diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index f3aac8afc1..045804c668 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -582,10 +582,7 @@ sk_sp<GrTexture> GrGLGpu::onWrapBackendTexture(const GrBackendTexture& backendTe if (!this->createRenderTargetObjects(surfDesc, idDesc.fInfo, &rtIDDesc)) { return nullptr; } - sk_sp<GrGLTextureRenderTarget> texRT( - GrGLTextureRenderTarget::MakeWrapped(this, surfDesc, idDesc, rtIDDesc)); - texRT->baseLevelWasBoundToFBO(); - return texRT; + return GrGLTextureRenderTarget::MakeWrapped(this, surfDesc, idDesc, rtIDDesc); } return GrGLTexture::MakeWrapped(this, surfDesc, idDesc); @@ -665,28 +662,16 @@ bool GrGLGpu::onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, GrPixelConfig srcConfig, DrawPreference* drawPreference, WritePixelTempDrawInfo* tempDrawInfo) { - if (SkToBool(dstSurface->asRenderTarget())) { - if (this->glCaps().useDrawInsteadOfAllRenderTargetWrites()) { - ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference); - } - } - - GrGLTexture* texture = static_cast<GrGLTexture*>(dstSurface->asTexture()); - - if (texture) { + // This subclass only allows writes to textures. If the dst is not a texture we have to draw + // into it. We could use glDrawPixels on GLs that have it, but we don't today. + if (!dstSurface->asTexture()) { + ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference); + } else { + GrGLTexture* texture = static_cast<GrGLTexture*>(dstSurface->asTexture()); if (GR_GL_TEXTURE_EXTERNAL == texture->target()) { // We don't currently support writing pixels to EXTERNAL textures. return false; } - if (texture->hasBaseLevelBeenBoundToFBO() && - this->glCaps().disallowTexSubImageForTexturesEverBoundToFBO() && - (width < dstSurface->width() || height < dstSurface->height())) { - ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference); - } - } else { - // This subclass only allows writes to textures. If the dst is not a texture we have to draw - // into it. We could use glDrawPixels on GLs that have it, but we don't today. - ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference); } // If the dst is MSAA, we have to draw, or we'll just be writing to the resolve target. @@ -1388,7 +1373,6 @@ GrTexture* GrGLGpu::onCreateTexture(const GrSurfaceDesc& desc, } tex = new GrGLTextureRenderTarget(this, budgeted, desc, idDesc, rtIDDesc, wasMipMapDataProvided); - tex->baseLevelWasBoundToFBO(); } else { tex = new GrGLTexture(this, budgeted, desc, idDesc, wasMipMapDataProvided); } @@ -3233,9 +3217,8 @@ void GrGLGpu::bindSurfaceFBOForPixelOps(GrSurface* surface, GrGLenum fboTarget, GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(surface->asRenderTarget()); if (!rt) { SkASSERT(surface->asTexture()); - GrGLTexture* texture = static_cast<GrGLTexture*>(surface->asTexture()); - GrGLuint texID = texture->textureID(); - GrGLenum target = texture->target(); + GrGLuint texID = static_cast<GrGLTexture*>(surface->asTexture())->textureID(); + GrGLenum target = static_cast<GrGLTexture*>(surface->asTexture())->target(); GrGLuint* tempFBOID; tempFBOID = kSrc_TempFBOTarget == tempFBOTarget ? &fTempSrcFBOID : &fTempDstFBOID; @@ -3250,7 +3233,6 @@ void GrGLGpu::bindSurfaceFBOForPixelOps(GrSurface* surface, GrGLenum fboTarget, target, texID, 0)); - texture->baseLevelWasBoundToFBO(); viewport->fLeft = 0; viewport->fBottom = 0; viewport->fWidth = surface->width(); diff --git a/src/gpu/gl/GrGLTexture.h b/src/gpu/gl/GrGLTexture.h index 85ada01c87..74358914ec 100644 --- a/src/gpu/gl/GrGLTexture.h +++ b/src/gpu/gl/GrGLTexture.h @@ -66,11 +66,7 @@ public: GrGLenum target() const { return fInfo.fTarget; } - bool hasBaseLevelBeenBoundToFBO() const { return fBaseLevelHasBeenBoundToFBO; } - void baseLevelWasBoundToFBO() { fBaseLevelHasBeenBoundToFBO = true; } - static sk_sp<GrGLTexture> MakeWrapped(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&); - protected: // Constructor for subclasses. GrGLTexture(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&, bool wasMipMapDataProvided); @@ -100,7 +96,6 @@ private: // direct interaction with the GL object. GrGLTextureInfo fInfo; GrBackendObjectOwnership fTextureIDOwnership; - bool fBaseLevelHasBeenBoundToFBO = false; ReleaseProc fReleaseProc = nullptr; ReleaseCtx fReleaseCtx = nullptr; |