Граф коммитов

847 Коммитов

Автор SHA1 Сообщение Дата
Jeff Vigil d2b659f9a1 EGL: implement EGL_EXT_protected_content Context
Add Validation check to Contexts and Surfaces
Add Vulkan protected memory features and properties
Add protected member to Surfaces and Contexts
Implement hasProtectedContent in Vulkan
Add QueueFamily helper, extent DeviceQueueMap
Protected Swapchains always on for Android
Add EGLProtectedContentTest

Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest

Bug: angleproject:3965
Change-Id: I9352b1e594f71bb4e89cee7137a468940d186b1b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2800413
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-07-20 18:11:00 +00:00
Jeff Gilbert 6a86d2079f Add a feature flag allowES3OnFL10_0 to allow ES3 on d3d10.0.
(Originally by Jeff Muizelaar <jrmuizel@gmail.com>)
This lets us run WebRender on devices that only support D3D 10.0.

Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1620075

Bug: angleproject:6189
Change-Id: I77c09851c50dee206702b1da25a9ef0c05eeb6c6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3036598
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jeff Gilbert <jgilbert@mozilla.com>
2021-07-20 00:33:56 +00:00
Jamie Madill 2b86e2d60f GN: Update dcheck/assert conditions.
In preparation for a Chromium change that makes dchecks enabled
by default in Release builds, we'll keep ASSERT disabled in
Release by default. We add a new flag 'angle_assert_always_on'
for controlling ANGLE ASSERT behaviour.

Also slightly refactors the direct SPIR-V generation GN.

Chromium CL: https://crrev.com/c/2893204

Bug: chromium:1225701
Change-Id: I01a6def28d7c21e771e9800889a6b9c274972de2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3035447
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2021-07-19 19:05:44 +00:00
Geoff Lang 232e523656 Remove the explicit context extension.
This extension currently has no known users and doubles the
number of entry points that ANGLE exports which is a significant
binary size cost.

This saves about 130kb of binary size on Android.

Bug: chromium:1084580
Change-Id: Ib0fc4930b38a33bd61434f7d0030ba9fb9b93ba7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3015518
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-07-16 20:04:00 +00:00
Mohan Maiya e66e334491 Vulkan: Add GL_ANGLE_yuv_internal_format extension
1. Add a new extension to support creation of immutable textures with
   sized internal YUV formats
2. Rename YUV format enums from *_ANGLEX to *_ANGLE
3. Move YUV format enums from angleutils.h to glext_angle.h

Bug: angleproject:5773
Change-Id: Ibfe732f4c9a4a536be56481f33e4768f6227c212
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2820153
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2021-07-14 21:02:30 +00:00
Mohan Maiya 31b06f5f79 Vulkan: Account for immutable samplers that need multiple descriptors
It is valid for immutable samplers to need more than 1 descriptor count.
Account for this possiblity while calculating descriptor pool size.

Bug: b/155487768
Bug: angleproject:5033
Bug: angleproject:5773
Bug: angleproject:6141
Change-Id: Ifb0ed3e4b3c01c61d81dd0c628101f31d4c8bd05
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3005329
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
2021-07-14 17:33:01 +00:00
Kyle Piddington d33a22228e Upstream Apple's direct-to-Metal backend: compile libANGLE.
This change is meant to merge the metal backend changes from Apple's
direct-to-Metal backend. Taken from Kyle Piddington's CL:
https://chromium-review.googlesource.com/c/angle/angle/+/2857366/
The goal of this CL is to merge the metal backend code in a state
that compiles, but not to switch the Metal backend over to using
the direct-to-metal backend yet.

Bug: angleproject:5505
Bug: angleproject:6127
Change-Id: If6783e06e0086b3a1dd25c6f53caca5cfc96cb86
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2950067
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
2021-07-12 14:54:45 +00:00
Shahbaz Youssefi 153240b223 Vulkan: SPIR-V Gen: Support loops
Loops are similar to if-else in that they generate a number of blocks
where the first block specifies divergence (OpLoopMerge) and the merge
block.  Differently from if-else, there is a block where the condition
is evaluated and a block which `continue;` leads to (this last block is
the only one allowed to back-jump to the beginning of the loop).

Bug: angleproject:4889
Change-Id: Ic59f4bf3e05fbf93cb5af85acd3bc4b0da8412af
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2957809
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
2021-06-28 15:02:46 +00:00
Shahbaz Youssefi 5b3142683b Vulkan: Support OVR_multiview and OVR_multiview2
Multiview is supported in Vulkan simply by specifying the number of
views in the render pass, and creating the appropriate image views.  A
number of changes to the way image views and render targets are stored
are made to support those that don't cover the entire range of layers.

One particular detail that is not implemented in this change is the use
of queries in combination with multiview.  Vulkan specifies that N
queries are actually produced (N being the number of views) which must
be summed by the application, but this is not currently done.

Bug: angleproject:6048
Change-Id: I1d4a9894c232d3a93d7a97c9fa0eedc334e57469
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2967625
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
2021-06-24 02:29:02 +00:00
Gert Wollny b6009f64aa Capture/Replay: Add feature for robust resource init
Query the feature when creating the display and the context, and
pass the flag to the created context and also to durfaces.

With that we create surfaces that will be marked "MayNeedInit" and
are initialized if the resource is cleared or invalidated.

Bug: angleproject:6041
Change-Id: I292f2e3f931736a18db93695441407e17d2265b6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2976656
Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-06-23 22:47:37 +00:00
Shahbaz Youssefi b6adeb2f32 Vulkan: Use pipeline statistics query to emulate primitives generated
The VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT query produces
the same result as the GL primitives generated query.  One caveat is
that in combination with rasterizer discard this query may not work.
This is emulated by disabling rasterizer discard when this query is
active and applying an empty scissor instead.

When VK_EXT_primitives_generated_query is released and supported, a
similar issue with rasterizer discard persists so this change will
facilitate using that extension as well.

Bug: angleproject:5430
Change-Id: Id45b6f058c5cb6837e04aa64b1efde28c104e4cf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2976181
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
2021-06-23 05:30:06 +00:00
John Plate 695625461e CL: Refactor info structs and fix conformance bug
- Remove variable name prefix from Info structs to be more consistent
  with other ANGLE structs.
- Fix CL object validation check with magics, since the Mesa solution
  doesn't work without RTTI.
- Add support for some extensions required by OpenCL 1.1 and for some
  optional extensions.
- Fix more conformance bugs.

Bug: angleproject:6015
Change-Id: I41b1c45d95059a9994f5dc78bf9b74476cc6f2d4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2956349
Commit-Queue: John Plate <jplate@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-06-17 17:13:07 +00:00
Geoff Lang 8333d06144 GL: Respect TexSubImage upload limits for robust init
The chunked_texture_upload splits texture uploads for glTexSubImage
calls but ANGLE uses glTexSubImage internally for robust resource
initialization. Also chunk those uploads.

Bug: chromium:1181068
Change-Id: Ia6eaac8117173946630f420b396cbc54c163b7ce
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2961230
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2021-06-15 00:04:03 +00:00
John Plate 2c8d9a9a00 CL: Remaining functions for OpenCL 1.2
Add support for the remaining functions for OpenCL 1.2 for the
front end and pass-through back end.
Also fix several bugs discovered by the conformance tests.

Bug: angleproject:6015
Change-Id: I1dca1c3f4c1d9aea7f0501094c171116ea01381f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2954259
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: John Plate <jplate@google.com>
2021-06-14 16:26:58 +00:00
John Plate 55df3ec11c CL: Add remaining enqueue commands
Add support for remaining OpenCL 1.2 enqueue commands to front end
and pass-through back end.

Bug: angleproject:6015
Change-Id: Iab650e42d51e2105dc826088d3606c56d5cd0fd5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2944966
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: John Plate <jplate@google.com>
2021-06-11 08:48:48 +00:00
John Plate 82654e5d51 CL: Add program build commands
Add program build commands to front end and pass-through back end.

Bug: angleproject:6015
Change-Id: I1175646d35ff050796b718d7f0e269520292b319
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2940839
Commit-Queue: John Plate <jplate@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-06-10 18:16:52 +00:00
Sergey Ulanov c670917ce0 [Fuchsia] Cleanup vulkan_fuchsia_ext.h
Removed defintions of fuchsia-specific vulkan types from
vulkan_fuchsia_ext.h . Instead, the types provided by vulkan_fuchsia.h
are used now.
Also re-enabled vulkan validation on Fuchsia.

Bug: chromium:1215736
Change-Id: I795347b7fb61d90033749533cefd42cf180730fb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2934718
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2021-06-10 14:42:51 +00:00
Brandon Schade 69f2fb0066 Vulkan: Expose OES_geometry_shader extension
Modify the symbol table generation script to accept a list
of supported extensions. This allows for the EXT and
OES versions of the geometry shader extension to be exposed.

Test: angle_deqp_khr_gles31_tests --deqp-case=*geometry_shader*
Bug: angleproject:3571
Change-Id: Ia7127a03dbd3fce78957f0505d3ce0c9bab6cb15
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2765011
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2021-06-08 23:16:33 +00:00
Shahbaz Youssefi 1b680b7728 Reland "Make SH_CLAMP_INDIRECT_ARRAY_BOUNDS do proper AST transformation"
This is a reland of a474fd7de7

The integer clamp used in this transformation is not available in es100
shaders, and float clamp is used instead.

Original change's description:
> Make SH_CLAMP_INDIRECT_ARRAY_BOUNDS do proper AST transformation
>
> This translator flag adds a clamp to non-literal indices to arrays.  Two
> strategies were provisioned, using the clamp intrinsic or a hand-written
> function.   The latter is ununsed in angle, chromium, firefox and
> webkit, so this change removes this option and uses the clamp intrinsic
> unconditionally.
>
> The clamp itself was added at output generation time with special flags
> set on the index node.  This is changed such that a proper AST
> transformation is done and no-special handling would be necessary.
>
> Bug: angleproject:4361
> Bug: angleproject:4889
> Change-Id: Ieccfd2c1c347563fb5282e9fa66d39304e62f2ca
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2935041
> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>

Bug: angleproject:4361
Bug: angleproject:4889
Change-Id: I9397ec7e6bdfb706c2a891b33fd3b2b79e883ccc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2940902
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
2021-06-05 04:36:49 +00:00
Yuly Novikov 10f15011da Revert "Make SH_CLAMP_INDIRECT_ARRAY_BOUNDS do proper AST transformation"
This reverts commit a474fd7de7.

Reason for revert: breaks GLES2ConformTest, see roll into Chromium:
https://chromium-review.googlesource.com/c/chromium/src/+/2935093

Original change's description:
> Make SH_CLAMP_INDIRECT_ARRAY_BOUNDS do proper AST transformation
>
> This translator flag adds a clamp to non-literal indices to arrays.  Two
> strategies were provisioned, using the clamp intrinsic or a hand-written
> function.   The latter is ununsed in angle, chromium, firefox and
> webkit, so this change removes this option and uses the clamp intrinsic
> unconditionally.
>
> The clamp itself was added at output generation time with special flags
> set on the index node.  This is changed such that a proper AST
> transformation is done and no-special handling would be necessary.
>
> Bug: angleproject:4361
> Bug: angleproject:4889
> Change-Id: Ieccfd2c1c347563fb5282e9fa66d39304e62f2ca
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2935041
> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>

Bug: angleproject:4361
Bug: angleproject:4889
Change-Id: I911cfe0199b04dbc3d6d4265775b6c2de00a9777
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2937024
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
2021-06-03 19:48:46 +00:00
Shahbaz Youssefi a474fd7de7 Make SH_CLAMP_INDIRECT_ARRAY_BOUNDS do proper AST transformation
This translator flag adds a clamp to non-literal indices to arrays.  Two
strategies were provisioned, using the clamp intrinsic or a hand-written
function.   The latter is ununsed in angle, chromium, firefox and
webkit, so this change removes this option and uses the clamp intrinsic
unconditionally.

The clamp itself was added at output generation time with special flags
set on the index node.  This is changed such that a proper AST
transformation is done and no-special handling would be necessary.

Bug: angleproject:4361
Bug: angleproject:4889
Change-Id: Ieccfd2c1c347563fb5282e9fa66d39304e62f2ca
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2935041
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2021-06-03 16:07:43 +00:00
John Plate baca10b7f2 CL: Remove object cache and fix multi-threading
All CL front end objects used to be cached to be able to determine
if an object has been created by the front end to check its validity.
The validity is now checked with the existence of an intrinsic value
(the dispatch table pointer), which is consistent with the patterns
found in Mesa and clvk (though clvk uses a magic value).
This allows the removal of all cached objects.

The cached objects were stored with std::unique_ptr. These are now
gone and all remaining pointers are now custom intrinsic reference
count pointers.

Also remove global lock which causes deadlocks, e.g. when CL API
is called from a separate thread to unlock a blocking call with
a user event. Most of the front end is constant and already
thread-safe. The ref count is also thread-safe now (atomic).
A few remaining locks will follow.
Without the global lock it was now possible to make the API
reentrant, and to remove the workaround with the Khronos ICD
loader to skip ANGLE's OpenCL library.

Bug: angleproject:6001
Change-Id: I7d3b52db9011a02cb7ea9ebdeb6e22c4c702ef5b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2927395
Commit-Queue: John Plate <jplate@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-06-02 16:04:49 +00:00
John Plate 076974a96a CL: event creation for front end & passthrough
Add event object to back end and implement creation and info query.

Bug: angleproject:6001
Change-Id: Id4951b726b66afa289fafe1a716a7cfdb6f5826d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2925477
Commit-Queue: John Plate <jplate@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-06-02 15:18:58 +00:00
Kyle Piddington d7aa013091 Upstream Apple's direct-to-Metal backend: compile translator.
This change is meant to merge the translator changes from Apple's
direct-to-Metal backend. Taken from Kyle Piddington's CL:
https://chromium-review.googlesource.com/c/angle/angle/+/2857366/
The goal of this CL is to merge the translator code in a state that
compiles, but not to switch the Metal backend over to use this
translator backend yet.

Bug: angleproject:5505
Change-Id: I68a6354604498cd5fd1eb96c13fc56f3b38f2bd0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897536
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
2021-06-02 15:01:18 +00:00
Geoff Lang c12f594a19 GL: Chunk uploads of texture data >120kb on Mac.
Mac drivers are hanging and crashing after large glTexSubImage uploads.
Chunk those uploads to avoid this problematic path in the driver.

Bug: chromium:1181068
Change-Id: I7dca0b8e49420f015ff7830283c14283a0515826
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2928098
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2021-06-01 23:29:47 +00:00
Geoff Lang f410e81a55 GL: Implement multisampled_render_to_texture
Bug: angleproject:2894, angleproject:5988
Change-Id: I17b55f0655d32d9f41cb55a0467b93a00fba751b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2841084
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2021-05-26 15:00:36 +00:00
Mohan Maiya dd312cc612 Reland "Vulkan: Add support for EXT_texture_border_clamp"
This is a reland of 4b92e089c0
Initializes mPadding to 0 in SamplerDesc::update

Original change's description:
> Vulkan: Add support for EXT_texture_border_clamp
> Add support for GL_EXT_texture_border_clamp. This is implemented by
> using VK_EXT_custom_border_color.
>
> Bug: angleproject:3577
> Test: dEQP-GLES31.functional.texture.border_clamp*
> Change-Id: Ie9fa1eb5dd03b997b5ae182787641a53080a9e51
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830192
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>

Bug: angleproject:3577
Change-Id: I8684242c4bce6e1a006dbe926defaa495fcc2282
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2911571
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
2021-05-21 18:03:17 +00:00
Yuly Novikov 44fabb7b88 Revert "Vulkan: Add support for EXT_texture_border_clamp"
This reverts commit 4b92e089c0.

Reason for revert: breaks "Linux MSan Tests" bot
https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20MSan%20Tests/28489/overview

Original change's description:
> Vulkan: Add support for EXT_texture_border_clamp
>
> Add support for GL_EXT_texture_border_clamp. This is implemented by
> using VK_EXT_custom_border_color.
>
> Bug: angleproject:3577
> Test: dEQP-GLES31.functional.texture.border_clamp*
> Change-Id: Ie9fa1eb5dd03b997b5ae182787641a53080a9e51
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830192
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>

Bug: angleproject:3577, angleproject:5996
Change-Id: I6b62f1a4a43fcfe2d0df2c73de24db83606ce430
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2911533
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
2021-05-21 03:36:57 +00:00
Shahbaz Youssefi 9bc837f64b Vulkan: Generate SPIR-V directly from the translator; Part 1
This is the first change in a series to generate SPIR-V directly from
the translator's AST, instead of the generating text GLSL and feeding it
to glslang.

This change implements the majority of the work needed to map AST types
to SPIR-V types, and declare types and interface variables in SPIR-V.
Additionally, it lays the infrastructure to conditionally enabling this
path in end2end tests.

No tests are currently enabled as the change doesn't actually generate
code for function bodies yet.

Bug: angleproject:4889
Change-Id: Iacb28b6907fd48c50e4cc5a0e7ad72f6eed241d4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2889603
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-05-19 19:03:10 +00:00
Mohan Maiya 4b92e089c0 Vulkan: Add support for EXT_texture_border_clamp
Add support for GL_EXT_texture_border_clamp. This is implemented by
using VK_EXT_custom_border_color.

Bug: angleproject:3577
Test: dEQP-GLES31.functional.texture.border_clamp*
Change-Id: Ie9fa1eb5dd03b997b5ae182787641a53080a9e51
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830192
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
2021-05-18 18:14:58 +00:00
John Plate c2fd338822 CL: Add front end object references to back end objects
Add front end object references to back end objects, which requires
a significant amount of refactoring, because the back end objects
have to be constructed during the construction of the front end
objects, so that the references can be passed to the back end objects,
which then can be passed to the front end member initialization.
That would have been easier with inheritance than with PImpl.

Bug: angleproject:5904
Change-Id: Ib58e6a698e76987bdd63cd8088f923424d6c622b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897249
Commit-Queue: John Plate <jplate@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-05-18 11:46:43 +00:00
Geoff Lang 5a0925def4 GL: Recreate textures on eglReleaseTexImage.
Texture data should be reset on eglReleaseTexImage but ANGLE sometimes
skipped this because it generated GL errors on Mac. Instead, delete
and recreate the native texture to make sure ANGLE doesn't hold any
references.

Bug: chromium:1181068
Change-Id: I1252b0900361852f66f73b8c9d20a29c53897ee4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897544
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
2021-05-14 22:52:52 +00:00
Charlie Lao 09dad082c3 Vulkan: Add feature flag to flush at framebuffer boundary
Testing shows most app traces seeing performance improved on ARM GPU
when we flush at FBO boundary instead of one submit per frame. This
likely due to more frequent submission means less chance of GPU
starvation. This also helps ANGLE to detect GPU finish at finer grain
since the queue serial is per submission. Finer grain detection of
object completion means memory gets recycled quicker and mapBufferRange
able to hit fast code path more often. With this CL, manhattan 3.1
offscreen score also score improves 7%. This may also helps onscreen
performance if frame time is on the edge of 16ms by submit FBO rendering
earlier instead of been blocked by vkAcquireNextImage.

Bug: b/187993625
Bug: angleproject:5295
Change-Id: I2946a7159231d36019ace89805a69ac8e906ce94
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2888709
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
Commit-Queue: Charlie Lao <cclao@google.com>
2021-05-14 18:50:56 +00:00
John Plate 48b835cf28 CL: Implement context for front end and passthrough
Bug: angleproject:5904
Change-Id: I23b764bba87be3a51a1b5b44b13968fc572efde9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2883773
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: John Plate <jplate@google.com>
2021-05-14 09:19:05 +00:00
John Plate b300dc52be CL: device partitioning for front end and passthrough
Partitioning is the creation of sub-devices. Also add reference
counting for CL objects, which is needed now for sub-devices.

Also fix CL print format strings, since cl_ulong is actually
always 64 bit and not unsigned long.

Bug: angleproject:5904
Change-Id: I006699fad2f953ce312bca87c9b6362b5d77a18a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2880665
Commit-Queue: John Plate <jplate@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-05-13 15:23:11 +00:00
John Plate 05fb22724f Add support for OpenCL ICD Loader
Bug: angleproject:5908
Change-Id: Idafc0d15b69f9a21f2ab5e48c4c34f0dc0e0ee96
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2854598
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: John Plate <jplate@google.com>
2021-05-03 17:27:16 +00:00
Geoff Lang ce89d99fde GL: Flush after framebuffer change on Mac 9th gen Intel GPUs
Speculative fix for crashes during flush on Mac. Mirrors the
flush_on_framebuffer_change workaround in Chrome from
http://crbug.com/783979

Bug: chromium:1181068
Change-Id: Ic84b1bfc44babf27016b306393da308d504d7fd9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2859984
Reviewed-by: Peng Huang <penghuang@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2021-04-29 18:01:07 +00:00
Mohan Maiya 61167d5291 Add EXT_primitive_bounding_box entry points
Addition of the entry points for
GL_EXT_primitive_bounding_box extension.

Bug: angleproject:5896
Change-Id: I0dce407d2826ce3f730125d7c03f1233420f6780
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2849615
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
2021-04-26 15:12:33 +00:00
John Plate 908ead3842 Updated OpenCL headers
Bug: angleproject:5761
Change-Id: I45e0f9a422a0dd94fec854d3387f676192e020eb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2831303
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: John Plate <jplate@google.com>
2021-04-22 19:15:17 +00:00
Geoff Lang ccd984ff39 Reland "Add a Vulkan feature to compress float32 vertex formats."
This reverts commit 8ace36f8c1.

Original change's description:
> Revert "Add a Vulkan feature to compress float32 vertex formats."
>
> Bug: b/167404532
> Bug: b/161716126
> Change-Id: I95157a006d5c1fd2d3c0c2c2be37fa0403c07f93
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2510011
> Reviewed-by: Tim Van Patten <timvp@google.com>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Commit-Queue: Geoff Lang <geofflang@chromium.org>

Bug: b/167404532
Bug: b/161716126
Change-Id: Ic6811fe3a7124e6eb1efe7c72a1a03a120217753
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815260
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Charlie Lao <cclao@google.com>
2021-04-22 15:16:56 +00:00
Peng Huang be2f7b1cd2 Unbind fbo before context switching for PowerVR GPUs
Imagination GL drivers are buggy with context switching.
We need to ubind fbo to workaround a crash in the driver.

Bug: chromium:1187513
Change-Id: Ie5142b5f43a3f23a9743ba7af0d90567fedd00d3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2841083
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
2021-04-21 01:03:24 +00:00
Mohan Maiya 2d741b430d Add KHR_blend_equation_advanced entry points
Addition of the entry points for GL_KHR_blend_equation_advanced
extension.

Bug: angleproject:3586
Change-Id: I7a651c19a4b3d0a7cfe4af7813f1530d27704bc1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830140
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2021-04-20 16:08:58 +00:00
Amy Liu 9593517622 Handle the compression of big pipeline cache.
Big pipeline cache will cost much time to compress. Regarding the
perfomance, handle the compression of big pipeline cache in this way:
1)Return when the pipeline cache data is larger than 10M.
2)Use worker thread to complete compression.

Bug: angleproject:4722
Change-Id: I62eb69d8c46729261f0502af01450ec301c258f3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2788169
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2021-04-20 15:32:08 +00:00
Mohan Maiya bdf5f08496 Add EXT_texture_border_clamp entry points
Addition of the entry points for EXT_texture_border_clamp extension.

Bug: angleproject:3586
Change-Id: I366c2748213d7fdde815543129320278937000e0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830146
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2021-04-20 14:28:18 +00:00
Le Hoang Quyen f2aa9d5da6 Reland: Metal: Support importing external metal textures
This relands I4d4a88cfbb77d8b7508b787c7fec44073d3b11b0.

Fixes:
- uninstantiated ImageTestMetal error
- failed ImageTest.ANGLEExtensionAvailability on ARM mac.

Bug: angleproject:5763
Bug: angleproject:5814
Change-Id: I906fe52baefd6be3c6e00f594795bd527df01616
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2820178
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com>
2021-04-16 03:31:26 +00:00
John Plate 9e1ccb240f Workaround for missing include in OpenCL headers
Bug: angleproject:5759
Change-Id: Ieeb5a251e614a4df1b5362dee474b368f362e0fc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2826121
Commit-Queue: John Plate <jplate@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-04-14 16:48:24 +00:00
Jonah Ryan-Davis 2d873e0c40 GL: Workaround to sanitize amdgpu renderer strings.
On Linux with the amdgpu driver, the GL_RENDERER string contains
precise kernel and DRM version info. We should sanitize this info
before using these strings for user privacy.

Bug: chromium:1181193
Change-Id: I047d1abf5b51412b4258a021761cc450385ef0fe
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2727658
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2021-04-13 22:05:34 +00:00
Geoff Lang 18c6d628c1 GL: Support VAOs without native VAOs.
Share the default VAO state between all frontend VAO when
there is no native VAO support. Forcefully sync state every
time a new frontend VAO is bound.

Bug: angleproject:5577, chromium:1167179
Change-Id: Ieaedb5108ad28fc78e7e58b74495639c5246bb05
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2665266
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Peng Huang <penghuang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2021-04-13 15:55:39 +00:00
Geoff Lang 065c232918 Reland "Vulkan: Add features to modify sampling parameters"
This reverts commit a51b57fa2d.

Original change's description:
> Revert "Vulkan: Add features to modify sampling parameters"
>
> Bug: b/167404532
> Change-Id: Iae19dfe165074e8c01216312bddd744c4fb504a4
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2510012
> Commit-Queue: Geoff Lang <geofflang@chromium.org>
> Reviewed-by: Tim Van Patten <timvp@google.com>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>

Bug: b/167404532
Change-Id: I2c756b8eb0f61701ef6e33275e557bc199a4d3b4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815259
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2021-04-13 15:36:39 +00:00
John Plate 1d7046ca5d Generate CL stubs in libGLESv2
Bug: angleproject:5758
Change-Id: I6440dacf0db57a56923d2cab5a7c791981ba3b9d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2822248
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-04-13 12:41:45 +00:00
Nicolas Capens 15f4925ac3 Restore EGL_EXT_buffer_age for SwiftShader Vulkan
EGL_EXT_buffer_age was previously disabled for SwiftShader Vulkan
because of an Android test timing out on Cuttlefish when the buffer
age is queried. aosp/1672445 addresses the root cause of the timeout,
so EGL_EXT_buffer_age can be supported again.

Bug: b/182521420
Bug: angleproject:3529
Change-Id: I5949f721316855d9138eb9f657a6df4e7b49ed71
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2821750
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Nicolas Capens <nicolascapens@google.com>
2021-04-13 03:05:35 +00:00
Ian Elliott b17a93175d Vulkan: damage rectangles must never be pre-rotated
Remove the SurfaceVk::present() code that rotated damage rectangles
and the feature flag that controlled that rotation.

The Vulkan specification was changed so that the rectangles provided
to the VK_KHR_incremental_present extension must never be pre-rotated.
The spec change requires the same behavior on all platforms (just in
case), even though Android is the only platform known to support
rotation.

FYI: the Vulkan spec change was merge request 4442.

Bug: b/182930524
Change-Id: I5128fd76e718f3d964c9091830bcc5886d265543
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2818826
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2021-04-10 02:08:58 +00:00
Shahbaz Youssefi 795d754369 Remove unused translator option bits
Usage of SH_DONT_REMOVE_INVARIANT_FOR_FRAGMENT_INPUT is removed from
ANGLE by [1], and from the validating command decoder by [2].  The flag
is only ever disabled in Firefox.

SH_REMOVE_POW_WITH_CONSTANT_EXPONENT is removed from the validating
command decoder by [3].  Not used in Firefox.

[1]: https://chromium-review.googlesource.com/c/angle/angle/+/1558678
[2]: https://chromium-review.googlesource.com/c/chromium/src/+/2810880
[3]: https://chromium-review.googlesource.com/c/chromium/src/+/2810879

Bug: angleproject:4889
Change-Id: If7d9c31c48510b1486a2285a88475b3c01a77527
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2810806
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2021-04-10 01:59:48 +00:00
Charlie Lao e249239c54 Vulkan: Add featue flag to force highp to mediump in fragment shader.
Adding feature flag that forces highp in fragment shader to mediump. It
is disabled by default. You can enable it for experiment.

Bug: b/184850002
Change-Id: I73980be4ad160eb1b17a3a3ecfc09f2e4aeb468c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815240
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Charlie Lao <cclao@google.com>
2021-04-09 20:26:21 +00:00
Shahbaz Youssefi 2feb3db572 Remove unused translator option bit
SH_DONT_PRUNE_UNUSED_FUNCTIONS was only used by tests, and never used by
ANGLE or chromium.

Bug: angleproject:4889
Change-Id: I4926f86125e69b07e9d4d95134b7b70522e0d64f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2607491
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2021-04-09 15:16:47 +00:00
John Plate 2489a0c104 Fixed OpenCL headers for Windows
Bug: angleproject:5761
Change-Id: I29d1fd3bf862728a3e78418a4f98219828394452
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2807717
Commit-Queue: John Plate <jplate@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-04-07 12:30:01 +00:00
Jamie Madill 9b0911a072 Add GL_ANGLE_get_serialized_context_string.
This will provide a front-door entry point where we can get
a serialized string representing the context state. Previously
we would have to call ANGLE internal directly.

This will enable a refactor of the replays to work more like
standalone plugin libraries.

Bug: angleproject:5811
Change-Id: I5a97d7aa3cd70c49199264c2eb7ca953943ac3c3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2803391
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
2021-04-03 01:56:41 +00:00
Kai Ninomiya 256100b201 Revert "Metal: Support importing external metal textures"
This reverts commit 2ec3e0a1e6.

Reason for revert: Test suite ImageTestMetal never instantiated https://anglebug.com/5814

Original change's description:
> Metal: Support importing external metal textures
>
> via KHR_image_base and ANGLE_metal_texture_client_buffer
>
> Bug: angleproject:5763
> Change-Id: I4d4a88cfbb77d8b7508b787c7fec44073d3b11b0
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2757811
> Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com>
> Reviewed-by: Kenneth Russell <kbr@chromium.org>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>

Bug: angleproject:5763, angleproject:5814
Change-Id: Ia862aa37a6c914f6e21f9b3121c7c36d449475ea
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2801155
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
2021-04-02 01:55:57 +00:00
Le Hoang Quyen 2ec3e0a1e6 Metal: Support importing external metal textures
via KHR_image_base and ANGLE_metal_texture_client_buffer

Bug: angleproject:5763
Change-Id: I4d4a88cfbb77d8b7508b787c7fec44073d3b11b0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2757811
Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-04-01 16:37:52 +00:00
Le Hoang Quyen 4ac6ea2a8a Metal: implement ANGLE_device_metal extension.
Allow user to query internal MTLDevice used by Metal back-end.

Bug: angleproject:2634
Change-Id: I9b0a6eaad8c634069f43e47d5f4f88f61da35f74
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2757810
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-04-01 01:37:08 +00:00
Jamie Madill 9a025fd448 Capture/Replay: add frontend feature to force capture limits
Some of the limits set when FrameCapture is enabled are reflected in
the serialized context. In order for capture/replay tests to pass
these limits may also be needed to be enforced when replaying. Add a
fronten feature enable_capture_limits for this and use it in the
capture replay test script.

Patch authored by gert.wollny@collabora.com.

Bug: angleproject:5750
Change-Id: I3d333d22fe65c12dd5aa5f263d19a2c1568541c2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2790301
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2021-03-28 19:26:30 +00:00
Shahbaz Youssefi 776c60150b Vulkan: Call glslang at compile time
With this change, the ANGLE translator immediately compiles the
generated GLSL into SPIR-V with glslang and discards the source.  This
is in preparation for generating SPIR-V directly, by making the frontend
and backend already able to digest it.

This change also allows the expensive glslang calls to be parallelized,
improving the following perf test by about 20%:

    LinkProgramBenchmark.Run/vulkan_compile_and_link_multi_thread

Previously, the test was run as such in the Vulkan backend:

    Main           Thread 1          Thread 2
    Compile1 --->
    Compile2 --------------------->
                  Translator        Translator
             <---
             <---------------------
    Link

    glslang
     for
      shader1

    glslang
     for
      shader2

    Done

With this change, it is run as such:

    Main           Thread 1          Thread 2
    Compile1 --->
    Compile2 --------------------->
                  Translator        Translator
                   glslang           glslang
             <---
             <---------------------
    Link
    Done

glslang_wrapper_utils no longer interacts with glslang! A rename will
follow.

Bug: angleproject:4889
Change-Id: If4303e8ba0ba43b1a2f47f8c0a9133d0bee1a19a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2721195
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-03-25 19:53:52 +00:00
David Reveman 3fd439c2b9 [Fuchsia] Add ifndefs to vulkan_fuchsia_ext.h
This allows chromium to build with upstream headers that
include these extension. The old TEMP enums and structure
types are used until drivers have been updated to support
upstream header values.

Bug: chromium:1191605
Change-Id: I25d2991204ca34956298013138af8f48e0aaefaf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2782765
Commit-Queue: David Reveman <reveman@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2021-03-24 05:21:37 +00:00
Shahbaz Youssefi d146222879 Vulkan: Use VK_EXT_multisampled_render_to_single_sampled
Additionally, makes the emulation path not require
independentResolveNone.  This was only used to select the NONE resolve
mode when the attachment format doesn't have either of depth or stencil
aspects, but it's ok to specify the same resolve mode for both aspects
even if one aspect is missing.

Bug: chromium:1088005
Change-Id: Ifc37cbf5331145179c5927853b996a0d62b871ee
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2743666
Reviewed-by: David Reveman <reveman@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2021-03-23 20:44:21 +00:00
Tim Van Patten 34e287786a Reorder ShaderVariable functions and members
ShaderVariable's functions and members are all mixed up. This CL
reorders things to move the functions before the members, to better
match ANGLE's coding style.

This also adds a note that any new members that are added need to be
added to gl::WriteShaderVar() and gl::LoadShaderVar(), which are
actually implemented in Program.cpp, since ShaderVars.h/cpp can't
include libANGLE/BinaryStream.h. There are currently several members
that are missing, leading to save/load errors, which are fixed in a
follow-on CL in this chain.

Bug: b/182409935
Change-Id: I1381a5efffb56c0989961bbcfd405b95d59d6396
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2770682
Commit-Queue: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-03-22 23:23:37 +00:00
Nicolas Capens 135385a1ae Disable EGL_EXT_buffer_age for SwiftShader Vulkan
Cuttlefish with SwANGLE failed to pass the android.graphics.cts.
BitmapTest#testDrawingHardwareBitmapNotLeaking test, due to a timeout in
dequeueBuffer (error = -110) during an EGL_BUFFER_AGE_EXT surface query.

This change conservatively works around the issue by leaving
EGL_EXT_buffer_age support disabled for SwiftShader.

Further investigation is required to check whether this timeout can also
occur with other Vulkan drivers, and if it can be addressed robustly.

Bug: b/182521420
Bug: angleproject:3529
Change-Id: I54e3767e74bf922f273d8860f9f4cfc8b6589536
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2774030
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Nicolas Capens <nicolascapens@google.com>
2021-03-20 04:44:57 +00:00
Ian Elliott 92db3c689b Vulkan: Disable rotating damage rectangles on Android
This fixes visual problems with Android games that use
eglSwapBuffersWithDamageKHR().  In 90/270-degree cases, the damage
rectangles are being double-rotated, leaving them 90-degrees out of
alignment with the window.

On Android, VK_KHR_incremental_present is built on top of the same
platform code as eglSwapBuffersWithDamageKHR().  The platform code
rotates all damage rectangles (assuming they are
application-provided).  Therefore, ANGLE should not also pre-rotate
damage rectangles.

Test: Black Desert Mobile
Test: Grand Theft Auto: San Andreas
Test: Extreme Car Driving Simulator
Bug: b/181796746
Change-Id: I6510e7540bb00afc75863e8ae8a9ea3841d1641d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2744984
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Ian Elliott <ianelliott@google.com>
2021-03-11 17:13:57 +00:00
Shahbaz Youssefi 2f737c2509 Translator: Rename GLSL to SPIR-V in Vulkan and Metal output
Preparation for actual SPIR-V output instead of GLSL.

Bug: angleproject:4889
Change-Id: Ic279b23d3a817bd5dca66a844905378207afdbac
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2721194
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
2021-03-04 17:47:51 +00:00
Shrek Shao 2b55f876ed Reland "Workaround for Mac Intel drawArraysInstanced with first > 0"
This is a reland of 027bc47ca5

Original change's description:
> Workaround for Mac Intel drawArraysInstanced with first > 0
>
> Workaround by forcefully set instanced arrays (divisor > 0)
> as streaming attributes and apply extra offset at front. Recover
> those attribute bindings when first == 0 and other draw calls
> (drawElementsInstanced)
>
> Bug: chromium:1144207, chromium:1144247, chromium:1144373
> Change-Id: Ie7836cc71b45a290513f34f90d49bd15b14ddba8
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2661095
> Commit-Queue: Shrek Shao <shrekshao@google.com>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>

Bug: chromium:1144207
Bug: chromium:1144247
Bug: chromium:1144373
Bug: angleproject:5271
Change-Id: Id0b818b25a605376c98c2366c1f2029e2490c6cb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2704799
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2021-02-26 23:24:10 +00:00
Lubosz Sarnecki 33907625db gl_angle_ext: Add param groups to glGetTexLevelParameterivANGLE.
As seen in glGetTexLevelParameteriv from gl.xml.

Bug: angleproject:5645
Change-Id: I1d8445f2178632b0edb0652e63984b31a1e34c48
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2718043
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2021-02-26 16:16:09 +00:00
Shahbaz Youssefi 77637f2dd2 Vulkan: Generate xfb support code in SPIR-V for emulation path
This change moves the code generation at link time from source code to
SPIR-V.  As a result, transform feedback extension and emulation paths
are more similarly handled before SPIR-V transformation (they both store
information identically in the ShaderInterfaceVariableInfoMap).

This change gets rid of the @@ XFB-OUT @@ marker.  With no source code
generation at link time, shader compilation can be moved to
glCompileShader time.

Bug: angleproject:4888
Change-Id: I8cdb89c22b57ce48cf5d226b8e41622d9d550d46
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2713269
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
2021-02-25 22:37:09 +00:00
Mohan Maiya 550f2a3e83 Vulkan: Shader support for EXT_shader_framebuffer_fetch_non_coherent
Translator can accept gl_LastFragData and 'inout' variable to gain
access to framebuffer attachment data. The Vulkan translator replaces
it with the SubpassInput type variable. Note that this works only for
the noncoherent version of the extension.

Bug: angleproject:5454
Test: *EXTShaderFramebufferFetchNoncoherent*.*
Change-Id: I392f84ee3ad3eb9fbd09d0b7ff83731a9a3f33f6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2598060
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
2021-02-24 21:44:25 +00:00
Jamie Madill 6623a70f3d Stubs for OpenCL entry points.
Bug: angleproject:5653
Change-Id: I7ec9692a47be2556fef5bdd7630b422cc2d369b9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2708343
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-02-24 15:38:53 +00:00
Corentin Wallez 9558445975 Revert "Workaround for Mac Intel drawArraysInstanced with first > 0"
This reverts commit 027bc47ca5.

Reason for revert: InstancingTests fail on Mac FYI Release (Intel UHD 630), see https://ci.chromium.org/ui/p/chromium/builders/ci/Mac%20FYI%20Release%20(Intel%20UHD%20630)/1729/overview

Original change's description:
> Workaround for Mac Intel drawArraysInstanced with first > 0
>
> Workaround by forcefully set instanced arrays (divisor > 0)
> as streaming attributes and apply extra offset at front. Recover
> those attribute bindings when first == 0 and other draw calls
> (drawElementsInstanced)
>
> Bug: chromium:1144207, chromium:1144247, chromium:1144373
> Change-Id: Ie7836cc71b45a290513f34f90d49bd15b14ddba8
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2661095
> Commit-Queue: Shrek Shao <shrekshao@google.com>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>

Bug: chromium:1144207
Bug: chromium:1144247
Bug: chromium:1144373
Change-Id: Ia4a6026a8c446490346b373c33fe2b1724c1761f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2704052
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2021-02-18 09:33:31 +00:00
Shrek Shao 027bc47ca5 Workaround for Mac Intel drawArraysInstanced with first > 0
Workaround by forcefully set instanced arrays (divisor > 0)
as streaming attributes and apply extra offset at front. Recover
those attribute bindings when first == 0 and other draw calls
(drawElementsInstanced)

Bug: chromium:1144207, chromium:1144247, chromium:1144373
Change-Id: Ie7836cc71b45a290513f34f90d49bd15b14ddba8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2661095
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2021-02-18 04:31:49 +00:00
Peng Huang 46203e322b Workaround context lost for Adreno 42x and 3xx
Bug: chromium:1171371
Change-Id: I8c2e13f3f35bf1f780526ad1d9d483226ce5ea34
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2688901
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2021-02-12 21:16:30 +00:00
Alexey Knyazev 1094d324cb GL: Add allow_etc_formats workaround
Enable ETC2/EAC formats on newer Intel GPUs.

Bug: angleproject:1552
Change-Id: I240b07d6d81d48e1e03dfcd56aad6fa9f1d7817f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2690952
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
2021-02-12 18:41:07 +00:00
Jamie Madill a8a2a71b3a Vulkan: Support y-flip with no driver support.
We can reuse the surface rotation matrix code to do the y-flip.
This requires the SPIR-V transformation support. Because not
all rotations are encoded into the table we can only support
rotation with the driver support for y-flip (currently).

Includes some very minimal regression testing. This work is
targeted towards supporting vk-portability implementations
which are not as up-to-date with Vulkan features.

Bug: angleproject:5596
Change-Id: I270fa1efc03267551d28df33ddac9972e1343d60
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2665892
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2021-02-10 17:03:45 +00:00
Kenneth Russell 572afd90bd Disable SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS workaround.
It causes incorrect compilation of some shaders. The original graphics
driver bugs that motivated enabling it have been fixed, at least on
one of the platforms (macOS).

Tested with new WebGL conformance test in
https://github.com/KhronosGroup/WebGL/pull/3214 .

Bug: chromium:1165751
Change-Id: Iee9747769ca918aab143592d6cf158ce02a75ee0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2661024
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2021-02-02 01:08:29 +00:00
Geoff Lang 61bd3440a1 Roll Khronos headers.
Many of our GLES and EGL headers had old SGI licenses which tripped up
Android's license detection.

Bug: None
Change-Id: Iede9a72b3619fdd77ba21895fc5a76a81f0a5790
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2643489
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2021-01-22 16:30:04 +00:00
Sunny Sachanandani 137271ffc5 Support specifying array slice for D3D11 texture EGLImage
Client can specify array slice for creating the SRV/RTV with
EGL_D3D11_TEXTURE_ARRAY_SLICE_ANGLE.

Test: D3DTextureTest.TextureArrayImage*
Bug: angleproject:5538, chromium:1116101
Change-Id: I81cb2823df2145f1d05ad1526b0e36d6a0724d5e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2628609
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
2021-01-21 00:10:29 +00:00
Shahbaz Youssefi bb3adfa428 Rename ShaderVariable::structName to structOrBlockName
Bug: angleproject:3580
Change-Id: Ic53a5267972f153dad2e20948e493e9767a45d16
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2568247
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-01-20 21:39:29 +00:00
Shahbaz Youssefi ea71c6b634 Vulkan: Emulate R32F images with R32UI
GL requires that imageAtomicExchange be supported for r32f formats.
However VK_FORMAT_FEATURE_STORAGE_*_ATOMIC_BIT is nearly unsupported
everywhere without some Vulkan extension that brings in unnecessary
support.

This GL feature is emulated by transforming the shader to use r32ui for
all images that originally specified r32f.  floatToUintBits and
uintBitsToFloat is used to maintain correct usage of the image* builtin
functions.

Bug: angleproject:5535
Change-Id: Ie607089935d3283b3ffa054f4b4385b81fb8f53d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2635453
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
2021-01-20 18:29:28 +00:00
Shahbaz Youssefi 383442e596 Add a helper ShaderVariable method to facilitate member rename
Chromium uses ShaderVariable::structName directly, which makes it
impossible to rename this variable.

Bug: angleproject:3580
Change-Id: I328015b0e7f26d22d689451bac0d7a48999bef2e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2637419
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-01-19 22:08:46 +00:00
Jamie Madill e670fc72a5 Implement shader compiler changes for Tessellation.
Numerous rule changes to support validating Tessellation Control and
Evaluation shaders. New per-patch inputs and output variable support.
Includes a new traverser step that validates barrier function calls.

Functionality changes upcoming in http://crrev.com/c/2568234

Bug: angleproject:3572
Change-Id: If8da1c21d30efa12c60ed0d6c3f8cf0b27e4c86f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2633936
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Mohan Maiya <m.maiya@samsung.com>
2021-01-19 17:15:46 +00:00
Peng Huang 043fcf1880 Support create ANGLE EGLContext from an external EGLContext
For Android WebView, Android creates an EGLContext, EGLSurface
and FBO, and makeCurrent on them, and then calls WebView draw
function to draw the WebView content on the current EGLSurface or
binded FBO. So to use ANGLE in WebView, this CL adds a way to
create ANGLE EGLContext from an external EGLContext, and save
and restore GL state in eglMakeCurrent().

Bug: angleproject:5509
Change-Id: I874986813117f125e23e975ea1adc51ac5b3a631
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2615239
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
2021-01-18 23:45:35 +00:00
Shahbaz Youssefi 68635b431b Reland "Vulkan: Move xfb position decl to translator in extension path"
This reverts commit b4b5972627.

Reason for revert: This was in a chain of reverts, but is unrelated to the issue.

Original change's description:
> Revert "Vulkan: Move xfb position decl to translator in extension path"
>
> This reverts commit 8f5ca26678.
>
> Reason for revert:
> Earlier CL breaks pre-rotation:
> https://chromium-review.googlesource.com/c/angle/angle/+/2598584
>
> Original change's description:
> > Vulkan: Move xfb position decl to translator in extension path
> >
> > This change removes the @@ XFB-DECL @@ marker.  The ANGLEXfbPosition
> > output is unconditionally emitted in VS, TES and GS by the translator,
> > and is appropriately decorated or removed by the SPIR-V transformer.
> >
> > Bug: angleproject:3606
> > Change-Id: Ia76224f5a6d147362eeb2d288f05e333aaf75481
> > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2617658
> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
> > Reviewed-by: Jamie Madill <jmadill@chromium.org>
> > Reviewed-by: Charlie Lao <cclao@google.com>
>
> TBR=syoussefi@chromium.org,jmadill@chromium.org,cclao@google.com
>
> Change-Id: Ia03988b9c17639513576e82e8f11cd4c7b52640b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: angleproject:3606
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2634202
> Reviewed-by: Tim Van Patten <timvp@google.com>
> Commit-Queue: Tim Van Patten <timvp@google.com>

TBR=timvp@google.com,syoussefi@chromium.org,jmadill@chromium.org,cclao@google.com

# Not skipping CQ checks because this is a reland.

Bug: angleproject:3606
Change-Id: Ib5b5925528a5c8698390b81f71ee788f5b332a1f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2633708
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2021-01-18 03:55:53 +00:00
Shahbaz Youssefi 60015ff672 Vulkan: Redo RewriteStructSamplers
This transformation is split into two.  The first transformation solely
takes out the samplers out of structs, and potentially generates array
of array of samplers.  A second transformation is added that takes any
array of array of opaque uniforms and flattens it.

A follow up change will simplify RewriteAtomicCounters which also
handles array of arrays (which is no longer possible), and removes
dependency on shaderStorageBufferArrayDynamicIndexing.

Bug: angleproject:2703
Bug: angleproject:3881
Bug: angleproject:4071
Bug: angleproject:4211
Change-Id: I352bb2bbe65ac49f4d7d753c0ba3160fa3cc925a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2628138
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-01-16 17:40:29 +00:00
Tim Van Patten b4b5972627 Revert "Vulkan: Move xfb position decl to translator in extension path"
This reverts commit 8f5ca26678.

Reason for revert:
Earlier CL breaks pre-rotation:
https://chromium-review.googlesource.com/c/angle/angle/+/2598584

Original change's description:
> Vulkan: Move xfb position decl to translator in extension path
>
> This change removes the @@ XFB-DECL @@ marker.  The ANGLEXfbPosition
> output is unconditionally emitted in VS, TES and GS by the translator,
> and is appropriately decorated or removed by the SPIR-V transformer.
>
> Bug: angleproject:3606
> Change-Id: Ia76224f5a6d147362eeb2d288f05e333aaf75481
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2617658
> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Charlie Lao <cclao@google.com>

TBR=syoussefi@chromium.org,jmadill@chromium.org,cclao@google.com

Change-Id: Ia03988b9c17639513576e82e8f11cd4c7b52640b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:3606
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2634202
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Tim Van Patten <timvp@google.com>
2021-01-16 00:12:36 +00:00
Shahbaz Youssefi 8f5ca26678 Vulkan: Move xfb position decl to translator in extension path
This change removes the @@ XFB-DECL @@ marker.  The ANGLEXfbPosition
output is unconditionally emitted in VS, TES and GS by the translator,
and is appropriately decorated or removed by the SPIR-V transformer.

Bug: angleproject:3606
Change-Id: Ia76224f5a6d147362eeb2d288f05e333aaf75481
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2617658
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
2021-01-15 17:51:39 +00:00
Shahbaz Youssefi c07ef60274 Vulkan: Move xfb buffer decl to translator in emulation path
This makes @@ XFB-DECL @@ empty on this path.  Ultimately, this is
working towards removing both @@ XFB-DECL @@ and @@ XFB-OUT @@ macros
for both the emulation and extension paths, allowing the shaders to be
compiled at compile time rather than link time.

Bug: angleproject:3606
Change-Id: If16e9d92c419a04ecd3094481ed546d0708cdb43
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2611305
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
2021-01-14 22:06:50 +00:00
Sunny Sachanandani 198dc34538 Support importing NV12/P010/P016 D3D textures as EGLImage
Allow importing individual planes of NV12/P010/P016 D3D textures with
supported SRV/RTV formats.  Restrict these to GL_TEXTURE_EXTERNAL_OES to
limit to using as shader inputs or render targets and prevent
unsupported operations like ReadPixels.

Test: D3DTextureYUVTest*
Bug: angleproject:5538, chromium:1116101
Change-Id: If5bf54f4f75bb2c703890ce3f5fbd67e4461c98f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2338827
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2021-01-13 23:41:01 +00:00
Mohan Maiya 68f35f242a Vulkan: Add GL_EXT_clip_control entry points
Addition of the entry points for GL_EXT_clip_control extension.

Bug: angleproject:5471
Change-Id: If17ba0120bdb226cc5728bfea83e9085260eba19
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2615862
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
2021-01-08 17:55:59 +00:00
Shahbaz Youssefi e2a8a69ade Vulkan: Move xfb emulation offset calculation to translator
A new function is added by the translator to calculate the transform
feedback offsets in the emulation path.  This function makes the
generated code for transform feedback smaller.

Bug: angleproject:3606
Change-Id: I01460f907e20e2887cb720bddad96697fdcb0cf3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2607492
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-01-07 08:04:41 +00:00
Jonah Ryan-Davis 88fec1e88f Code generation for NV_framebuffer_blit
Generate the entry points for NV_framebuffer_blit.

Bug: angleproject:5474
Bug: chromium:1157057
Change-Id: Iadffa24ce7368d8ab6c4bf9d5b6c016276e762f5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2602242
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
2020-12-23 23:39:50 +00:00
Kenneth Russell 011e0ad186 Promote RGBA4444 and RGB565 to RGB[A]8 on macOS with AMD GPUs.
There are bugs in Apple's OpenGL driver when uploading to textures of
these formats via pixel buffer objects.

Because automatic graphics switching might activate the AMD GPU at any
time, use this workaround on dual-GPU MacBook Pros even if the Intel
GPU is active.

Fixes the following WebGL 2.0 conformance tests:

  deqp/functional/gles3/texturespecification/
    teximage2d_pbo_2d_00.html
    teximage2d_pbo_2d_01.html
    texsubimage2d_pbo_2d_00.html
    texsubimage2d_pbo_2d_01.html
    texsubimage2d_pbo_cube_01.html

Bug: angleproject:5469
Change-Id: I7d65dc5f664159b4b59d46400a8d9c492f67040b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2595245
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2020-12-18 23:21:21 +00:00
Mohan Maiya 8f9e17d529 Add EXT_clip_cull_distance extension autogen code
Addition of shader autogen code for EXT_clip_cull_distance extension.

Bug: angleproject:5458
Change-Id: I299528957c0e747fd84987c420588c314f54aae0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2590989
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2020-12-15 21:54:35 +00:00
Mohan Maiya f32fbb51e8 Add EXT_shader_framebuffer_fetch_non_coherent entry points
Addition of the entry points for
EXT_shader_framebuffer_fetch_non_coherent extension.

Bug: angleproject:5454
Change-Id: I2b8ba5141eed61a0c3ba58aeb2eec12a2071e7f1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2590991
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2020-12-15 19:45:15 +00:00
Mohan Maiya da8c226140 Vulkan: Enable FramebufferVk cache on Apple
This effectively reverts ff60aba. The crash no longer
occurs on Apple.

Bug: angleproject:4442
Change-Id: I4aa745c80a482eb99311f3810e34124afe950cfe
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2588429
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
2020-12-13 16:59:31 +00:00
Charlie Lao c75473c2cf Vulkan: Generalize FlipRotationSpecConst to SpecializationConstant
Specialization constant are used not just for flip/rotation. It also
used for other things. This CL merges all specialization constant usage
(lineRasterEmulation, flip, rotation, halfRenderArea) into one class and
rename FlipRotationSpecConst to SpecConst.

Bug: b/173800146
Change-Id: I8dc3354b6caedbb183cec29855fc1c301ec8872a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2555812
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2020-12-11 00:58:09 +00:00