Commit Graph
184 Commits
Author SHA1 Message Date
Olli Etuaho 4ebd8f3d99 Fix issues with clearing deleted attachments
Deleting an object that was acting as a framebuffer color attachment
in the current framebuffer didn't previously update all of the
framebuffer state correctly. Fix this by going through the usual
resetAttachment path when any framebuffer attachment is deleted
instead of having custom code that only updated part of the state.

Also early out from clearbuffer calls in case of a missing color
buffer - even now that the draw buffer mask is being updated correctly,
some backend code doesn't take it into account. One example is
querying attachment format when the SRGB clear for linear framebuffer
attachments workaround is active.

BUG=angleproject:2831
TEST=angle_end2end_tests

Change-Id: I1071a60dc0251946fed00e88e43a244fe59f4863
Reviewed-on: https://chromium-review.googlesource.com/1235656
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2018-09-25 05:19:53 +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
Jamie Madill 55e57f96fb Remove some redundant dirty bits notifications.
These were already being signaled in the front end.

Bug: angleproject:2763
Change-Id: Id78d3d764e80e687c29c08395b59048d314bfbe2
Reviewed-on: https://chromium-review.googlesource.com/1204490
Reviewed-by: Yuly Novikov <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-09-22 00:20:56 +00:00
Jamie Madill 38fe68403b Remove secondary Texture rendering loop check.
This check was not used. It applied only to rendering Feedback Loops.
The behaviour is undefined in non-WebGL and for WebGL we have a
separate validation check.

Also update the feedback loop tests to ignore the current GL states.
This change is based on feedback from the OpenGL ES working group.

Bug: angleproject:2763
Bug: chromium:763695
Change-Id: I9882b4f9af2d43fc7b5604ff36dadcc79dfd378f
Reviewed-on: https://chromium-review.googlesource.com/1228373
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-09-21 06:16:23 +00:00
Jamie Madill d84b6737fa Cache ValidateDrawStates.
This improves performance of all draw call validation. The error that
should be generated on the draw call is cached in the Context. The
cache is updated in several places.

Bug: angleproject:2747
Change-Id: I178617623731608e2e7166b53ab6489d8b742ff5
Reviewed-on: https://chromium-review.googlesource.com/1158612
Reviewed-by: Yuly Novikov <[email protected]>
Reviewed-by: Frank Henigman <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-09-07 14:30:02 +00:00
Yuly Novikov 2eb54074af Fix EGLImage pixel format validation
This fixes the scenario when EGLImage source and target have different types.
For example, a texture is created with unsigned format using glTexImage2D,
it is used as a source of EGLImage with eglCreateImageKHR,
and then the EGLImage is used to create a renderbuffer target with
glEGLImageTargetRenderbufferStorageOES.

OES_EGL_image doesn't specify what should happen in this case,
but GL implementations (Nexus 5X) seem to allow using this renderbuffer in
glFramebufferRenderbuffer and the resulting framebuffer is complete.
Thus, in this case, instead of checking whether the renderbuffer format
can be used in glFramebufferRenderbuffer, we need to check whether the
original texture can be used in glFramebufferTexture2D.
Similarly in reverse direction.

Also, for the case of source renderbuffer and target texture,
presume that glEGLImageTargetTexture2DOES will succeed regardless of
renderbuffer format.

1. Add isRenderable and isTexturable checks to egl::Image class,
   and perform different checks depending on source type.
2. Add isRenderable check to FramebufferAttachment and delegate EGLImage
   attachments check to egl::Image.
3. Use these checks in validation of EGLImageTargetTexture2D,
   EGLImageTargetRenderbufferStorage and when checking attachment completeness

Bug: angleproject:2567

Change-Id: I8e9f4a2930a4075a4d8464f62582c6825270187e
Reviewed-on: https://chromium-review.googlesource.com/1192585
Commit-Queue: Yuly Novikov <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-08-31 18:07:27 +00:00
Jamie Madill b983a4b28b Pass Context to Framebuffer::invalidateCompletenessCache.
This will be useful for validation state caching.

Bug: angleproject:2747
Change-Id: I0737adca7406f79b9e15429f30ae22e1299cd7e4
Reviewed-on: https://chromium-review.googlesource.com/1158611
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Frank Henigman <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-08-07 13:11:21 +00:00
Geoff Lang b8430dd749 Use FixedVector for storing textures referenced by a framebuffer.
This improves the performance of Framebuffer::hasTextureAttachment 3X.

BUG=angleproject:2188

Change-Id: I6acc7f4440fe0232438182274d7bba6075530f38
Reviewed-on: https://chromium-review.googlesource.com/1159171
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-08-03 13:22:56 +00:00
Jamie Madill cc73f24114 Micro-optimize some validation checks.
Prepares for caching hasMappedBuffer. Also inclines several checks for
faster speed.

Bug: angleproject:2746
Change-Id: I74f9408d7b41e245c3f58d367dd2cc8fbace4a7a
Reviewed-on: https://chromium-review.googlesource.com/1150762
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Frank Henigman <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-08-01 22:01:53 +00:00
Jamie Madill a11819deca Context: Use Observer pattern for container objects.
Container objects in this case are the Vertex Array and Read and Draw
Framebuffers. Instead of using a mutable dirty bit state with a const
function to notify of dirty bits we can use the Observer/Subject
pattern. This more cleanly allows us to do cache updates.

Bug: angleproject:1391
Change-Id: I88f863894ec3efa00322038f323a84850166107d
Reviewed-on: https://chromium-review.googlesource.com/1153399
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Frank Henigman <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-08-01 16:20:50 +00:00
Olli Etuaho 8acb1b6127 Allow reads from a multiview framebuffer with one view
It's safe to read from a multiview framebuffer if it is layered and
has just one view. The native OVR_multiview spec supports this as
well.

BUG=angleproject:2062
TEST=angle_end2end_tests

Change-Id: I04e1364390574075f7e06e39a64e3bf05a539a05
Reviewed-on: https://chromium-review.googlesource.com/1156509
Commit-Queue: Olli Etuaho <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-07-31 15:39:00 +00:00
Yuly Novikov 21edf3db5e Fix stencil mask check in Framebuffer::partialClearNeedsInit
Bug: 850060

Change-Id: I9672e6c93e92941e61763d77180bef1548f5fbde
Reviewed-on: https://chromium-review.googlesource.com/1148897
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Yuly Novikov <[email protected]>
2018-07-24 21:28:13 +00:00
Jamie Madill 6b873dd796 Add gl::ErrorSet and angle::Result.
gl::ErrorSet can handle errors and is accessible from ContextImpl.
It allows the implementation to mutate the error set without using
the gl::Context directly.

angle::Result is the faster POD return value class. It should generate
optimal code. It can also be used seamlessly with the ANGLE_TRY macro.

Also introduces an internal enum as a workaround for generating and
consuming errors in the back-end. When the internal enum is used as
an error return value the error is not consumed in the front-end. This
is a temporary workaround only.

Bug: angleproject:2491
Bug: angleproject:2713
Change-Id: I6cbdaadd075ccbdf241844cbcbc4ed5c3be40a8b
Reviewed-on: https://chromium-review.googlesource.com/1133200
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Frank Henigman <[email protected]>
2018-07-13 17:06:40 +00:00
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