Load the Vulkan loader ourselves and give vkGetInstanceProcAddr to
volk. This allows us to always prefer loading from the current module
directory instead of using the platform-specific ordering.
Refactor angle::Library loading to use ModuleDir instead of
ApplicationDir.
CL originally authored by Geoff Lang.
Bug: chromium:1219969
Change-Id: I21d1926e90fd66e1c23cea7323991ae55f3d22d4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3035444
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This change is meant to merge the metal backend changes from Apple's
direct-to-Metal backend. Taken from Kyle Piddington's CL:
https://chromium-review.googlesource.com/c/angle/angle/+/2857366/
The goal of this CL is to merge the metal backend code in a state
that compiles, but not to switch the Metal backend over to using
the direct-to-metal backend yet.
Bug: angleproject:5505
Bug: angleproject:6127
Change-Id: If6783e06e0086b3a1dd25c6f53caca5cfc96cb86
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2950067
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
This fixes a bug in SystemInfo_vulkan where we were using the
System search path for the Vulkan loader when we prefer using the
custom ANGLE loader.
Re-land fixes a bug where we would try to load the custom
libVulkan on Android and other platforms where we should be using
the system version.
Bug: chromium:1219969
Change-Id: I34b592fb87cbddfd02c837a17942cac54c85d9d1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3007265
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This reverts commit 18e99f4a2b.
Reason for revert: breaks Mac, e.g.
https://ci.chromium.org/ui/p/chromium/builders/ci/mac-arm64-rel-tests/2197/overview
Original change's description:
> Add SearchType to OpenSharedLibraryWithExtension.
>
> This fixes a bug in SystemInfo_vulkan where we were using the
> System search path for the Vulkan loader when we prefer using the
> custom ANGLE loader.
>
> Bug: chromium:1219969
> Change-Id: Iedf0fd11fe9ed8cc020b445ea9e12a7936937361
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2988791
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Bug: chromium:1219969, chromium:1225040, chromium:1226675
Change-Id: I7a7e329181b69b0fb546e5245d8842723077126f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3006320
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
This fixes a bug in SystemInfo_vulkan where we were using the
System search path for the Vulkan loader when we prefer using the
custom ANGLE loader.
Bug: chromium:1219969
Change-Id: Iedf0fd11fe9ed8cc020b445ea9e12a7936937361
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2988791
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This will allow us to load ANGLE libraries without needing
LD_LIBRARY_PATH.
Bug: None
Change-Id: Iaa389b3a42fed37216e175bee080a9f8fde3eb0b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2884418
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
A prior refactor had broken the method we used to cause test steps to
fail on API errors. This CL restores the path. We detected this when
analyzing a particular GLES trace that contained invalid GLES calls.
Bug: angleproject:5788
Change-Id: I26940e49cf73ce6050ea6ee274d5c5748835a167
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2782008
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
With this change, the ANGLE translator immediately compiles the
generated GLSL into SPIR-V with glslang and discards the source. This
is in preparation for generating SPIR-V directly, by making the frontend
and backend already able to digest it.
This change also allows the expensive glslang calls to be parallelized,
improving the following perf test by about 20%:
LinkProgramBenchmark.Run/vulkan_compile_and_link_multi_thread
Previously, the test was run as such in the Vulkan backend:
Main Thread 1 Thread 2
Compile1 --->
Compile2 --------------------->
Translator Translator
<---
<---------------------
Link
glslang
for
shader1
glslang
for
shader2
Done
With this change, it is run as such:
Main Thread 1 Thread 2
Compile1 --->
Compile2 --------------------->
Translator Translator
glslang glslang
<---
<---------------------
Link
Done
glslang_wrapper_utils no longer interacts with glslang! A rename will
follow.
Bug: angleproject:4889
Change-Id: If4303e8ba0ba43b1a2f47f8c0a9133d0bee1a19a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2721195
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
This will allow the isolation scripts to correctly package the trace
data GZ file.
Bug: angleproject:5040
Change-Id: I9e0229701eb10ea5e46b79304c8da47a42ba552d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2408718
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
This allows us to use the sample for benchmarking.
Bug: angleproject:5040
Change-Id: I9177d04b270a0588dc5f261918eb27b0bc734256
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2408716
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
This moves the debug callback code into a common location. For ease of
access it's in shader_utils since that file has access to the GL API.
Bug: angleproject:5040
Change-Id: Iab9de47c2d520a5618ea6825852f8afa63565c8a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2408715
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
New header required to compile. It mirrors one used by
our perf tests, but this one will remain basic.
Test: Replay a new trace
Bug: angleproject:4845
Change-Id: If42bba6a91bf37ed063b5828b4cbc80373108b2f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2327292
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
frame_capture_utils.h is only used in tests so changing the name to be
frame_capture_test_utils.h is more appropriate. Also
frame_capture_utils.h will now be a file in libANGLE_with_capture
library where serialization code is stored.
Bug: angleproject:4806
Change-Id: I7482693a75b2d0edda7e84ae9b777fd3f46f1855
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2273917
Commit-Queue: Manh Nguyen <nguyenmh@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
We shouldn't need to query function pointers now that we're using
a custom loader.
Bug: angleproject:4729
Change-Id: I50f50545a2f29e16ab675afe0155700332c8f670
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2241618
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Adds support for Linux and Android native EGL testing.
This can be useful for doing performance comparisons of ANGLE vs
a native GL driver. Only enabled for the trace perf tests due to
limitations in the test harness.
Bug: angleproject:4596
Change-Id: Iba6d3ccd7c1275cf095893fab824a0ea33dc3a79
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2116254
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
This CL adds infrastructure for tracking whether resources need to be
reset when looping back to the beginning of the frame sequence.
A new function is generated on the last frame: ResetContext*Replay().
It will contain calls to gen, delete, and restore contents of
resources. This CL only supports Buffer resets.
Bug: b/152512564
Bug: angleproject:3662
Bug: angleproject:4599
Change-Id: I46672dd70dcb997967e3cc0897308144f2582e21
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2168121
Commit-Queue: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
- Built-in variable gl_ClipDistance has been added to compiler.
- Desktop GL: gl_ClipDistance is supported since GL 3.0. Enable/Disable
each gl_ClipDistances[i] works out of the box via glEnable().
- Vulkan/Metal: Use uniform variable to control writing to each
gl_ClipDistance. One bit flag controls one element in the gl_ClipDistance
array. The writing to the disabled element in vertex shader will be
ignored, and turned into zero assignment instead.
- Direct3D/Mobile GL: Not implemented yet.
- Added ClipDistanceTest to gl_tests and compiler unittests.
- GL_APPLE_clip_distance is a subset of GL_EXT_clip_cull_distance, so
GL_EXT_clip_cull_distance could be implemented in future if needed.
Bug: angleproject:4452
Change-Id: I571ac8b56826989808a680226a04bec4cf59988e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2084324
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
* Move DecompressBinaryData to a shared helper
* Start using it in CaptureReplay sample
* Error out if decompress callback isn't set correctly
Test: AngryBirds and CandyCrush captures replay on desktop
Test: angle_perftests --gtest_filter="*Trace*"
Bug: angleproject:4484
Change-Id: I0432004fdb0cfb0fd61f9a66f792591c9aa40d9b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2118790
Commit-Queue: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
This source set target lets other targets import the test utils without
needing to export them. They get built into angle_util. They also get
compiled into the various tests and samples. The change also fixes
export issues.
Moves some of the GN logic into the util/ subfolder.
Bug: angleproject:3162
Bug: chromium:1030192
Change-Id: If99d201092ad8541c0de60b3bd893ac9b5875270
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1968259
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Clarifies that angle_util is only used in tests and samples.
Bug: angleproject:3162
Change-Id: I9a578cf7a9a09b2c3fd4683155824ed2e72f68cc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1964934
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Adds --deqp-egl-display-type=angle-metal for running the deqp tests
on Mac. Note: does not add any test suppressions for metal.
Bug: angleproject:2634
Change-Id: I8f8d3a83cf93a5b930b05af9f0075a9ce435823a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1954612
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Renaming "all" targets to reduce duplication. Also add libGLESv1_CM to
"angle". And remove "shader_translator" since we already had
"angle_shader_translator".
An attempt to work around "invalid COFF sections" error that is popping
up on the MSVC try bots.
Bug: None
Change-Id: I105aa5e59f67173643a3a2071b2aff345b5a6135
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1947457
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This CL gets capture/replay working on Android again.
* Updates where Android frame captures are written
* Uses debug system properties to prime Android environment variables
* Adds a configurable target Context to the capture_replay sample
* Updates capture/replay documentation for Android
Bug: angleproject:4036
Test: Captured TRex on Android, replayed on Linux
Change-Id: I94b4f6dc77468cd179b9d884b4dcd4afa56bd28c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1928056
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
This is a sample program that can be used to compile a shader and
inspect the intermediate tree or the output from the shader translator.
This change adds support for the recently added desktop GLSL inputs as
well as the ability to produce Vulkan GLSL output.
Bug: angleproject:3453
Change-Id: I1f378e8d84b74636d6a47ce1aaff5f1f55f5bbb3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1784881
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Removes an unreferenced function. Also adds the ability for samples to
respond to key up and down events. Only implemented on Windows.
Bug: angleproject:2830
Change-Id: I44c9f93f0ad07b92923ffc0efa580f97d9b98693
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1908448
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Includes much more state serialization. Notably Vertex Arrays were
missing as well as multiple GL render states. Also fixes many
serialization bugs. For example, we would not be using the correct
client array and pack/unpack state in the mid-execution capture. Also
depth/stencil attachments were missing from the capture.
Also fixes the replay sample to work with non-zero starting frames.
With these fixes we can run mid-execution replay of the T-Rex demo.
Bug: angleproject:3611
Change-Id: I6945eb9b30a5137be996956b43f074a0a750b333
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1895112
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
This index file lets us very easily write a generic capture sample.
Previously the dev had to maintain a list of multiple sources files.
Potentially hundreds. By writing the source file list to an index file
we can load this easily in GN as a variable and plug that into the
sources.
Also updates docs.
Bug: angleproject:3611
Change-Id: I69ba961e271d6d13d06ae01c89a0605a6fd725ec
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1902189
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Mid-execution replay starts the replay from a specific start frame
instead of frame 0. Integration tests will then run between the start
and end frames. This lets us make much smaller reproduction cases from
large benchmarks or applications.
We implement mid-execution replay via a cpp "Setup" function. The
replay test will run the setup function before the starting frame. Test
execution proceeds normally after setup.
Currently we do not implement mid-execution capture. We run capture on
all frames. Including frames before the start frame. We do this to
intercept compiled shaders and programs for easier caching. This could
be changed in the future to also start capture mid-execution. Mid-
execution capture might require using ProgramBinary calls to capture
shader and program data.
Many captures are unimplemented. Several comments indicate missing
functionality. There's a lot we can add as we explore replaying more
complex applications and higher GL versions. We will also need some
kind of state reset functionality so we can run the replay in a loop.
Bug: angleproject:3611
Change-Id: I51841fc1a64e3622c34e49c85ed8919a9a7c0b20
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1689329
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
This change refactors the GLenum utils into a non-autogenerated and an
autogenerated portion. That makes it easier to modify the non-auto-
generated bits to properly output GLenums even when the gl.xml data
isn't totally correct. For instance, the "GetPName" group was missing
a bunch of queries. Instead of trying to fix the GL we can simply fall
back to querying the "Default" group when we return invalid enum.
Also corrects a missing "0x" on hex output.
Also allows the capture/replay sample to specify the correct binary
data directory when testing a replay.
Bug: angleproject:3611
Change-Id: I8e4c690b2850bb157a8cde8b057b20603e4b177d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1891008
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This file will be used with multi-frame captures to share common code.
Common code is global state, resource maps, and a list of frame replay
functions. This should make converting a CPP replay into a functional
test quite a bit simpler. The replay files will now be something like:
angle_capture_context1.cpp
angle_capture_context1.h
angle_capture_context1_frame000.cpp
angle_capture_context1_frame001.cpp
... etc
Also adds a template for adding a capture/replay sample. Instructions
are located in samples/BUILD.gn and docs in doc/CaptureAndReplay.md.
Bug: angleproject:3611
Change-Id: I437b338fd84689d670a7d9e3e219d9334de25fd8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869543
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tobin Ehlis <tobine@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
This removes a GN naming conflict between util/system_utils and
common/system_utils. This conflict was preventing us from adding
unit tests to utils' version of system_utils. Since these functions are
only useful to tests and samples rename them test_utils for simplicity.
Will enable further development of ANGLE's standalone testing harness.
Bug: angleproject:3162
Change-Id: I9e34fb69f96c5de6dc2453fce4148a0f285e15ed
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1825268
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
The following structs are being refactored and moved into the parent
struct ShaderVariable:
VariableWithLocation
Uniform
Attribute
OutputVariable
InterfaceBlockField
Varying
Bug: angleproject:3899
Test: CQ
Change-Id: I389eb3ab4ed44a360e09fca75ecc78d64a277f83
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1785877
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Commit-Queue: Tim Van Patten <timvp@google.com>
A debug overlay system for the Vulkan backend designed with efficiency
and runtime configurability in mind. Overlay widgets are of two
fundamental types:
- Text widgets: A single line of text with small, medium or large font.
- Graph widgets: A bar graph of data.
Built on these, various overlay widget types are defined that gather
statistics. Five such types are defined with one widget per type as
example:
- Count: A widget that counts something. VulkanValidationMessageCount
is an overlay widget of this type that shows the number of validation
messages received from the validation layers.
- Text: A generic text. VulkanLastValidationMessage is an overlay
widget of this type that shows the last validation message.
- PerSecond: A value that gets reset every second automatically. FPS is
an overlay widget of this type that simply gets incremented on every
swap().
- RunningGraph: A graph of last N values. VulkanCommandGraphSize is an
overlay of this type. On every vkQueueSubmit, the number of nodes in
the command graph is accumulated. On every present(), the value is
taken as the number of nodes for the whole duration of the frame.
- RunningHistogram: A histogram of last N values. Input values are in
the [0, 1] range and they are ranked to N buckets for histogram
calculation. VulkanSecondaryCommandBufferPoolWaste is an overlay
widget of this type. On vkQueueSubmit, the memory waste from command
buffer pool allocations is recorded in the histogram.
Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py
processes to create an array of bits, which is processed at runtime to
create the actual font image (an image with 3 layers).
The overlay widget layout is defined in overlay_widgets.json which
gen_overlay_widgets.py processes to generate an array of widgetss, each
of its respective type, and sets their properties, such as color and
bounding box. The json file allows widgets to align against other
widgets as well as against the framebuffer edges.
Two compute shaders are implemented to efficiently render the UI:
- OverlayCull: This shader creates a bitset of Text and Graph widgets
whose bounding boxes intersect a corresponding subgroup processed by
OverlayDraw. This is done only when the enabled overlay widgets are
changed (a feature that is not yet implemented) or the surface is
resized.
- OverlayDraw: Using the bitsets generated by OverlayCull, values that
are uniform for each workgroup (set to be equal to hardware subgroup
size), this shader loops over enabled widgets that can possibly
intersect the pixel being processed and renders and blends in texts
and graphs. This is done once per frame on present().
Currently, to enable overlay widgets an environment variable is used.
For example:
$ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste
$ ./hello_triangle --use-angle=vulkan
Possible future work:
- On Android, add settings in developer options and enable widgets based
on those.
- Spawn a small server in ANGLE and write an application that sends
enable/disable commands remotely.
- Implement overlay for other backends.
Bug: angleproject:3757
Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>