Commit Graph
563 Commits
Author SHA1 Message Date
Geoff Lang 07467b4aca Remove GL_CHROMIUM_path_rendering
Bug: chromium:1063193
Bug: angleproject:4270
Change-Id: I35b24b7d8d892181955e49dd2495655bc57cb0df
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2112275
Reviewed-by: Zhenyao Mo <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2020-03-20 19:13:16 +00:00
Julien Isorce 07044c6549 Reland "Instantiate rx::DisplayEGL when device type EGL is selected"
This is a reland of 7455b54401

Original change's description:
> Instantiate rx::DisplayEGL when device type EGL is selected
>
> Define EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE that should be
> used to request a driver egl-backed implementation with ANGLE.
>
> Bug: angleproject:4328
> Change-Id: I6871d3a27e2bfc02af9815dcf86ae1cb6524f0cc
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2030038
> Commit-Queue: Jonah Ryan-Davis <[email protected]>
> Reviewed-by: Geoff Lang <[email protected]>

Bug: angleproject:4328
Change-Id: I4e997c4fa1b5b59f081436f05bd208303ffe38e9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2093412
Reviewed-by: Yuly Novikov <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Commit-Queue: Julien Isorce <[email protected]>
2020-03-12 22:21:48 +00:00
Ian Elliott 03ed5f6c46 Revert "Instantiate rx::DisplayEGL when device type EGL is selected"
This reverts commit 7455b54401.

Reason for revert: This appears to break the "Linux FYI Ozone (Intel)" bots on the chromium.gpu.fyi waterfall.  Ozone means ChromeOS.

Original change's description:
> Instantiate rx::DisplayEGL when device type EGL is selected
> 
> Define EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE that should be
> used to request a driver egl-backed implementation with ANGLE.
> 
> Bug: angleproject:4328
> Change-Id: I6871d3a27e2bfc02af9815dcf86ae1cb6524f0cc
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2030038
> Commit-Queue: Jonah Ryan-Davis <[email protected]>
> Reviewed-by: Geoff Lang <[email protected]>

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

Change-Id: I8aec6c2783b0acb67d3315d351cdc9e526f58d6b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:4328
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2091864
Reviewed-by: Ian Elliott <[email protected]>
Commit-Queue: Ian Elliott <[email protected]>
2020-03-06 22:15:53 +00:00
Tobin Ehlis 1a5c7a16ba Reland "Vulkan:Include precision qualifier in GLSL"
Currently still ignoring precision qualifiers for Vulkan shaders by
default, but have added feature "enablePrecisionQualifiers" that can be
enabled in order to include precision qualifiers.

With this initial implementation, it's possible to get precision
qualifier mis-matches in the generated GLSL 4.50. According to the
spec this is allowed. From GLSLangSpec 4.50 section 4.7 "Precision and
Precision Qualifiers":

For the purposes of determining if an output from one shader stage
matches an input of the next stage, the precision qualifier need not
match.

However, when converted to SPIR-V and run through the shader validation
any mismatches will cause shader validation errors. Initially just
ignoring those errors with this commit.

Bug: angleproject:3078
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057749
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tobin Ehlis <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Tobin Ehlis <[email protected]>
Change-Id: Ieecca604bb2c834c9b1c2bcab85279d1f8755dfa
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2086280
2020-03-06 18:13:05 +00:00
Julien Isorce 7455b54401 Instantiate rx::DisplayEGL when device type EGL is selected
Define EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE that should be
used to request a driver egl-backed implementation with ANGLE.

Bug: angleproject:4328
Change-Id: I6871d3a27e2bfc02af9815dcf86ae1cb6524f0cc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2030038
Commit-Queue: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2020-03-06 17:39:35 +00:00
Xiaoxuan Liu f8b2867816 Vulkan: Add support for VK_EXT_index_type_uint8
Enable VK_EXT_index_type_uint8 Vulkan extension if supported by
VkDevice.

Bug: angleproject:4405
Change-Id: I84d030497898c5944a36d9a88a31e7377ccd5e9e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2082391
Commit-Queue: Xiaoxuan Liu <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-03-03 16:24:14 +00:00
Jamie Madill 80f55e9742 Expose glGetInteger64vEXT.
This entry point is specifically for retrieving very large timestamp
values from EXT_disjoint_time_query. In GLES 2.0 contexts with the
Vulkan back-end we were getting some astronomical values that couldn't
be cast to 32-bit ints.

Also fix missing dependencies in generate_loader.py.

Bug: angleproject:4433
Change-Id: I59146dcc1a163a24ac2d7c37546f4551a7a8890a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2080595
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2020-03-03 02:01:39 +00:00
Alexey Knyazev 51a9da21ff Add OES_draw_buffers_indexed autogenerated wrappers and validation redirects.
This extension allows setting independent blend state (and color write mask) for each draw buffer. OES and EXT versions provide exactly the same functionality. It is also included in GLES 3.2 core.

Bug: angleproject:4394
Change-Id: I0c27c419472622e309a038dd1463fa0b3e4ca595
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2078587
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2020-03-02 21:38:09 +00:00
Tobin Ehlis ff60abaf62 Vulkan:Disable FramebufferVk cache on Apple
Currently hitting a crash on Apple so disabling FramebufferVk cache.

Bug: angleproject:4442
Change-Id: I3824252210aeeaf9919c8d17730395b394a50862
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2080661
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Commit-Queue: Tobin Ehlis <[email protected]>
2020-03-02 16:47:29 +00:00
Jamie Madill daf6e47111 Upgrade gl2ext.h.
Includes a new entry point needed for disjoint timer queries. This
header is copied exactly from Khronos's official repo. We add one
change so that we can include special ANGLE modifications in
gl2ext_angle.h.

Bug: angleproject:4433
Change-Id: I6c9cbdfa73ca3de052ff49c5ea91eb5e9a9ee699
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2080596
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-02-29 02:33:28 +00:00
Ian Elliott e488d8b8da Vulkan: Implement Android pre-rotation
As an Android GLES driver on top of Vulkan, ANGLE must pre-rotate
rendering on behalf of the application.  This involves modifying the
vertex shader to multiply gl_Position with a mat2 "rotation matrix".
Not doing so means that SurfaceFlinger (SF) will perform a costly
rotation blit before presenting every image.  Setting
WindowSurfaceVk::mPreTransform to mCurrentTransform tells SF to not do
the blit.

When the surface is rotated 90 or 270 degrees, the width and height
must be swapped for:

- The swapchain images, and for any depth, stencil, and/or multisample
  attachments used with the swapchain image.

- The viewport, scissor, and render area.

Because the Metal back-end shares the TranslatorVulkan, it will define
the same preRotation (mat2) DriverUniform that is used for Vulkan.

Bug: angleproject:3502
Change-Id: I968dbe8869ba0f50de18dd41f1195e847c06b545
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2038272
Commit-Queue: Ian Elliott <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-02-27 01:11:16 +00:00
Jamie Madill 660c0dd6f5 Vulkan: Fix padding out Buffer allocations on AMD.
We would often pad incorrectly given the constraints of the max stride.
We shouldn't really be rounding up the buffer size, but we should
instead be adding the max alignment size to the end of the buffer.

Bug: angleproject:4428
Change-Id: Id2afc572c85985548a18f60b42cdc388d83d5c4c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2071235
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-02-25 20:14:03 +00:00
Michael Spang c419771396 Implement glImportMemoryZirconHandle & glImportSemaphoreZirconHandle
Implement import of fuchsia external objects passed by zircon handle. This
works exactly the same as with file descriptors.

Bug: angleproject:3492
Change-Id: I4d46917dfc5902f00c94550158a9f8073097f0a4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1642334
Commit-Queue: Michael Spang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-02-21 18:35:23 +00:00
Jamie Madill c58458e633 Vulkan: Remove CommandGraph code.
Also updates relevant comments to no longer refer to a graph.

Bug: angleproject:4029
Change-Id: Ic29716e9ae4926870f902947d49d8fee7af98662
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057804
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2020-02-21 04:36:29 +00:00
Jamie Madill ce4918f18f Vulkan: Sanitize Images & Buffers with non-zero values.
Only enabled for specific tests at the moment. This CL allows our tests
to sanitizes memory for the robust resource access extension. It is
quite slow so should not be enabled by default.

Only works for 1 level 2D color textures and buffers. Makes several
flaky robust resource initialization tests consistently fail.

Controlled via an angle::Feature in FeaturesVk.

It works by initializing memory to an abitrary non-zero value:

 - if newly allocated memory is mappable, we map it in init and set it
 - if a buffer or texture can be a transfer destination, we use a
   staging resource
 - otherwise we don't attempt to initialize the resource.

Bug: angleproject:4384
Change-Id: I9b4f347bfcddf3096f491ed0243bef86837feaa0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2043271
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2020-02-21 00:09:27 +00:00
Michael Spang dec00bc833 Generate entrypoints for Fuchsia external objects extensions
Add GL_ANGLE_memory_object_zircon_handle &
GL_ANGLE_semaphore_zircon_handle extensions to supported extensions list
and re-generate bindings.

Bug: angleproject:2475
Change-Id: I464aa402aaac916c1f459930c771a0813ec63c9b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1642333
Commit-Queue: Michael Spang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-02-20 23:44:31 +00:00
Michael Spang 0941e65385 Add external object extensions for Fuchsia to GL API
Add extensions layered on top of GL_EXT_memory_object and GL_EXT_semaphore
to support GL & Vulkan interoperation on Fuchsia. They are analagous to
the file descriptor versions, except not quite as opaque.

This is a draft; the underlying vulkan extensions have not been submitted
to Khronos.

Bug: angleproject:3492
Change-Id: Ic4723ded9fff752c4186eaa6a7f07d9ac51a3364
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1642332
Commit-Queue: Michael Spang <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2020-02-20 21:54:21 +00:00
Pierre-Marc Berube 9a481b6ec8 Add missing #include to fix build with GCC 10.
Bug: angleproject:4389
Change-Id: I4a2f04a12a059924871f5d54f137c67670747ebd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2063042
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2020-02-19 19:16:44 +00:00
Shahbaz Youssefi 1f5f7ea3e9 Vulkan: Fix SPIR-V transformation name-info association
Prior to this commit, when "OpName %id name" was encountered, the info
corresponding to "name" was immediately associated with %id.  This is
not necessarily correct because there could be multiple ids with the
same name.  For example a sampler declaration and an unrelated function
argument could have the same name.  In this case, the sampler
declaration and function argument name don't even need to be in the same
shader stage.

This change modifies the SPIR-V transformation such that the name-id
mapping is tracked until the OpVariable instruction that actually
declares the variable is visited.  The mapping to variable info is only
done if the storage class specified in this instruction corresponds to a
shader interface variable.

Bug: angleproject:3394
Change-Id: I35a1f6f8278e4b1ad81c9955a55e1b72d6f2e4ea
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057248
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2020-02-19 18:59:03 +00:00
Peng Huang fa9eff37c3 Disable GL_EXT_semaphore_fd for Mesa version < 19.3.5 on AMD GPUs
Bug: chromium:1053516
Change-Id: Idfc271ac70c8ded7d05a258beb4a7578a5a652c3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2062162
Commit-Queue: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
2020-02-18 23:21:22 +00:00
Jonah Ryan-Davis 806ba5663b Extend ANGLE_iosurface_client_buffer to Vulkan backend for Swangle
Implement an IOSurface-backed pBuffer surface for the Vulkan backend
on Mac, through SwANGLE. ANGLE will pass a raw pointer to Swiftshader
and handle locking/unlocking the IOSurface.

Bug: chromium:1015454
Change-Id: Ia3ead55334736003d405b54ba8dcc7701706fbb2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1965434
Commit-Queue: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-02-05 21:19:16 +00:00
Alexey Knyazev 9e774041f8 Update S3TC GL extension strings
Added avoid_dxt1_srgb_texture_format workaround

Bug: angleproject:4266
Change-Id: I286a9c66f6ea1d2c9d3587f6ca85608336eb44a6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2033065
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2020-02-04 14:37:37 +00:00
Tobin Ehlis 1736c47b74 Vulkan: Remove transient cmd buffer workaround
We no longer need this workaround. Also mCommandPoolFreeList dead code.

Bug: angleproject:3508
Change-Id: Ib73ddd431eb1bf9a55c3421111af4df5976cc1fb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2033485
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tobin Ehlis <[email protected]>
Commit-Queue: Tobin Ehlis <[email protected]>
2020-01-31 20:33:22 +00:00
Jeff Gilbert a805ac7cbe Allow overriding ANGLE_PLATFORM_EXPORT.
Bug: angleproject:4365
Change-Id: I4098ebdd718624e9d0578e0ee69f0a84a5b78183
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2033064
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2020-01-31 18:43:28 +00:00
Charlie Lao 71153201dc Vulkan: Disable restartRenderPassAfterLoadOpClear workaround
This workaround was added due to qualcomm driver bug b/129281932. But
this has been fixed with recent drivers. Removing the WR here so that it
will not negatively affect performance.

Bug: angleproject:4344
Change-Id: Iea2ec86082a0ced64bfe843bf916c6bdb2aea60b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2029210
Commit-Queue: Charlie Lao <[email protected]>
Reviewed-by: Tobin Ehlis <[email protected]>
2020-01-31 18:22:58 +00:00
Kenneth Russell e196bc85ac Add driver bug workaround for rewriting row major matrices.
Joint work with syoussefi@, who wrote the RewriteRowMajorMatrices
pass, and revised it for this CL to not rely on the
NameNamelessUniformBuffers pass - which was breaking it on the GL
backend.

Hook up previously written RewriteRowMajorMatrices transformation, and
enable on all GPU types on macOS. It is needed at least for AMD and
Intel GPUs.

Add a new test which verifies the behavior of dynamically-indexed
arrays of row-major matrices.

Bug: angleproject:2273
Bug: angleproject:3843
Change-Id: Id582f9cf6b9b1a59091aab1786539174f360b705
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2008717
Commit-Queue: Kenneth Russell <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2020-01-30 22:08:39 +00:00
shrekshao eca11cc81c SH_CLAMP_INDIRECT_ARRAY_BOUNDS logic update
Remain the old hardware requirement for turning on clampArrayAccess. But
also turns it on universally for WebGL context. So that we won't suffer
from clampArrayAccess not handled properly on some compute shader deqp
tests.

Bug: chromium:1042252, angleproject:4361
Change-Id: Ib11affd6df27ce7d2100980d2b8decdee36876e8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2026029
Reviewed-by: James Darpinian <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Shrek Shao <[email protected]>
2020-01-29 16:53:37 +00:00
Shahbaz Youssefi f1f082e137 Vulkan: Set varying location & xfb decorations in SPIR-V
The shader translator outputs arbitrary location indices.  Once compiled
by glslang, the SPIR-V transformer modifies these decorations.  If the
transform feedback extension is used, it will also add the relevant
decorations to the varyings that are captured.

Bug: angleproject:3394
Change-Id: I5ecafd0536408612a5d4b920dbabbfabe650657c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2008468
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-01-29 15:01:27 +00:00
Shahbaz Youssefi 71e6afb1c1 Vulkan: Set set/binding in SPIR-V
This change introduces a SPIR-V transformer that modifies shader
interface variable decorations directly in SPIR-V instead of
manipulating the input GLSL.  Currently, descriptor set and binding
indices are set by the transformer.

The shader translator outputs arbitrary set and binding indices.  Once
compiled by glslang, the SPIR-V transformer modifies these decorations.
The ultimate goal is to be able to modify the SPIR-V again when program
pipeline objects decide a different set/binding is necessary.

Bug: angleproject:3394
Change-Id: If358265a72bf1fe9f5676562b39a632cb2e05dc4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2001477
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2020-01-29 05:24:40 +00:00
Jonah Ryan-Davis 1a1a1427fd Expose eglGetMscRateCHROMIUM from EGL_CHROMIUM_sync_control
When ANGLE is using the GL backend on GLX, we can expose
eglGetMscRateCHROMIUM via glXGetMscRateOML. Otherwise, this function
should return false.

Bug: chromium:1042393
Change-Id: Id9b308c2217e07ee9860e2869be0e23b7a0c7411
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2017048
Commit-Queue: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2020-01-27 19:30:45 +00:00
Shahbaz Youssefi b36e46ab02 Vulkan: Line raster emulation through specialization constant
In preparation for compiling shaders early at link time, this change
reworks line raster emulation such that it uses specialization constants
instead of a preprocessor condition.  This means drawing both triangles
and lines with this program will still result in a one-time shader
compilation.

The compilation is still done at draw time in this change.

Bug: angleproject:3394
Change-Id: I0bf91398868d7f7147456533b728906b505192b2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1992365
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2020-01-22 22:26:11 +00:00
Jamie Madill 62475e95da Allow tests to pick ANGLE features.
This uses the EGL_ANGLE_feature_control extension through the test
harness to control feature selection via a test config. This obviates
the need for the hacky platform methods table override.

Also adds a command graph feature that will be used to prototype the
command graph linearization for Vulkan.

Bug: angleproject:4029
Change-Id: Id37fadd5d2c317c9d9dd90dfab1fdc8e4ac3701f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2007612
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-01-20 21:45:20 +00:00
Kenneth Russell 86f7309717 Upstream support for iOS Simulator.
Originally authored in the WebKit repository:
https://bugs.webkit.org/show_bug.cgi?id=205618

Has been tested with WebKit's WebGL backend on top of ANGLE inside the
iOS Simulator. TODOs will be addressed in forthcoming CLs.

Bug: angleproject:4263
Change-Id: Ic879866aaee5f933599d956b0646d0c01db55d0d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1995824
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Commit-Queue: Kenneth Russell <[email protected]>
2020-01-14 21:08:21 +00:00
Shahbaz Youssefi 6b2754066a Vulkan: Workaround vertex attributes vs stride issue on AMD
Under robustBufferAccess, Vulkan states that:

Vertex input attributes are considered out of bounds if the offset of
the attribute in the bound vertex buffer range plus the size of the
attribute is greater than either:

- vertexBufferRangeSize, if bindingStride == 0; or
- (vertexBufferRangeSize - (vertexBufferRangeSize % bindingStride))

The latter implies that if the buffer size is not a multiple of the
vertex attribute stride, what lies beyond the last multiple of stride is
considered out of bounds.

It also says:

Out-of-bounds buffer loads will return any of the following values:

- Values from anywhere within the memory range(s) bound to the buffer
  (possibly including bytes of memory past the end of the buffer, up to
  the end of the bound range).
- Zero values, or (0,0,0,x) vectors for vector reads where x is a valid
  value represented in the type of the vector components and may be any
  of ...

The first bullet point indicates that the driver is allowed to load the
attribute values from the buffer if its range still lies within the
buffer size.

Take the following example:

- Buffer size = 12
- Attribute stride = 8
- Attribute offset = 0
- Attribute size = 4

Basically the buffer is thus laid out as follows:

          attr stride
      _________/\_________
     /                    \
    +----------+----------+----------+
    | vertex 0 | padding  | vertex 1 |
    +----------+----------+----------+
     \___ ____/
         V
     attr size

In the above example, the attribute for vertex 1 is considered out of
bounds, but the driver is allowed to either read it correctly, or return
(0, 0, 0, 1) for it.

Most drivers implement the former, while AMD implements the latter.
This change introduces a workaround for AMD where
GL_MAX_VERTEX_ATTRIB_STRIDE is limited to 2048 (the common value for it
according to gpuinfo.org) and conservatively rounds up every buffer
allocation to that size.

While technically, this workaround should be applied on any device with
the robustBufferAccess feature enabled, it is currently limited to AMD
to avoid the inefficiency.  A possible future revision of Vulkan may
relax the above restrictions.

Bug: angleproject:2848
Change-Id: Ida5ae5d777da10f22ce8be5a09a7644b5bbd778e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1991709
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2020-01-11 06:07:42 +00:00
Kenneth Russell 12ce8f687d Upstream WebKit's iOS port of ANGLE.
Added the EAGL backend authored by Dean Jackson from Apple, and the
refactoring changes needed to support it side-by-side with the macOS
backend. Ran "git cl format" against these diffs.

Defined the EGL_ANGLE_device_eagl extension and allocated an enum out
of ANGLE's reserved range.

The iOS backend is not yet included in any of the GN files.

Bug: angleproject:4263
Change-Id: I631c32930433c03bb16a242955ffedf55174bb29
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1987278
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: James Darpinian <[email protected]>
Commit-Queue: Kenneth Russell <[email protected]>
2020-01-10 02:00:18 +00:00
Kenneth Russell 7a37d3acf5 Work around Intel driver bug with CopyTex{Sub}Image2D/DeleteTextures.
Dependencies seem to be incorrectly tracked in some Intel OpenGL
drivers (on macOS specifically), causing crashes in glDeleteTextures
if a GL command buffer is being constructed where those textures are
destinations of CopyTexImage2D/CopyTexSubImage2D. Work around this bug
by flushing before texture deletion if CopyTex{Sub}Image have been
called recently. The tracking is only done on a per-context rather
than a per-device basis, but seems sufficient to work around the
problem as identified.

Tested both with new ANGLE test on affected hardware, and in WebKit's
ANGLE backend for WebGL. Works around the crash reported in
https://bugs.webkit.org/show_bug.cgi?id=205707 .

Bug: angleproject:4267
Change-Id: I2266a5590759f6a3f19080def08710ef4b66d463
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1987932
Commit-Queue: Kenneth Russell <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-01-09 23:58:27 +00:00
James Darpinian 27db24581e Optimize disabling ARB_texture_rectangle
In https://crrev.com/c/1838418 I added the ability to disable
ARB_texture_rectangle so that we can use it in the WebGL implementation
but disable it when compiling user shaders. Unfortunately disabling
and re-enabling the extension causes the shader translator to be
reinitialized which turns out to be more expensive than the actual
work of shader translation, at least for small shaders. It's slow enough
to cause timeouts in WebKit's WebGL conformance test runs.

This introduces an alternate method of disabling ARB_texture_rectangle
in the translator which is much faster because it avoids reinitializing
the translator.

Bug: angleproject:3956
Change-Id: I5d31b683ff19a59bdfd289cfd3c609f64ef5e25b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1991969
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: James Darpinian <[email protected]>
2020-01-09 17:46:38 +00:00
Shahbaz Youssefi 0721cc8ba0 Vulkan: No line raster emulation code if extension
A flag is added to the translator to disable generation of Bresenham
line raster emulation code when the Bresenham line raster Vulkan
extension is present.  This is primarily for the sake of conversion of
line raster emulation condition to specialization constant:

- Avoid dead SPIR-V code in every shader
- Avoid ANGLEUniforms being active in every shader stage even if it's
  not used anywhere but in line raster emulation.
- Optimize SPIR-V transformations by both having fewer instructions to
  iterate through, and to avoid generating line raster patches.
- Reduce the severity of anglebug.com/4251 where the location assignment
  of ANGLEPosition can incorrectly overlap a varying array or struct, by
  making only platforms without Bresenham extension afflicted by the
  bug.

Bug: angleproject:3394
Change-Id: Ic0ae6ce0392b4eae0cc79cb94bbcd0805b276a31
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1986379
Reviewed-by: Cody Northrop <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2020-01-06 21:05:38 +00:00
Jeff Vigil 3311ef6568 update date comments to 2020
run_code_generation.py updated comments with 2019 to 2020.
Put all date updates into this one CL.
This also updated hashes.

Bug: angleproject:4262
Change-Id: Ia213dd5e47f155986cbb4161d777724355878af0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1986994
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Mohan Maiya <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-01-06 16:25:35 +00:00
shrekshao 81ee4d2919 Workaround EXT_texture_norm16 for OpenGL ES drivers
Implement a workaround for widespread bugs calling glReadPixels with
RGBA/UNSIGNED_SHORT against R16/RG16 color attachments. Read back the
data using the GL_IMPLEMENTATION_COLOR_READ_FORMAT, and then rearrange
the read back pixels to fit the RGBA layout.

Also skip RGB16/RGB16_SNORM texture sample test on Nexus 5X/Nexus 6P
due to a another driver bug.

Bug: chromium:1000354, angleproject:4214, angleproject:4215, angleproject:4245
Change-Id: Iedea6f4136878cac5ad0dec3757c77b73502e1cd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1952166
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Shrek Shao <[email protected]>
2020-01-03 17:56:58 +00:00
Xinghua Cao 1fdf6ca514 D3D11: Restrict to translate uniform block to StructuredBuffer
Only translate uniform block to StructuredBuffer when system is
Windows 10 and later.

Bug: angleproject:3682
Change-Id: I27e3f4503392791883a44e1d486ffe9512e04bd8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1984863
Commit-Queue: Xinghua Cao <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-01-02 14:13:13 +00:00
Mohan Maiya 942d91520a EGL: Add support for EGL_KHR_gl_colorspace extension
If the Vulkan backend supports VK_EXT_swapchain_colorspace extension,
enable the option for applications to create surfaces with non-linear
formats. Not all formats have non-linear versions and is platform
specific.

Tests: dEQP-EGL.functional.wide_color.*
       angle_deqp_egl_tests --use-angle=vulkan --deqp-gl-context-type=egl --deqp-case=dEQP-EGL.functional.wide_color.*
Bug: angleproject:2514
Change-Id: I441ee797cceef92c84473bfa18605c4fd8180de1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1951963
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2019-12-30 23:45:18 +00:00
Xinghua Cao 0af8b59612 D3D11: Translate uniform blocks to StructuredBuffer when necessary
fxc exhibits slow compile performance with dynamic cbuffer indexing.
So when a uniform block contains only one large array member, which is
an array of structures, translate this uniform block to
a StructuredBuffer instead.

Bug: angleproject:3682
TEST=angle_end2end_tests.UniformBufferTest.*
Change-Id: Ife80dba8aae65b761737e095895e00a570230f88
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1782046
Commit-Queue: Xinghua Cao <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2019-12-21 03:35:38 +00:00
Yan 17b3c2f3f8 Implement SamplerVideoWEBGL for WEBGL_video_texture extension on desktop
WEBGL_video_texture is an extension that will improve uploading video frame to WebGL performance.
(https://www.khronos.org/registry/webgl/extensions/proposals/WEBGL_video_texture/)

This extension introduced a new texture type TEXTURE_VIDEO_IMAGE_WEBGL and a new sampler type
samplerVideoWEBGL to sample it.

In chromium implementation, TEXTURE_VIDEO_IMAGE_WEBGL maps to different native texture type
based on platform. On desktop, it maps to GL_TEXTURE2D(Currently supported). On Android, it
should map to GL_TEXTURE_EXTERNAL(TODO). SamplerVideoWEBGL needs to be mapped to sampler2D or
samplerExternalOES according to TEXTURE_VIDEO_IMAGE_WEBGL implementation.

This patch implements samplerVideoWEBGL in Angle to support WEBGL_video_texture on desktop. In
this case, samplerVideoWEBGL should map to sampler2D.

Bug: chromium:776222, angleproject:3889
Change-Id: Idb0a5fcde37ca75ccc1181226b91f257212e7500
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1866274
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2019-12-18 16:49:26 +00:00
Le Hoang Quyen d1860ea17e Metal: support OES_depth_texture
Also added Depth32 & Depth16 texture data upload tests.

Bug: angleproject:2634
Change-Id: I103f1cda1dc915f0dc8b04f7aaa2d8c0f9220cda
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1919281
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-12-15 14:44:43 +00:00
Hyunchang Kim caa6eccde3 Vulkan: Implement Transform Feedback support via extension
Implemented transform feedback extension path. Where
VK_EXT_transform_feedback is supported, extension path will be taken
over an emulation path. Extension path has advantages in terms of
performance.

BUG=angleproject:3206
Test: dEQP-GLES3.functional.transform_feedback.*
      angle_end2end_tests --gtest_filter=TransformFeedbackTest*

Change-Id: Ia07c23afb289d9c67073469a97b714ec96f5265a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1882767
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Mohan Maiya <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2019-12-10 21:33:32 +00:00
Shahbaz Youssefi 795a355921 Vulkan: EXT_gpu_shader5 support: precise
The precise keyword is used in tessellation shaders but introduced in
this extension.

EXT_gpu_shader5 introduces a handful of features to shaders.  This
change only implements the `precise` keyword.

Bug: angleproject:3569
Change-Id: I2252b79098eb8ba2d2faa040d7eaed7548b7051e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1939851
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-12-05 20:20:07 +00:00
Courtney Goeltzenleuchter 33a00efd7c Add Compute Shared Memory Size Validation
Add tracking of shared memory declarations in compute shaders.

Test:
  angle_deqp_gles31_tests --gtest_filter=dEQP.GLES31/functional_debug_negative_coverage_callbacks_compute_exceed_shared_memory_size_limit

Bug: 4173
Change-Id: If2a86d467a82f73fa5b2ee0ced752701acfe1872
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1934653
Commit-Queue: Courtney Goeltzenleuchter <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2019-12-04 19:45:47 +00:00
Ethan Lee a825eb70cc Implement BaseVertex draw calls for Vulkan, OpenGL, NULL contexts.
This adds support for the following functions:

- glDrawElementsBaseVertex
- glDrawRangeElementsBaseVertex
- glDrawElementsInstancedBaseVertex

Bug: angleproject:3582
Bug: angleproject:3402
Bug: angleproject:4166
Change-Id: I83770f62e3a918c0965fd4ca8c7d9e598b8b4154
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1929083
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-11-25 21:27:58 +00:00
Jonah Ryan-Davis f9c3eaf457 Add ability to disable all ANGLE features
Chrome has a --disable-gpu-driver-bug-workarounds flag that needs to be
able to be forwarded to ANGLE

Bug: 1016377
Change-Id: Ied6c8656742e25c32d508b8bfe76a902d82bcf93
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1925249
Commit-Queue: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2019-11-20 17:01:23 +00:00