Commit Graph
68 Commits
Author SHA1 Message Date
Jamie Madill ea3f501e62 Feedback Loop Redesign 3/3: Remove feedback loop tracking.
We now we detect feedback loops by tracking the Framebuffers that the
Texture is bound to. We still have the old tracking method that counts
sampler and image bindings in the code as well.

This CL removes the old front-end tracking for feedback loops. It's no
longer used by any back-ends. This removal should reduce CPU overhead
around Texture and Program binding changes. Reverts the image binding
tracking to the simpler scheme that tracks if a Texture has ever been
bound as an Image. This should practically have little or no perf
effect and we can reinstate some simpler tracking in the future if
required.

Bug: angleproject:4500
Bug: angleproject:4959
Change-Id: Idc625d6e4c519919f97a4dc72dd9c35d262706fb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2363210
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Tobin Ehlis <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
2020-08-21 21:34:02 +00:00
Jamie Madill 185d9d08bc Re-land "Feedback Loop Redesign 2/3: Track bound FBOs in Texture."
Re-land fixes the crash when drawing with no bound Program executable.

Currently we track feedback loops by counting the times a Texture is
bound as a sampler or image in a particular context. This is a bit
tricky because Texture bindings change frequently. Relative to the
number of times we need to check for a feedback loop this causes excess
overhead.

Usually Framebuffers have a low number of Textures bound (in many cases
just 1). And Textures aren't usually bound to many different FBOs. So
instead of counting the number of times a Texture is bound as a sampler
or image we will track the Framebuffers that the Texture is bound to.

This CL adds a small vector class to gl::Texture which tracks all the
Framebufer Serials of its bound Framebuffers. We can use this set to
quickly check if there's any potential feedback loop between the a FBO
and this Texture.

We also update the feedback loop check to use this new method. We will
be able to remove the old counting method when we switch the Vulkan
feedback loop handling to use the new tracking in this CL.

Bug: angleproject:4500
Bug: angleproject:4959
Change-Id: If2bd25b08298a99f5e64b4055137f9154b0f0860
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2365595
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2020-08-20 01:24:10 +00:00
Khushal f6fb6da87d Revert "Feedback Loop Redesign 2/3: Track bound FBOs in Texture."
This reverts commit 699bcde0b7.

Reason for revert: Breaking GLES2WebGLDecoderPassthroughTest.DrawArraysInstancedANGLEEnablement. Here is a sample build : https://ci.chromium.org/p/chromium/builders/ci/Win10%20FYI%20x64%20Release%20%28NVIDIA%29/4240

Original change's description:
> Feedback Loop Redesign 2/3: Track bound FBOs in Texture.
> 
> Currently we track feedback loops by counting the times a Texture is
> bound as a sampler or image in a particular context. This is a bit
> tricky because Texture bindings change frequently. Relative to the
> number of times we need to check for a feedback loop this causes excess
> overhead.
> 
> Usually Framebuffers have a low number of Textures bound (in many cases
> just 1). And Textures aren't usually bound to many different FBOs. So
> instead of counting the number of times a Texture is bound as a sampler
> or image we will track the Framebuffers that the Texture is bound to.
> 
> This CL adds a small vector class to gl::Texture which tracks all the
> Framebufer Serials of its bound Framebuffers. We can use this set to
> quickly check if there's any potential feedback loop between the a FBO
> and this Texture.
> 
> We also update the feedback loop check to use this new method. We will
> be able to remove the old counting method when we switch the Vulkan
> feedback loop handling to use the new tracking in this CL.
> 
> Bug: angleproject:4500
> Bug: angleproject:4959
> Change-Id: I84a2f0ed8480d1da63d5879e0e56a8be4af4e735
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2358850
> Reviewed-by: Tobin Ehlis <[email protected]>
> Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
> Reviewed-by: Jonah Ryan-Davis <[email protected]>
> Commit-Queue: Jamie Madill <[email protected]>

[email protected],[email protected],[email protected],[email protected]

Change-Id: Ica795036895652add37ac8ed319031f9d5a321ac
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:4500
Bug: angleproject:4959
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2365077
Reviewed-by: Khushal <[email protected]>
Commit-Queue: Khushal <[email protected]>
2020-08-19 21:04:49 +00:00
Jamie Madill 699bcde0b7 Feedback Loop Redesign 2/3: Track bound FBOs in Texture.
Currently we track feedback loops by counting the times a Texture is
bound as a sampler or image in a particular context. This is a bit
tricky because Texture bindings change frequently. Relative to the
number of times we need to check for a feedback loop this causes excess
overhead.

Usually Framebuffers have a low number of Textures bound (in many cases
just 1). And Textures aren't usually bound to many different FBOs. So
instead of counting the number of times a Texture is bound as a sampler
or image we will track the Framebuffers that the Texture is bound to.

This CL adds a small vector class to gl::Texture which tracks all the
Framebufer Serials of its bound Framebuffers. We can use this set to
quickly check if there's any potential feedback loop between the a FBO
and this Texture.

We also update the feedback loop check to use this new method. We will
be able to remove the old counting method when we switch the Vulkan
feedback loop handling to use the new tracking in this CL.

Bug: angleproject:4500
Bug: angleproject:4959
Change-Id: I84a2f0ed8480d1da63d5879e0e56a8be4af4e735
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2358850
Reviewed-by: Tobin Ehlis <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2020-08-19 01:39:46 +00:00
Geoff Lang c9e0edc278 Handle 3D texture entire-mip initialization for FBO attachments
FramebufferAttachmentObject::initializeContents clears the entire mip
level for layered textures (not including cube map). This was done by
special casing 2D array and 2D multisample array textures but did not
work for 3D.

Generalize the logic to work for all layered texture types.

Handle clearing the entire 3D texture mip in Vulkan.

TEST=conformance2/misc/uninitialized-test-2.html

BUG=angleproject:4602

Change-Id: I35bb9fc3304f0553e8de68d205b0843845bf7549
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2174264
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2020-05-01 16:57:38 +00:00
Jamie Madill c9c4e4ed84 Track rendering feedback loops by-context.
This fixes an issue where feedback loops detection would trigger false
positives based on texture use in multiple contexts.

1) there are two contexts, C1 and C2, sharing resources
2) in C1, there is a texture T bound to GL_TEXTURE_2D, and a program in
   use that will sample C1
3) in C2, a framebuffer is created and T is bound to it

This fix indexes each set of active bindings in an object by ContextID.
We can potentially redo this solution in the future if this proves to
have too much tracking overhead.

Includes a test writen by Ken Russell.

Bug: angleproject:4517
Change-Id: I67012e68947c42d863dca193972576c82d5f3712
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2134406
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
2020-04-03 20:14:05 +00:00
Jamie Madill e259e7e321 Pass layer count to robust 2D array texure init.
The Vulkan back-end needs the layer count to correctly initialize the
whole range of the mip level. Otherwise we were only clearing a single
layer of the 2D array. This only popped up when the code started to be
lazier about robust resource init.

Bug: angleproject:4517
Change-Id: Id5007c877d413dc80d54d9800a5898e130593451
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2134412
Reviewed-by: Cody Northrop <[email protected]>
2020-04-03 18:31:58 +00:00
Jamie Madill 1c88cf278c Add optimized rendering feedback loop tracking.
This can be used both for WebGL and the Vulkan back-end workaround for
Manhattan. Uses the recently added tracking for Textures being bound as
samplers. Then caches this information in the Framebuffer using the
Subject/Observer pattern.

Bug: angleproject:4490
Change-Id: I08bef0a1b95c4333da19c2dae1f02a993e5835e1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2109335
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2020-03-20 17:23:43 +00:00
Tim Van Patten 8ac49e182a Fix dEQP renderbuffer unspecified attachment test.
The spec mandates default sizes of 0 for everything, while we
assume a non-initialized Renderbuffer is RGBA4.

Bug: angleproject:2321
Test: dEQP-GLES3.functional.state_query.fbo.framebuffer_unspecified_attachment_x_size_rbo
Change-Id: I7defbdda46fc90dc3672628667c710a8304473b7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1785881
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Tim Van Patten <[email protected]>
2019-09-11 17:32:56 +00:00
Mingyu Hu 7e44ec26d6 GL_EXT_multisampled_render_to_texture extension. Part 1.
Adding new parameters for extension without adding any real code change. Since no new code paths were added, we expect all tests to pass as before.

Bug: angleproject:980428
Change-Id: I551b46a66f422eabd357fd021e00cf266a991efb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1772377
Commit-Queue: Rafael Cintron <[email protected]>
Reviewed-by: Rafael Cintron <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2019-09-04 19:37:30 +00:00
Stuart Morgan 9d737966ac Standardize copyright notices to project style
For all "ANGLE Project" copyrights, standardize to the format specified
by the style guide. Changes:
- "Copyright (c)" and "Copyright(c)" changed to just "Copyright".
- Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1").
- Fixed a small number of files that had no copyright date using the
  initial commit year from the version control history.
- Fixed one instance of copyright being "The ANGLE Project" rather than
  "The ANGLE Project Authors"

These changes are applied both to the copyright of source file, and
where applicable to copyright statements that are generated by
templates.

BUG=angleproject:3811

Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-08-14 23:05:33 +00:00
Kenneth Russell cbdf8616f9 Support blitFramebuffer to and from IOSurface-backed textures.
Extend validation to allow texture rectangle-backed textures as
blitFramebuffer sources and destinations.

Add end-to-end test covering this functionality, and run the
IOSurfaceClientBufferTests against both ES2 and ES3.

Bug: angleproject:3669
Change-Id: I7b8815a2c98072c12de45717afbba9e9b29ba253
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1694483
Commit-Queue: Kenneth Russell <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-07-11 00:56:55 +00:00
Mingyu Hu 7d64c4863d GL_ANGLE_multiview has been renamed to GL_OVR_multiview2.
changes include:
1) GL_OVR_multiview to GL_OVR_multiview2 extension directive change
2) Removal of all references to side by side. We no longer support multiple views in a single 2DTexture. Only 2DTextureArray's are supported
3) WebGL 2 (ES3) is required for multiview

Bug: angleproject:3341
Change-Id: Ie0c1d21d7610f8feebdb2e4d01c6947f57e69328
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1552023
Commit-Queue: Rafael Cintron <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2019-04-16 17:37:10 +00:00
Jamie Madill 7c985f5c4f Make angle::Result an enum.
This moves away from a class type to a value type. This should improve
performance when using angle::Result as a return value. Previously the
generated code would return a pointer instead of a value.

Improves performance in the most targeted microbenchmark by 10%. In
more realistic scanarios it will have a smaller improvement. Also
simplifies the class implementation and usage.

Includes some unrelated code generation changes.

Bug: angleproject:2491
Change-Id: Ifcf86870bf1c00a2f73c39ea6e4f05ca705050aa
Reviewed-on: https://chromium-review.googlesource.com/c/1356139
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-12-07 04:59:23 +00:00
Jamie Madill 66f0d2c1e7 Make Framebuffer attachments angle::Subjects.
Now that there's storage change notifications in the GL front-end we
no longer need to give the back-end access to the angle::Subject. The
Texture object is a special case where it has mirrored dirty bits. To
keep the gl::Texture class notified of when the Impl has dirty bits we
make the TextureImpl class an angle::Subject that is observed by the
gl::Texture class.

This will enable further dirty bits improvements.

Bug: angleproject:2966
Change-Id: Id22da0926f51ff4679e58af3e62903f4d7948915
Reviewed-on: https://chromium-review.googlesource.com/c/1347670
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-12-03 21:07:40 +00:00
Jamie Madill b980c5630e Reformat all cpp and h files.
This applies git cl format --full to all ANGLE sources.

Bug: angleproject:2986
Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f
Reviewed-on: https://chromium-review.googlesource.com/c/1351367
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2018-11-27 18:27:13 +00:00
Jamie Madill 31116738ad Inline many more hotspots for the Texture draw test.
Bug: angleproject:2763
Change-Id: Ib8193e7ff5ee7763b92f4775fb7e9adaa51c9305
Reviewed-on: https://chromium-review.googlesource.com/c/1262738
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-10-09 23:17:17 +00:00
Jamie Madill 6f755b210f Use angle::Result in front-end. (Part 1)
This covers most of the hot paths used in draw calls. Gives in the
order of a 5% reduction in draw call overhead.

Bug: angleproject:2491
Change-Id: I2d53afb1163eaceed61fb9cd9ce6c1267c85c0fa
Reviewed-on: https://chromium-review.googlesource.com/c/1258149
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-10-09 20:27:56 +00:00
Jamie Madill f668a4b5fb Skip Texture::syncState when no dirty bits.
We sometimes generate local dirty bits in TextureGL. To make sure the local
dirty bits don't get skipped we use a Subject/Observer pattern between the
TextureGL and gl::Texture. This allows us to skip syncState in the hot path.

Also inlines a couple of other texture functions. And fixes a stray header
in EGLBlobCacheTest.

Bug: angleproject:2763
Change-Id: Ie1d8a5865deaf2a563a358c31ae28bef6b2458b1
Reviewed-on: https://chromium-review.googlesource.com/1228374
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-09-24 02:07:21 +00:00
Olli Etuaho daab00149e Test and fix robust resource init for multisampled textures
New test coverage for robust initialization of multisampled textures
is added in angle_end2end_tests. Some missing functionality that was
affecting the initialization of multisampled 2D array textures is now
fixed.

BUG=angleproject:2775
TEST=angle_end2end_tests

Change-Id: I1d9d3cd154ca2910159941fe8b1bef4ae6320bdd
Reviewed-on: https://chromium-review.googlesource.com/1224530
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2018-09-13 13:54:16 +00:00
Jiawei Shao a880247775 ES31: Implement FramebufferTextureEXT on OpenGL back-ends
This patch intends to implement FramebufferTextureEXT on OpenGL
back-ends.
1. Support layered framebuffer attachments.
2. Add new framebuffer completeness rules on layered framebuffer
   attachments.
3. Support FRAMEBUFFER_ATTACHMENT_LAYERED_EXT as a valid <pname>
   parameter of GetFramebufferAttachmentParameteriv.

Note that for an entire level of a cube map:
1. It has no TextureTarget because TEXTURE_CUBE is not a valid
   target for TexImage*D.
2. It corresponds to 6 ImageDescs (that represents its faces) in
   class Texture, so when the cube map is cube complete, we return
   the ImageDesc of its first face, meanwhile we do not allow
   querying ImageDesc if it is not cube complete.

BUG=angleproject:1941
TEST=angle_end2end_tests
     dEQP-GLES31.functional.geometry_shading.query.framebuffer_attachment_layers
     dEQP-GLES31.functional.geometry_shading.query.framebuffer_incomplete_layer_targets
     dEQP-GLES31.functional.geometry_shading.layered.*
     dEQP-GLES31.functional.geometry_shading.instanced.invocation_per_layer_*
     dEQP-GLES31.functional.geometry_shading.instanced.multiple_layers_per_invocation_*

Change-Id: I44393b513ec8f1a682fd1c47d3eaa6f3b3fae877
Reviewed-on: https://chromium-review.googlesource.com/1075811
Commit-Queue: Jiawei Shao <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2018-06-12 02:06:20 +00:00
Luc Ferron 1d97a4d036 Revert "Fix dEQP renderbuffer unspecified attachment test."
This seems to have caused a regression in Chrome. I'm reverting the
change and suppressing the test that is failing on our end because of
it. Once we can confirm this solves the problem, we'll need some help
investigating further.

This reverts commit c0db9addea.

Bug: angleproject:2321
Bug: chromium:833809
Change-Id: I5e40364217e15ae6117f5288a4754b25d983ca0a
Reviewed-on: https://chromium-review.googlesource.com/1017763
Commit-Queue: Luc Ferron <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-04-19 12:15:30 +00:00
Jamie Madill cc12937753 ImageIndex: Consolidate layer/cube face.
In terms of the Texture or Image resource, a cube face
refers to a layer of a 2D texture. This layer has a special
meaning for cube textures, but it is represented as a layer
with a layer index. Cube array textures are no different,
they just use a different indexing scheme for the array
layers.

This also cleans up the ImageIndex helper to have a class
structure with private data, and cleans up a few cases to
use generic Make functions and iterators where they were
setting properties of the index directly.

This will make it easier to have ImageIndexes address
entire levels of a Cube map in the future, and makes the
layer count logic in Vulkan cleaner.

Bug: angleproject:2318
Change-Id: Iea9842e233f974a9896282ca224cb001f7882bd1
Reviewed-on: https://chromium-review.googlesource.com/987525
Reviewed-by: Luc Ferron <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-04-12 23:08:07 +00:00
Jamie Madill d7518622b6 Buffer11: Refactor Subject/Observer pattern.
Instead of having a direct/static observer distinction, add two
messages for 'Contents Changed' and 'Storage Changed'. This makes
Buffer11 itself the subject with two different message handling
cases in the onSubjectStateChange methods.

Bug: angleproject:2389

Change-Id: I645cd4b7cc7ce51cb7f48a01c7fc72939cbe89fe
Reviewed-on: https://chromium-review.googlesource.com/957940
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-03-27 15:06:47 +00:00
Corentin Wallez 99d492c241 Use packed enums for the texture types and targets, part 2
This completes the refactor by using the packed enums in the gl:: layer
and in the backends.

The packed enum code generation is modified to support explicitly
assigning values to the packed enums so that the TextureTarget cube map
faces are in the correct order and easy to iterate over.

BUG=angleproject:2169

Change-Id: I5903235e684ccf382e92a8a1e10c5c85b4b16a04
Reviewed-on: https://chromium-review.googlesource.com/939994
Commit-Queue: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-03-06 19:15:33 +00:00
Jamie Madill 888081d59a D3D11: Refactor dependent Framebuffer state changes.
Previously, when a state change would cause a Texture to
recreate its storage specific to D3D11, we would use a
dependent notification from RenderTarget11 to Framebuffer11
to re-check internal dirty bits. In this new method, we
instead set dirty bits on the gl::Frambuffer directly. This
also means we use fewer internal objects for these
notifications, because we share the same structures between
the D3D11 back-end notifications and the top-level notifications
we use for Robust init and Framebuffer completeness.

This also allows us to get rid of one "if" that we check on
every draw call in D3D11.

This also introduces a dirty bits guard concept - a shadow
set of dirty bits that is checked in dependent state changes
to ensure that extra bits aren't set inside syncState.

This also implements Framebuffer dirty bits for the D3D9
back-end. This has the side effect of cleaning up the
"null colorbuffer" D3D9 workaround.

Bug: angleproject:2372
Change-Id: Ie346d39030f4f6df583d735685b0babea4e745a8
Reviewed-on: https://chromium-review.googlesource.com/936691
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-03-02 15:54:30 +00:00
Jamie Madill d444255a77 Refactor signal utils into Observer pattern.
These types were over-generalized. All use cases featured
arrays of resources attached to single parent resources. The
channel ID is sufficient to identify the child resource in the
parent, and having variadic template arguments wasn't necessary.

Futhermore we can rename these types to use the common Observer
pattern. This should make them more readable to new developers.

Also update some classes to inherit from Subject instead of
having a member Subject. This cleans up the code in a few places.

This should lead to a simpler refactor to allow dependent dirty
bits notifications in the Vulkan back-end.

In the following patch the signal_utils files will be renamed. They
are not renamed in this patch to ensure git history is preserved.

Bug: angleproject:2372
Change-Id: I17a3f2c8d92afd4bb3cba2d378c3a2e8a6d7fb11
Reviewed-on: https://chromium-review.googlesource.com/936690
Reviewed-by: Luc Ferron <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-02-28 16:12:25 +00:00
Geoff Lang b52fac03f4 Refactor ImageIndex to have separate type and target members.
BUG=angleproject:2169

Change-Id: Ib3fb699058f76d0eb810a9691ea1d64311dadbb1
Reviewed-on: https://chromium-review.googlesource.com/929650
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-02-26 17:23:04 +00:00
Luc Ferron c0db9addea Fix dEQP renderbuffer unspecified attachment test.
Full test name: dEQP-GLES3.functional.state_query.fbo.framebuffer_unspecified_attachment_x_size_rbo

Bug: angleproject:2321

Change-Id: I086aefe23a3141f58cc33149c9cd7bdc5eb98dba
Reviewed-on: https://chromium-review.googlesource.com/891662
Commit-Queue: Luc Ferron <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-02-01 14:31:34 +00:00
Jamie Madill 05b35b210e D3D11: Lazy robust resource init.
This patch moves the robust resource init logic to the GL front-end.
Instead of initializing texture resources immediately on creation in
D3D11, it defers the clear until before a draw call in some cases, or
skips the update if we can determine if a texture (or other resource)
has been fully initialized.

Currently lazy init is only implemented for Textures, Renderbuffers,
and Surfaces.

Various places where lazy resource init is triggered:
* Framebuffer operations (Draw, Blit, CopyTexImage, Clear, ReadPixels)
* Texture operations (SubImage, GenerateMipmap, CopyTexImage)

Some efficiency gains remain to be implemented, such as when a
SubImage call fills the entire object. Similarly for Blit, and a few
other operations. In these cases we can skip lazy init as an
optimization. Edge cases with EGLImage are mostly untested.

BUG=angleproject:2107

Change-Id: I2bf3a69b1eae0d4feeb5b17daca23451f1037be8
Reviewed-on: https://chromium-review.googlesource.com/576058
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2017-10-03 14:18:13 +00:00
Jamie Madill 81c2e253b9 Add top-level dirty bits for texture and samplers.
These will have to be fleshed out in the back-ends.
Also currently uses a single bit for all the bindings, and we can
extend this to more fine-grained updates in the future.

This patch implements top-level updates for texture completeness.
Sampler completeness caches are removed from the Texture class, and
replaced by a cache in the gl::State class. The State class also
keeps a channel binding to the bound textures so it can be notified
when textures might change from complete <-> incomplete.

In future CLs we skip updating back-ends if texture state doesn't
change.

BUG=angleproject:1387

Change-Id: If580b4851303c86f3240e62891f5f6047eefb6a2
Reviewed-on: https://chromium-review.googlesource.com/648053
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-09-11 17:26:26 +00:00
Martin Radev 82ef774b73 Save layered multiview end-point's arguments into attachment's state
Handle glFramebufferTextureMultiviewLayeredANGLE calls by saving the
arguments into the attachment's state.

BUG=angleproject:2062
TEST=angle_end2end_tests

Change-Id: I9d7c0e00fe9e917ad2f9d903a39f30b2546dc7a3
Reviewed-on: https://chromium-review.googlesource.com/609960
Commit-Queue: Martin Radev <[email protected]>
Reviewed-by: Olli Etuaho <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2017-08-14 08:12:26 +00:00
Martin Radev 878c8b1e5e Handle viewport and scissor state changes for side-by-side framebuffers
Side-by-side framebuffers have viewport offsets as part of their state
which have to be applied to the viewport and scissor rectangles to
generate the final viewport and scissor rectangles of each view.
Whenever there is a transition to or from a side-by-side framebuffer,
viewport and scissor state has to be synced. Also, because rendering is
done on the same 2D texture the scissor test has to be always enabled to
guarantee that no fragments leak to a neighboring view.

The patch addresses this by extending the viewport and scissor state
in StateManagerGL to be a vector of rectangles instead of a single
rectangle. Two new dirty bits are added to cover changes in the viewport
offsets and whether the framebuffer has a side-by-side layout.

BUG=angleproject:2062
TEST=angle_end2end_tests

Change-Id: I8107d7ba97d06b20cf24358f19963fa494844592
Reviewed-on: https://chromium-review.googlesource.com/585012
Commit-Queue: Martin Radev <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-07-31 15:55:39 +00:00
Martin Radev 9bc9a3217e Integrate multiview state in FBO completeness check
The patch extends the FBO completeness validation to include the
multiview state members according to the ANGLE_multiview specification.

It also changes the numViews in FramebufferAttachment to be consistently
of type GLsizei instead of GLint.

BUG=angleproject:2062
TEST=angle_end2end_tests

Change-Id: Ibe550ba03204d808d96a4edf4807c68421aa1158
Reviewed-on: https://chromium-review.googlesource.com/581193
Commit-Queue: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-07-24 12:00:08 +00:00
Martin Radev 5dae57b036 Save side-by-side function arguments into attachment's state
Handle glFramebufferTextureMultiviewSideBySideANGLE calls by saving the
arguments into the attachment's state.

BUG=angleproject:2062
TEST=angle_end2end_tests

Change-Id: Idc5441d673b48640f47415b07b2854fbdf566c8d
Reviewed-on: https://chromium-review.googlesource.com/574915
Commit-Queue: Olli Etuaho <[email protected]>
Reviewed-by: Olli Etuaho <[email protected]>
2017-07-20 13:28:31 +00:00
Martin Radev e5285d298f Handle ANGLE_multiview state queries
The patch extends glGetIntegerv and glGetFramebufferAttachmentParameteriv
logic to handle the new tokens from the ANGLE_multiview extension.

BUG=angleproject:2062
TEST=angle_end2end_tests

Change-Id: Ide145279cd7b58cd03502458d7d3a1a0f5e9e86d
Reviewed-on: https://chromium-review.googlesource.com/573780
Reviewed-by: Olli Etuaho <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-07-19 07:51:00 +00:00
Jamie Madill 4928b7caac Proliferate gl::Context everywhere.
This gives the D3D back-end access to the GL state almost anywhere.
This uses the onDestroy hook for Textures to push errors up from
destructors, although they still don't quite make it to the Context.

There are places, such as in EGL object (Context/Surface) destruction,
where we end up calling through to GL implementation internals without
having access to a gl::Context. We handle this via a proxy Context
to a Display, basically a null context, that has access to impl-side
state like the Renderer pointer if necessary. It does not have access
to the normal GL state.

Also Pass gl::Context to RefCountObject::release(). Since we're using
destroy() methods now, we should not ever call the destructor directly.

BUG=angleproject:1156

Change-Id: Ie4c32ad6bf6caaff0289901f30b5c6bafa2ce259
Reviewed-on: https://chromium-review.googlesource.com/529707
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-06-20 21:41:46 +00:00
Jamie Madill 4fd95d5470 Stop using FramebufferAttachment::Target.
Target includes the binding (DEPTH/STENCIL/COLOR), which is not useful
for many operations. Simplify this to just passing the mip/layer.

This allows us to stop using this internal struct in other classes.

BUG=angleproject:1635

Change-Id: Ic5a11781bf45fe7835437fa1e363c190b876d453
Reviewed-on: https://chromium-review.googlesource.com/469152
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-04-20 19:40:19 +00:00
Jamie Madill 1e5499db80 Refactor Signal utils into template classes.
This will allow us to pass on extra information to the receiving end,
such as the specific texture levels that are dirty.

BUG=angleproject:1635

Change-Id: Idb7ca1d625499e50e7712c458b694f6e9bfc0595
Reviewed-on: https://chromium-review.googlesource.com/453382
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-04-12 16:11:30 +00:00
Jamie Madill a02315b060 WebGL Compat: Add DEPTH_STENCIL attachments.
This is a special WebGL 1 binding point, that does not correspond to
any native functionality. Due to particularities in validation we
need to represent this with additional state in the Framebuffer.
WebGL 2 fixes this oddity by resolving to the GLES 3 native spec.

In order to pass the WebGL framebuffer objects test, we will also
need a chromium-side CL to work with the additional state tracking
it does in the blink layer, and an additional patch to ANGLE to
clear the depth buffer before the first use (robust resource init).

BUG=angleproject:1708

Change-Id: I111f8f5a451cce7de6cf281a6bc335b92dd2daf2
Reviewed-on: https://chromium-review.googlesource.com/444095
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-02-23 20:42:14 +00:00
Corentin Wallez 57e6d50e47 FramebufferAttachment: make attach(nullptr) work like detach
Otherwise when trying to use a DEPTH texture for DEPTH_STENCIL,
attach(nullptr) gets called but the FramebufferAttachment still returns
true when isAttached is called.

BUG=angleproject:1523

Change-Id: I30b78aff619eb6cd63e0befac886bddc177a2e58
Reviewed-on: https://chromium-review.googlesource.com/418403
Commit-Queue: Corentin Wallez <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2016-12-16 20:56:59 +00:00
Jamie Madill a3944d4f49 Add gl::Format to represent a texture/rb/surface format.
This has a few advantages: it preserves all the information of the
internal format, such as if it is sized or unsized. It also saves
looking up the format multiple times in the table, which should
improve speed in some cases.

The extra sized-ness information will allow us to perform the
correct validation in CopyTexSubImage calls.

BUG=angleproject:1228

Change-Id: I42954771b0a9a968f5d787b8cf6e0af721791855
Reviewed-on: https://chromium-review.googlesource.com/362626
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-07-23 04:34:16 +00:00
Jamie Madill 362876b157 Cache Framebuffer completeness.
Improves performance on the render-to-texture microbenchmark
by ~3x on the OpenGL back-end. Wipes out several of the top profling
hotspots on that benchmark.

BUG=angleproject:1388

Change-Id: I6a35a0b435b2ed3c83d32acdb9df090df98214ad
Reviewed-on: https://chromium-review.googlesource.com/348957
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Corentin Wallez <[email protected]>
2016-06-17 14:19:12 +00:00
Jamie Madill 35170f5c32 Fix Renderer generator script.
This script breaks peridocially because we don't have automated tests
for it. Split the FBO attachment object class into its own file, and
also fix a couple other small snags that prevented the script from
running.

This will facilitate generating Vulkan renderer stubs.

BUG=angleproject:1319

Change-Id: I30a6ce4ab0adad962cea76731dbe82837c5c9a1b
Reviewed-on: https://chromium-review.googlesource.com/347064
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-05-25 18:19:10 +00:00
Corentin Wallez 086d59ae38 In ES3, validate that depth and stencil are the same image
BUG=605775

Change-Id: I9508c70a588270dae871dde79fea1df1c3fd1558
Reviewed-on: https://chromium-review.googlesource.com/341440
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Corentin Wallez <[email protected]>
2016-05-08 22:12:50 +00:00
Corentin Wallez 314f9b33f5 FramebufferAttachment: do not attach with an uninitialized mResource
Otherwise attach will try to call onDetach on mResource, causing an UB
(and a segfault in most cases).

This fixes a crash when running angle_unittests on Mac with another
patch.

BUG=angleproject:891

Change-Id: I09d34d7246849059a13bc2fb00a61837cccd97d7
Reviewed-on: https://chromium-review.googlesource.com/294830
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Corentin Wallez <[email protected]>
2015-08-20 18:32:02 +00:00
Corentin Wallez 51706eaeeb Make FramebufferAttachmentObject not refcountable
Re-land with a fix for an unitialized variable

Instead the refcount is done via callbacks. This allows Surface to
ignore this refcounting which will be useful in a follow-up CL.

BUG=angleproject:891

Change-Id: I1925ccaa4ce7b502b33088660d31c404b8313cb5
Reviewed-on: https://chromium-review.googlesource.com/293712
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Corentin Wallez <[email protected]>
2015-08-17 19:50:32 +00:00
Corentin Wallez 0020426e2e Revert "Make FramebufferAttachmentObject not refcountable"
BUG=

This reverts commit 19ba57469a.

Change-Id: I5dce6c8a81570e22affbcaf32183a97c97849718
Reviewed-on: https://chromium-review.googlesource.com/293351
Reviewed-by: Corentin Wallez <[email protected]>
Tested-by: Corentin Wallez <[email protected]>
2015-08-13 02:08:03 +00:00
Corentin Wallez 19ba57469a Make FramebufferAttachmentObject not refcountable
Instead the refcount is done via callbacks. This allows Surface to
ignore this refcounting which will be useful in a follow-up CL.

BUG=angleproject:891

Change-Id: I39b028476e0e3ab1837c033e1121ea21e54d7970
Reviewed-on: https://chromium-review.googlesource.com/291651
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Corentin Wallez <[email protected]>
2015-08-12 19:10:16 +00:00
Jamie Madill 2d06b738a1 Store value types for FBO attachments.
*re-land with fix for Mac*

This prevents us from re-allocating FBO attachments every set.
This change requires quite a bit of refactoring.

BUG=angleproject:963

Change-Id: Ia1f83e3c427d446ddbe16c6703db136942149e91
Reviewed-on: https://chromium-review.googlesource.com/266691
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2015-04-27 19:38:06 +00:00