Commit Graph
171 Commits
Author SHA1 Message Date
Luc Ferron bf6dc37972 Vulkan: Flip viewport on y for the backbuffer only
- Hide the implementation behind a feature flag, currently
disabled permanently as I'm working on fixing the different
failures.
- SimpleOperationTest.* passing

Bug: angleproject:2673
Change-Id: Ic86520c3cc478d62bebbaeaf4c6b33c439a67b0f
Reviewed-on: https://chromium-review.googlesource.com/1119089
Commit-Queue: Luc Ferron <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-07-04 19:25:37 +00:00
Luc Ferron 5bdf8bd1cf Vulkan: enable the rest of dEQP tests in fbo.render.*
Vulkan does not support separate depth and stencil attachments.
Adding this check to checkStatus skips the relevant tests to that.

There was also a bug in FramebufferVk::clear where we were not
checking the number of bits for depth/stencil attachments before
setting the aspects for clearing.

Bug: angleproject:2597
Change-Id: Iabe9f77a51fc7aca08b8faf3cecc3df9f99a7f1e
Reviewed-on: https://chromium-review.googlesource.com/1107847
Commit-Queue: Luc Ferron <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-06-21 19:06:07 +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
Yuly Novikov f15f886c2d Differentiate texture and renderbuffer framebuffer attachment capabilities
ANGLE used to describe the abitily to attach textures and renderbuffers
of a specific format to a framebuffer using a single notion of "renderable".
However, for some formats, only one can be supported, but not the other.

Split TextureCaps::renderable into textureAttachment and renderbuffer.
Also, split InternalFormat::renderSupport into
textureAttachmentSupport and renderbufferSupport.

The only functional change is in a few places which now explicitly check
for texture or renderbuffer attachement support.
Information in format support tables was duplicated for the two capabilities,
so behavior should remain the same. It should be corrected in future CLs.

Note: additional information in those tables may need to be added
in order to properly support GenerateMipmap and TexStorage2DMultisample,
this is beyond the scope of this CL.

Bug: angleproject:2567
Change-Id: I18bce4100525be35709d8bbf4de08ec812aab502
Reviewed-on: https://chromium-review.googlesource.com/1086491
Commit-Queue: Yuly Novikov <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-06-08 21:58:15 +00:00
Geoff Lang bf7b95db6b Create a default framebuffer per surface/context pair on MakeCurrent.
Sharing a gl::Framebuffer object between multiple contexts causes problems if
contexts are not virtualized because the native framebuffer objects are not
shared between these contexts.  The FramebufferImpl created should be the glue
that binds a specific context to a specific surface.

Update the SurfaceImpl implementations to re-create the framebuffer
object before passing it to FramebufferGL.  No backing resources will be
re-created.

BUG=angleproject:2464

Change-Id: Id0b13a221c22b71517b25cb5b1ef2392ad2ecdd6
Reviewed-on: https://chromium-review.googlesource.com/1039985
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Frank Henigman <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-06-01 18:01:39 +00:00
Jamie Madill 2274b652c0 StateManager11: Cache impl objects.
Also requires putting the Framebuffer ID in the shared state object.

Bug: angleproject:2575
Change-Id: I68e3af839a85798e01050560a67624a165d3ed2c
Reviewed-on: https://chromium-review.googlesource.com/1067119
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-05-31 16:32:31 +00:00
Jiawei Shao b1e9138015 ES31: Implement EXT_geometry_shader framebuffer default layers on OpenGL
This patch implements FRAMEBUFFER_DEFAULT_LAYERS_EXT as a legal framebuffer
parameter required in OpenGL ES 3.1 extension EXT_geometry_shader on OpenGL
back-ends.

The query on FRAMEBUFFER_DEFAULT_LAYERS_EXT specifies the layer count used
when the framebuffer has no attachments.

BUG=angleproject:1941
TEST=dEQP-GLES31.functional.geometry_shading.query.framebuffer_default_layers

Change-Id: I888465dfe23da53541ec2fedb8616027df532466
Reviewed-on: https://chromium-review.googlesource.com/1063560
Reviewed-by: Jiajia Qin <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Jiawei Shao <[email protected]>
2018-05-23 01:13:40 +00:00
Geoff Lang ce07f967c2 Merge the Framebuffer onDestroy and onDestroyDefault methods.
Pass the proxy context to the onDestroyDefault call.

BUG=angleproject:2464

Change-Id: I47f869d623e238ca3680c962387ba9359e7d3844
Reviewed-on: https://chromium-review.googlesource.com/1052220
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2018-05-09 18:29:15 +00:00
Geoff Lang 1345507923 Pass a context pointer to Framebuffer[Impl]::getSamplePosition
BUG=angleproject:2464

Change-Id: Icd260db9bbd11699b2d0f6152e898c38baa4844d
Reviewed-on: https://chromium-review.googlesource.com/1052219
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2018-05-09 18:24:46 +00:00
Jamie Madill 427064d2ac Fix perf regression with checkStatus.
Returning an Error was costing us performance in extra
error checks. This intead uses the Context to process the
Error immediately, and returns a value from isComplete and
checkStatus.

Improves performance in draw call validation.

Bug: chromium:822235
Change-Id: I0793fc690e86137425fed593d45083e40aee8db9
Reviewed-on: https://chromium-review.googlesource.com/1011370
Reviewed-by: Luc Ferron <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-04-18 17:48:24 +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 0946393dfd Move Buffer Subject/Observer to front end.
This makes BufferImpl into an Observer Subject. It also refactors
the Vertex Array updates for the D3D11 backend use more of a dirty
bit coding style.

This change makes it so Buffer contents changes trigger front-end
dirty bits from the back-end, which may be undesirable.

Bug: angleproject:2389
Change-Id: Iac8ce1171284a86851c18cd1373ddf24fcefe40b
Reviewed-on: https://chromium-review.googlesource.com/979812
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-04-04 15:25:51 +00:00
Ken Russell b9f9250486 Update stencil validation rules for WebGL
Based on kbr's patch:
https://chromium-review.googlesource.com/c/angle/angle/+/890605

Implements new rules in this revised WebGL conformance test:
https://github.com/KhronosGroup/WebGL/pull/2583

BUG=chromium:806557

Change-Id: I84701dd7156f0bc4a45ba68e63cb962d2d54c2e5
Reviewed-on: https://chromium-review.googlesource.com/952567
Commit-Queue: Kai Ninomiya <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2018-03-26 19:42:57 +00:00
Jamie Madill 690c8eb7f2 Framebuffer: syncState before internal format query.
Since querying the internal format of an attachment might need ot look
at the RenderTarget for some back-ends, or otherwise flush attachment
changes, we should call syncState internally. This means that we can't
mark these queries as const.

Bug: angleproject:2372
Change-Id: I9bfb43a472bcd7dfdd6ea7fab4751d494e1126bb
Reviewed-on: https://chromium-review.googlesource.com/948784
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-03-13 22:38:45 +00:00
Jamie Madill e98b1b5d41 Framebuffer: Handle errors in checkStatus.
This pipes a lot more errors around in the Validation, where
they now will be caught.

Bug: angleproject:2372
Change-Id: Ibb4e47ddc932995a02dd92e10578b7a4097182a9
Reviewed-on: https://chromium-review.googlesource.com/954406
Reviewed-by: Luc Ferron <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-03-12 16:36:52 +00:00
Geoff Lang a36483fce6 Use full type names instead of auto for simple structs.
BUG=angleproject:2107

Change-Id: I7a5e4be124ec4381799fea51de3715e09c2f7400
Reviewed-on: https://chromium-review.googlesource.com/957272
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-03-09 22:19:32 +00:00
Jamie Madill 5b77231252 Nuke ValidationContext.
This pattern never really took off. It was intended to be used to
unit-test our Validation logic, but it become so complex because
of interactions with Framebuffer::syncState that we could never
really make use of it.

Nuke it entirely and simplify the Context class.

Bug: angleproject:2372
Change-Id: I40b9d46ce7706511a210da496ee19192cf609366
Reviewed-on: https://chromium-review.googlesource.com/954291
Reviewed-by: Luc Ferron <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-03-09 18:16:46 +00:00
Geoff Lang d4fff50695 Reorder state synchronization for resource init.
Some backends may change state while initializing resources.  Make sure
that all resources are initialized before synchronizing the backend
state for the given operation.

BUG=angleproject:2107

Change-Id: Ie75ac3eee986e41dfe3dd11a94a706e19df7497e
Reviewed-on: https://chromium-review.googlesource.com/678481
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2018-03-09 17:42:37 +00:00
Jamie Madill 19fa1c6f88 Return an Error from Framebuffer::syncState.
This pipes errors up from the Impl to the top level. There are
still a few places were error swallowing is needed, because the
Framebuffer API doesn't support returning an error.

Bug: angleproject:2372
Change-Id: Idc06bda1817fd28075940f69874d8b6ba69194f9
Reviewed-on: https://chromium-review.googlesource.com/954290
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Luc Ferron <[email protected]>
2018-03-08 18:12: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
Geoff Lang 8170eab7d8 D3D: Implement robust resource init for Surfaces.
BUG=angleproject:2107
BUG=angleproject:2317

Change-Id: I22260e1093dc6c09e4627c62a95ca4088c99e951
Reviewed-on: https://chromium-review.googlesource.com/678480
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2018-02-14 17:05:04 +00:00
Brandon Jones c405ae717f Optimize Vertex Shader Attribute Type Validition
Improves ValidateVertexShaderAttributeTypeMatch by storing vertex
attributes types into masks for quick comparisons when needed. This shows
2% improvement to glDrawElements for the aquarium workload.

BUG=angleproject:2202

Change-Id: I87fa3d30c3d8cdba6dfd936cd1a41fd27b1c6b77
Reviewed-on: https://chromium-review.googlesource.com/814795
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-01-04 22:42:39 +00:00
Bryan Bernhart (Intel Americas Inc) 5f19810d5d WebGLCompat: Fix depth & stencil query results.
getFramebufferAttachmentParameter returns incorrect
result for framebuffers in an inconsistent state.

BUG=angleproject:2281

Change-Id: Ifb83ecaf16c95bf1237b2c4f2684de6aa2d55c46
Reviewed-on: https://chromium-review.googlesource.com/823224
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-12-13 18:10:27 +00:00
Bryan Bernhart (Intel Americas Inc) 2eeb1b34ec WebGLCompat: Fix depthstencil query results.
getFramebufferAttachmentParameter returns incorrect
result for framebuffers in an inconsistent state.

BUG=angleproject:2259

Change-Id: I76fa99f1b8847c30469d344bd93dedd9cf6657bf
Reviewed-on: https://chromium-review.googlesource.com/798318
Reviewed-by: Bryan Bernhart <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2017-12-04 22:47:13 +00:00
Brandon Jones 76746f9bc2 Optimize Fragment Shader Type Match Validation
Improves ValidateFragmentShaderColorBufferTypeMatch by storing input and
output types into a bitmask for quick comparison when validation is
needed. This shows a 2% improvement to glDrawElements for the aquarium
workload.

BUG=angleproject:2203
Change-Id: Iade2ecf28383164e370b48442f01fba6c0962fba
Reviewed-on: https://chromium-review.googlesource.com/775019
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-12-01 21:08:45 +00:00
Geoff Lang 92019431df Make conversion from GL types to native bools consistant.
Some places would compare with "== GL_TRUE" and others with "!= GL_FALSE".
This behaviour is not in the OpenGL spec but "!= GL_FALSE" is the most
standard and follows the same rules as C and C++.

Remove un-necessary validation that params are either GL_TRUE or
GL_FALSE.

Update some internal storage from GLboolean to bool.

BUG=angleproject:2258

Change-Id: I12adbe2d24318a206521ca6ad1099ee7e2bf677e
Reviewed-on: https://chromium-review.googlesource.com/779799
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2017-11-20 20:56:37 +00:00
Corentin Wallez 336129f66f Use a packed enum for buffer targets.
BUG=angleproject:2169

Change-Id: I4e08973d0e16404b7b8ee2f119e29ac502e28669
Reviewed-on: https://chromium-review.googlesource.com/723865
Commit-Queue: Corentin Wallez <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-11-10 23:18:12 +00:00
Jeff Gilbert 8f8edd6eac attachmentsHaveSameDimensions should not compare depths.
From: https://bugzilla.mozilla.org/show_bug.cgi?id=1372083

BUG=angleproject:2210
TEST=angle_end2end_tests
Change-Id: I00539fb7e0bc9a21f90f5c87d7082c2a6b1ed907
Reviewed-on: https://chromium-review.googlesource.com/747814
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-11-08 15:31:11 +00:00
Corentin Wallez cda6af1960 Split pixelBuffer from pack/unpack state
This will refactor will help use packed enums for buffer targets.

BUG=angleproject:2169

Change-Id: Ie7ed3e105f89457c67027e6598d7e29503ad355c
Reviewed-on: https://chromium-review.googlesource.com/745181
Commit-Queue: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-11-08 00:35:15 +00:00
Jamie Madill 4297564424 Move incomplete texture logic to shared helper.
The incomplete texture handling is similar between the D3D and Vulkan
back-ends. We create 1x1 textures, initialize them to black, and bind
them when we detect incomplete textures. We would also bind incomplete
textures when we detect feedback loops. In the GL back-end, we
wouldn't detect feedback loops, and would allow the driver to handle
incompleteness.

Instead implement this in a shared helper class, and do the feedback
loop detection in the front-end for every back-end. This makes our
behaviour more consistent between back-ends, and prevents undefined
behaviour.

Because initializing multisample textures is tricky (they
can't be updated with TexImage calls) we do a bit of a workaround so
the back-end can clear the incomplete multisample texture initially.

This progresses the initial Vulkan textures implementation.

BUG=angleproject:2167

Change-Id: I79ddcc0711fcc986f2578a52ac6f701231d241ac
Reviewed-on: https://chromium-review.googlesource.com/700993
Reviewed-by: Yuly Novikov <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-10-13 04:34:36 +00:00
Kenneth Russell ce8602ab79 WebGL requires GL_FRAMEBUFFER_UNSUPPORTED for identical FBO attachments.
If the same level of a texture is attached to multiple color
attachments of a framebuffer object, for example, the WebGL
conformance tests require generating a GL_FRAMEBUFFER_UNSUPPORTED
error. The Direct3D backend already had this restriction; apply it to
all backends when the WebGL compatibility extension is enabled.

Fixes the following WebGL conformance tests with the pass-through
command decoder in Chrome:
  conformance/extensions/webgl-draw-buffers-framebuffer-unsupported
  conformance2/rendering/framebuffer-unsupported

BUG=angleproject:2168

Change-Id: I340d06ca0ee969989c6c5725512b1b9542281477
Reviewed-on: https://chromium-review.googlesource.com/699856
Commit-Queue: Kenneth Russell <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-10-05 01:33:11 +00:00
Jamie Madill 682efdc47a Fix a GCC warning found by Skia.
This only seems to affect GCC's enum-compare warning,
because we were comparing an untyped enum with a size_t enum.

BUG=None 

Change-Id: I74b8315cff61344d1b7700b1c56a40d2ffce41e2
Reviewed-on: https://chromium-review.googlesource.com/698296
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-10-03 18:54:36 +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 8693bdb881 Add a few missing dirty bit cases.
Discovered some of these while investigating Texture dirty bits.

BUG=angleproject:1387

Change-Id: I8b170462bfd283e4b0f9d47b7f7ddbaa7957914d
Reviewed-on: https://chromium-review.googlesource.com/648051
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-09-05 20:58:51 +00:00
Martin Radev 4e619f5877 Add branch for viewport or layer selection in VS
The patch extends the behavior of
SH_SELECT_VIEW_IN_NV_GLSL_VERTEX_SHADER so that either the viewport
or layer is selected based on the value of the internal uniform variable
MultiviewRenderPath.

BUG=angleproject:2062
TEST=angle_end2end_tests
TEST=angle_unittests

Change-Id: Ia311b12b1fed642dac78eba8732e2535242f34fd
Reviewed-on: https://chromium-review.googlesource.com/615260
Commit-Queue: Martin Radev <[email protected]>
Reviewed-by: Olli Etuaho <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-08-21 08:00:04 +00:00
Martin Radev 5c00d0dbe6 D3D11: Handle Clear* commands for side-by-side framebuffers
The patch modifies Clear11 to add support for clearing the color, depth
and stencil attachments to a side-by-side framebuffer:
- Color attachments are cleared through the command ClearView.
- Depth and stencil attachments are cleared by drawing a quad on top of
each view.

BUG=angleproject:2062
TEST=angle_end2end_tests

Change-Id: I5753a72222216a48cd954eb1219bc58f968735fc
Reviewed-on: https://chromium-review.googlesource.com/603853
Commit-Queue: Martin Radev <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-08-16 12:23:49 +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 a3ed457682 Disallow glBlitFramebuffer for multi-view framebuffers
According to the ANGLE_multiview spec, glBlitFramebuffer must
generate an INVALID_FRAMEBUFFER_OPERATION error if either the active read
framebuffer, or active draw framebuffer has a multi-view layout.

BUG=angleproject:2062
TEST=angle_end2end_tests

Change-Id: I885bdc970c9606cfad882f31759f5780c65d15e5
Reviewed-on: https://chromium-review.googlesource.com/590237
Commit-Queue: Martin Radev <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-07-28 16:06:39 +00:00
Martin Radev 14a26aeaf4 Disallow indirect draw calls for multi-view framebuffers
According to the ANGLE_multiview spec indirect draw calls
must generate an INVALID_OPERATION error if the number of
views in the active draw framebuffer is greater than 1.
The patch addresses this by extending the indirect draw call
validation.

BUG=angleproject:2062
TEST=angle_end2end_tests

Change-Id: Ic30ef9a0eabba454aeea6176df1be8bd2ccd9783
Reviewed-on: https://chromium-review.googlesource.com/583027
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Martin Radev <[email protected]>
2017-07-26 16:01:15 +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
Jamie Madill 5aca193980 Framebuffer: Fix enabled draw buffers bitset.
This would start off the zeroth element as enabled even if there was
no attachment. If we remove the extra set, then we no longer have to
check if the attachment is valid when iterating over the enabled
bitset.

BUG=angleproject:2107

Change-Id: I679f66156ced09d42add9e302ac974166713e0d5
Reviewed-on: https://chromium-review.googlesource.com/581884
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-07-21 19:22:01 +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
Jamie Madill 6dd06eaca3 Give StateManager11 internal dirty bits.
Intead of checking a series of bools and special variables, organize
the state application into a switch with internal dirty bits. This
should be faster for no-op, and makes it clear where we have to
further optimize the state update to pre-compute certain values.

BUG=angleproject:1156

Change-Id: I8eca8716340499085afa170ff45f7788e84fecab
Reviewed-on: https://chromium-review.googlesource.com/531794
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-07-19 20:07:30 +00:00
Jamie Madill 9c33586521 Refactor StateManager11 for dirty bits.
This will make iterating over an internal set of dirty bits simpler.

This also reorganizes the framebuffer invalidation logic a  bit,
including how the sample count is pulled from the Framebuffer.

BUG=angleproject:1156

Change-Id: I79dbcd11704ab52568c587d836af9c1bff1d2d1f
Reviewed-on: https://chromium-review.googlesource.com/529708
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-07-18 19:17:17 +00:00
Jamie Madill a0016b7fc9 Check depth-stencil attachment sample count.
Currently we would only check for the color attachment sample count,
which could return incorrect results for depth or stencil-only
Framebuffers.

BUG=angleproject:2108

Change-Id: I378349c91c0139ee507d88fa6a36a86234fea0d4
Reviewed-on: https://chromium-review.googlesource.com/571064
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-07-14 20:34:56 +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