Commit Graph
141 Commits
Author SHA1 Message Date
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
Jamie Madill 4fd95d5470 Stop using FramebufferAttachment::Target.
Target includes the binding (DEPTH/STENCIL/COLOR), which is not useful
for many operations. Simplify this to just passing the mip/layer.

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

BUG=angleproject:1635

Change-Id: Ic5a11781bf45fe7835437fa1e363c190b876d453
Reviewed-on: https://chromium-review.googlesource.com/469152
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-04-20 19:40:19 +00:00
Geoff Lang ca27139e6b Key the format tables on internal format and type.
Keying the format tables on internal format alone is not enough to fully
validate the unsized formats which require additional type information.

This CL has no functional changes, it just splits the tables and updates
the calls to GetInternalFormat info to provide type information when the
format is not sized.

BUG=angleproject:1523
BUG=angleproject:1958
BUG=angleproject:1228

Change-Id: I37e5201e7f54fa8eca01b8a6e64b11a6b94484e7
Reviewed-on: https://chromium-review.googlesource.com/468449
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-04-20 14:50:44 +00:00
Jamie Madill 6de5185898 Optimize angle::BitSetIterator.
Adds a new custom bitset template to handle packing as many bits as
possible into a single variable. Intelligently select the right class
depending on platform features and bit sizes.

For now, always use a packed 64-bit set on 64-bit, instead of using
a 32-bit set for smaller bitsets.

BUG=angleproject:1814

Change-Id: I3ffef815c15515555833f6fc9302d8a4eee5423b
Reviewed-on: https://chromium-review.googlesource.com/471827
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-04-19 21:50:10 +00:00
Geoff Lang a0e0aebbf2 Validate that framebuffer attachments all have the same size for WebGL.
TEST=conformance2/rendering/draw-buffers

BUG=angleproject:1989

Change-Id: Ifcbc766dea99a8361261713fde7a6b6ad724fd55
Reviewed-on: https://chromium-review.googlesource.com/475083
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-04-19 20:15:43 +00:00
Jamie Madill b8126691cf Framebuffer: Add an update attachment helper function.
This will allow us to set that certain attachments need to be
initialized in a single place.

BUG=angleproject:1635

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

BUG=angleproject:1635

Change-Id: Idb7ca1d625499e50e7712c458b694f6e9bfc0595
Reviewed-on: https://chromium-review.googlesource.com/453382
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-04-12 16:11:30 +00:00
Jamie Madill 20e005b2a1 Rename BitSetIterator.h to bitset_utils.h
BUG=angleproject:1814

Change-Id: I152ae13b6b7cf0ba72259967f0f124e199b20e07
Reviewed-on: https://chromium-review.googlesource.com/471826
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-04-10 16:24:59 +00:00
Geoff Lang 9aded17c25 Invalidate completeness caches when enabling extensions.
Enabling extensions can cause framebuffers and textures to go from
incomplete to complete.

No functional changes from the API surface.

BUG=angleproject:1523
BUG=angleproject:1958

Change-Id: Iff686e1c292f6cf4921d6fffd7eb98bedaba828b
Reviewed-on: https://chromium-review.googlesource.com/468410
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2017-04-05 20:14:13 +00:00
Jamie Madill dd43e6cd1f Pass Context to VertexArray and Framebuffer syncstate.
This will enable more Vulkan-friendly idioms like clearing the
vulkan pipeline caches correctly on GL state changes immediately
because we have access to the ContextVk.

BUG=angleproject:1898

Change-Id: I16c848d8abdde8e26a38d384e565cec8548a66d0
Reviewed-on: https://chromium-review.googlesource.com/459079
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-04-04 23:22:13 +00:00
Geoff Lang d90d388cdb Make sure the default framebuffer has enough draw buffer states.
Querying the draw buffer states of the default framebuffer would lead to
crashes because it only had one state.  The spec says that all non-zero
attachments default to GL_NONE and makes no mention of special cased
errors for querying the default framebuffer.

Also fix the validation to check for extensions and ES version when
querying draw buffer state.

BUG=703508

Change-Id: I7db5443141c65a3f9c638f07ba90f78d76e4e7b4
Reviewed-on: https://chromium-review.googlesource.com/457524
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-03-21 19:16:47 +00:00
Geoff Lang e466c55130 Preserve ImageIndex of texture attachments when committing.
When calling Framebuffer::commitWebGL1DepthStencilIfConsistent with
textures attached to depth or stencil, an invalid ImageIndex would be
provided and later cause crashes when trying to index image arrays with a
-1 mip level.

BUG=angleproject:1708

Change-Id: Iadd159ad740aa79561de823d8812c6b07454e5e5
Reviewed-on: https://chromium-review.googlesource.com/456840
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-03-20 16:00:18 +00:00
JiangYizhou 461d9a3060 ES31:Check framebuffer status for multisample and default params
This patch implements FRAMEBUFFER_INCOMPLETE_MULTISAMPLE checking for
checkFramebufferStatus, and also modify conditions of
FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENTS when setting default
parameters to fbo.

BUG=angleproject:1594
TEST=angle_end2end_tests --gtest_filter=FramebufferTest_ES31*
TEST=dEQP-GLES31.functional.texture.multisample.negative.fbo_attach_different_fixed_state_tex*

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

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

BUG=angleproject:1708

Change-Id: I111f8f5a451cce7de6cf281a6bc335b92dd2daf2
Reviewed-on: https://chromium-review.googlesource.com/444095
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-02-23 20:42:14 +00:00
Jamie Madill 6f60d05fb7 Make Framebuffer backbuffer constructor take Surface.
This allows the Framebuffer to initialize all the attachment info
internally. This in turn will allow us to clean up the way we
validate WebGL1 depth/stencil attachments.

BUG=angleproject:1708

Change-Id: I8871a9791dfce0ac806f4e1367a521610e5283ae
Reviewed-on: https://chromium-review.googlesource.com/446130
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-02-22 23:37:41 +00:00
JiangYizhou f7bbc8a30e ES3.1: Implement framebuffer parameters api for opengl part.
Add new framebuffer parameters that can be set with glFramebufferParameteri
and queried with glGetFramebufferParameteriv.
GL_FRAMEBUFFER DEFAULT WIDTH
GL_FRAMEBUFFER_DEFAULT_HEIGHT
GL_FRAMEBUFFER_DEFAULT_SAMPLES
GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS

BUG=angleproject:1594
TEST=angle_unittests
TEST=angle_end2end_tests
TEST=dEQP-GLES31.functional.state_query.framebuffer_default.framebuffer_default*

Change-Id: I425e73a6b798fc7c73841ab98d7c8aabc381133d
Reviewed-on: https://chromium-review.googlesource.com/412126
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2017-02-16 15:22:16 +00:00
Jamie Madill 6c1f671b36 Add destroy hooks for several GL objects.
These hooks allow the back-end renderer to free object resources
without having to store pointers to shared device handles for
each and every object. This will allow us to save memory on
back-ends that really care about memory overhead.

There is a downside in that there is more boilerplate in passing
gl::Context handles around everywhere.

BUG=angleproject:1684

Change-Id: I89463bba8d23f92920e8956650cb73c7fc6d66b7
Reviewed-on: https://chromium-review.googlesource.com/426401
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-02-15 01:29:47 +00:00
Jamie Madill fd3dd436e5 WebGL: Add 3D tex copying feedback loop detection.
When copying to and from the same texture, we need to reject only
the feedback loops formed with the same levels of the texture -
copying between different unrelated layers and levels is fine.

This change also fixes a couple bugs in our D3D11 CopyTexSubImage3D
implementation. We were missing some "!" operators, and we actually
would hit an ASSERT when trying to blit from a level of a 3D texture.

BUG=angleproject:1685

Change-Id: Id715bebafe8336cf8bb95d0d06275a8b95e522e1
Reviewed-on: https://chromium-review.googlesource.com/425494
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2017-02-07 21:20:57 +00:00
Jamie Madill 1d37bc5086 WebGL: Validate depth/stencil feedback loops.
BUG=angleproject:1685

Change-Id: I6019555af69800f07862a0038fd0c25a9bb5aab8
Reviewed-on: https://chromium-review.googlesource.com/425493
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2017-02-07 00:00:33 +00:00