Commit Graph
199 Commits
Author SHA1 Message Date
Jamie Madill 14126505b2 Revert "Use a constexpr array for es3 copy conversion table."
This reverts commit f30808db86.

Reason for revert: build/android/gyp/assert_static_initializers.py thinks this adds a static initializer.

See https://ci.chromium.org/p/chromium/builders/try/android-marshmallow-arm64-rel/208664

Need to revert since this is blocking the roll.

Original change's description:
> Use a constexpr array for es3 copy conversion table.
> 
> With the relaxed C++14 constexpr rules allowed in Chromium, we can
> use a constexpr sorted array to store our table data. This can lead
> to very fast lookups while being more maintanable than using auto-
> generator scripts for every lookup table.
> 
> Note that to be sure this syntax is permitted, we should land this
> through the bots and let it sit for a little while.
> 
> Bug: angleproject:1389
> Change-Id: I9395c40276470108ce3e5786d8f1b8d85462c517
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/777544
> Commit-Queue: Jamie Madill <[email protected]>
> Reviewed-by: Yuly Novikov <[email protected]>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: angleproject:1389
Change-Id: I482729b6f16975896b0e5c29999f9a081056e800
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1506238
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-03-06 22:24:56 +00:00
Jamie Madill f30808db86 Use a constexpr array for es3 copy conversion table.
With the relaxed C++14 constexpr rules allowed in Chromium, we can
use a constexpr sorted array to store our table data. This can lead
to very fast lookups while being more maintanable than using auto-
generator scripts for every lookup table.

Note that to be sure this syntax is permitted, we should land this
through the bots and let it sit for a little while.

Bug: angleproject:1389
Change-Id: I9395c40276470108ce3e5786d8f1b8d85462c517
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/777544
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2019-03-05 20:11:12 +00:00
Jamie Madill 2f1c1d7eee Minor improvements to run_code_generation.
Isolate variables better. And add a check for out-of-date hases.
Currently if a generator is removed the hashes will stick around.

Bug: angleproject:3227
Change-Id: I9b9da245b9b29093b1f3f320a81810cd7da82395
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1500575
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2019-03-05 14:28:16 +00:00
Jamie Madill b82d201490 Revert "Vulkan: Update code hash after roll."
This reverts commit 0e1ce2e553.

Reason for revert: I think this was my fault. Was maybe using an
outdated version locally. Should probably add a presubmit bot to
the CQ.

Original change's description:
> Vulkan: Update code hash after roll.
> 
> Bug: angleproject:3905
> Change-Id: I3cd7eecd5f0ab9990fd714d5fab3b94008fb9488
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1498129
> Reviewed-by: Jamie Madill <[email protected]>
> Reviewed-by: Shahbaz Youssefi <[email protected]>
> Commit-Queue: Jamie Madill <[email protected]>

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

Change-Id: I387721af7dcbb002d54bd9e785fa782d77cd186d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:3905
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1500077
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-03-04 21:02:02 +00:00
Jamie Madill 0e1ce2e553 Vulkan: Update code hash after roll.
Bug: angleproject:3905
Change-Id: I3cd7eecd5f0ab9990fd714d5fab3b94008fb9488
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1498129
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-03-04 16:06:15 +00:00
Shahbaz Youssefi 6f1a852fce Reland "Roll Vulkan repos"
This reverts commit 3805122b02.

Reason for revert: The OOM issue that coincidentally happened at the time this CL landed, and for which this CL was reverted, turned out to be irrelevant to this change.

Original change's description:
> Revert "Roll Vulkan repos"
>
> This reverts commit 55ea947c3b.
>
> Reason for revert: Seems to be causing a memory corruption on Windows/Intel bots.
>
> Original change's description:
> > Roll Vulkan repos
> >
> > Bug: angleproject:3095
> > Change-Id: I6ae9d61304981223f9e2f1869ed32612aa38952c
> > Reviewed-on: https://chromium-review.googlesource.com/c/1405714
> > Commit-Queue: Shahbaz Youssefi <[email protected]>
> > Reviewed-by: Yuly Novikov <[email protected]>
>
> [email protected],[email protected],[email protected]
>
> Change-Id: I61879770c9bb16ac2231b081bda08e6211ba6831
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: angleproject:3095
> Reviewed-on: https://chromium-review.googlesource.com/c/1470605
> Reviewed-by: Shahbaz Youssefi <[email protected]>
> Commit-Queue: Shahbaz Youssefi <[email protected]>

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

Bug: angleproject:3095
Change-Id: Iabe8ea215b44c65c4c22b9b158c5dad3ffffdbb0
Reviewed-on: https://chromium-review.googlesource.com/c/1489153
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-03-01 21:16:29 +00:00
Shahbaz Youssefi 76bd848cab Vulkan: Support ETC, S3TC and BPTC compressed textures
Fixes the format table so the correct Vulkan format for the types are
generated.  Additionally, implements CHROMIUM_copy_compressed_texture as
well as other functions relevant to initializing compressed textures.

Bug: angleproject:2670, angleproject:2904
Change-Id: I682d36574262525027cddf8f329515f38cd77dc0
Reviewed-on: https://chromium-review.googlesource.com/c/1468048
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-03-01 18:14:25 +00:00
Jamie Madill d09546e1ec D3D: Fall back to old compiler DLL.
This is a workaround for Windows 7 users sometimes not having the UCRT
required for the new versions of the MS HLSL compiler. It requires a
specific version of the Windows SDK with the old compiler DLL.

Bug: chromium:920704
Change-Id: Id9adb3b9d569272cbd69a8b4fc99dc160d837dbc
Reviewed-on: https://chromium-review.googlesource.com/c/1403254
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Bruce Dawson <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-02-22 17:30:43 +00:00
Shahbaz Youssefi b9039bf76b Vulkan: fix numerous formats missing support
Vulkan _SRGB formats have a suffix of _UNORM_SRGB in the corresponding
angle name.

Vulkan A2B10G10R10_*_PACK32 formats have angle names in the form
R10G10B10A2_*.

A16 and A32 formats are emulated similar to A8.

Some formats that are not in the front-end are removed.

Bug: angleproject:2364, angleproject:2405
Change-Id: I00718f450a374912d57d3c00ea167ce486e10aa0
Reviewed-on: https://chromium-review.googlesource.com/c/1468042
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Ian Elliott <[email protected]>
Commit-Queue: Ian Elliott <[email protected]>
2019-02-22 03:31:22 +00:00
Shahbaz Youssefi 3805122b02 Revert "Roll Vulkan repos"
This reverts commit 55ea947c3b.

Reason for revert: Seems to be causing a memory corruption on Windows/Intel bots.

Original change's description:
> Roll Vulkan repos
> 
> Bug: angleproject:3095
> Change-Id: I6ae9d61304981223f9e2f1869ed32612aa38952c
> Reviewed-on: https://chromium-review.googlesource.com/c/1405714
> Commit-Queue: Shahbaz Youssefi <[email protected]>
> Reviewed-by: Yuly Novikov <[email protected]>

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

Change-Id: I61879770c9bb16ac2231b081bda08e6211ba6831
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:3095
Reviewed-on: https://chromium-review.googlesource.com/c/1470605
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2019-02-13 21:21:25 +00:00
Shahbaz Youssefi 55ea947c3b Roll Vulkan repos
Bug: angleproject:3095
Change-Id: I6ae9d61304981223f9e2f1869ed32612aa38952c
Reviewed-on: https://chromium-review.googlesource.com/c/1405714
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2019-02-13 03:24:31 +00:00
Jonah Ryan-Davis 2b0553ce59 Implement EXT_instanced_arrays
Bug: angleproject:3015
Change-Id: Ib01cc5e0df6db27981cb843a6bd386de5d10c2db
Reviewed-on: https://chromium-review.googlesource.com/c/1452740
Commit-Queue: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2019-02-08 20:40:08 +00:00
Shahbaz Youssefi e1a763d152 Vulkan: Implement basic barrier perf test
There's a lot more that can go into this perf test, but it requires
further work on the Vulkan back end.

Bug: angleproject:2999
Change-Id: Iea62bfd09639af108674dcf0a9e7c9d36ccddcef
Reviewed-on: https://chromium-review.googlesource.com/c/1437734
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2019-02-05 19:06:12 +00:00
Jamie Madill c09ae15c08 Enable -Wextra-semi and -Wextra-semi-stmt.
This will prevent users from accidentally making semicolon errors in
the future.

Bug: chromium:926235
Change-Id: I79a6fa376fb1ad8f0fcf1b65b1f572a035d1f4e9
Reviewed-on: https://chromium-review.googlesource.com/c/1446493
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Nico Weber <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2019-02-01 21:53:28 +00:00
Shahbaz Youssefi 5313c8a899 Implement EGL_KHR_fence_sync and EGL_KHR_wait_sync
EGL_KHR_fence_sync introduces the EGLSync object and associated
create/destroy/clientWait functions.  EGL_KHR_wait_sync adds the
serverWait function on top of that.

Bug: angleproject:2466
Change-Id: Iebb239a85c4471ea18b3c3a8a83b793af555e31d
Reviewed-on: https://chromium-review.googlesource.com/c/1412261
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-01-23 04:12:20 +00:00
Jeff Gilbert 465d6090cd Add GL_ANGLE_provoking_vertex on D3D11 and GL.
This extension is a subset of GL_ARB_provoking_vertex without the
QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION query.

Bug: angleproject:2829
Change-Id: I907a4d16b7b13d3bbfb948842091eedd7b6a8b77
Reviewed-on: https://chromium-review.googlesource.com/c/1410289
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-01-16 20:32:14 +00:00
Jamie Madill dd34b3b9b7 Pack VertexAttribType enum.
This improves performance slightly in vertex array format checks.
Instead of needing to switch on GLenum values we can use packed arrays
and tables to determine the values we need.

Does not significantly affect performance but will enable future work.

Bug: angleproject:3074
Change-Id: I6f4821a463e9b41fe3f8c8967eb3ed4c1d6b84be
Reviewed-on: https://chromium-review.googlesource.com/c/1393903
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-01-16 18:25:16 +00:00
Jamie Madill ab2bfa814c Enable Chromium clang style plugin for libANGLE.
This fixes a few style warnings:

 * auto should not deduce to raw pointer type
 * inlined virtual methods are not allowed
 * non-trivial constructors and destructors should be explicit
 * inlined non-trivial constructors should not be in-class
 * missing override keywords

Bug: angleproject:3069
Change-Id: I3b3e55683691da3ebf6da06a5d3c729c71b6ee53
Reviewed-on: https://chromium-review.googlesource.com/c/1407640
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2019-01-16 01:44:15 +00:00
jchen10 55f20f681b Fix generate_loader.py
The message printed by the #error macro should be enclosed in marks
for gcc.

Bug: angleproject:2995

Change-Id: I5d8ebb28ef5e225eb88990642b6b58936cad4369
Reviewed-on: https://chromium-review.googlesource.com/c/1407542
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jie A Chen <[email protected]>
2019-01-15 00:40:12 +00:00
Shahbaz Youssefi 98a3550bce Add a presubmit step to make sure autogenerated code is up-to-date
While here, added a presubmit test for the Bug: tag too.

Bug: angleproject:3046
Change-Id: I7030685230b4ce4bfc435c14ef85324e16b76274
Reviewed-on: https://chromium-review.googlesource.com/c/1402061
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-01-09 14:58:25 +00:00
Shahbaz Youssefi 4f3b207d04 Vulkan: Shader path for texture-to-texture copy
This change implements glCopy[Sub]TextureCHROMIUM in GPU.  As with the
previous change implementing glCopyTex[Sub]Image2D, it currently only
selects the shader path if the texture is already defined.

Bug: angleproject:2958
Change-Id: Ia1b5625f92e6c9f91807c9b601e5c34d2d5e5c30
Reviewed-on: https://chromium-review.googlesource.com/c/1392394
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2019-01-09 04:07:30 +00:00
Jamie Madill dbc605cecc Vulkan: Optimize VBO state changes.
Also has some minor optimizations for the front-end.

12% improvement on the Vulkan VBO change test.

Bug: angleproject:3014
Change-Id: I38e1a8194edfc14bfe57424be348cb9688e928f4
Reviewed-on: https://chromium-review.googlesource.com/c/1369286
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-01-05 02:04:05 +00:00
James Darpinian e4109f2713 WebGL: validate texture format matches sampler type
WebGL requires that drawing produces INVALID_OPERATION if a texture's
format doesn't match the sampler type it is bound to. This is a little
confusing because samplers have two attributes that could be called
"type": addressing mode (2D/3D/Cube), and component format
(float/signed/unsigned/shadow). ANGLE already handled checking the
addressing mode; this change adds checking for the component format.

Fixes WebGL conformance test
conformance2/uniforms/incompatible-texture-type-for-sampler.html

Bug: chromium:809237
Change-Id: I52ebfecd92625e3ee10274cb5f548d7e53de72dd
Reviewed-on: https://chromium-review.googlesource.com/c/1377611
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: James Darpinian <[email protected]>
2019-01-04 02:03:28 +00:00
Jamie Madill 1f56ed2a9b Add WGLWindow and WGL test configs.
WGLWindow lets us use a Windows driver's bindings instead of ANGLE.
This only works if the underlying driver supports OpenGL ES
compatibility.

Also adds the WGL headers, WGL XML, and a specialized WGL loader.

Because of a small driver issue with NVIDIA I added a retry for the WGL
Window initialization.

Bug: angleproject:2995
Change-Id: Ie5148ece470dd03df33015f4919ad1fa79a859ec
Reviewed-on: https://chromium-review.googlesource.com/c/1366021
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2019-01-03 21:35:24 +00:00
Jamie Madill ba319ba31c Re-land "Load entry points dynamically in tests and samples."
Fixes the Android/ChromeOS/Fuchsia builds by using consistent EGL
headers.

This CL adds a dynamic loader generator based on XML files. It also
refactors the entry point generation script to move the XML parsing
into a helper class.

Additionally this includes a new GLES 1.0 base header. The new
header allows for function pointer types and hiding prototypes.

All tests and samples now load ANGLE dynamically. In the future this
will be extended to load entry points from the driver directly when
possible. This will allow us to perform more accurate A/B testing.

The new build configuration leads to some tests having more warnings
applied. The CL includes fixes for the new warnings.

Bug: angleproject:2995
Change-Id: I5a8772f41a0f89570b3736b785f44b7de1539b57
Reviewed-on: https://chromium-review.googlesource.com/c/1392382
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-01-01 18:56:45 +00:00
Yuly Novikov 9f088621eb Revert "Load entry points dynamically in tests and samples."
This reverts commit 03923558a7.

Reason for revert: fails compilation on Android, ChromeOS and Fuchsia during roll https://chromium-review.googlesource.com/c/chromium/src/+/1392624

Original change's description:
> Load entry points dynamically in tests and samples.
> 
> This CL adds a dynamic loader generator based on XML files. It also
> refactors the entry point generation script to move the XML parsing
> into a helper class.
> 
> Additionally this includes a new GLES 1.0 base header. The new
> header allows for function pointer types and hiding prototypes.
> 
> All tests and samples now load ANGLE dynamically. In the future this
> will be extended to load entry points from the driver directly when
> possible. This will allow us to perform more accurate A/B testing.
> 
> The new build configuration leads to some tests having more warnings
> applied. The CL includes fixes for the new warnings.
> 
> Bug: angleproject:2995
> Change-Id: I6726d4163f7a6e54d2482f094c0a952f59702a05
> Reviewed-on: https://chromium-review.googlesource.com/c/1359516
> Commit-Queue: Jamie Madill <[email protected]>
> Reviewed-by: Shahbaz Youssefi <[email protected]>

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

Change-Id: I902bec2d733c2b879be29c02ab52a0b7d4eaa077
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:2995
Reviewed-on: https://chromium-review.googlesource.com/c/1392381
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Yuly Novikov <[email protected]>
2018-12-29 20:46:23 +00:00
Jamie Madill 03923558a7 Load entry points dynamically in tests and samples.
This CL adds a dynamic loader generator based on XML files. It also
refactors the entry point generation script to move the XML parsing
into a helper class.

Additionally this includes a new GLES 1.0 base header. The new
header allows for function pointer types and hiding prototypes.

All tests and samples now load ANGLE dynamically. In the future this
will be extended to load entry points from the driver directly when
possible. This will allow us to perform more accurate A/B testing.

The new build configuration leads to some tests having more warnings
applied. The CL includes fixes for the new warnings.

Bug: angleproject:2995
Change-Id: I6726d4163f7a6e54d2482f094c0a952f59702a05
Reviewed-on: https://chromium-review.googlesource.com/c/1359516
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2018-12-29 16:24:36 +00:00
Markus Tavenrath cb9609fe58 Optimize glDrawElements performance
A call to glDrawElements results in a calling depth of up to 4
* glDrawElements
* gl::Context::DrawElements
* rx::ContextGL::DrawElements
* VertexArrayGL::syncDrawState.

Each function call has to save/restore a lot of registers which
results in a stall in the prologue of rx::ContextGL::DrawElements
due to memory bandwidth limitations.

The main change is the function gl::Context::DrawElements being
inlined to reduce the calling depth by one. In addition the call
to ContextGL::syncDrawElementsState is now protected so that it
gets called only if it's required. Finally a few small getter
functions have been inlined where the calling code was bigger
than the actual function.

In total this change improves performance of the
DrawElementsPerfBenchmark.Run/gl benchmark by 16%.

Bug: angleproject:2966

Change-Id: I423d18452f2f5b520ab52850fda2054e1da86991
Reviewed-on: https://chromium-review.googlesource.com/c/1389988
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Markus Tavenrath <[email protected]>
2018-12-28 15:47:26 +00:00
Jamie Madill 4638dc9def Re-land "Load correct libGLESv2 on Linux and Mac."
Re-land fixes build to ensure commit_id is built before libEGL.

libEGL was implicitly loading libGLESv2 on startup. This is bad
because on platforms like Linux and Mac we could sometimes use the
incorrect rpath. This in turn meant we needed workarounds like using
"_angle" extensions to our shared objects to get the correct loading
behaviour.

Fix this by loading libGLESv2 dynamically in libEGL. We build the
loader automatically from egl.xml. The loader itself is lazily
initialized on every EGL entry point call. This is necessary because
on Linux, etc, there is no equivalent to Windows' DLLMain.

We also use an EGL.h with different generation options so we have the
proper function pointer types. A README is included for instructions
on how to regenerate EGL.h.

The entry point generation script is refactored into a helper class
that is used in the loader generator. Also adds the libGLESv2 versions
of the EGL entry points in the DEF file on Windows. This allows them to
be imported properly in 32-bit configurations.

Also fixes up some errors in ANGLE's entry point definitions. Also
includes a clang-format disable rule for the Khronos headers.

This CL will help us to run ANGLE tests against native drivers.

Bug: angleproject:2871
Bug: chromium:915731
Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab
Reviewed-on: https://chromium-review.googlesource.com/c/1380511
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-12-18 18:54:44 +00:00
Yuly Novikov 175d918a1f Revert "Load correct libGLESv2 on Linux and Mac."
This reverts commit dd815b623e.

Reason for revert: Broke https://luci-milo.appspot.com/p/chromium/builders/luci.chromium.ci/win-rel/8006

Original change's description:
> Load correct libGLESv2 on Linux and Mac.
> 
> libEGL was implicitly loading libGLESv2 on startup. This is bad
> because on platforms like Linux and Mac we could sometimes use the
> incorrect rpath. This in turn meant we needed workarounds like using
> "_angle" extensions to our shared objects to get the correct loading
> behaviour.
> 
> Fix this by loading libGLESv2 dynamically in libEGL. We build the
> loader automatically from egl.xml. The loader itself is lazily
> initialized on every EGL entry point call. This is necessary because
> on Linux, etc, there is no equivalent to Windows' DLLMain.
> 
> We also use an EGL.h with different generation options so we have the
> proper function pointer types. A README is included for instructions
> on how to regenerate EGL.h.
> 
> The entry point generation script is refactored into a helper class
> that is used in the loader generator. Also adds the libGLESv2 versions
> of the EGL entry points in the DEF file on Windows. This allows them to
> be imported properly in 32-bit configurations.
> 
> Also fixes up some errors in ANGLE's entry point definitions. Also
> includes a clang-format disable rule for the Khronos headers.
> 
> This CL will help us to run ANGLE tests against native drivers.
> 
> Bug: angleproject:2871
> Change-Id: Id6ecf969308f17b1be4083538428c9c1a1836572
> Reviewed-on: https://chromium-review.googlesource.com/c/1370725
> Commit-Queue: Jamie Madill <[email protected]>
> Reviewed-by: Geoff Lang <[email protected]>

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

Change-Id: I921b3c45435ab4f05cbc2d1c1172b4185d6257b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:2871
Reviewed-on: https://chromium-review.googlesource.com/c/1378887
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Yuly Novikov <[email protected]>
2018-12-16 19:53:36 +00:00
Jamie Madill dd815b623e Load correct libGLESv2 on Linux and Mac.
libEGL was implicitly loading libGLESv2 on startup. This is bad
because on platforms like Linux and Mac we could sometimes use the
incorrect rpath. This in turn meant we needed workarounds like using
"_angle" extensions to our shared objects to get the correct loading
behaviour.

Fix this by loading libGLESv2 dynamically in libEGL. We build the
loader automatically from egl.xml. The loader itself is lazily
initialized on every EGL entry point call. This is necessary because
on Linux, etc, there is no equivalent to Windows' DLLMain.

We also use an EGL.h with different generation options so we have the
proper function pointer types. A README is included for instructions
on how to regenerate EGL.h.

The entry point generation script is refactored into a helper class
that is used in the loader generator. Also adds the libGLESv2 versions
of the EGL entry points in the DEF file on Windows. This allows them to
be imported properly in 32-bit configurations.

Also fixes up some errors in ANGLE's entry point definitions. Also
includes a clang-format disable rule for the Khronos headers.

This CL will help us to run ANGLE tests against native drivers.

Bug: angleproject:2871
Change-Id: Id6ecf969308f17b1be4083538428c9c1a1836572
Reviewed-on: https://chromium-review.googlesource.com/c/1370725
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-12-16 14:04:28 +00:00
Jamie Madill dfaccbc08a Clean up Windows DEF file generation.
Ordinal numbers weren't necessary. It's a legacy function from Win16.
Also refactor the def file generator to be much simpler.

Will be helpful for adding the libGLESv2 EGL entry points to the DEF
files. This will enable loading the right GLES libs on Linux and Mac
once we break the link dependency of libEGL on libGLESv2.

Bug: angleproject:2871
Bug: angleproject:2621
Change-Id: Ia2585323b076446af55359d875a6b67bcdc4d6f9
Reviewed-on: https://chromium-review.googlesource.com/c/1372378
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-12-14 05:00:52 +00:00
Shahbaz Youssefi 611bbaabb2 Vulkan: Convert vertex attributes in compute
In this commit, VertexArrayVk::convertVertexBuffer() is renamed to
VertexArrayVk::convertVertexBufferCpu() to explicitly show it does a CPU
readback.  A new VertexArrayVk::convertVertexBuffer() function is added
that has the same functionality in gpu (with some assumptions, where the
CPU fallback is used should those assumptions fail).  Currently, the
only requirement is that buffer offset/stride are divided by the
component size.

ConvertVertex.comp is the shader responsible for this conversion, and it
implements the functionality in renderer/copyvertex.inc, minus a few
functions that are not used in the Vulkan backend.

Bug: angleproject:2958, angleproject:3009
Change-Id: I8ec9a5f4672509bcf7b9e352cd27663970ad4653
Reviewed-on: https://chromium-review.googlesource.com/c/1364451
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-12-11 21:20:33 +00:00
Shahbaz Youssefi 149eb33bb4 Vulkan: add possibility to build subset of shaders
As the number of internal shaders grow, it's helpful in development time
to be able to build variations of a specific shader, instead of building
everything every time.

With this commit, one can do:

$ python gen_vk_internal_shaders.py SubString

which will result in compilation of shaders whose name matches the glob
*SubString*.

Bug: angleproject:2958
Change-Id: I3b18d7e32e2ec4317531a7655eb2c6148cea177b
Reviewed-on: https://chromium-review.googlesource.com/c/1369285
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-12-10 21:16:12 +00:00
Austin Eng 153e0224da Add gl_DrawID emulation for ESSL3 with ANGLE_multi_draw
Bug: chromium:890539
Change-Id: I3d9a9429608afb454f076013f3ed844e115c56cc
Reviewed-on: https://chromium-review.googlesource.com/c/1368784
Reviewed-by: Kai Ninomiya <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Austin Eng <[email protected]>
2018-12-10 17:46:33 +00:00
Jamie Madill 7c985f5c4f Make angle::Result an enum.
This moves away from a class type to a value type. This should improve
performance when using angle::Result as a return value. Previously the
generated code would return a pointer instead of a value.

Improves performance in the most targeted microbenchmark by 10%. In
more realistic scanarios it will have a smaller improvement. Also
simplifies the class implementation and usage.

Includes some unrelated code generation changes.

Bug: angleproject:2491
Change-Id: Ifcf86870bf1c00a2f73c39ea6e4f05ca705050aa
Reviewed-on: https://chromium-review.googlesource.com/c/1356139
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-12-07 04:59:23 +00:00
Austin Eng d300548fcc Add ANGLE_multi_draw entrypoints to proc table
Bug: chromium:890539
Change-Id: Iddd4b02d218ea11ccd77de139fd060bed4996bc2
Reviewed-on: https://chromium-review.googlesource.com/c/1363931
Commit-Queue: Austin Eng <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-12-06 08:23:51 +00:00
Shahbaz Youssefi 8f1b7a66a5 Vulkan: Add DispatchUtilsVK
This class provides a set of compute-based internal utilities.
Currently, buffer clear and copy are implemented.  Other possibilities
include more efficient mip map generation, or specialized texture
operations.

VertexArrayVk::updateIndexTranslation() is updated to convert the
GL_UNSIGNED_BYTE index buffer to a GL_UNSIGNED_SHORT one using this
class to avoid a CPU readback.

The vk::Format class is augmented with a few flags (IsInt, IsUnsigned)
to be able to select the appropriate shader based on the format (float,
int or uint).

Bug: angleproject:2958,angleproject:3003
Change-Id: Ie35519deb3c32a3da5ccf74080c70092c9287f0a
Reviewed-on: https://chromium-review.googlesource.com/c/1336307
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-12-05 21:41:45 +00:00
Jamie Madill ff03e51ea2 Copy PDBs in update_canary_angle.
A change in Chromium's build tools caused symbol paths to become
relative. Since copying dlls no longer links back to the build
directory we need to copy the PDBs as well to get debuggging symbols.

Bug: angleproject:3001
Change-Id: I54d9a1d57d3c69d81d68913993653bab61fa4e65
Reviewed-on: https://chromium-review.googlesource.com/c/1358645
Reviewed-by: Jamie Madill <[email protected]>
2018-12-03 22:48:58 +00:00
Nico Weber ce0a8f3c8f List vulkan_core.h as input of generate_vulkan_layers_json.py.
Since this was missing, the layer json files didn't get regenerated on
vulkan rolls, leading to stale generated json files, which in turn led
to incremental builds having different files in the swarming isolate
than full builds.

To make this type of bug harder to introduce, rewrite
generate_vulkan_layers_json.py a bit:

- pass in path to vulkan_core.h as an argument
- also pass in the input .json / .json.in files as arguments,
  so that the script re-runs if a .json or .json.in input is added
  or removed, and in the script verify that the passed-in list matches
  the glob() the script did previously (this verifies that the sources
  list in the .gn file is up-to-date with the state on disk)
- generate outputs list in gn from sources list, to make sure they're
  in sync
- use an expicit --icd flag instead of doing `'icd' in path`
- fail when failing to extract vk_version instead of silently using a
  default
- some minor python style fixes

Bug: chromium:910699,chromium:869348
Change-Id: I1e598f4566697a7f1ef56b040e52d0717f7ad075
Reviewed-on: https://chromium-review.googlesource.com/c/1358631
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Nico Weber <[email protected]>
2018-12-03 15:48:33 +00:00
Shahbaz Youssefi df8c1053db Vulkan: Uber-shader generated code optimization
Refactors code out of generated functions into a common function and
simplifies assertions.

Bug: angleproject:2958
Change-Id: I896c2304c3ac1e043c16f9ecf81fa8b72a6b87c0
Reviewed-on: https://chromium-review.googlesource.com/c/1355501
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-11-29 21:31:06 +00:00
Jamie Madill 8dc27f99b5 Use packed enum for DrawElementsType.
The packing and unpacking take a few extra instructions. But it
completely obviates the need for any switches in the validation code.
Speed is slightly faster or the similar depending on the back-end.

Also add gl_angle_ext.xml to GL entry point generator inputs. This was
missing and would cause the code generation to miss certain changes.

Bug: angleproject:2985
Change-Id: I1ea41a71db71135000166ead8305ec42d22ff7b3
Reviewed-on: https://chromium-review.googlesource.com/c/1351729
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2018-11-29 18:13:39 +00:00
Shahbaz Youssefi a1442ecdf5 Vulkan: Uber-shader support
For each internal shader, there is now possibly a companion .json file
that defines shader variations.  The variations consist of a set of
flags and a set of enums.  Each enum defines a variation that takes one
of a few values.  Flags are shorthands for 2-value enums.

In the shader code, #if can be used to change the shader based on
variations derived from flags and enums.  On the C++ side, those
variations are combined into an index and the appropriate shader is
retrieved from a table.

Bug: angleproject:2958
Change-Id: Ic4fc7061adb20c047c26624305285e3005092aab
Reviewed-on: https://chromium-review.googlesource.com/c/1351117
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-11-29 11:46:17 +00:00
Yizhou Jiang 7310da33bc Implement GetMultismaplefvANGLE and SampleMaskiANGLE of texture multisample extension
This patch adds GetMultismaplefvANGLE and SampleMaskiANGLE api.

TEST=TextureMultisampleTest.CheckSamplePositions*
TEST=NegativeTextureMultisampleTest.Negtive*

BUG=angleproject:2275

Change-Id: Ib1e8b856059229bbe88328a28cf2a892f4673214
Reviewed-on: https://chromium-review.googlesource.com/c/1319252
Commit-Queue: Yizhou Jiang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-11-29 03:09:05 +00:00
Austin Eng 3b7c9d099b Change offsets in MultiDrawElements* entrypoints to match glMultiDrawElements
This patch changes arguments for MultiDrawElements and
MultiDrawElementsInstanced from from GLsizei *offsets to
const* GLvoid* indices.

Bug: chromium:890539

Change-Id: I2124cf2daeaa6af0f889f3c46aa2b8c77be200a6
Reviewed-on: https://chromium-review.googlesource.com/c/1352591
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Kai Ninomiya <[email protected]>
Commit-Queue: Austin Eng <[email protected]>
2018-11-28 01:50:44 +00:00
Jamie Madill 752d220a5f Use flat enum for PrimitiveMode.
The GLenum was already mostly packed. There were just a few missing
values because of the exclusion of things like GL_QUADS and GL_POLYGON
from GLES.

Also update the PackedEnumMap initialization to take an intializer.
The initializer is a list of key/values which is much more robust to
changes in the packed map.

Improves draw call speed slightly as there is no conversion needed any
more for the mode enum.

Bug: angleproject:2966
Change-Id: Icae658272c6234f29335f6a57a63cf341cf5b2a0
Reviewed-on: https://chromium-review.googlesource.com/c/1346529
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2018-11-27 21:10:11 +00:00
Jamie Madill 778bf09dee Auto-generate validation headers.
This will make them easier to maintain. Add to add new features.

Bug: angleproject:2964
Change-Id: I8c1f92e0d0ca15fc4f555f6c537fa9311320ef7d
Reviewed-on: https://chromium-review.googlesource.com/c/1334429
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-11-16 21:09:19 +00:00
Jamie Madill 526392dd96 Use angle::Result in front-end (Part 9)
This removes the ANGLE_TRY_HANDLE macro. Also the internal uses of
gl::ErrorStreamBase. There are remaining uses in the validation code.

Further progress will be blocked on removing egl::Error and the use
of gl::Error in the validation layer.

Also reduces binary size by up to 4k.

Bug: angleproject:2491
Change-Id: I3e0481f99738f9f24256c10e73f3efcce9826a35
Reviewed-on: https://chromium-review.googlesource.com/c/1334427
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-11-16 15:47:52 +00:00
Jamie Madill 417ac91cdb Fix typo in perf_test_runner.py.
Bug: angleproject:2923
Change-Id: I2e961e18373cc1c317700f2f6b64a0b9bf32e4a2
Reviewed-on: https://chromium-review.googlesource.com/c/1340200
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-11-16 12:54:15 +00:00
Brandon Jones b77884b78b Autogenerate Repeated Portions of Blit11
Introduces a script to generate Blit11's
BlitShaderType enum and shader mapping functions.

Bug: angleproject:2870
Change-Id: I5b704f55bdde1706614a519ecb0ee3756f7799e0
Reviewed-on: https://chromium-review.googlesource.com/c/1273725
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2018-11-15 19:10:21 +00:00