Commit Graph
165 Commits
Author SHA1 Message Date
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
Jamie Madill f3acb8c133 Retool perf test running.
This change does a few things involving the way we run the perf tests:

- Perf test runner can capture different metrics

Useful for capturing the new "nanoSecPerIteration" metric.

- Removes the "score" metric

We'll move to the new time-based metrics. These new metrics are scaled
correctly with iteration counts.

- Runs three trials per perf test

This gives more measurements per test. Each trial is approximately one
second. First the perf tests set a fixed number of iterations after
calibrating the number of steps that we can run in one second. After
that the three trials are run. This should give more stable results.

- Apply more CPU stabilization on Windows

Use SetPriorityClass to apply more CPU priority. Also upgrade
SetThreadPriority to the highest level.

- Always build the Vulkan command buffer test

This catches build regressions more easily. We still skip the test on
non-Android platforms.

Bug: angleproject:2923
Change-Id: I7da234c5af07775ba4a232bb8d65e0138ee7073f
Reviewed-on: https://chromium-review.googlesource.com/c/1330262
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-11-15 01:00:06 +00:00
Austin Eng 1bf18ce9e2 Implement GL_ANGLE_multi_draw
This patch adds entrypoints glMultiDrawArraysANGLE,
glMultiDrawElementsANGLE, glMultiDrawArraysInstancedANGLE,
annd glMultiDrawElementsInstancedANGLE

Bug: chromium:890539

Change-Id: Ic9c374c53892460f44ca6e73a253b78473ac2dff
Reviewed-on: https://chromium-review.googlesource.com/c/1282268
Reviewed-by: Kai Ninomiya <[email protected]>
Commit-Queue: Austin Eng <[email protected]>
2018-11-06 18:04:07 +00:00
Geoff Lang 6ba22ee137 GL: Implement EGL_ANDROID_get_frame_timestamps.
BUG=angleproject:2936

Change-Id: I758d797d185b2de330cce3401bfeef76c7df590e
Reviewed-on: https://chromium-review.googlesource.com/c/1302836
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-11-02 16:43:05 +00:00
Yizhou Jiang c0b6c639b1 Implement GetTexLevelParameter api of texture multisample extension
This patch adds GetTexLevelParameterivANGLE and GetTexLevelParameterfvANGLE.

TEST=TextureMultisampleTest.GetTexLevelParameter*
TEST=NegativeTextureMultisampleTest.Negtive*

BUG=angleproject:2275

Change-Id: Id702ba31df36ab65f46b697d480b5bf01b87e360
Reviewed-on: https://chromium-review.googlesource.com/c/1295830
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Yizhou Jiang <[email protected]>
2018-11-02 02:51:57 +00:00
Jamie Madill 3402d52309 Try to reduce variance in angle_perftests.
This change does a few things:

- make perf test runner script print % variation instead of stddev

This makes it a bit more clear how much variance there is.

- stabilize CPU in the render perf tests

Setting a thread affinity and priority should stop from switching cores
during the run. Hopefully can prevent background noise from changing
the test results.

- warm up the benchmark with a few iterations

This should hopefully make the test results a bit more stable.

- output a new normalized perf result value

The new result is normalized against the number of iterations. So it
should hopefully be stable even if the number of iterations is changed.

- increases the iteration count in the draw call perf tests.

These tests were completely dominated by SwapBuffers time. Increasing
the iterations per step means we actually are bottlenecked on CPU time
instead.

Bug: angleproject:2923
Change-Id: I5ee347cf93df239ac33b83dc5effe4c21e066736
Reviewed-on: https://chromium-review.googlesource.com/c/1303679
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-10-30 20:27:07 +00:00
Jamie Madill 77abad8d9c Remove Context::gatherParams.
This won't be used in the future. It saves a few instructions on each
entry point.

Also refactors a bit of touched code. Also adds in a missed entry
point: "glTexStorage2DMultisampleANGLE".

Removes related code and moves remaining helper code in params.h into a
new file entry_point_utils.h.

In total this patch series reduces overhead by up to 5%.

Bug: angleproject:2933
Change-Id: Ifb49564597cde6ba82dfc3e185227619fdc62612
Reviewed-on: https://chromium-review.googlesource.com/c/1299478
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-10-29 20:09:19 +00:00
Geoff Lang fefaba5bfd Regenerate hashes for the builtin symbol table.
BUG=chromium:890539

Change-Id: Ia5bdf652dc37a466560071b4fe2cdc7d89ff941f
Reviewed-on: https://chromium-review.googlesource.com/c/1302837
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Austin Eng <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2018-10-27 00:16:39 +00:00
Jamie Madill e357535f7f Fix entry points.
A race broke the ANGLE tree due to an entry point formatting change.

Bug: angleproject:2890
Bug: angleproject:2928
Change-Id: I08cc4e13c9d5bd1888c0d891113d3042759d43dc
Reviewed-on: https://chromium-review.googlesource.com/c/1302534
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-10-26 19:09:38 +00:00
Till Rathmann b854363004 Support GL_OES_texture_border_clamp
Added support for GL_TEXTURE_BORDER_COLOR and GL_CLAMP_TO_BORDER in
OpenGL/OpenGLES, Direct3D9 and Direct3D11 backends.
For integer textures in OpenGLES3 contexts these additional entry points
are available now:

void glTexParameterIivOES(enum target, enum pname, const int *params);
void glTexParameterIuivOES(enum target, enum pname, const uint *params);

void glGetTexParameterIivOES(enum target, enum pname, int *params);
void glGetTexParameterIuivOES(enum target, enum pname, uint *params);

void glSamplerParameterIivOES(uint sampler, enum pname, const int *params);
void glSamplerParameterIuivOES(uint sampler, enum pname, const uint *params);

void glGetSamplerParameterIivOES(uint sampler, enum pname, int *params);
void glGetSamplerParameterIuivOES(uint sampler, enum pname, uint *params);

BUG=angleproject:2890
TEST=angle_end2end_tests.TextureBorderClamp*

Change-Id: Iee3eeb399d8d7851b3b30694ad8f21a2111f5828
Reviewed-on: https://chromium-review.googlesource.com/c/1257824
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-10-26 18:45:54 +00:00
Shahbaz Youssefi a390ebd9e7 Add compiler printf attribute to relevant functions
Relands 27a472c60 with reinterpret_cast changed to C-style cast to
support types that are pointers on some platforms and integers on
others.

This commit includes fixes to undefined behavior caught by this
attribute.  The following changes have been made:

- 0x%0.8p is changed to %016 PRIxPTR. Both 0 and . have undefined
  behavior with p.  Additionally, %p already prints 0x with both gcc and
  clang.  This results in a small output change:

    void *x = (void *)0x1234;
    void *y = (void *)0x1234567890abcdef;

    printf("|%0.8p|\n", x);
    printf("|%0.8p|\n", y);

    printf("|%016" PRIxPTR "|\n", (uintptr_t)x);
    printf("|%016" PRIxPTR "|\n", (uintptr_t)y);

  prints:

    |0x00001234|
    |0x1234567890abcdef|
    |0x0000000000001234|
    |0x1234567890abcdef|

- %d used for GLintptr, GLsizeiptr, EGLTime and EGLnsecsANDROID is
  changed to %llu and the relevant argument is cast to unsigned long
  long.  This is due to these types being typedefs to unknown types (on
  Linux for example, these are unsigned long, and my guess would be
  unsigned long long on Windows where long is 32 bits).
- %llu is used for GLuint64, which could be unsigned long (as is on
  Linux).  Those arguments are cast to unsigned long long.
- %p is used for some EGLNative types, but those types may not be a
  pointer.  Those arguments are cast to uintptr_t and printed as above.

Bug: angleproject:2928
Change-Id: Idf9f705c3d00f69e41e7603453016276a2e13a64
Reviewed-on: https://chromium-review.googlesource.com/c/1300913
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2018-10-26 18:18:21 +00:00
Jamie Madill e9503ae90a Revert "Add compiler printf attribute to relevant functions"
This reverts commit 27a472c601.

Reason for revert: Causing failures on 32-bit Linux configs:

https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8931673733828416640/+/steps/compile/0/stdout

../../third_party/angle/src/libGLESv2/entry_points_egl.cpp:257:11: error: reinterpret_cast from 'EGLNativeWindowType' (aka 'unsigned long') to 'uintptr_t' (aka 'unsigned int') is not allowed
          reinterpret_cast<uintptr_t>(win), reinterpret_cast<uintptr_t>(attrib_list));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../third_party/angle/src/common/debug.h:230:112: note: expanded from macro 'EVENT'
#define EVENT(message, ...) gl::ScopedPerfEventHelper scopedPerfEventHelper("%s" message "\n", __FUNCTION__, ##__VA_ARGS__);
                                                                                                               ^~~~~~~~~~~
../../third_party/angle/src/libGLESv2/entry_points_egl.cpp:314:11: error: reinterpret_cast from 'EGLNativePixmapType' (aka 'unsigned long') to 'uintptr_t' (aka 'unsigned int') is not allowed
          reinterpret_cast<uintptr_t>(pixmap), reinterpret_cast<uintptr_t>(attrib_list));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Original change's description:
> Add compiler printf attribute to relevant functions
> 
> This commit includes fixes to undefined behavior caught by this
> attribute.  The following changes have been made:
> 
> - 0x%0.8p is changed to %016 PRIxPTR. Both 0 and . have undefined behavior with
>   p.  Additionally, %p already prints 0x with both gcc and clang.  This
>   results in a small output change:
> 
>     void *x = (void *)0x1234;
>     void *y = (void *)0x1234567890abcdef;
> 
>     printf("|%0.8p|\n", x);
>     printf("|%0.8p|\n", y);
> 
>     printf("|%016" PRIxPTR "|\n", reinterpret_cast<uintptr_t>(x));
>     printf("|%016" PRIxPTR "|\n", reinterpret_cast<uintptr_t>(y));
> 
>   prints:
> 
>     |0x00001234|
>     |0x1234567890abcdef|
>     |0x0000000000001234|
>     |0x1234567890abcdef|
> 
> - %d used for GLintptr, GLsizeiptr, EGLTime and EGLnsecsANDROID is
>   changed to %llu and the relevant argument is cast to unsigned long
>   long.  This is due to these types being typedefs to unknown types (on
>   Linux for example, these are unsigned long, and my guess would be
>   unsigned long long on Windows where long is 32 bits).
> - %llu is used for GLuint64, which could be unsigned long (as is on
>   Linux).  Those arguments are cast to unsigned long long.
> - %p is used for some EGLNative types, but those types may not be a
>   pointer.  Those arguments are cast to uintptr_t and printed as above.
> 
> Bug: angleproject:2928
> Change-Id: I63e9e998c72701ce8582f1ebf25d6374be9090e4
> Reviewed-on: https://chromium-review.googlesource.com/c/1289232
> Commit-Queue: Shahbaz Youssefi <[email protected]>
> Reviewed-by: Yuly Novikov <[email protected]>

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

Change-Id: I4f3cea64977bee9f889db6c995371bd2bbc6d81b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:2928
Reviewed-on: https://chromium-review.googlesource.com/c/1299480
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-10-25 17:55:19 +00:00
Shahbaz Youssefi 27a472c601 Add compiler printf attribute to relevant functions
This commit includes fixes to undefined behavior caught by this
attribute.  The following changes have been made:

- 0x%0.8p is changed to %016 PRIxPTR. Both 0 and . have undefined behavior with
  p.  Additionally, %p already prints 0x with both gcc and clang.  This
  results in a small output change:

    void *x = (void *)0x1234;
    void *y = (void *)0x1234567890abcdef;

    printf("|%0.8p|\n", x);
    printf("|%0.8p|\n", y);

    printf("|%016" PRIxPTR "|\n", reinterpret_cast<uintptr_t>(x));
    printf("|%016" PRIxPTR "|\n", reinterpret_cast<uintptr_t>(y));

  prints:

    |0x00001234|
    |0x1234567890abcdef|
    |0x0000000000001234|
    |0x1234567890abcdef|

- %d used for GLintptr, GLsizeiptr, EGLTime and EGLnsecsANDROID is
  changed to %llu and the relevant argument is cast to unsigned long
  long.  This is due to these types being typedefs to unknown types (on
  Linux for example, these are unsigned long, and my guess would be
  unsigned long long on Windows where long is 32 bits).
- %llu is used for GLuint64, which could be unsigned long (as is on
  Linux).  Those arguments are cast to unsigned long long.
- %p is used for some EGLNative types, but those types may not be a
  pointer.  Those arguments are cast to uintptr_t and printed as above.

Bug: angleproject:2928
Change-Id: I63e9e998c72701ce8582f1ebf25d6374be9090e4
Reviewed-on: https://chromium-review.googlesource.com/c/1289232
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-10-25 15:58:11 +00:00
Yizhou Jiang 7818a85c33 Implement GL_ANGLE_texture_multisample API part
Support GL_ANGLE_texture_multisample extension.
This patch adds enums of multisampled texture and texStorage2DMultisampleANGLE
API.

TEST=angle_end2end_tests.exe --gtest_filter=TextureMultisampleTest*
TEST=angle_end2end_tests.exe --gtest_filter=NegativeTextureMultisampleTest.Negtive*

BUG=angleproject:2275

Change-Id: I2cab997edc33aa2d0be6082381545335423f64e0
Reviewed-on: https://chromium-review.googlesource.com/c/804613
Commit-Queue: Yizhou Jiang <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-10-22 02:53:04 +00:00
Yizhou Jiang c4533eae08 Enable ANGLE_texture_multisample in glsl in es 3.0
Enable gsampler2dMS, texelFetch, textureSize in glslang in
es 3.0 if ANGLE_texture_multisample is supported.

Bug: angleproject:2275
TEST=SamplerMultisampleEXTTest.TextureMultisampleEXTEnabled

Change-Id: Ibfa367970db3ae790f3822e57eb50090843dc6db
Reviewed-on: https://chromium-review.googlesource.com/c/867521
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Yizhou Jiang <[email protected]>
2018-10-12 01:40:05 +00:00
Olli Etuaho f2ed299569 Add support for EXT_texture_compression_bptc
After validation, the enums are simply forwarded to the native
drivers. The BPTC formats are supported on both OpenGL and D3D.

The included test coverage covers the API quite well, but only has
basic coverage for correct decoding of texture data. More coverage for
texture data could be added later.

BUG=angleproject:2869
TEST=angle_end2end_tests

Change-Id: I3de37972dcf13c6fa3fc1bc429a2627523a4a082
Reviewed-on: https://chromium-review.googlesource.com/c/1261675
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-10-11 22:25:21 +00:00
Olli Etuaho 0ca0975339 Add GLES3 support for EXT_blend_func_extended
This adds GLES3 API support for EXT_blend_func_extended. The patch
includes the API entrypoints, validation and also implementation on
the desktop GL backend.

Instead of having built-in fragment color variables, ESSL 3.00 has
custom output variables, which can now be bound to either primary or
secondary output color locations. The "index" set to a custom output
variable determines whether it's used a primary or secondary blending
source color.

The shader layout qualifier takes precedence over the bind call. This
is not specified in the EXT spec, but is specified in desktop OpenGL
specs.

BUG=angleproject:1085
TEST=angle_end2end_tests

Change-Id: Ia24e8e5dadcc165e5e8fbd7c653c7fab6217db88
Reviewed-on: https://chromium-review.googlesource.com/c/1249361
Commit-Queue: Olli Etuaho <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-10-05 09:12:42 +00:00
Brandon Jones 4e6f2aeac2 Implement ANGLE_copy_texture_3d Extension
Adds copyTexture3DANGLE and copySubTexture3DANGLE that adds copy
operations on volumetric textures.

Bug: angleproject:2762
Test: angle_end2end_tests

Change-Id: I0076989c2b7ed69abfc73143c325065bdb06a360
Reviewed-on: https://chromium-review.googlesource.com/c/1207216
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-10-04 12:06:13 +00:00
Jamie Madill 115e8a2625 Vulkan: Store "is packed" in buffer formats.
This more easily allows us to compute the format alignment for use with
the vertex input stage.

Bug: angleproject:2797
Change-Id: If15281ce18fbed743b6a0c843cece4626bc4ce72
Reviewed-on: https://chromium-review.googlesource.com/1245841
Reviewed-by: Frank Henigman <[email protected]>
Reviewed-by: Jie A Chen <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-09-27 02:06:13 +00:00
jchen10 547edfe22c Fix angle::Format::ID in gen_dxgi_format_table.py
The dxgi_format_map_autogen.cpp was updated, but the generating script
was missed to submit in https://crrev.com/c/1142299.

Bug: angleproject:2729

Change-Id: I8d726854581d27881a737f12457482ac955e6312
Reviewed-on: https://chromium-review.googlesource.com/1242853
Commit-Queue: Jie A Chen <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-09-26 02:15:51 +00:00
Jamie Madill 8a5619147a Pack SamplerState into small struct.
Is much faster for completeness cache checks in syncProgramTextures.

Bug: angleproject:2763
Change-Id: Iffdacbb8a4f6640caa5051643c379a7b4c3311b6
Reviewed-on: https://chromium-review.googlesource.com/1171508
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-09-13 22:03:11 +00:00
Frank Henigman 6c6be2cef6 Vulkan: add S8_UINT texture fallbacks.
Add two fallbacks for S8_UINT.  Enable tests.

BUG=angleproject:2655

Change-Id: If7df23745a8de8a01d86ab6efa3bca67b5227d76
Reviewed-on: https://chromium-review.googlesource.com/1217282
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Frank Henigman <[email protected]>
2018-09-12 19:45:47 +00:00
Frank Henigman 3b1fe64f21 Vulkan: allow a list of fallback formats.
Allow a list of fallback formats as well as a single one in the format
map.  The first supported format is used.  No functional change.

BUG=angleproject:2655

Change-Id: Ica312b7899471a7a65184a6921713b79da056f31
Reviewed-on: https://chromium-review.googlesource.com/1214847
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Yuly Novikov <[email protected]>
2018-09-11 21:49:00 +00:00
Olli Etuaho dff32a0da1 Support multisample arrays in shader programs
The added tests check that using textureSize() and texelFetch() on
textures with a fixed point format return expected results. texelFetch
is also covered for integer format textures.

dEQP GLES 3.1 tests also cover a variety of multisampled array texture
formats.

BUG=angleproject:2775
TEST=angle_end2end_tests, angle_deqp_gles31_tests

Change-Id: I99b422e24b39e3563ed72f0fb85c9c1907df807d
Reviewed-on: https://chromium-review.googlesource.com/1196521
Commit-Queue: Olli Etuaho <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-09-06 15:44:35 +00:00
Jamie Madill 7359954301 Update update_canary_angle script.
Make it search in any output directory.

Bug: None
Change-Id: I4ea3ee70bbf051e534e97a972fcb6bbcb5ceeecc
Reviewed-on: https://chromium-review.googlesource.com/1208512
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-09-05 20:32:50 +00:00
Tobin Ehlis 3a181e3e53 Roll VK deps forward as of 8/31/2018
Roll Vulkan ANGLE dependencies forward as of 8/31/2018. This grabs some
new validation checks including point-related checks that may be
interesting for bug 2727.

One of these checks, related to PointSize, is firing so I've added some
code in the VK debug callback to suppress those error messages for now
and filed a separate bug (2796) to fix that issue in the renderer.

Had to overhaul the json gen script as validation changed how these are
generated. They now use a base template with some strings replaced to
account for platform and Vulkan header version. Offloaded all of that
work to our existing json generate script which was previously more of
an intelligent copy but now had some further intelligence for
transforming from input template into final json files.

Had to also roll glslang forward to meet shader validation dependency.

Bug: angleproject:2727
Change-Id: I929619cd258cddd6bc9c6743600e072c46736f5c
Reviewed-on: https://chromium-review.googlesource.com/1194617
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Tobin Ehlis <[email protected]>
2018-08-31 17:06:59 +00:00
Geoff Lang b02fc662fa Lock around all EGL and GL calls with a global mutex.
BUG=angleproject:2464

Change-Id: I0231cc84777272f9cf26298c6a137f1ad3fd51d6
Reviewed-on: https://chromium-review.googlesource.com/1183441
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2018-08-31 16:11:58 +00:00
Olli Etuaho 064458a8f8 Remove separate ANGLE_texture_multisample_array
We can just expose OES_texture_storage_multisample_2d_array instead.
The compiler was already changed to accept
OES_texture_storage_multisample_2d_array, and now the change is made
also at the API level.

Out-of-bounds access guarantees provided by ANGLE were the only big
difference between the ANGLE spec and the OES spec, so it's simpler
to just expose the native extension. Safe out-of-bounds accesses can
be guaranteed without having them in the extension spec.

This also adds missing texStorage3DMultisample entry point to the proc
table, which will enable running dEQP tests.

BUG=angleproject:2775
TEST=angle_end2end_tests

Change-Id: Idf376ee877a3374a33de177df023f0531ec8f01d
Reviewed-on: https://chromium-review.googlesource.com/1196722
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2018-08-31 14:04:58 +00:00
Olli Etuaho f0d0408a35 Use OES_texture_storage_multisample_2d_array
There's an OES extension for multisample texture arrays,
OES_texture_storage_multisample_2d_array. Change references from
ANGLE_texture_multisample_array to the native extension in the shader
compiler.

ANGLE still needs to have robust behavior for out-of-range texel
fetches that's not found in the original extension, but this does not
need to be spelled out in the extension spec.

BUG=angleproject:2775
TEST=angle_unittests

Change-Id: Ie80ae767cc92ccaf7389af28789f45547f86978f
Reviewed-on: https://chromium-review.googlesource.com/1193266
Commit-Queue: Olli Etuaho <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-08-30 09:44:05 +00:00
Frank Henigman a7f97a27eb Gyp is dead. Long live gn.
Remove the gyp build.  The .gypi files were not renamed so that diff and
rebase would work on this change.  They will be renamed in a separate
change.

BUG=angleproject:1569

Change-Id: If8a217027633293664b820104f91a4ca5889b24e
Reviewed-on: https://chromium-review.googlesource.com/1187380
Commit-Queue: Frank Henigman <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-08-29 19:26:38 +00:00
Olli Etuaho d310a4342c Add validation and negative tests for multisample arrays
This adds errors for binding and allocating multisample array
textures. New tests in TextureMultisampleTest.cpp check that the
errors are generated as specified.

Tests for querying supported sample counts are also improved and
extended for multisample array textures.

BUG=angleproject:2775
TEST=angle_end2end_tests

Change-Id: I6a0fe7ae04bb3d0072f6cbe09026b05e2bc47325
Reviewed-on: https://chromium-review.googlesource.com/1188576
Commit-Queue: Olli Etuaho <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-08-28 20:48:02 +00:00
Olli Etuaho 89664843c6 Add glTexStorage3DMultisampleANGLE entry point
This adds the entry point but does not implement it yet.

The entry point and enums are also added to the gl2ext_angle.h
header file.

BUG=angleproject:2775
TEST=angle_end2end_tests

Change-Id: I24c231c52e7cbb13637880b21044e655935b51e8
Reviewed-on: https://chromium-review.googlesource.com/1188575
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2018-08-27 14:59:00 +00:00
Olli Etuaho 8ca6080591 Add 2D MS array sampler support to compiler
This also places textureSize(gsampler2DMS) correctly in the ESSL 3.10
builtins instead of ESSL 3.00 builtins.

BUG=angleproject:2775
TEST=angle_unittests

Change-Id: Ieb0f7a7424a5558a5569af6d4fcbcc9b12ec9840
Reviewed-on: https://chromium-review.googlesource.com/1186466
Commit-Queue: Olli Etuaho <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-08-24 09:38:34 +00:00
Lingfeng Yang 6e5bf36ff5 GLES1: Fixes for Gets() test
- Fixed wrong face parameter for glGetMaterial*.
- Enabled GL_LINE_SMOOTH capability in state only (no rendering yet)
- Enabled logical operation capability in state only (no rendering yet)
- Fixed wrong handling of GL_RGB/ALPHA_SCALE and
GL_POINT_COORD_REPLACE_OES

Test: Enable and pass Gets() GLES1 conformance test

BUG=angleproject:2306

Change-Id: Ib5c50a2055129b76ad24053baf0dac24dcc00761
Reviewed-on: https://chromium-review.googlesource.com/1176161
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Lingfeng Yang <[email protected]>
2018-08-16 15:43:07 +00:00
Jamie Madill cc1dc5ee4c Add a perf test for draw calls with texture changes.
This perf test highlights the performance hotspots with
State::syncProgramTextures.

Also includes a fix to the perf test runner script.

Bug: angleproject:2763
Change-Id: I69ffa0cc0d5e023944495b7a1c844770a54f7ddc
Reviewed-on: https://chromium-review.googlesource.com/1166041
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-08-08 19:46:00 +00:00