141 Commits

Author SHA1 Message Date
Mark Lobodzinski
9e47cbd300 Capture/Replay: Rework trace EGLDisplay handling
Refactor the trace-replay EGLDisplay handling to allow
initializing the global EGLDisplay handle in the
InitializeReplay4() body. This included adding
support for eglGetCurrentDisplay() to the EGL-on-
WGL shim.

Test: angle_trace_tests --gtest_filter=infinity_ops
Bug: b/282725258
Change-Id: I2319fd9a35f8fb9c0a7f10547ca39f49ce402b8d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4546267
Reviewed-by: Roman Lavrov <romanl@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Mark Łobodziński <mark@lunarg.com>
2023-05-23 23:58:34 +00:00
Jamie Madill
2031e2153f Fixes for Vulkan secondaries build.
Includes the defined name of the alternate library in every
build, so that platforms without Vulkan still have access to
the library name define.

Also fixes checks for the ANGLE driver in the tests to work
with the new secondaries enum. This will let developers run
trace tests with the vulkan secondaries library.

Bug: angleproject:6811
Change-Id: If3846d68e532238f0b1c1c506638867a23fb4357
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4076513
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2022-12-02 23:07:40 +00:00
Jamie Madill
aaee3c23c1 Build and test ANGLE with Vulkan secondary CBs.
This will allow us to run tests with both permutations of
ANGLE (custom secondaries & Vulkan secondaries) in the same
build directory. It will also allow us to run these configs
as tests on our infra. This CL adds a few simple test to CI.

Bug: angleproject:6811
Change-Id: I053f8cc5bafc2a7ab7d0665da9301f0ba7f8417f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4067806
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-12-02 15:46:53 +00:00
Cody Northrop
202fcb8d85 TraceTest: Route EGLSync entry points through WGL
Test: diablo_immortal trace
Bug: angleproject:7402
Bug: angleproject:7839
Change-Id: I8897337bac38cb1923e58a9503de01454766158d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4044865
Commit-Queue: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2022-11-22 17:55:43 +00:00
Cody Northrop
bae82cfae3 TraceTest: Route eglGetError through WGL
eglGetError is not implemented, but shouldn't crash on Windows.

Bug: angleproject:7799
Change-Id: I61158ab21b86539020b5d492486333a56908ab69
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3995984
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
2022-11-01 21:04:23 +00:00
Yiwei Zhang
fd3bfb778d EGLWindow: workaround eglQueryString behavior before Android 10
EGL_NO_DISPLAY + EGL_EXTENSIONS returns NULL before angle support
introduced in Android 10. See aosp/760681 for the reference.

Bug: b/255844932
Test: build and run angle trace on Android Pie
Change-Id: I23a8236cbd220ce34ebbcc602d6ced351fc76619
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3988422
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
2022-10-28 00:39:50 +00:00
Jamie Madill
a986811024 Add support for testing with Mesa + Zink.
To run a trace test with zink, use --use-gl=zink.

Bug: angleproject:7689
Change-Id: I70073756f903db1c224fe6175d55be4cad637aca
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3899382
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-10-27 22:47:47 +00:00
Jamie Madill
5b3781ecff Remove namespacing from all ANGLE loaders.
This will make it easier to work with pure C files.

Bug: angleproject:7731
Change-Id: I2fe9af486af5f339d973c9149f082eb1f2efa8c4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3925426
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-10-04 12:16:30 +00:00
Shahbaz Youssefi
2debd07df8 Automatically query status of features for tests
Now tests can skip based on what features exist, compared to what
features are explicitly asked for.  For example, a test suite may
override-enable a (normally disabled) feature that depends on a hardware
capability. With this change, it can be skipped if said hardware
capability doesn't exist.

As a bonus, tests now correctly skip if the feature is overriden through
an environment variable.  This change also cleans up
VulkanPerformanceCounterTest tests which did the same for a number of
specific features.

Bug: b/243398683
Change-Id: I84f026e3394eab56fd123e02bee72720c7ed94c6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3909789
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
2022-09-23 14:02:20 +00:00
Geoff Lang
785353fd35 Support Desktop OpenGL context creation in end2end tests
Validation of Desktop GL versions and profile masks is unimplemented.

Bug: angleproject:7360
Change-Id: Ifae94215b6aada895c2b02318a1d05c9515e9b96
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3664916
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2022-06-29 21:25:15 +00:00
Gert Wollny
fd9301c1d8 Capture/Replay: Capture egl surface related calls
Creation from a pbuffer and generalized destruction are
implemented, as well as binding and releasing a TexImage
and making the context current with explicit draw and
read surfaces given.

Bug: angleproject:4964
Bug: angleproject:6180
Bug: angleproject:6512
Change-Id: Id8be6486125d45341905f3aabdbae4366cd568b7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3711741
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2022-06-29 15:07:05 +00:00
Gert Wollny
029a4c9483 util: Add calls for createImage* and destroyImage* to GLWindow
This adds the interface to the GLWindowBase, an implementation to
EGLWindow, and placeholder functions to WGLWindow.

Bug: angleproject:4964
Change-Id: Ia13f5237500cece9564910c95c6c5eea67ca022d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3637559
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
2022-05-11 09:00:00 +00:00
Shahbaz Youssefi
7d31a47fc7 Vulkan: Optimize away eglSwapBuffers for single buffer surfaces
For single buffer surfaces, eglSwapBuffers serves two purposes:

- Switch to/from single buffer mode
- Implicitly issue a glFlush

Simultaneously, for single buffer surfaces, glFlush serves three
purposes:

- Submit the commands
- Call queue present (if necessary)
- Throttle the CPU

In this mode, ContextVk::flush() already redirects to the surface,
calling WindowSurfaceVk::swapImpl() which calls back to
ContextVk::flushImpl() (to submit the commands), calls queue present and
throttles the CPU.

If the application calls eglSwapBuffers(), the exact same thing happens
(i.e. WindowSurfaceVk::swapImpl() is called to the same effect).
Calling swapImpl() leads to an addition of the corresponding submit
serial to the "swap history".  The CPU throttling code always throttles
the CPU to the serial of two swaps ago.

Unnecessary calls to eglSwapBuffers() (when there is no command to be
flushed) in single buffer mode would thus lead to the CPU throttled to
the end of the last submission, effectively turning into a glFinish().

In this change, eglSwapBuffers() in single buffer mode, when not
switching to/from this mode, is redirected to glFlush() as it's
functionally equivalent.  Simultaneously, ContextVk now tracks whether
it has any pending commands for submission at all, and skips glFlush()
altogether if there are none.  Together, this results in the unnecessary
eglSwapBuffers() to become no-op.

Bug: b/229908040
Change-Id: I0e3b4a8b7eb4f6b0e0ed22260644825fc67dd330
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3603841
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2022-04-27 17:57:37 +00:00
Shahbaz Youssefi
797e627e64 Autogenerate list of features as enum
The WithX() and WithNoX() helpers are removed and replaced with enable()
and disable() member functions that take the name of the feature (as a
Feature::X enum constant).  This has two benefits:

- Adding tests that override a feature no longer requires additional
  helper functions to be written.
- There's no mistaking the feature name.

This change doesn't yet fix the main issue in anglebug.com/6435, but
does fix the following helpers using an old feature name (so they were
ineffective):

- WithMetalForcedBufferGPUStorage
- WithNoVulkanViewportFlip

A follow up would remove the old way of overriding features in tests and
replaces them with the new way.

Bug: angleproject:6435
Change-Id: Ida02b26ec72bc40d7a8938c76a93815bb903ca05
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3580982
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-04-12 03:42:40 +00:00
Mohan Maiya
f9ade9fb4a Vulkan: Add feature to create pipeline during glLinkProgram
Creating the pipeline will trigger the compilation of shaders to byte
code thus warming up Vulkan shader caches. Typically most apps call into
glLinkPrograms during app loadtime and the goal is to improve cache hit
rate and reduce CPU workload during game play.

Bug: angleproject:7046
Test: ProgramBinary*CreatePipelineDuringLink*
Change-Id: I71351d45a9aa84e220ca38503735e94cff1dcf98
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3478354
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: mohan maiya <m.maiya@samsung.com>
2022-03-04 21:52:41 +00:00
Mohan Maiya
1b9774f577 Vulkan: Force submit updates to immutable textures
Submit immutable texture updates recorded in outside renderpass
commands when the following conditions are met -

1. "forceSubmitImmutableTextureUpdates" feature is enabled
2. The texture is immutable

This works around a problem that manifests in some applications
that do not perform appropriate synchronization of shared contexts.

Bug: angleproject:6929
Test: EGLContextSharingTestNoSyncTextureUploads.*
Change-Id: I2a237046e2cc53650eb8dc07e3697f7481df9b02
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3418138
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: mohan maiya <m.maiya@samsung.com>
2022-02-08 23:25:49 +00:00
Mohan Maiya
feb599ad89 Invalidate EGL handles during eglTerminate
EGL 1.5 spec says -
    Termination marks all EGL-specific resources, such as contexts
    and surfaces, associated with the specified display for deletion.
    Handles to all such resources are invalid as soon as eglTerminate
    returns

Move EGL object handles to another set, tracking invalid objects,
during display terminate. Destroy these invalid objects during
eglReleaseThread

Bug: angleproject:6798
Test: EGLMultiContextTest.NegativeTestAfterEglTerminate*
Test: EGLMultiContextTest.RepeatedEglInitAndTerminate*
Test: Android CTS WrapperTest.testThreadCleanup
Change-Id: Ie160212c98367493e645d9d1c8260e7a30649386
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3329273
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: mohan maiya <m.maiya@samsung.com>
2021-12-15 19:01:01 +00:00
Hailin Zhang
7b13a9ac9d Vulkan: Fix dynamic partial update buffer data issue.
add test case for dynamic update buffer data.

Signed-off-by: Hailin Zhang<hailinzhang@google.com>

Bug: b/207714894
Change-Id: I8c1e93d152847c3162c0e2dd49abe3d899c859a0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3328869
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Hailin Zhang <hailinzhang@google.com>
2021-12-14 17:31:38 +00:00
Amirali Abdolrashidi
d02875522d Reland "Vulkan: Implement GL_EXT_multi_draw_indirect"
This is a reland of 79f9d163b4
* Added drawcount > 1 as a condition to fall back to
MultiDraw*IndirectGeneral().
* Expanded the tests to include cases with disabled support
for multiDrawIndirect.

Original change's description:
> Vulkan: Implement GL_EXT_multi_draw_indirect
>
> * Optimized the implementations of multiDrawArraysIndirect()
> and multiDrawElementsIndirect() for Vulkan
>   * Added helper functions to support drawArraysIndirect() and
> drawElementsIndirect() as special cases of multiDraw*Indirect
> functions.
>   * Added the flag to enable the multiDrawIndirect feature
> (drawCount > 1). The generic implementation is used if the
> flag is disabled.
>
> Bug: angleproject:6439
> Change-Id: Ibc653d93d355657f828de9c33da22428629e450f
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3276044
> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>

Bug: angleproject:6439
Change-Id: I96c015855fabc8abbb87320a5ca71a8d92d61954
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3313412
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
2021-12-04 00:58:08 +00:00
Jonah Ryan-Davis
f422f21a4c Reland "Metal: Reintroduce GPU power preference selection code."
This reverts commit 67a8cf07a7.

Reason for revert: Landed Chromium-side dependency:
https://chromium-review.googlesource.com/c/chromium/src/+/3271170

Original change's description:
> Revert "Metal: Reintroduce GPU power preference selection code."
>
> This reverts commit 017161701b.
>
> Reason for revert: Blocking roller, please re-land with the fix.
>
> Original change's description:
> > Metal: Reintroduce GPU power preference selection code.
> >
> > This CL re-introduces the GPU power preference code to
> > the metal backend. It also reworks EGLDisplay caching
> > in the frontend to cache based on the native display
> > as well as the power preference attribute.
> > A new extension, EGL_ANGLE_display_power_preference is
> > added based on EGL_ANGLE_power_preference. This extension
> > is a client extension that allows selection of GPU on
> > display creation, similar to how GPUs are selected on
> > context creation in EGL_ANGLE_power_preference.
> > This CL adds EGLDisplayPowerPreferenceTest and enables it on
> > the metal backend.
> >
> > Bug: angleproject:6143
> > Change-Id: I0a081dcd2e3f18ab365fdd3498ddcb6e2ba35212
> > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3231986
> > Reviewed-by: Kenneth Russell <kbr@chromium.org>
> > Reviewed-by: Jamie Madill <jmadill@chromium.org>
> > Reviewed-by: Gregg Tavares <gman@chromium.org>
> > Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
>
> TBR=kbr@chromium.org,gman@chromium.org,jonahr@google.com,jmadill@chromium.org,angle-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I4f775bf7139253a87b033a30e0da2100b3c1bb02
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: angleproject:6143
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3270749
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Commit-Queue: Jamie Madill <jmadill@chromium.org>

# Not skipping CQ checks because this is a reland.

Bug: angleproject:6143
Change-Id: Id9b0a5cbb76e4dea9e2f2da2b1c47a0587dfdaf5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3270970
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
2021-11-10 15:11:01 +00:00
Jamie Madill
67a8cf07a7 Revert "Metal: Reintroduce GPU power preference selection code."
This reverts commit 017161701b.

Reason for revert: Blocking roller, please re-land with the fix.

Original change's description:
> Metal: Reintroduce GPU power preference selection code.
>
> This CL re-introduces the GPU power preference code to
> the metal backend. It also reworks EGLDisplay caching
> in the frontend to cache based on the native display
> as well as the power preference attribute.
> A new extension, EGL_ANGLE_display_power_preference is
> added based on EGL_ANGLE_power_preference. This extension
> is a client extension that allows selection of GPU on
> display creation, similar to how GPUs are selected on
> context creation in EGL_ANGLE_power_preference.
> This CL adds EGLDisplayPowerPreferenceTest and enables it on
> the metal backend.
>
> Bug: angleproject:6143
> Change-Id: I0a081dcd2e3f18ab365fdd3498ddcb6e2ba35212
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3231986
> Reviewed-by: Kenneth Russell <kbr@chromium.org>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Gregg Tavares <gman@chromium.org>
> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>

TBR=kbr@chromium.org,gman@chromium.org,jonahr@google.com,jmadill@chromium.org,angle-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I4f775bf7139253a87b033a30e0da2100b3c1bb02
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:6143
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3270749
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2021-11-09 15:11:03 +00:00
Jonah Ryan-Davis
017161701b Metal: Reintroduce GPU power preference selection code.
This CL re-introduces the GPU power preference code to
the metal backend. It also reworks EGLDisplay caching
in the frontend to cache based on the native display
as well as the power preference attribute.
A new extension, EGL_ANGLE_display_power_preference is
added based on EGL_ANGLE_power_preference. This extension
is a client extension that allows selection of GPU on
display creation, similar to how GPUs are selected on
context creation in EGL_ANGLE_power_preference.
This CL adds EGLDisplayPowerPreferenceTest and enables it on
the metal backend.

Bug: angleproject:6143
Change-Id: I0a081dcd2e3f18ab365fdd3498ddcb6e2ba35212
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3231986
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Gregg Tavares <gman@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
2021-11-08 16:11:51 +00:00
Geoff Lang
d2c01d2ce5 GL: Allow selecting virtualization groups at context creation
Rewrite EGL_ANGLE_platform_angle_context_virtualization to
EGL_ANGLE_context_virtualization, changing the context virtualization
parameter to an identifier for what virtualization group the frontend
context should be added to.

This allows ANGLE's GL backend to be used by multiple threads if the
user creates contexts with different virtualization groups.

Bug: angleproject:6406
Change-Id: I7414d4705ce10bdf63a9b824043d5dd040dad875
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3169193
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2021-10-25 17:20:56 +00:00
Shahbaz Youssefi
ca75c7bbde Vulkan: Fix async queue testing
Due to a feature renaming, the async queue tests where actually ran
without the required feature that makes them async.  This change fixes
the feature name so async queue testing will be resumed.

Bug: angleproject:6437
Change-Id: I73c9c8cd196576455265f72144399a93edc82bdf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3193420
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2021-10-15 04:45:38 +00:00
Shahbaz Youssefi
f3d5dac3ba Vulkan: SPIR-V Gen: Drop dependency to glslang
The SPIR-V gen path is now made default.  Compilation through glslang is
still supported for debugging, and is enabled on the GLSL* end2end tests
for smoke testing.  On release builds, glslang is not supported.

To test with glslang, add the following gn arg (only necessary if dcheck
is disabled):

    angle_enable_spirv_gen_through_glslang = true

Then enable the generateSPIRVThroughGlslang feature.  This can be done
by setting an environment variable:

    ANGLE_FEATURE_OVERRIDES_ENABLED=generateSPIRVThroughGlslang ./angle_deqp_gles2_tests

Binary size saving:

- 1.3MB on Linux (SPIR-V gen itself: 240KB)
- 730KB on Android (SPIR-V gen itself: 140KB)

Perf tests:

- LinkProgramBenchmark.Run/vulkan_compile_single_thread
  * Through glslang:
      truncated mean: 1287033.36
  * Direct SPIR-V Gen:
      truncated mean: 244495.91  (~80% reduction)

- LinkProgramBenchmark.Run/vulkan_compile_multi_thread
  * Through glslang:
      truncated mean: 4565894.83
  * Direct SPIR-V Gen:
      truncated mean: 1158164.10  (~75% reduction)

Bug: angleproject:4889
Bug: angleproject:6210
Change-Id: I486342702977c8114e90073b97183aba115a8b2d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3115140
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
2021-10-14 04:43:32 +00:00
Jamie Madill
9391199053 Add regression test for PBO write to vertex buffer.
There was no test coverage for the "packBuffer->onDataChanged()" call
in Framebuffer::readPixels.

Bug: angleproject:6371
Change-Id: Ib7ccf965a2375077046e21949dc26dc800abff09
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3182700
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2021-09-27 14:45:33 +00:00
Lubosz Sarnecki
e024635d20 ANGLEPerfTest: Skip tests when missing color space support.
Make tests where a non-linear colorspace was requested on platforms
that do not support EGL_KHR_gl_colorspace non-fatal.

Add a initializeGLWithResult function to GLWindowBase, returning a
new GLWindowResult enum and wrap it in EGLWindow and WGLWindow.

Bug: angleproject:6366
Change-Id: Ib57327c4d988d82064272f229f8ad59287541623
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3151833
Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-09-24 20:45:00 +00:00
Jamie Madill
b6e99bb382 Rename and expand shader variable init feature.
This feature now forces both output and unitialized locals to be
initialized by the shader translator. This feature is needed by the
trace validator to ensure we get deterministic behaviour in traces
that exhibit some undefined results.

Bug: angleproject:5133
Change-Id: Id1242cd077a57e891eed217f7671976ce1631a58
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3140216
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2021-09-03 14:47:23 +00:00
Cody Northrop
ef96bde8b0 Vulkan: Fix VVL error regarding geometryStreams
Addresses new validation error:

    [ VUID-VkPipelineRasterizationStateStreamCreateInfoEXT-geometryStreams-02324 ] Validation Error: [ VUID-VkPipelineRasterizationStateStreamCreateInfoEXT-geometryStreams-02324 ] Object 0: handle = 0xb400007e8176af60, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xf1034461 | pCreateInfos[0].pRasterizationState pNext chain includes VkPipelineRasterizationStateStreamCreateInfoEXT, but geometryStreams feature is not enabled. The Vulkan spec states: VkPhysicalDeviceTransformFeedbackFeaturesEXT::geometryStreams must be enabled (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-VkPipelineRasterizationStateStreamCreateInfoEXT-geometryStreams-02324)

The validation was added in this commit:
bdaec8454a

Test: World of Kings MEC
Bug: b/198101940
Bug: angleproject:6339
Change-Id: I3cfacc20d231d246500e83451c9ec6b74d9372f2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3127942
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
2021-08-30 18:50:39 +00:00
Tim Van Patten
58bb11ca62 Capture/Replay: Multi-Context Support
Add support for capturing and replaying multiple contexts.

1.) Create and initialize the Contexts in the share group during
SetupReplay().
2.) Track the Context the command stream is for, and if the Context ID
changes, inject an eglMakeCurrent() call to switch to the new Context.
3.) Intercept eglCreateContext() and eglMakeCurrent() to route to either
EGLWindow or WGLWindow, depending on the current platform.

Specifically, this enables capturing and replaying Asphalt 9.

Bug: angleproject:5878
Change-Id: I5bc9b7ece5388ce405ba3f9e9dc3967e78662000
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830145
Commit-Queue: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-08-27 23:24:59 +00:00
Jamie Madill
2f45d93d5b Capture/Replay: Init shader outputs during self-tests.
This forces all uninitialized variables to have default values.
For instance if the application doesn't initialize the output
color, or a varying that's use in the output, this will ensure we
don't use any undefined values in the computation.

Found when working on a re-trace of T-Rex, which doesn't write to
the alpha channel in the final rendering pass. Also fixes undefined
values in GLSLTest.InactiveVaryingInVertexActiveInFragment.

Bug: angleproject:5133
Change-Id: Ia291338e5adf23dab5263cb2ebe737dc05852d3e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3110225
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
2021-08-21 11:25:50 +00:00
Jamie Madill
d2d1f41fdc Add EGL extension to create window with a swap interval set.
On Vulkan this allows creating a window once without needing to
recreate the swapChain after we specify the swap interval.

Also adds a simple regression test and EGL enum assertion
printing formatting.

Bug: angleproject:5133
Change-Id: I72af124cb0e8f7cddfa810988a9862c0f36a0e46
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3097806
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-08-20 20:31:34 +00:00
Kenneth Russell
ff64d2c7e5 Choose direct-to-Metal translator through a feature.
Define directMetalGeneration in FeaturesMtl.h. If
ANGLE_ENABLE_METAL_SPIRV is defined to 1 (still the default),
directMetalGeneration defaults to false. It can be overridden via the
standard ANGLE mechanism:
  ANGLE_FEATURE_OVERRIDES_ENABLED=directMetalGeneration

It can also be overridden by instantiating angle_end2end_tests with
the directives:
  WithDirectMetalGeneration(ES2_METAL())
  WithDirectMetalGeneration(ES3_METAL())

These directives aren't working properly yet though. The
direct-to-Metal compiler is instantiated, but the _DirectMetalGen
versions of the tests fail. They pass when switching the Metal
backend's default behavior using the above environment variable. This
will be debugged in follow-on CLs.

Thanks to syoussefi@ for the prototype of this CL:
https://chromium-review.googlesource.com/3076129

Bug: angleproject:5505
Change-Id: I188ab89abc75bf89c5ed2d90102af311feaa1960
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3079083
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
2021-08-11 20:58:45 +00:00
Jamie Madill
0e88f24024 EGLWindow: Add option to force robust init.
Not currently used but may be useful in the future.

Bug: angleproject:5133
Change-Id: I11c082a3285587217d5b955048547b0617b8c51b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3076132
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2021-08-09 12:52:48 +00:00
Jamie Madill
7ed0729dc5 EGLWindow: Add option to enable capture limits.
This will be useful for the replay serialization validation.

Bug: angleproject:5133
Change-Id: Ib5bb2a9522b0e35e47bdf2b1321fe6a18dcdb897
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3076131
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2021-08-09 12:09:38 +00:00
Lubosz Sarnecki
4a841e6aff PerfTests: Replay EGL color spaces.
Add EGL_GL_COLORSPACE_KHR to the EGLWindow's surface attributes if
EGL_KHR_gl_colorspace is available.

Require the extension to be available if the color space differs from
the default EGL_COLORSPACE_LINEAR value.

Bug: angleproject:5857
Change-Id: Ib33cbed7d4b115979bd847418cb5cd2b96f4f173
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3056374
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
2021-08-06 16:26:38 +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
Gert Wollny
ee2f330203 Capture/Replay: recreate the EGL window if contexts don't match
In addition enable affected tests.

Bug: angleproject:5955
Change-Id: I4fb72e38a633daa4565d3c0ae7cddb6ace7226f1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2891775
Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-05-13 19:36:14 +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
Lubosz Sarnecki
df72ea36f3 EGLWindow: Append noError context attribs only if enabled.
Push EGL_CONTEXT_OPENGL_NO_ERROR_KHR only to the context attribute list
if it's enabled in the mConfigParams. Prior to this patch the attribute
was pushed with a EGL_FALSE value if noError was disabled but available.

This resolves issues on EGL implementations which expose the extension
but fail if it's in the attrib list if certain conditions are met.

This is the case for mesa 21.0 when EGL_CONTEXT_MAJOR_VERSION_KHR is set
to 1 / GLES1.

Mesa upstream issue:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/4586

Bug: angleproject:5809
Change-Id: I91dfafe2a89f0488556942813087e54499895088
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2797331
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
2021-04-07 14:30:11 +00:00
Amy Liu
49babcbc07 Fix crash of MultithreadingTest end2end tests.
Extension platformANGLEContextVirtualization is currently only
supported in the OpenGL backend, it's confused to validate it
when the test is set up by WithNoVirtualContexts(). It'll generate
crash when it's not OpenGL backend.

Bug: angleproject:5636
Change-Id: Ib04fb4a3d29beaac5162e63af5ef1fd80c8a420c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2709821
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-02-24 21:05:14 +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
Shahbaz Youssefi
9041ca0c34 Limit testing of in-progress work to ANGLE's build of dEQP
A new feature is added, exposeNonConformantExtensionsAndVersions, which
is set by ANGLE's build of dEQP to allow exposing ES3.2 or extensions
that are not yet entirely conformant.  This would allow ANGLE to expose
WIP extensions for regression testing without affecting partners that
test ANGLE with dEQP's standalone build.

Bug: angleproject:3647
Change-Id: Id1e6219f26b41d3f8cdc9763131b8052227761c5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2552926
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Sunny Sun <sunny.sun@arm.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2020-11-24 15:26:32 +00:00
Jamie Madill
38016632a1 Vulkan: Enable async feature in end2end_tests.
This adds a new async-command-queue-enabled config that we run against
most of the GLES tests in angle_end2end_tests. The tests now test
both with and without the threaded command queue.

Bug: b/172704839
Change-Id: Ife75f8328f23ac150cddf8ad8a6c4b8fc2d83986
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2532655
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2020-11-11 16:51:03 +00:00
Jamie Madill
2e74c4526b Vulkan: Make feature names consistent.
This gives the features the exact same name as the member variable.
It fixes a bunch of inconsistencies between the variable name and the
external string identifier.

Ideally these could be auto-generated from JSON.

Bug: b/172704839
Change-Id: Id75c01db544672234435c3dd727c927027b9236d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2524541
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2020-11-09 20:13:35 +00:00
Le Hoang Quyen
cb6176f3a8 Metal: Support tri-fan & line-loop with primitive restart
Triangle fan:
- If primitive restart is NOT enabled and there is no active render
  pass, use Compute Shader to generate indices.
- If primitive restart is enabled, use CPU to generate indices.

Line loop:
- If draw non-instanced without primitive restart, generate and
  draw only one additional last segment (fastest).
- If draw instanced, primitive restart is NOT enabled, and there is no
  active render pass, use Compute Shader to generate indices (OK).
- Otherwise, use CPU to generate indices (slowest).

Also Disable OcclusionQueriesTest.ClearNotCounted failure on NVIDIA.

Bug: angleproject:2634
Bug: angleproject:5307
Change-Id: Ia5529825807a964f5fcb2a4af8844778896cd42a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2435859
Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2020-11-04 10:13:16 +00:00
Le Hoang Quyen
8a50b42b01 Metal: Convert index & vertex format on GPU when possible.
- When converting vertex buffer:
  - if there is no render pass active, use compute shader to convert.
  - if there is a render pass active and device supports explicit memory
    barrier then convert the buffer in vertex shader with direct buffer
    write and insert a memory barrier.
  - if there is a render pass active and device doesn't support explicit
    memory barrier then convert the buffer on CPU.

Bug: angleproject:2634
Change-Id: I5346e3a2adb855f40e46a3912d9db404a4482e0f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2434025
Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
2020-10-31 22:03:13 +00:00
Shahbaz Youssefi
09932e046b Vulkan: Support emulated pre-rotation in dEQP testing
Similarly to end2end tests, the window dimensions are swapped with
emulated prerotation at 90 and 270 degrees, while maintaining to the
application that dimensions are as requested.

The following new command line argument can be used to select an
emulated prerotation:

    --emulated-pre-rotation=90
    --emulated-pre-rotation=180
    --emulated-pre-rotation=270

For example:

    $ ./angle_deqp_gles2_tests --use-angle=vulkan \
                               --deqp-case=*draw* \
                               --emulated-pre-rotation=270

Additionally, the deqp test expectations can be marked with the
following new tags to add suppressions for failing tests under
prerotation:

    PREROTATION
    PREROTATION90
    PREROTATION180
    PREROTATION270

Bug: angleproject:4901
Change-Id: I7a68c1a1e7da4366cde981469c589d8d900c40c5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2506810
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2020-10-31 04:22:06 +00:00
Shahbaz Youssefi
b0db7cca32 Vulkan: Initial emulated prerotation support
This is currently only supported for end2end tests (those which use
ANGLETestBase, excluding those that use WithNoFixture) and Vulkan.  Use
WithEmulatedPreoration(*_VULKAN(), degree) where degree is either 90,
180 or 270.

With emulated prerotation, the window dimensions are physically swapped
if 90 and 270 degrees, while the width and height is still reported as
requested by the test.  In the Vulkan backend, the width and height are
swapped after getting queried from the surface, and prerotation is
assumed.

Bug: angleproject:4901
Change-Id: I294436be4c7015d2a63463c4d61de7b67f38c95d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2495544
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2020-10-27 09:23:14 +00:00
Shahbaz Youssefi
fdb7874db4 Gracefully fail end2end tests if no window support
EGL_WINDOW_BIT is now specifically requested for tests that open a
window (those that aren't WithNoFixture).  This makes sure pbuffer-only
configs are not selected for the window.

Additionally, a few WithNoFixture tests are made more robust in the
presence of no-window configs.

In the context of crbug.com/1034840, this means that a subset of end2end
tests would be able to run in a remote desktop environment.  Tested on
Linux/X11 by turning a subset of configs PBUFFER-only.

Bug: chromium:1034840
Change-Id: I09fd149d43d3b865856fe6b9491c5f333f4a2efc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2378922
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: back sept 10 - Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2020-09-02 15:33:45 +00:00