Commit Graph

54 Commits

Author SHA1 Message Date
Chris Dalton
8854829351 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>
2021-07-23 16:20:36 +00:00
Chris Dalton
e3f2a63db7 Revert "Prefer the NV_framebuffer_blit extension over ANGLE"
This reverts commit 202ce887ec.

Reason for revert: Need to update Chrome first to give us the NV one.

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>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:12176
Bug: skia:12177
Bug: skia:12234
Bug: skia:12235
Change-Id: Iaa9f82e1c0c935a67dd8f446d1513b2b0a98f725
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430819
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-22 04:58:39 +00:00
Chris Dalton
202ce887ec 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>
2021-07-20 19:00:21 +00:00
Chris Dalton
661abd0f8d Reland "Use GL_ANGLE_instanced_arrays"
This is a reland of 76b80eca64

Original change's description:
> Use GL_ANGLE_instanced_arrays
>
> It turns out the es2 command buffer has supported instanced rendering
> all along. We just weren't using it! This CL starts using
> GL_ANGLE_instanced_arrays, after which point chrome es2 will start
> taking many of our instanced codepaths. It can even use tessellation if
> we update the shaders to not rely on gl_VertexID.
>
> Bug: chromium:1220246
> Change-Id: I173f4c07771691143d2540ecb9c3f8222ed8e4b3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/422379
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

Bug: chromium:1220246
Change-Id: I4d6f74adff4e2eda4b55a459faf16b5f5a230d06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/422616
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-06-28 21:49:46 +00:00
Chris Dalton
040728364d Revert "Use GL_ANGLE_instanced_arrays"
This reverts commit 76b80eca64.

Reason for revert: Chrome layout test diffs

Original change's description:
> Use GL_ANGLE_instanced_arrays
>
> It turns out the es2 command buffer has supported instanced rendering
> all along. We just weren't using it! This CL starts using
> GL_ANGLE_instanced_arrays, after which point chrome es2 will start
> taking many of our instanced codepaths. It can even use tessellation if
> we update the shaders to not rely on gl_VertexID.
>
> Bug: chromium:1220246
> Change-Id: I173f4c07771691143d2540ecb9c3f8222ed8e4b3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/422379
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com

Change-Id: I62c25be4f6cf6937c0b5ab6e765a7113aad76916
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1220246
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/422441
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-06-28 16:12:11 +00:00
Chris Dalton
76b80eca64 Use GL_ANGLE_instanced_arrays
It turns out the es2 command buffer has supported instanced rendering
all along. We just weren't using it! This CL starts using
GL_ANGLE_instanced_arrays, after which point chrome es2 will start
taking many of our instanced codepaths. It can even use tessellation if
we update the shaders to not rely on gl_VertexID.

Bug: chromium:1220246
Change-Id: I173f4c07771691143d2540ecb9c3f8222ed8e4b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/422379
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-06-28 14:58:39 +00:00
Robert Phillips
43e3dc994e Remove NVPR entry points from Skia's GL interface
This is blocked on the Chrome-side CL:

https://chromium-review.googlesource.com/c/chromium/src/+/2774573 (Remove setting of NVPR entries on Skia's GL interface)

Bug: skia:11760
Change-Id: I1788de07d8f0208e15356a147005b87110dfeab5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/387096
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-03-22 17:44:16 +00:00
Robert Phillips
31798c2796 Remove NVPR
Bug: skia:11760
Change-Id: Ie0fc1aaa3120b37b1d452fdc9a8b5cb91b6ffe1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386559
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-03-19 12:26:38 +00:00
Greg Daniel
7ae444449c Fix gl vertex array object functions.
This logic looks to have been dropped when we moved to the auto
generated interfaces

Bug: skia:11083
Change-Id: I5069d81c872ed2c084b8ddf773f63e5202b123eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348190
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-12-30 14:29:10 +00:00
Chris Dalton
61003cde76 Add support for WEBGL_multi_draw_instanced_base_vertex_base_instance
Bug: skia:10419
Change-Id: I82238c3115daa0c1879fe18a8f8af8199194be80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319936
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-10-09 22:12:03 +00:00
Chris Dalton
4c1fcdb4e8 Don't cast emscripten pointers when assembling WebGL interface
Since we are now referencing the exact methods instead of calling
GetProcAddress, there is no need to cast the function pointers. This
also catches a bug where the emscripten signatures for glWaitSync and
glClientWaitSync did not match the OpenGL API.

Change-Id: If365a8f6090961cb4b44146d87e102430bc5b30f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320659
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-09-30 14:31:07 +00:00
Kevin Lubick
2f9a098439 [canvaskit] Remove getproc when creating WebGL interface
This saves about 15kb of wasm code size (4kb gzipped), 11kb
of JS code size (2kb gzipped) and about 10ms
when creating a new surface (~35ms -> 25ms in a local test).

This also gates the webgl code more strongly (off unless you
really request it), since the headers won't be available
except in an emscripten environment.

Change-Id: I303f6c342c72e7cfe29be241f55ae8f5631a3f75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311916
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-08-20 14:55:50 +00:00
Chris Dalton
bde4bb7efe Implement indirect draws with ANGLE's multi draw extension
This also brings indirect draw support to CanvasKit because Emscripten
will expose WEBGL_multi_draw through these extensions.

Bug: skia:10419
Change-Id: Icea3fedb846bb932e7d19f8f4a1e5646e25d4c2d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303263
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-07-17 21:18:53 +00:00
Chris Dalton
b490eb2c51 Add ANGLE's glMultiDraw*BaseInstance functions to the GL interface
This is how we will implement indirect draws in ANGLE and WebGL.
Emscripten will expose WEBGL_multi_draw through this extension.

Bug: skia:10419
Change-Id: I3fc56b130b06cdcc05a25be69878b398b8820f50
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301736
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-07-10 16:39:53 +00:00
Chris Dalton
e29f9e2187 Reland "Make glPatchParameteri required when tessellation is supported"
This is a reland of 7d7cd2b178

Original change's description:
> Make glPatchParameteri required when tessellation is supported
> 
> Chrome started wrangling this entrypoint in the following CL:
> 
> https://chromium-review.googlesource.com/c/chromium/src/+/2253344
> 
> Change-Id: Ief4dfb1ddca8d86e0c09dfdc443e01830cb4de20
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298405
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

Change-Id: I4d37973892c589d7fcffc1baf3285aa3ad97a21d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300922
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-07-09 21:16:35 +00:00
Greg Daniel
632db1c742 Revert "Make glPatchParameteri required when tessellation is supported"
This reverts commit 7d7cd2b178.

Reason for revert: breaking chrome roll

Original change's description:
> Make glPatchParameteri required when tessellation is supported
> 
> Chrome started wrangling this entrypoint in the following CL:
> 
> https://chromium-review.googlesource.com/c/chromium/src/+/2253344
> 
> Change-Id: Ief4dfb1ddca8d86e0c09dfdc443e01830cb4de20
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298405
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=kjlubick@google.com,csmartdalton@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I569f2a16de156c5b2e819cb2a45ea942ca2cdec7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298819
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-06-24 20:48:42 +00:00
Brian Salomon
24069ebd23 Add GrContext::oomed() and implement for GL and VK.
Surfaces to client whether GrContext has seen a GL_OUT_MEMORY,
VK_ERROR_OUT_OF_HOST_MEMORY, or VK_ERROR_OUT_OF_DEVICE_MEMORY error.

Bug: chromium:1093997
Change-Id: I8e9799a0f7d8a74df056629d7d1d07c0d0a0fe30
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298216
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-06-24 16:04:06 +00:00
Chris Dalton
7d7cd2b178 Make glPatchParameteri required when tessellation is supported
Chrome started wrangling this entrypoint in the following CL:

https://chromium-review.googlesource.com/c/chromium/src/+/2253344

Change-Id: Ief4dfb1ddca8d86e0c09dfdc443e01830cb4de20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298405
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-06-23 18:45:41 +00:00
Chris Dalton
5846ff3c7a Make glDraw*BaseInstance non-optional when extension(s) are present
TBR=michaelludwig@google.com

Change-Id: Ie9fc5eb6aee8cffde5d17a01fc816a1c49d02e9c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281881
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-07 04:02:07 +00:00
Chris Dalton
afbf2aa737 Revert "Reland "Reland "Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding""""
This reverts commit 0a51aa55f8.

Reason for revert: chrome

Original change's description:
> Reland "Reland "Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding"""
> 
> This is a reland of 47d03f6ee5
> 
> Original change's description:
> > Reland "Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding""
> > 
> > This is a reland of d84b691950
> > 
> > Original change's description:
> > > Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding"
> > > 
> > > This is a reland of e8c963d474
> > > 
> > > Original change's description:
> > > > Use glDraw.*BaseInstance calls to avoid deferred buffer binding
> > > > 
> > > > Change-Id: I968dab317673051acc65f87ea76a0d657d89b3d2
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279538
> > > > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> > > > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > 
> > > Change-Id: I79b2d23e5e66d47214898a9068079b6fe2269599
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280806
> > > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > 
> > Change-Id: I9240c5cc6e58ce196be393c649bbdd86560602f0
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281077
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> 
> Change-Id: Id9e3aacaa7c693bef74454aeccbebf367c047fd3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281632
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com

Change-Id: I227b4f0ec8704bd62f22965ff75aeb337786dbdc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281870
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-06 22:27:42 +00:00
Chris Dalton
0a51aa55f8 Reland "Reland "Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding"""
This is a reland of 47d03f6ee5

Original change's description:
> Reland "Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding""
> 
> This is a reland of d84b691950
> 
> Original change's description:
> > Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding"
> > 
> > This is a reland of e8c963d474
> > 
> > Original change's description:
> > > Use glDraw.*BaseInstance calls to avoid deferred buffer binding
> > > 
> > > Change-Id: I968dab317673051acc65f87ea76a0d657d89b3d2
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279538
> > > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> > > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > 
> > Change-Id: I79b2d23e5e66d47214898a9068079b6fe2269599
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280806
> > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> Change-Id: I9240c5cc6e58ce196be393c649bbdd86560602f0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281077
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

Change-Id: Id9e3aacaa7c693bef74454aeccbebf367c047fd3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281632
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-06 18:43:10 +00:00
Chris Dalton
bddf60b423 Revert "Reland "Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding"""
This reverts commit 47d03f6ee5.

Reason for revert: Chrome GL interface not setting up properly

Original change's description:
> Reland "Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding""
> 
> This is a reland of d84b691950
> 
> Original change's description:
> > Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding"
> > 
> > This is a reland of e8c963d474
> > 
> > Original change's description:
> > > Use glDraw.*BaseInstance calls to avoid deferred buffer binding
> > > 
> > > Change-Id: I968dab317673051acc65f87ea76a0d657d89b3d2
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279538
> > > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> > > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > 
> > Change-Id: I79b2d23e5e66d47214898a9068079b6fe2269599
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280806
> > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> Change-Id: I9240c5cc6e58ce196be393c649bbdd86560602f0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281077
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com

Change-Id: I7df1d60d5b33c84179dbe5391b49a84413cc9ec2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281570
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-03 18:28:54 +00:00
Chris Dalton
47d03f6ee5 Reland "Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding""
This is a reland of d84b691950

Original change's description:
> Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding"
> 
> This is a reland of e8c963d474
> 
> Original change's description:
> > Use glDraw.*BaseInstance calls to avoid deferred buffer binding
> > 
> > Change-Id: I968dab317673051acc65f87ea76a0d657d89b3d2
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279538
> > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> Change-Id: I79b2d23e5e66d47214898a9068079b6fe2269599
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280806
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Change-Id: I9240c5cc6e58ce196be393c649bbdd86560602f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281077
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-02 20:48:31 +00:00
Michael Ludwig
b14b144458 Revert "Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding""
This reverts commit d84b691950.

Reason for revert: seems like chrome's glInterface is maybe not setup correctly. Crashing on intel gpu chrome bots: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8884195221041295328/+/steps/trace_test_on__intel-hd-630-ubuntu-stable__GPU_on_Linux__retry_shards_with_patch__on_linux-intel-stable/0/stdout

snippet: 
Crash reason:  SIGABRT
Crash address: 0x3e8000050b0
Process uptime: not available

Thread 0 (crashed)
 0  libc.so.6 + 0x43ed7
    rax = 0x0000000000000000   rdx = 0x0000000000000000
    rcx = 0x00007ff964c3ced7   rbx = 0x00002cc73685ddc0
    rsi = 0x00007fffb9128960   rdi = 0x0000000000000002
    rbp = 0x00007fffb9128bb0   rsp = 0x00007fffb9128960
     r8 = 0x0000000000000000    r9 = 0x00007fffb9128960
    r10 = 0x0000000000000008   r11 = 0x0000000000000246
    r12 = 0x0000000000000048   r13 = 0x0000000000000000
    r14 = 0x000000000000006c   r15 = 0x0000000000000000
    rip = 0x00007ff964c3ced7
    Found by: given as instruction pointer in context
 1  chrome!GrGLGpu::drawElementsInstancedBaseVertexBaseInstance(GrPrimitiveType, int, unsigned int, void const*, int, int, unsigned int)::$_81::operator()() const + 0x33
    rbp = 0x00007fffb9128bc0   rsp = 0x00007fffb9128bc0
    rip = 0x000055c5c1db6923
    Found by: previous frame's frame pointer
 2  chrome!drawElementsInstancedBaseVertexBaseInstance [GrGLGpu.cpp : 2306 + 0x5]
    rbp = 0x00007fffb9128c10   rsp = 0x00007fffb9128bd0
    rip = 0x000055c5c1db68b6
    Found by: call frame info
 3  chrome!onDrawIndexed [GrGLOpsRenderPass.cpp : 144 + 0x16]

Original change's description:
> Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding"
> 
> This is a reland of e8c963d474
> 
> Original change's description:
> > Use glDraw.*BaseInstance calls to avoid deferred buffer binding
> > 
> > Change-Id: I968dab317673051acc65f87ea76a0d657d89b3d2
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279538
> > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> Change-Id: I79b2d23e5e66d47214898a9068079b6fe2269599
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280806
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com

Change-Id: I1d2617f077676b6f36bb723615d527e4aa4b3efe
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281057
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-01 21:55:43 +00:00
Chris Dalton
d84b691950 Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding"
This is a reland of e8c963d474

Original change's description:
> Use glDraw.*BaseInstance calls to avoid deferred buffer binding
> 
> Change-Id: I968dab317673051acc65f87ea76a0d657d89b3d2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279538
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Change-Id: I79b2d23e5e66d47214898a9068079b6fe2269599
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280806
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-04-01 18:41:53 +00:00
Michael Ludwig
7800453ed2 Revert "Use glDraw.*BaseInstance calls to avoid deferred buffer binding"
This reverts commit e8c963d474.

Reason for revert: assert failures: https://logs.chromium.org/logs/skia/4b4b7fcb2ff3fe11/+/steps/dm/0/stdout

Original change's description:
> Use glDraw.*BaseInstance calls to avoid deferred buffer binding
> 
> Change-Id: I968dab317673051acc65f87ea76a0d657d89b3d2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279538
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com

Change-Id: Ic760a56ca9d112e924baf7e833adb09b371928b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280817
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-03-31 22:34:17 +00:00
Chris Dalton
e8c963d474 Use glDraw.*BaseInstance calls to avoid deferred buffer binding
Change-Id: I968dab317673051acc65f87ea76a0d657d89b3d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279538
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-03-31 21:09:57 +00:00
Chris Dalton
80f865fa6d Use GL_ANGLE_base_vertex_base_instance
Adds the ANGLE extension to our list of options for
glDraw*BaseInstance.

Removes glDrawElementsInstancedBaseInstance since this method is not
supported by the ANGLE extension.

Change-Id: Ifd25324feeaad55a4d141b5064bcd8e059948ef7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280388
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-30 17:59:05 +00:00
Chris Dalton
ccbf54ad50 Add glDraw*BaseInstance functions to GrGLInterface
Change-Id: I3f36fc0bdbc1d25e3da0e29be215a19acba6ed0e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279407
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-26 18:12:29 +00:00
Mike Klein
a9609ea8c5 turn on -Wreturn-std-move-in-c++11
This CL has a complicated back story, but it's concrete change is
simple, just turning the warning on and converting a bunch of

    return foo;

to

    return std::move(foo);

These changes are exclusively in places where RVO and NRVO do not apply,
so it should not conflict with warnings like -Wpessimizing-move.

Since C++11, when you return a named local and its type doesn't match
the declared return type exactly, there's an implicit std::move()
wrapped around the value (what I'm making explicit here) so the move
constructor gets an opportunity to take precedence over the copy
constructor.  You can read about this implicit move here under the
section "automatic move from local variables and parameters":
https://en.cppreference.com/w/cpp/language/return#Notes.

This situation comes up for us with smart pointers: a function declares
its return type as std::unique_ptr<Base> or sk_sp<Base>, and we return a
std::unique_ptr<Impl> or sk_sp<Impl>.  Those types don't match exactly,
so RVO and NRVO don't come into play.  They've always been going through
move constructors, and that's not changed here, just made explicit.

There was apparently once a bug in the C++11 standard and compilers
implementing that which made these copy instead of move, and then this
sort of code would do a little unnecessary ref/unref dance for sk_sp,
and would entirely fail to compile for uncopyable std::unique_ptr.
These explicit moves ostensibly will make our code more compatible with
those older compilers.

That compatibility alone is, I think, a terrible reason to land this CL.
Like, actively bad.  But... to balance that out, I think the explicit
std::move()s here actually help remind us that RVO/NRVO are not in play,
and remind us we're going to call the move constructor.  So that C++11
standard bug becomes kind of useful for us, in that Clang added this
warning to catch it, and its fix improves readability.

So really read this all as, "warn about implicit std::move() on return".
In the end I think it's just about readability.  I don't really hold any
hope out that we'll become compatible with those older compilers.

Bug: skia:9909
Change-Id: Id596e9261188b6f10e759906af6c95fe303f6ffe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271601
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-02-18 23:55:35 +00:00
Brian Salomon
8675bcbaf9 Add support for GL_NV_fence.
Will be used for YUV420 readback on ANGLE ES 2 contexts in Chrome.

Marks the functions as required as Chrome now adds inits these on
GrGLInterface.

Bug: 1040643
Change-Id: I5504d4c9209874991592c9f86aaf7987c316aa40
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265602
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-01-24 01:53:33 +00:00
Brian Salomon
87c314210a Add functions for GL_NV_fence to GrGLInterface.
Also add macro for ALL_COMPLETED

We plan to use this with ANGLE ES2 contexts.

Change-Id: I6c967fa9b9aefc41c31cd806aece8533f846f940
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265756
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-01-22 16:02:45 +00:00
Chris Dalton
0a1923e507 Disable QCOM_tiled_rendering while we wait for test devices
There are devices that advertise this extension but don't actually
provide the GL entrypoints. This is causing live crashes.

Bug: flutter:47164
Bug: flutter:47804
Change-Id: Idded47e8dbd4462463ad91a62b06b0df3245f0c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263809
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-01-11 06:04:56 +00:00
Chris Dalton
e1196c5d01 Add a mechanism to insert framebuffer barriers for NVIDIA tessellation
Bug: skia:9739
Change-Id: I4f13110c30af796edded1d0e18860bcb4a6ef925
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261673
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-12-31 00:18:36 +00:00
Chris Dalton
5a2f962313 Add back door support for GLSL tessellation shaders
Implements tessellation support at the Ganesh level, and adds back
door methods for supplying raw GLSL strings directly to the OpenGL
driver. Adds a new gm to verify tessellation is works in GL.

Change-Id: Idfc285b955cbe5e8e6bf0475be8b518b0cc6ed2c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261196
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-12-27 22:34:10 +00:00
Hal Canary
c99a4df86e WebGL2: Add BlitFramebuffer, ShaderDerivativeSupport
fix from paraboul@

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Debian9-EMCC-GCE-GPU-AVX2-wasm-Release-All-CanvasKit,Test-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-CanvasKit

Bug: skia:9052
Change-Id: If0c408f33f4bb6cd47513a2c1f3a1e3ac3da3320
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249228
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-10-17 20:05:39 +00:00
Hal Canary
e054d3cf3d CanvasKit: Switch to WebGL 2.0
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Debian9-EMCC-GCE-GPU-AVX2-wasm-Release-All-CanvasKit,Test-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-CanvasKit

Bug: skia:9052
Change-Id: I444031276aea90d82f289b16ba6cd36de5192abd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248927
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-10-16 18:45:46 +00:00
Chris Dalton
b50cc81a3c Reland "Use GL_QCOM_TILED_RENDERING to explicitly discard stencil"
This is a reland of 7e6d3b00ad

Original change's description:
> Use GL_QCOM_TILED_RENDERING to explicitly discard stencil
> 
> Bug: skia:
> Change-Id: I7a6234f6a9955dbda83ab2d8fc6930fe680e102b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245529
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Bug: skia:
Change-Id: Ifb2ac1a595be0ca55d75d53d85bf76f7d98e1c15
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246282
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-10-15 19:23:48 +00:00
Chris Dalton
38f0a4972a Add GL_QCOM_TILED_RENDERING as an optional interface
Change-Id: I29b53e674cd788ac188295060028bbb7805858a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246281
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-10-07 18:42:01 +00:00
Brian Salomon
768f900a88 Revert "Use GL_QCOM_TILED_RENDERING to explicitly discard stencil"
This reverts commit 7e6d3b00ad.

Reason for revert: Breaks chrome, need to stage new GL function requirment. Example failure:

https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8900671758208001488/+/steps/vr_pixeltests_on_Android_device_Nexus_5__with_patch_/0/stdout


Original change's description:
> Use GL_QCOM_TILED_RENDERING to explicitly discard stencil
> 
> Bug: skia:
> Change-Id: I7a6234f6a9955dbda83ab2d8fc6930fe680e102b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245529
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com

Change-Id: I3f059d4232ef664cf2eb2c5122e55c2c291e45b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245876
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-03 01:32:28 +00:00
Chris Dalton
7e6d3b00ad Use GL_QCOM_TILED_RENDERING to explicitly discard stencil
Bug: skia:
Change-Id: I7a6234f6a9955dbda83ab2d8fc6930fe680e102b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245529
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-10-02 16:36:08 +00:00
Brian Salomon
9c73e3df83 Turn off -Wreturn-std-move-in-c++11
Change-Id: I127c979670c3dc7dac2e35908a795afbdefca8f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234902
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-08-15 17:45:58 +00:00
Brian Osman
064729e439 Implement program binary caching in ES2 (with GL_OES_get_program_binary)
Change-Id: I6f9ee51f7c063ca03bf48fccd413dae244edd191
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221778
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-18 23:49:11 +00:00
Brian Salomon
fc1dddbb8d Reland "Get EGLimage functions out of GrGLInterface."
This reverts commit 753836fcad.

Reason for revert: fixed

Original change's description:
> Revert "Get EGLimage functions out of GrGLInterface."
>
> This reverts commit bc233135e4.
>
> Reason for revert:
> EGLImageTest and TextureBindingTest broken on Windows ANGLE
> Build failures on Debian9, unable to link
>   ld.lld: error: undefined symbol: eglCreateImageKHR
>
> Original change's description:
> > Get EGLimage functions out of GrGLInterface.
> >
> > Only used in test code which can just directly call these.
> >
> > Also removed related code in interface assemble/validate generator.
> >
> > Change-Id: I7e821ebb9328bdd2a54d8ab3af929399ca0517d5
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213480
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com
>
> Change-Id: I622fadf22c5d79f5b1d335a8a81455978d49a86a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213960
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com

EXTRA_TRYBOTS=Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE

Change-Id: I71397072fa79ae3c72f3835c5e991b9ef2465a9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214040
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-05-15 19:58:45 +00:00
Michael Ludwig
753836fcad Revert "Get EGLimage functions out of GrGLInterface."
This reverts commit bc233135e4.

Reason for revert:
EGLImageTest and TextureBindingTest broken on Windows ANGLE
Build failures on Debian9, unable to link
  ld.lld: error: undefined symbol: eglCreateImageKHR

Original change's description:
> Get EGLimage functions out of GrGLInterface.
>
> Only used in test code which can just directly call these.
>
> Also removed related code in interface assemble/validate generator.
>
> Change-Id: I7e821ebb9328bdd2a54d8ab3af929399ca0517d5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213480
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: I622fadf22c5d79f5b1d335a8a81455978d49a86a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213960
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-05-15 17:45:48 +00:00
Brian Salomon
bc233135e4 Get EGLimage functions out of GrGLInterface.
Only used in test code which can just directly call these.

Also removed related code in interface assemble/validate generator.

Change-Id: I7e821ebb9328bdd2a54d8ab3af929399ca0517d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213480
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-15 16:29:18 +00:00
Brian Osman
a9aaef0c99 Revert "Support GL_EXT_draw_buffers"
This reverts commit 77af4ecd35.

Reason for revert: iOS errors and bad images on Gold

Original change's description:
> Support GL_EXT_draw_buffers
> 
> Change-Id: I078aa7c42de4368602b0ef43bd7e18efbfd1e049
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212182
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com

Change-Id: Ib8759d4a1009f9a8774365a699e211834d634cff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212264
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-05-06 20:07:27 +00:00
Brian Osman
77af4ecd35 Support GL_EXT_draw_buffers
Change-Id: I078aa7c42de4368602b0ef43bd7e18efbfd1e049
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212182
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-05-06 18:59:06 +00:00
Mike Klein
fb80e52c73 update GL interface codegen
Tested by:
    cd tools/gpu/gl/interface/
    go run *.go --in_table "./interface.json5" -out_dir "../../../../src/gpu/gl/"

Cq-Include-Trybots: skia.primary:Housekeeper-PerCommit-CheckGeneratedFiles
Change-Id: I1fee1263e321580c0e8c4e41d345fc856ef2a4e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210128
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-04-24 18:01:07 +00:00
Kevin Lubick
3902628e35 Support WebGL 1.0 with caps
There is some logic in here for 2.0 as well, just as a
"as long as I was looking at the specs", but only 1.0
is really supported.

This seems to resolve the bug where some GPUs weren't
advertising correctly that they had vertex array object
support, by checking for both extension names (with and
without "GL_" prefix)

Of note, this saves about 18 Kb (5.5 Kb gzipped) of code size
by compiling out the unneeded GLES checks/functionality.

Bug: skia:8378
Change-Id: I773bf4dbf231b991051d2a9f640b8047a9010e7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203461
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-28 17:21:23 +00:00