Commit Graph

8233 Commits

Author SHA1 Message Date
Austin Eng 6a7bba54fa Add basic Dawn microbenchmarks using Google benchmark
The initial test tests bind group layout creation of
different sizes, cache / no-cache hit, with and without
multiple threads.

Change-Id: Ic9ed6c6f1c298d35cd1358c7ff492027c83649a7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127346
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-17 18:11:51 +00:00
Ben Clayton 559e5a2cde tint/transform: Fix ICE in HLSL backend
When referencing a pointer parameter with a 'let', but not using that
let.

Also fix a bunch of places where we used the old names for the pointer
transforms.

Bug: chromium:1433499

Change-Id: I8decefeacd6150bd6f7637f80e62b9cb62936235
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127540
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-04-17 14:24:58 +00:00
Le Hoang Quyen 7532f6665e Disable OOM tests when TSAN is enabled.
Bug: dawn:1725
Change-Id: I83ddaaf0d98d2831f95abbfbf5adfad268ebdba5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127380
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
2023-04-14 22:38:28 +00:00
Peng Huang f5966b09e1 d3d11: enable d3d11 if dawn is not build with chromium
This CL enable build d3d11 by default, if dawn is not build with
chromium. d3d11 backend is not full implemented yet, so no tests
will run against d3d11 backend.

Bug: dawn:1705
Change-Id: Id689ab5168511af0f75f0b3537f246713de5ca45
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127260
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
2023-04-14 02:05:17 +00:00
Peng Huang 34d52ffa4c Revert "d3d11: add d3d11 backend in end2end tests"
This reverts commit 3fcf96dd8c.

Reason for revert: want to enable end2end test piece by piece on bots for d3d11

Original change's description:
> d3d11: add d3d11 backend in end2end tests
>
> Right now, many tests are not passed becasue unimplemented
> features in d3d11 backend. HoweverD3D11 backend is disabled on
> bots by default, so this CL will not break out bots.
>
> Bug: dawn:1705
> Change-Id: I57321b86a404bc245b71c467479fdee0464dee9b
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126260
> Commit-Queue: Peng Huang <penghuang@chromium.org>
> Reviewed-by: Austin Eng <enga@chromium.org>
> Kokoro: Kokoro <noreply+kokoro@google.com>

Bug: dawn:1705
Change-Id: I95a1cc9a0962b01a6b31ea32b6129f109f4b3e42
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127240
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
2023-04-13 22:45:28 +00:00
dan sinclair c4cc6ec038 Remove the demangler.
The demangler is no longer used by the Tint executable, and nothing else
calls it, so delete it.

Change-Id: Ic47238e4a6126e5daacd81dfc6f5986524b648ba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127280
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-04-13 21:17:12 +00:00
Brian Sheedy c0398e4174 Skip logging on Win official builds
Skips logging in sandboxed processes on Windows
official builds since the file handles will not
be set properly, causing crashes when we try to
write to stdout/stderr.

Bug: chromium:1429665
Change-Id: Ie70d0cc2e096bd22490dc3538467752b448f213b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127205
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Brian Sheedy <bsheedy@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@google.com>
2023-04-13 20:41:23 +00:00
Le Hoang Quyen c405dddf5e Add missing locks to indirect draw validation & timestamp query.
Also added new multithreaded tests to verify them.

Bug: dawn:1662
Change-Id: I58ebe265edf58e0c4eb5d9337d3441a6bb972ed4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126781
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-13 15:59:15 +00:00
Peng Huang b08d87c06e d3d11: implement SwapChain
This CL also abstracts common code from d3d12::SwapChain to
d3d::SwapChain base class for sharing.

Bug: dawn:1705
Change-Id: I7b6ac8770b3c517fe552061de3c5589174ba5814
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126665
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Peng Huang <penghuang@chromium.org>
2023-04-13 15:36:52 +00:00
dan sinclair 2200823afd Allow building SPIRV_WRITER without READER
Currently the SPIR-V headers are only included when building the
SPIRV_READER. This means the build breaks if the SPIRV_WRITER is enabled
but not the reader.

This CL fixes the conditionals to include the SPIR-V header for both the
reader and the writer.

Change-Id: I8690e3e42dbe3071dcaa3ed467d6eac8f62a7bbc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127160
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-04-13 12:59:33 +00:00
Le Hoang Quyen a4866d0d97 D3D12's external image: Add multithread support.
Bug: dawn:1662
Change-Id: Id2d720af4e5e654b5f34aebf485bededc6d247ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122740
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
2023-04-13 08:44:34 +00:00
dan sinclair 541138b11b Cleanup SyntaxTree writer.
This Cl removes the boolean return values from most of the SyntaxTree
writer methods. The diagnostics are used to determine if the generation
was successful. The writer itself just continues until complete.

Change-Id: I87d85e2cbe061306a4598a498ccad4510f62e8c9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/124681
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-04-13 04:18:55 +00:00
dan sinclair 27c7722620 Cleanup WGSL writer.
This Cl removes the boolean return values from most of the WGSL writer
methods. The diagnostics are used to determine if the generation was
successful. The writer itself just continues until complete.

Change-Id: Iff33128c1df286cab799f08dab8c3defc5651d76
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/124680
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-04-13 02:57:27 +00:00
Le Hoang Quyen 3e7a114a6e Add missing lock to APIBeginRender/ComputePass.
Add tests to verify multithreading behaviors of encoding render/compute
passes.

Bug: dawn:1662
Change-Id: I9bc6a0dd5d94b53b59e7e49a4611d4d55cc36e60
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126980
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-12 21:07:31 +00:00
Peng Huang 3dba94c1d4 d3d11: implement RenderPipeline
Bug: dawn:1705
Change-Id: If6de0d18c4da530ba63637aa095ae2f4a957c2f7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126663
Commit-Queue: Peng Huang <penghuang@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2023-04-12 19:05:00 +00:00
dan sinclair 0b3fc055d3 Update samples to process events.
This CL updates the `dawn/sample` programs to call the
`dawn::native::InstanceProcessEvents` which allows things like shader
validation errors to be emitted.

Without this change the errors are never displayed.

Change-Id: I054bb4f7177c5d0c110e97409852143b2bef1e02
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126760
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-04-12 13:19:35 +00:00
dan sinclair 8a435a2a4b Remove `error` from TextGenerator.
This CL removes the `error()` method from the TextGenerator in favour of
using `Diagnostics().str()`.

Change-Id: If20261ac839d11f6d29890cb17f95f2d4df5db2d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126923
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-04-12 11:59:24 +00:00
dan sinclair 585f395e66 Simplify MultiplanarExternalTexture::ShouldRun.
Currently the multiplanar `ShouldRun` function is scanning all objects
looking for an external texture. This CL switches to using the type
manager and attempts to find an `ExternalTexture` type in the system. If
found, then the transform should run.

Change-Id: I28b8fa1835a83f2bff5d804e95bcbaa73d3d2124
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126922
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-04-12 00:44:20 +00:00
Peng Huang c3cc75067e d3d11: implement ComputePipeline
Bug: dawn:1705
Change-Id: I915000a747cc913ed52a423940d20e169b829315
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126664
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-12 00:02:30 +00:00
dan sinclair 04d61c85cd Always run Multiplanar transform.
Currently the multiplanar transform is only run if a global variable is
seen with a `texture_external`. There are cases where a function with a
`texture_external` can exist (the fuzzers do this, the tint command line
can do this as well). These will fail when hitting the backend.

This CL makes the running of multiplanar unconditional. This causes the
logic to process the function parameters to run and the external texture
is removed.

Bug: chromium:1431610
Change-Id: I1793142e803e864c744b38cf843931521e6a449f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126921
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-11 23:02:45 +00:00
dan sinclair d146c8a7a2 Enable multiplanar for SPIRV fuzzers.
This CL updates the common fuzzer code to enable the multiplanar
extension for the SPIR-V backend.

Bug: chromium:1427801
Change-Id: Ie03d3e10f7831ca851aa11c00cbac0aa474ccabb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126920
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-04-11 23:02:38 +00:00
Peng Huang defda09e3c d3d11: implement Texture
Bug: dawn:1705
Change-Id: Iff5e301c04120a86ccf4eba33281233e4d972981
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126662
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2023-04-11 20:42:23 +00:00
Le Hoang Quyen dc626d357d Add missing lock when creating new pipeline during encoding.
This was unsafe when encoding indirect draws with validations on
multiple threads.

Bug: dawn:1662
Change-Id: I479bb35bc98dd314860955b3c30df788d18ed84e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126780
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
2023-04-10 10:09:57 +00:00
Le Hoang Quyen 3dce55a6fe MetalBackend: Enable multithread support.
Bug: dawn:1662
Change-Id: If2f74b4bbce9d108fcd5906c2105f9ebd95845fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/124400
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
2023-04-10 09:33:43 +00:00
Corentin Wallez 087deedbc8 dawn.json: remove leftovers from implementation-based swapchains.
This also removes the need for special casing the swapchain creation
proc in the fuzzers because it is no longer possible to have a valid
CreateSwapChain call since the wire can't create a surface (which is no
longer optional).

Bug: dawn:269
Change-Id: Icc6ed5e82c1d5382628d71d212640d238cfba348
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126425
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
2023-04-07 14:59:55 +00:00
Corentin Wallez a48ba981ea Remove dawn_wsi.h
Bug: dawn:269
Change-Id: Ie1fb1a8109ff646b880c3e27762300167776d050
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126424
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-07 13:33:26 +00:00
Corentin Wallez 1226684b09 Merge NewSwapChainBase in SwapChainBase
Bug: dawn:269
Change-Id: I514c210f88e2bf1f501e2d814f8ab931c5ed724f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126423
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-07 13:30:50 +00:00
Peng Huang 6635b965b9 d3d11: implement ShaderModule
Bug: dawn:1705
Change-Id: I621a561e1b61762bb8347a74b24cb18a7c808ba3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126303
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Peng Huang <penghuang@chromium.org>
2023-04-06 22:37:26 +00:00
Peng Huang 86e6a13649 d3d11: add BindGroup, BindGroupLayout and PipelineLayout
Bug: dawn:1705
Change-Id: I9bc7545328409c7ce8fd8adc26a35b872cda1420
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126302
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Peng Huang <penghuang@chromium.org>
2023-04-06 19:59:05 +00:00
Peng Huang 4faf3d31ba d3d11: add Device, Queue, Sampler, etc
Bug: dawn:1705
Change-Id: I0cfc54a3be2c9dc4471d0b5b9cb7d6066519bcf1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126300
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-06 18:02:13 +00:00
Peng Huang ac77863352 d3d: supports more errors in HRESULTAsString()
Bug: dawn:1705
Change-Id: I811ed5867399fa417a0a542f3d4e706e989f0a23
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126660
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Peng Huang <penghuang@chromium.org>
2023-04-06 17:12:04 +00:00
Le Hoang Quyen b7a3cbe8ca end2end tests: add --enable-implicit-device-sync option.
This option will allow tests to be run with
ImplicitiDeviceSynchronization feature.

Bug: dawn:1662
Change-Id: Ic001b2fa175f63e8d77eeb3b23d4d2cf52bb224e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126580
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
2023-04-06 16:03:13 +00:00
Le Hoang Quyen c173a0ea88 Fix TRACE_EVENT wasn't thread safe.
TRACE_EVENT uses INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO and
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO reads and writes to a static
variable on multiple threads.

Fix by using std::atomic for the static variable.

Bug: dawn:1700
Change-Id: I914bb73352e400f0adeafb64518d61099276270d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123680
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
2023-04-06 08:08:00 +00:00
Le Hoang Quyen 7971bfe16f Add an option to enable implicit device synchronization.
1. Auto-generate mutex locking code in DawnNative's ProcTable's
functions. Using a mutex owned by the related Device.
  - Unless the function/class has "no autolock" attribute (new) in
  dawn.json. In which cases, no locking code will be auto-generated.
  - Currently Instance, Adapter, Surface, Encoder classes and
  Reference/Release method have "no autolock".

2. Added Feature::ImplicitDeviceSynchronization to enable Device's
mutex.
  - If this feature is disabled, lock/unlock Device's mutex is no-op.
  Auto-generated locking code will have no effect. This is the default.
  - This approach is used instead of generating two sets of ProcTable
  because it's cleaner and the internal code doesn't need to care about
  whether there is a mutex being locked or not. Furthermore, if there
  were two sets of ProcTable, and user used dawnProcSetProcs() to set
  global ProcTable, it would affect all other modules using different
  Devices. Even though those modules don't need thread safety.

Bug: dawn:1662
Change-Id: I75f0d28959f333318e4159916b259131581f79f5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119940
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2023-04-05 19:35:07 +00:00
Austin Eng 78c496395c Always flush device callbacks when the callbacks are changed
With the wire, callbacks reference device-related data which is
freed when the device is unregistered from the wire. However,
the device that the wire refers to can live longer than this
and have its callbacks invoked at a later time, leading to a
use-after-free. Always flush the callbacks so that when the
wire unregisters a device and clears its callbacks, they are
called immediately and no dangling pointers remain.

Bug: chromium:1430221
Change-Id: Ib753b58cee5e7cb4d90ebd703958a0ddd5873573
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126481
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-05 17:10:58 +00:00
Corentin Wallez 8a6ed63809 Remove OldSwapChain*
Bug: dawn:269
Change-Id: I5bc6f5f8b98a88c5d0bd69e0d2eaf1e4bbd12e2b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126422
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2023-04-05 10:13:01 +00:00
Corentin Wallez 961f7eae70 Remove all NativeSwapChain*
These were helpers to avoid the need for users of implementation-based
swapchains to implement them themselves. They are no longer used and can
be removed.

Also removes SwapChainuUtils.h that's no longer used.

Bug: dawn:269
Change-Id: I3c563edaf107e9ce04f708e8bacae9d231b0f40d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126421
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
2023-04-05 07:24:44 +00:00
Corentin Wallez 974802d17c Remove BackendBinding and its implementations.
These were helpers for implementation-based swapchains that are getting
removed.

Bug: dawn:269
Change-Id: I44b0f9a9d221b9370c3eb2625c68e540b6e2ef46
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126420
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2023-04-05 07:23:09 +00:00
Yan,Shaobo 2c4847e59a Fix bug about requiring unexpected files when compiling on Android
In MemoryService implementation, Dawn uses DAWN_PLATFORM_IS() to choose
required header files for different OS platform.

On Android platform, both DAWN_PLATFORM_IS(LINUX) and DAWN_PLATFORM_IS(ANDROID) are true. This caused some linux platform header files and implementations has been included unexpected when compiling on Android platform.

This CL strict the macro condition to ensure Android platform include AHardwareBuffer related files only.

Bug:dawn:1593
Change-Id: If64567edf99cd25a3783d8c456a1fc3f6a7dccf2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126323
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2023-04-04 08:57:46 +00:00
Peng Huang 3fcf96dd8c d3d11: add d3d11 backend in end2end tests
Right now, many tests are not passed becasue unimplemented
features in d3d11 backend. HoweverD3D11 backend is disabled on
bots by default, so this CL will not break out bots.

Bug: dawn:1705
Change-Id: I57321b86a404bc245b71c467479fdee0464dee9b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126260
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-04 00:27:36 +00:00
Peng Huang ebfd505d29 d3d11: implement Adaptor, Backend, etc
This CL also moves some comman code in d3d12::Adapter and
d3d11::Backend to d3d::Adapter and d3d::Backend, so it can be
shared with d3d11 backend.

Bug: dawn:1705
Change-Id: Ica3bf33232d3380b7d4799c77bf9b43a8374a66e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126220
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
2023-04-03 21:33:54 +00:00
Stephan Hartmann a7423b3d83 IWYU: add cstdint for uint8_t dawn::native::stream::ByteVectorSink
Bug: chromium:957519
Change-Id: I48436db0e203d793e47d717bfb75977c67145e94
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126120
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-03 13:51:27 +00:00
Le Hoang Quyen 44afd7112f Fix APIGetInstance() didn't increase external ref.
InstanceBase has two seperate ref counts: external & internal.
When we return it to the external user, we need to increase external
ref count as well.

Bug: chromium:1429835
Change-Id: I4b585d04149180418bd620e6e4d86522e033b64e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126080
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-03 10:04:42 +00:00
Yan,Shaobo 07b88f3aef MemoryService Choose Implementation based on ExternalImageType
This CL add supports for MemoryService choosing implementation based on
ExternalImageType in runtime instead of choosing in compile time.

This CL also removes MemoryServiceNull.cpp.

Bug: dawn:1593
Change-Id: Iddec1f5cf03a7d962ef12b8fd6293ffbb7dc064d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/125900
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-03 02:14:21 +00:00
Peng Huang c00ff7f3c7 [tint] do not emit space for binding group 0
D3D11 only supports HLSL SM5.0 which doesn't support `space`
(binding group in WGSL). So for D3D11, only one binding group will be
used, and tint will not emit `space` for HLSL, so shaders can be used
with D3D11.

Bug: dawn:1705
Change-Id: Ie0e9868137f10762c5243e188d76f5e41879c2bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/125080
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
2023-03-31 17:55:19 +00:00
Peng Huang 70d8711973 [d3d] Move some texture format convert methods to d3d folder
Bug: dawn:1705
Change-Id: I08a348666785ab25110b179e37b6a2869313d998
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/125241
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-31 17:24:31 +00:00
Peng Huang 3f76570d9a Print FPS for sample Animometer
Change-Id: I21ae60077638944258436c4cab14cc1d98e7f169
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/125881
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Peng Huang <penghuang@chromium.org>
2023-03-31 16:44:51 +00:00
Antonio Maiorano d8f0f44b54 dawn: enable IEEE strictness for compute pipeline to match render pipeline
This is the only flag we set for FXC compilation of render pipelines that we don't set for compute.

This fixes a (potentially unrelated) bug I've been looking into it (tint:1887

Bug: tint:1887
Change-Id: Iaf67ebe9221cd1d6e4e20afe0bcd3e5aa6e89366
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/125820
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-31 12:24:10 +00:00
Antonio Maiorano 51249b83e6 tint/hlsl: don't use min16float to implement quantizeToF16
min16float is not required to convert its input to an 16-bit float.
Instead, use f32tof16, and f16tof32.

This is also required to be able to enable the IEEE strictness option on
FXC, otherwise FXC emits an error X4028: expression has a minimum
precision type and cannot be marked precise

Bug: tint:1887
Change-Id: I2268c9336b8e873b36e6532984838054fe4dedbd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/125920
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-31 08:00:33 +00:00
Peng Huang 151e67b5d1 Support D3D11 backend for dawn samples also add toggle options
Bug: dawn:1705
Change-Id: I192ea2e8f85df8f995855109ef20eaf3bfd1ffa0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/125840
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Peng Huang <penghuang@chromium.org>
2023-03-31 01:03:42 +00:00