Commit Graph

324 Commits

Author SHA1 Message Date
Roman Lavrov
5215293366 Add trace_interface: functions and callbacks for traces
Defines the interface between the test suite
(or an other TraceLibrary class user) and trace libraries.

TraceFunctions defines entry points for calls suite->trace, such as
SetupReplay() or SetBinaryDataDir().

TraceCallbacks defines entry points for calls trace->suite, for example
for loading .angledata.gz files.

These are set up via the exported SetupEntryPoints() call. Functions
like SetupReplay etc no longer need to be exported from the trace
library.

TraceInfo (parsed representation of the trace json) is moved to
trace_interface as is. This is convenient for further changes to the
fixture that will allow to easily move some of the captured parameters
to json.

This also moves Decompress functionality (and memory ownership) to test
suite entirely, which avoids Decompress/Delete callbacks - the trace
just calls LoadBinaryData via TraceCallbacks and TraceLibrary releases
the memory either on FinishReplay or in its destructor.
This should also take care of the memory leak described in
https://crrev.com/c/3858185

Bug: b/286072760
Change-Id: Ibc6f6f64156ad805b1917c8fc41a3b0d2c0d6375
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4594445
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2023-06-08 20:06:15 +00:00
Shahbaz Youssefi
02e7f96759 Translator: Remove the "variables" option
Variable collection is invariably enabled by the front-end as well as
other major users of ANGLE such as Firefox.  All translator backends
except GLSL force-enable variable collection either way.

This change removes this compile option and enables variable collection
unconditionally.

The flag itself remains in ShCompileOptions until references to it are
removed from Chromium.

Bug: chromium:1447314
Change-Id: I4d3b30c1bfbd345c5ad269abc62c0a6a59de2f56
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4568524
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2023-05-26 20:33:26 +00:00
Jose Dapena Paz
ee9a7df0b3 IWYU: usage of size_t requires include in texture_utils
Bug: chromium:957519
Change-Id: I69a1455c0c1570cffa5964b8a5e856643961e603
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4352889
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-03-20 14:12:17 +00:00
Shahbaz Youssefi
78e28cb8f7 Vulkan: Remove glslang fallback
ANGLE's SPIR-V generator is battle tested by now.

Bug: angleproject:6210
Change-Id: I2ed88642e3ede435e3f906fbd701133be6873fb7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4002868
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
2022-11-08 14:42:58 +00:00
Shahbaz Youssefi
5b2181969a Metal: Remove compilation through SPIR-V
Direct metal generation is stable.

Bug: angleproject:6081
Change-Id: If9e76f61ad38f2fc9963f0181dfd03c99ffa3e2b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4003675
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
2022-11-07 21:53:21 +00:00
Mohan Maiya
3245e55530 Expand support in angle_shader_translator
1. Add GLES3.2 support
2. Add support for tessellation control and eveluation shaders
3. Enable "variables" compile option when generating SPIRV

Bug: angleproject:7773
Change-Id: I372343bf70edf80d40a410d70ccb63334f2b1450
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3967819
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-10-21 02:19:31 +00:00
Jamie Madill
e495e7fdd0 Redo perf and trace test parameters.
- Moves common argument parsing code into test_util.
- Changes the perf test arg parsing to use the common functions.
- Adds new --use-angle and --use-gl parameters to the trace tests.
- Also adds new --offscreen and --vsync parameters to the traces.
- Removes the now unneeded --enable-all-trace-tests argument.
- Both --arg=value and --arg value work in test suites now.

Now, instead of using --enable-all-trace-tests you can specify the
backend with --use-angle=swiftshader, --offscreen, or combinations
of those parameters. The test names are the same as they were
before, but only the configured tests will run in a session. We
could opt to simplify the test names in later CLs if we want to
simplify the test running. Ideally we'd keep the perf reporting
the same because then we'd keep the time series the same on the
test infra.

This also allows us to split up the trace tests into separate
targets on the bots, which will better allow us to control the
workloads and sampling of the tests. For example:

- angle_perftests becomes
  - angle_perftests (microbenchmarks)
  - angle_trace_perf_vulkan_tests (traces with vulkan back-end)
  - angle_trace_perf_native_tests (traces with system GL)

Bug: angleproject:7755
Change-Id: I537168f3a6de96425dfda05ed98220eff9b19b76
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3956937
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2022-10-19 16:50:01 +00:00
Roman Lavrov
4b33633a7c Capture/Replay: Delete binary data in FinishReplay via callback
Delete callback fixes b/179188489 as delete[] will get called from the
same module where allocation happens. When decompress/delete callbacks
not provided, new[] and delete[] are called from the fixture.

AFAICT, gBinaryData == nullptr every time, even with a single test and
--gtest_repeat=N, so we never delete the uncompressed data. When
running multiple tests locally, I see RES usage grow significantly
on Linux which this CL fixes. I don't think this matters for bot runs as
we run tests one by one there.

Bug: b/179188489
Change-Id: Iee3bccb9d6d72c315c4358b70ec9c3c0ac963258
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3858185
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
2022-08-29 18:45:47 +00:00
Shahbaz Youssefi
6f80f0f037 Translator: Clean up the compile flag passing interface
Historically, compile flags were sent to the translator as a bitmask.
Recently, we were getting close to running out of bits.  Additionally,
direct-to-metal work had started to introduce constants to be passed to
the translator, which were misplaced in ShBuiltInResources and Caps.
Recent work on Pixel Local Storage adds even more constants, aggravating
the situation.

In this change, the interface to passing compile flags is reworked.  A
struct is passed (instead of a bitmask) that has one bit for each flag.
This can be indefinitely extended.  Additionally, the constants needed
by metal and PLS are also placed in this struct.  In turn, the backends
can set these options directly, and don't have to hack them into Caps to
further get hacked into ShBuiltInResources.

Bug: angleproject:7559
Change-Id: If93f1e1b8818ad3a0ac708ab04ab93b4b397d114
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3812562
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
2022-08-09 00:04:02 +00:00
Eddie Hatfield
c54ed79053 Get desktop GL conformance tests to build
The target for these tests is angle_deqp_gl_tests.

Bug: angleproject:7533
Change-Id: I290822671d99da020f9a6a1f02bee43987644bf9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3766435
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Eddie Hatfield <eddiehatfield@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2022-08-03 22:17:47 +00:00
Shahbaz Youssefi
5a65a2b1c6 Fix samples' arguments to SampleApplication
Two new parameters were added in
https://chromium-review.googlesource.com/c/angle/angle/+/3664916 with
default values, but not all samples were updated to accomodate them.  As
a result, many samples passed in the major version for client type and
thus couldn't run.

This change introduces an enum class for the client type + version to
make sure such a mistake is impossible.

Bug: angleproject:7360
Change-Id: I450edee612d08a7b67530b61615f63268fefb200
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3748413
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Lingfeng Yang <lfy@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-07-06 16:10:52 +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
Brian Osman
31f8413860 Add option for Metal output to angle_shader_translator
Bug: angleproject:7254
Change-Id: Idbccae3aaf11043940c53f4239e402aaa8b240b1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3615078
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-04-29 19:00:49 +00:00
Roman Lavrov
5d17caef2e Migrate capture_replay sample to trace_fixture
Bug: angleproject:5911
Change-Id: I6987e42f39a796e5888242a0d0f0dc05c99c703d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3537535
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
2022-03-25 16:01:16 +00:00
Lubosz Sarnecki
1bfdc98109 TorusBufferStorage: Regenerate buffer storage every second.
To test regeneration in FrameCapture, the torus buffer storage example
now reinitializes its coherent buffer storage every second.

Define attrib pointers every draw.

Bug: angleproject:4599
Bug: angleproject:5857
Bug: angleproject:6774
Change-Id: I32984535d9810478b6906217102ac9c3e83464b2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3406756
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
2022-03-01 11:24:08 +00:00
Jamie Madill
4b45831b64 Add a multi-context sample.
This will be useful for multi-context trace testing.

Bug: angleproject:5133
Change-Id: Ib4b6aac3069bc88939c1f5c409b2e7ef95a1a539
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3313598
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2021-12-08 15:56:18 +00:00
Lingfeng Yang
e9f9fa17da Add cpu time measurement to perf tests
Bug: angleproject:6667
Change-Id: I16570a7b51d363dd1c0f35789b985520cb76d488
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3270601
Commit-Queue: Lingfeng Yang <lfy@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
2021-11-17 17:13:00 +00:00
Lubosz Sarnecki
da02c6d9a5 samples: Improve TorusLighting samples.
Adjust the code style of the ES1 and ES2 TorusLighting samples to match
the one of TorusBufferStorage.

Use the step function override to calculate rotation and move state
changes that are required only once out of the draw function.

Bug: angleproject:5751
Change-Id: Ie663c7ecfd306504b6f9e9390ec24b251194f970
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3178904
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
2021-09-23 16:52:49 +00:00
Lubosz Sarnecki
3369f72057 samples: Add torus bufferstorage ES3 sample.
Adds a sample that uses GL_EXT_buffer_storage and the
GL_MAP_COHERENT_BIT_EXT to update colors.

Expose IsGLExtensionEnabled in SampleApplication.

Bug: angleproject:5857
Change-Id: I1ba2962cda939da527a17c49a3ef430a69486c52
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3168628
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
2021-09-23 16:44:59 +00:00
Jamie Madill
2f3e4db838 Capture/Replay: Serialize trace metadata to a JSON file.
This will allow us to remove more code auto-generation for the trace
tests. The trace info now can be loaded directly from JSON instead of
from the autogenerated information.

Bug: angleproject:5133
Change-Id: I04e22b9279b19282df274bc8defcd363d0449111
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3140218
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-09-08 17:13:59 +00:00
Shahbaz Youssefi
1ce7839728 Remove support for WEBGL_debug_shader_precision
This extension was rejected, and the implementation was hacky.  This
clean up is part of an ongoing work to improve precision handling.

Bug: angleproject:6059
Change-Id: If08581ec6f19cf1698ffa3dd6d248dc5e68a1d31
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3064303
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2021-08-04 20:07:30 +00:00
Jamie Madill
48da1c3594 Vulkan: Prefer the local vulkan loader over the system one.
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>
2021-07-16 18:56:40 +00:00
Kyle Piddington
d33a22228e Upstream Apple's direct-to-Metal backend: compile libANGLE.
This change is meant to merge the metal backend changes from Apple's
direct-to-Metal backend. Taken from Kyle Piddington's CL:
https://chromium-review.googlesource.com/c/angle/angle/+/2857366/
The goal of this CL is to merge the metal backend code in a state
that compiles, but not to switch the Metal backend over to using
the direct-to-metal backend yet.

Bug: angleproject:5505
Bug: angleproject:6127
Change-Id: If6783e06e0086b3a1dd25c6f53caca5cfc96cb86
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2950067
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
2021-07-12 14:54:45 +00:00
Jamie Madill
51937ab386 Re-land "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.

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>
2021-07-06 17:48:26 +00:00
Yuly Novikov
f8d5d5ed62 Revert "Add SearchType to OpenSharedLibraryWithExtension."
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>
2021-07-05 23:11:37 +00:00
Jamie Madill
18e99f4a2b 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>
2021-06-28 13:39:03 +00:00
Jamie Madill
caf9742dfe samples: Use rpath on Linux/ChromeOS.
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>
2021-05-10 21:48:11 +00:00
Lubosz Sarnecki
d1da88ee27 samples: Add TorusLighting sample.
Add a vertex buffer example for GLES1 and 2.

Bug: angleproject:5751
Change-Id: If039451ff85dfffd8915497e9aaaab6e4ff71181
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2859827
Commit-Queue: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-05-10 04:10:48 +00:00
Jamie Madill
68f06888a0 Perf Tests: Trigger test failure on API errors.
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>
2021-04-07 17:13:52 +00:00
Shahbaz Youssefi
776c60150b Vulkan: Call glslang at compile time
With this change, the ANGLE translator immediately compiles the
generated GLSL into SPIR-V with glslang and discards the source.  This
is in preparation for generating SPIR-V directly, by making the frontend
and backend already able to digest it.

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

    LinkProgramBenchmark.Run/vulkan_compile_and_link_multi_thread

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

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

    glslang
     for
      shader1

    glslang
     for
      shader2

    Done

With this change, it is run as such:

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

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

Bug: angleproject:4889
Change-Id: If4303e8ba0ba43b1a2f47f8c0a9133d0bee1a19a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2721195
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-03-25 19:53:52 +00:00
Shahbaz Youssefi
2f737c2509 Translator: Rename GLSL to SPIR-V in Vulkan and Metal output
Preparation for actual SPIR-V output instead of GLSL.

Bug: angleproject:4889
Change-Id: Ic279b23d3a817bd5dca66a844905378207afdbac
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2721194
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
2021-03-04 17:47:51 +00:00
Shahbaz Youssefi
bb3adfa428 Rename ShaderVariable::structName to structOrBlockName
Bug: angleproject:3580
Change-Id: Ic53a5267972f153dad2e20948e493e9767a45d16
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2568247
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-01-20 21:39:29 +00:00
Mohan Maiya
8a401051a8 Vulkan: Support OES_sample_variables extension
Enable OES_sample_variables extension on Vulkan backend.
Add support for built-in variables, uniform state and constants
- gl_SampleId, gl_SamplePosition, gl_SampleMask,
  gl_SampleMaskIn
- gl_NumSamples
- gl_MaxSamples

Bug: angleproject:3588
Tests: dEQP-GLES31.functional.shaders.sample_variables.*
       KHR-GLES31.core.sample_variables.*
Change-Id: Idf37c7b4ccb0331dbda7acd6389ff4e1022ba959
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2477907
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2020-11-19 17:47:55 +00:00
Jamie Madill
eba501c8a4 Samples: Move frame counter to common location.
Bug: angleproject:5040
Change-Id: I64f762b4eb5734f0768054a330a36e20ff9ba93e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2408713
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2020-09-14 20:42:54 +00:00
Jamie Madill
e82f282289 Correctly forward 'data' for capture_replay sample.
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>
2020-09-14 16:14:54 +00:00
Jamie Madill
7402b3f65f Capture/Replay: Disable swap limit in sample.
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>
2020-09-14 16:01:14 +00:00
Jamie Madill
ba7f8913da Samples: Enable Debug callback.
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>
2020-09-14 15:31:13 +00:00
Jamie Madill
5c56f22864 Enable two override suggestion warnings.
-Wsuggest-destructor-override and -Wsuggest-override.

Bug: skia:7647
Change-Id: Iaac1baa8f34fdf210baf2fdbe811a582b3ac2d14
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2376717
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2020-08-28 19:47:05 +00:00
Cody Northrop
be958a1792 Samples: Fix Capture/Replay release build
Hadn't been tested since previous fixes.

Test: Release build of Capture/Replay sample
Bug: angleproject:4048
Change-Id: I7fbb8b08edc2596e19469ecbacb02dc6f0e66ca1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2342275
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
2020-08-07 23:27:08 +00:00
Cody Northrop
fd60950e59 Samples: Fix Capture/Replay sample
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>
2020-07-30 05:35:32 +00:00
Manh Nguyen
bdf91e5fb9 Refactor frame_capture_utils.h to frame_capture_test_utils.h
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>
2020-06-29 19:58:59 +00:00
Manh Nguyen
9dee8e3f66 Automate testing of capture_replay
automation script will:
1. compile all tests in angle_end2end with framecapture enabled
2. run each test with frame capture
3. compile CaptureReplayTest with cpp trace files
4. Run CaptureReplayTest

Test: run_tests_with_framecapture.py
Bug: angleproject:4749
Change-Id: Ieb21c6137653632d73beedea48712e46fc15a0f3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2246321
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Manh Nguyen <nguyenmh@google.com>
2020-06-19 18:32:58 +00:00
Jamie Madill
e95e2c3c48 Add timer and frame counter to SimpleTexture2D.
Can be useful for perf testing.

Bug: angleproject:4729
Change-Id: I26c5fd53a34f4ed21d565e020b7c2058ff7ee6db
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2241621
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2020-06-15 15:20:37 +00:00
Jamie Madill
11e26fa006 Allow running Samples against native GL.
Useful for perf testing/comparison.

Bug: angleproject:4729
Change-Id: Ic46424570dcef0a30d506962f546910ba7440595
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2241620
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2020-06-12 17:59:03 +00:00
Jamie Madill
37e6ede655 Minor cleanup to PostSubBuffer sample.
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>
2020-06-11 17:53:07 +00:00
Manh Nguyen
550bc06999 Fill in missing GL methods for MemorySizeTest
Implements captures of glGetRenderbufferParameteriv,
glGetBufferParameteriv, and glgetAttachedShader. Fix FrameCapture and
CaptureReplay sample so that it has single-frame capture and replay
capabilities.

Bug: angleproject:4681
Bug: angleproject:4682
Change-Id: I12c25a3857a88f2f40b3c3e8624da1379a950339
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2229069
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Manh Nguyen <nguyenmh@google.com>
2020-06-05 16:25:59 +00:00
Mohan Maiya
cbbfde6c06 Excplicitly include <string> header in tga_utils.h
Some compiler versions are unable to resolve
std::string without including <string> header.

Bug: angleproject:4651
Change-Id: Ie2b9d843b55dc46278ed5571d82fa9c413f6b3c9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2213664
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2020-05-25 16:36:49 +00:00
Jamie Madill
9724aa3d56 Suppress optimization in trace/replay sample.
Bug: angleproject:4048 
Change-Id: I44154a53698fb2447682cbbbe2f1982895677102
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2202198
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2020-05-14 20:42:35 +00:00
Jamie Madill
930b26417d Allow tests to run on native EGL.
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>
2020-05-05 21:45:46 +00:00
Cody Northrop
06ce17e039 Capture/Replay: Reset buffers on replay loop
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>
2020-05-05 21:07:06 +00:00