Reland "Prefer the NV_framebuffer_blit extension over ANGLE"

This is a reland of 202ce887ec

Original change's description:
> Prefer the NV_framebuffer_blit extension over ANGLE
>
> The ANGLE/CHROMIUM glBlitFramebuffer requires full size blits, which
> is really bad for DMSAA. The NV extension does allow blits of
> sub-rectangles, so we prefer that one if it's available.
>
> Bug: skia:12176
> Bug: skia:12177
> Bug: skia:12234
> Bug: skia:12235
> Change-Id: I463ac631fff64ad564f294cf2f26be7410e8c356
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430576
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

Bug: skia:12176
Bug: skia:12177
Bug: skia:12234
Bug: skia:12235
Change-Id: I41d062f9894f5a81c78a37de27a288bc17812643
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431817
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
Chris Dalton 2021-07-20 11:46:13 -06:00
parent 747c321922
commit 8854829351
4 changed files with 6 additions and 1 deletions

View File

@ -301,6 +301,8 @@ sk_sp<const GrGLInterface> GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc
if (glVer >= GR_GL_VER(3,0)) {
GET_PROC(BlitFramebuffer);
} else if (extensions.has("GL_NV_framebuffer_blit")) {
GET_PROC_SUFFIX(BlitFramebuffer, NV);
} else if (extensions.has("GL_CHROMIUM_framebuffer_multisample")) {
GET_PROC_SUFFIX(BlitFramebuffer, CHROMIUM);
} else if (extensions.has("GL_ANGLE_framebuffer_blit")) {

View File

@ -464,7 +464,8 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
fBlitFramebufferFlags = 0;
}
} else if (GR_IS_GR_GL_ES(standard)) {
if (version >= GR_GL_VER(3, 0)) {
if (version >= GR_GL_VER(3, 0) ||
ctxInfo.hasExtension("GL_NV_framebuffer_blit")) {
fBlitFramebufferFlags = kNoFormatConversionForMSAASrc_BlitFramebufferFlag |
kNoMSAADst_BlitFramebufferFlag |
kRectsMustMatchForMSAASrc_BlitFramebufferFlag;

View File

@ -486,6 +486,7 @@ bool GrGLInterface::validate() const {
fExtensions.has("GL_EXT_framebuffer_blit"))) ||
(GR_IS_GR_GL_ES(fStandard) && (
(glVer >= GR_GL_VER(3,0)) ||
fExtensions.has("GL_NV_framebuffer_blit") ||
fExtensions.has("GL_CHROMIUM_framebuffer_multisample") ||
fExtensions.has("GL_ANGLE_framebuffer_blit"))) ||
(GR_IS_GR_WEBGL(fStandard) && (

View File

@ -373,6 +373,7 @@
{/* else if */ "ext": "GL_ARB_framebuffer_object"},
{/* else if */ "ext": "GL_EXT_framebuffer_blit"}],
"GLES": [{"min_version": [3, 0], "ext": "<core>"},
{/* else if */ "ext": "GL_NV_framebuffer_blit"},
{/* else if */ "ext": "GL_CHROMIUM_framebuffer_multisample"},
{/* else if */ "ext": "GL_ANGLE_framebuffer_blit"}],
"WebGL": [{"min_version": [2, 0], "ext": "<core>"}],