Commit Graph
159 Commits
Author SHA1 Message Date
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
Yuly Novikov c4d18aac0a Use ErrorStream everywhere
Eliminates one more usage of FormatString and its static initializer.

Add more ErrorStream types
and replace gl::Error and egl::Error with them.

BUG=angleproject:1644

Change-Id: Ib498d0ae4b81a332ec71aed7cf709993b154e6bb
Reviewed-on: https://chromium-review.googlesource.com/505429
Commit-Queue: Yuly Novikov <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-06-07 20:48:52 +00:00
Corentin Wallez e755774407 WebGL compatibility: remove UB for draw buffers in the GL backend.
WebGL adds two rules:
 - Fragment outputs declared but not written to should default to black.
 - FBO attachments for outputs not declared in the shader should not be
written to (it is UB in OpenGL ES).

Fix the first one by using the SH_INIT_OUTPUT_VARIABLES compiler
options, and the second one by messing with glDrawBuffers so that the
enabled draw buffers are always a subset of the ones declared by the
shader.

BUG=angleproject:2048

Change-Id: I1d851c190959c1acfc3e41d837e6990aec1d4086
Reviewed-on: https://chromium-review.googlesource.com/521682
Commit-Queue: Corentin Wallez <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-06-02 18:32:55 +00:00
Jamie Madill c564c070ff Pass gl::Context to impl methods instead of ContextImpl.
In some cases we might have to call back into the GL layer, passing
the Context, and if we just have a ContextImpl pointer this isn't
possible. It also removes the need for SafeGetImpl.

BUG=angleproject:2044

Change-Id: I6363e84b25648c992c25779d4c43f795aa2866d6
Reviewed-on: https://chromium-review.googlesource.com/516835
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-06-01 20:35:14 +00:00
Geoff Lang e0cff1901d Validate that fragment shader output matches the draw buffer type.
TEST=conformance2/rendering/fs-color-type-mismatch-color-buffer-type
BUG=angleproject:1688

Change-Id: I17848baf40b6d32b5adc1458fe2369b850164da3
Reviewed-on: https://chromium-review.googlesource.com/518246
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Frank Henigman <[email protected]>
2017-06-01 16:41:36 +00:00
Geoff Lang 857c09db35 Add missing completeness checks for texture attachments.
Texture attachments need to validate that the attached mip level is within
the [baseLevel,maxLevel] range and that the texture is complete if the
attached mip level is not the base level.

BUG=722684

Change-Id: I859766506b295638572b75a0e2e9fed168be047a
Reviewed-on: https://chromium-review.googlesource.com/506928
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2017-05-29 16:00:00 +00:00
Geoff Lang a1b9d5a259 Refactor multisample framebuffer completeness checks.
Re-land with protection against div-by-zero in samples compatibility
check.

BUG=722684

Change-Id: I3d5c310d1f2cb4d8b92d80492435855c3c4ad807
Reviewed-on: https://chromium-review.googlesource.com/517427
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2017-05-29 15:11:47 +00:00
Geoff Lang 7d79fe95bd Revert "Refactor multisample framebuffer completeness checks."
This reverts commit ff77c35922.

Reason for revert: Breaks FramebufferMixedSamplesTest on Android NVIDIA

BUG=angleproject:2045

Original change's description:
> Refactor multisample framebuffer completeness checks.
> 
> BUG=722684
> 
> Change-Id: Iebe6968ebd693e7f051394a040eac1cf6f539e6e
> Reviewed-on: https://chromium-review.googlesource.com/508221
> Reviewed-by: Geoff Lang <[email protected]>
> Reviewed-by: Jamie Madill <[email protected]>
> Commit-Queue: Geoff Lang <[email protected]>
> 

[email protected],[email protected],[email protected]
# Not skipping CQ checks because original CL landed > 1 day ago.
BUG=722684

Change-Id: I1abab021ba73b218cbbe60d4e7bfdaae56955c64
Reviewed-on: https://chromium-review.googlesource.com/517390
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2017-05-26 21:54:10 +00:00
Geoff Lang ff77c35922 Refactor multisample framebuffer completeness checks.
BUG=722684

Change-Id: Iebe6968ebd693e7f051394a040eac1cf6f539e6e
Reviewed-on: https://chromium-review.googlesource.com/508221
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2017-05-25 19:02:24 +00:00
Geoff Lang 9f10b775c9 Refactor checks for incomplete framebuffer attachments.
BUG=722684

Change-Id: I6f47d92b450a056a2344767bef28e96c4552f98e
Reviewed-on: https://chromium-review.googlesource.com/506927
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2017-05-18 15:50:14 +00:00
Jamie Madill 231c7f56ca Apply clang-format to many files.
This cleans up the formatting in many places.

BUG=None

Change-Id: I6c6652ebc042f1f0ffecced53582d09d66b4f384
Reviewed-on: https://chromium-review.googlesource.com/487884
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-05-17 16:02:02 +00:00
Geoff Lang 677bb6ffc0 Update checks for floating point renderability.
* Expose GL_CHROMIUM_color_buffer_float_rgb and
   GL_CHROMIUM_color_buffer_float_rgba
 * Fix many texture formats that were incorrectly checking the wrong
   extension for support or renderability.
 * Make all floating point texture extensions dynamically enableable.

BUG=angleproject:1958
BUG=angleproject:1715

Change-Id: Iefccc8b5ae5edd97623affa9de05b1d9af5c9598
Reviewed-on: https://chromium-review.googlesource.com/468450
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2017-05-04 17:05:10 +00:00
Jamie Madill 876429b7a1 Update gl2.h and update entry points.
Some method signatures were updated. Types like GLclampf and GLvoid
were replaced with other equivalents.

BUG=angleproject:1309

Change-Id: I05e8e2072c5a063d87ad96a855b907424661e680
Reviewed-on: https://chromium-review.googlesource.com/475011
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-04-27 16:32:22 +00:00