Commit Graph

1634 Commits

Author SHA1 Message Date
Corentin Wallez cab352c2f6 Make end2end and perf tests use webgpu.h
BUG=dawn:22

Change-Id: Ief855d294779b97283a79532e9d503aab6fda751
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12740
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-28 13:27:36 +00:00
Bryan Bernhart 9cf62efda9 D3D12: Use CheckHRESULT for allocator errors.
BUG=dawn:27

Change-Id: If28d1cbafcbdac29bafac0fb0e846208634ece33
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12521
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-28 12:59:36 +00:00
Austin Eng f6281a5530 perf_tests: Add missing trace event "id"
This missing identifier is used to match async trace events. Its
absence broke async trace events since their Begin/End could not
be matched correctly.

Bug: dawn:208
Change-Id: I0671af8c3cbb8ff6220adcb8ed5621b831e383c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12760
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-28 11:35:20 +00:00
Corentin Wallez 04863c42be Make examples and utils use webgpu.h
BUG=dawn:22

Change-Id: I602d6a3422b493d199f3fded61ff1666bc2d9d7d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12702
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-10-25 11:36:47 +00:00
Corentin Wallez 9f90c8d3ca Make dawn_native public headers and dawn_wsi use webgpu.h
BUG=dawn:22

Change-Id: I112d71323c9305fa0997d251556fe0a41dafed29
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12701
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-10-24 23:55:37 +00:00
Corentin Wallez 1fdcb16b69 Make dawn_wire use the webgpu.h header
BUG=dawn:22

Change-Id: I4963aa27322086e74947a1a6265c921e2c7d3d85
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12700
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-24 22:27:27 +00:00
Corentin Wallez 15e751e418 Vulkan: Implement initial version of the suballocation
This makes the Vulkan backend use the BuddyMemoryAllocator to
sub-allocate small resources inside a larger VkDeviceMemory object.
Right now the heuristic to decide to do suballocation is naive and
should be improved.

BUG=dawn:27

Change-Id: Idcc7b6686c086633c85328a7afb91ee84abf7b8c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12662
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-24 21:32:27 +00:00
Corentin Wallez ca35435716 Preliminary changes to Vulkan memory suballocation
This mostly makes the MemoryAllocator not owned by the
BuddyResourceAllocator so that we don't need an extra class for the
dependency injection in the Vulkan backend. (the container for the
BuddyMemoryAllocator can be it's MemoryAllocator at the same time).

Also renames methods of MemoryAllocator to be more explicit.

Also renames the constructor parameter of BuddyMemoryAllocator to be
(subjectively) closer to what the represent.

BUG=dawn:27

Change-Id: I37355ad5b3cded143956f0adc4742fa1b717e9bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12661
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-24 21:28:16 +00:00
Corentin Wallez 60a04dd18c Vulkan: Use the ResourceMemoryAllocator for all resources
This removes the duplication of the memory allocators in preparation for
using sub-allocation in the Vulkan backend too.

Also renames ResourceMemory to ResourceHeap and MemoryResourceAllocator
to ResourceMemoryAllocator, and fixes a number of unused includes.

BUG=dawn:27

Change-Id: I1a9e7d41e5efafa5192bda1d89dc06455fa2af40
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12660
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-24 21:24:27 +00:00
Yunchao He 6da1770507 Fix ambiguous errors for bind group
BUG=

Change-Id: I384e8125674dd5a83ef742fde9f3546f938909df
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12680
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-10-24 17:27:06 +00:00
Pawel Pluciennik 20b416235a Move ldflags (Metal dependency) to libdawn_native.
Bug: chromium:1003381
Change-Id: I1cb0f0404dde9936f4fb8f64588535a84e50c957
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12600
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Nico Weber <thakis@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-10-24 09:44:13 +00:00
Yan 402fbcca93 Enable UpdateDynamicOffsetsMultipleTimesComputePipeline case
Austin added barriers for storage buffer in compute pipeline in
this patch (https://dawn-review.googlesource.com/c/dawn/+/12301).

This case now can work fine.

Bug: dawn:236
Change-Id: Id449ae5053f1f018ea95c271bff7e4ab2180a937
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12640
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-10-23 16:34:42 +00:00
Corentin Wallez 1f6c8c4d54 Make dawn_native use the webgpu.h header
BUG=dawn:22

Change-Id: I66e2d998f5e09030e40ec88813cd65c492018fd0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12541
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-10-23 11:57:41 +00:00
Bryan Bernhart c833c0c592 D3D12: Enable sub-allocation for MSAA and non-MSAA textures.
Updates TextureD3D to use the allocation handle and
defaults to using MSAA heaps.

BUG=dawn:27

Change-Id: I2318bb8d068df86364cb2ebc433f4737e9e121aa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12580
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2019-10-22 21:01:11 +00:00
Austin Eng 7b3cc35cb6 D3D12/Vulkan: Insert storage buffer barriers between compute pass dipatches
This patch extends the BindGroupTracker in the D3D12 and Vulkan backends to
track bound storage buffers. We insert barriers between dispatches to properly
synchronize writes to storage buffers.

Bug: dawn:236
Change-Id: Iab3f964c345b64755557ab206e05a2ff7b0a3a1f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12301
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-10-22 17:28:20 +00:00
Corentin Wallez 2c8b5c6370 Introduce the webgpu[_cpp].h headers.
webgpu.h is the "official" header for WebGPU in native and is being
developed in https://github.com/webgpu-native/webgpu-headers

dawn.h and dawncpp.h are changed to become webgpu.h and webgpu_cpp.h
respectively and use the new naming convention. New dawn.h and dawncpp.h
headers are created that just proxy the types, constants and functions
to their WebGPU counterpart.

Almost no naming change is done in Dawn in this commit, which help check
that the proxying headers work correctly. A couple changes were
necessary, in particular for tests of the internal of dawncpp.h, and a
workaround for a standard library bug for std::underlying_type was
removed because it is no longer needed and got in the way.

Finally since some templates were renamed to match the name of the file
they create instead of using the generic "api" name.

BUG=dawn:22

Change-Id: I12ee22d0b02ccb5b8a52ceccabb3e63ce74da007
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12480
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-10-21 20:04:10 +00:00
Ryan Harrison 16f1068025 Rolling 3 dependencies
Roll third_party/SPIRV-Tools/ e3da3143b..e8c3f9b0b (4 commits)

e3da3143b2..e8c3f9b0b4

$ git log e3da3143b..e8c3f9b0b --date=short --no-merges --format='%ad %ae %s'
2019-10-18 chris Ensure timestamp does not vary with timezone. (#2982)
2019-10-18 stevenperron Keep NOPs when comparing with original binary (#2931)
2019-10-18 alanbaker Check that derivatives operate on 32-bit values (#2983)
2019-10-17 rharrison Check text->str before destroying (#2981)

Roll third_party/shaderc/ 65adcb504..c4835b852 (5 commits)

65adcb504d..c4835b8523

$ git log 65adcb504..c4835b852 --date=short --no-merges --format='%ad %ae %s'
2019-10-19 9856269+sarahM0 spvc: add known_spvc_failures  (#842)
2019-10-18 dneto Remove utils/build.py (#841)
2019-10-17 9856269+sarahM0 spvc parser for a trivial shader (#839)
2019-10-17 rharrison Rolling 5 dependencies and update known_failures & known_invalids (#840)
2019-10-17 dsinclair The glslang-testsuite is moved into glslang. (#838)

Roll third_party/spirv-cross/ a92668bc1..ff1897ae0 (1 commit)

a92668bc11..ff1897ae0e

$ git log a92668bc1..ff1897ae0 --date=short --no-merges --format='%ad %ae %s'
2019-10-21 post CFG: Compute actual immediate dominators.

Created with:
  roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers

Change-Id: Iceebd0f8d8bb83e60bf94a3dc01570358c563804
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12560
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2019-10-21 18:29:00 +00:00
Rafael Cintron f0c036a3d2 Plug D3D 11on12 memory leak
11on12 has a bug where D3D12 resources used only for keyed
shared mutexes are not released until work is submitted to
the device context and flushed.

The most minimal work we can get away with is issuing a
TiledResourceBarrier.

ID3D11DeviceContext2 is available in Win8.1 and above.
This suffices for a D3D12 backend since both D3D12 and 11on12
first appeared in Windows 10.

Bug:dawn:217
Change-Id: I422eedf0de9c41777ab704f63520e2f2584f2afb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12520
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
2019-10-21 15:13:29 +00:00
Pawel Pluciennik 3c79cf2ab9 Metal.framework must be optional instead of hard requirement.
It's required to execute binary on Mac 10.10.

Problem has been revealed after integrating 1002023.
It's not visible by default,
because clang under the hood changes hard requirement to optional.

See:
- https://chromium-review.googlesource.com/c/chromium/src/+/1792702
- https://bugs.chromium.org/p/chromium/issues/detail?id=1003381 discussion.

Bug: chromium:1003381
Change-Id: I46e8da1092748256985ca4c2b90244f2ac5d422c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12540
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-21 11:35:49 +00:00
Bryan Bernhart 8d00f5db8f Prevent kMaxHeapSize overflow on 32-bit debug builds.
Uses uint64_t instead of size_t in isPowerOfTwo checks.

BUG=dawn:27

Change-Id: If8bcdcd855d10fd2dc1f42fa18e3defab13a76b0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12500
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-21 09:23:09 +00:00
Jiawei Shao 5c2f5f3961 Implement serialization/deserialization of DawnDeviceProperties
This patch implements the serialization and deserialization of
DawnDeviceProperties in dawn_wire for the use of serializing this type
of object in Chromium.

BUG=chromium:996713
TEST=dawn_unittests

Change-Id: I1678627a017079540689d8529a1a7e1c975aae61
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12240
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-10-20 03:01:56 +00:00
Bryan Bernhart f603903da7 Replace size_t with uint64_t in ringbuffer.
Adds overflow check in RingBufferAllocator + unit-test.
Also, update clients to use uint64_t to avoid casts or narrowing.

BUG=dawn:233

Change-Id: I652e3142407006d082491add600371f95d44741a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12380
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2019-10-18 16:19:00 +00:00
Yizhou Jiang 4794168ef8 Use toggle to turn off vsync on D3D12
Parameter syncInterval of function Preset specifies how to synchronize
presentation of a frame. To turn off vsync in D3D12 backend,
set syncInterval to 0 which represents the presentation occurs
immediately.

BUG=dawn:237

Change-Id: Ic17f00bae5af9fd6bca4130d6e2282f3c34de4e6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12303
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com>
2019-10-18 01:45:28 +00:00
Rafael Cintron b2b2ef57a5 Add D3D12 keyed shared mutexes to Dawn
Dawn creates a keyed shared mutex for all wrapped resources and acquires
the mutex before the texture is used in an ExecuteCommandList call.

To coordinate with external clients, backend API has been extended
to allow clients to get and set the acquire key.

Pending and queue command lists have now been merged into one.

A future change will adjust GetPendingCommandContext to return a raw
command context without the need for error handling.

Bug:dawn:217
Change-Id: Ia96c449c305586407153f05ce75a40794b96027e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12220
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
2019-10-18 00:37:42 +00:00
Ryan Harrison 63f98f6e19 Rolling 4 dependencies
Roll third_party/SPIRV-Tools/ 253806adc..e3da3143b (14 commits)

253806adc4..e3da3143b2

$ git log 253806adc..e3da3143b --date=short --no-merges --format='%ad %ae %s'
2019-10-17 kubak Disallow use of OpCompositeExtract/OpCompositeInsert with no indices (#2980)
2019-10-17 rharrison Add fuzzer for spirv-dis call path (#2977)
2019-10-17 rharrison Check binary->code existence before destroying (#2979)
2019-10-17 akb825 Improved CMake install step. (#2963)
2019-10-16 kubak Support constant-folding UConvert and SConvert (#2960)
2019-10-16 rharrison Add fuzzer for spirv-as call path (#2976)
2019-10-15 afdx spirv-fuzz: Refactor 'copy object' and 'construct composite' transformations (#2966)
2019-10-15 dneto Update SPIR-V binary header test for SPIR-V 1.5 (#2967)
2019-10-14 afdx spirv-fuzz: Refactor 'split blocks' to identify instructions differently (#2961)
2019-10-11 alanbaker Validate that selections are structured (#2962)
2019-10-11 afdx spirv-fuzz: Rework id descriptors (#2959)
2019-10-11 afdx spirv-fuzz: Add fuzzer pass to add NoContraction decorations (#2950)
2019-10-11 afdx spirv-fuzz: Add fuzzer pass to change function controls (#2951)
2019-10-10 paulthomson reduce: add large tests and fix (#2947)

Roll third_party/glslang/ 4b97a1108..834ee546f (23 commits)

4b97a11081..834ee546f9

$ git log 4b97a1108..834ee546f --date=short --no-merges --format='%ad %ae %s'
2019-10-17 jbolz Only apply volatile semantics to atomics when using Vulkan Memory Model
2019-10-16 dsinclair Use commandline options instead of ENV variables
2019-10-16 rharrison Keep code style improvements
2019-10-16 dsinclair Indenting
2019-10-15 dsinclair Update CMakeLists.txt
2019-10-15 dsinclair Move TARGETDIR as well
2019-10-15 dsinclair Make runtests configurable.
2019-10-15 rharrison Fix config issues and revert previous fixes for semi-colon issues
2019-10-16 swda.durl Added an option to make pch enabled in Cmake
2019-10-15 wahlster find Python and add External subdir only if BUILD_EXTERNAL option was set (on by default) and /External dir exists
2019-10-14 cepheus GLSL/SPV: Pre SPIR-V 1.5, subgroupQuadBroadcast index must be constant
2019-10-12 geothrock remove redundant check
2019-10-12 Xottab-DUTY Fixed typo in README.md
2019-10-11 rharrison Forgot that GCC doesn't recognize this flag
2019-10-11 rharrison Remove unnecessary semi-colons and add warning about them
2019-10-10 cepheus Fix #1924: Promote SPV_EXT_physical_storage_buffer to KHR when required.
2019-10-10 greg Update spirv-tools known good.
2019-10-10 cepheus Fix #1924: Emit SPV_EXT_physical_storage_buffer, not the KHR form.
2019-09-04 lryer Fix code style issue and remove setXfbBufferStride new paramte
2019-09-02 lryer Adjusting code interface
2019-08-25 geothrock Add support for GL_ARB_explicit_uniform_location
2019-08-06 james.rumble Handle install vs build include directories
2019-08-06 james.rumble Export glslang targets on installation

Roll third_party/spirv-cross/ e5d3a6655..a92668bc1 (8 commits)

e5d3a6655e..a92668bc11

$ git log e5d3a6655..a92668bc1 --date=short --no-merges --format='%ad %ae %s'
2019-10-17 post Fix OpVectorExtractDynamic with spec constant op index.
2019-10-16 post Travis: Update PATH for Python3 on Windows.
2019-10-14 post MSL: Add opt-in support for huge IABs.
2019-10-14 post HLSL: Fix unrolled S/G LE/LT/GE/GT opcodes.
2019-10-14 post GLSL: Deal correctly with bitwidth on integer compares.
2019-10-14 post HLSL: Partially implement Unordered compare.
2019-10-14 post GLSL: Support unordered floating point compare.
2019-10-11 post MSL: Fix regression with OpCompositeConstruct from std140 float[].

Roll third_party/spirv-headers/ b252a5095..af64a9e82 (2 commits)

b252a50953..af64a9e826

$ git log b252a5095..af64a9e82 --date=short --no-merges --format='%ad %ae %s'
2019-10-15 cepheus Versioning: Complete the versioning change in recent commits.
2019-10-14 nicolai.haehnle buildHeaders: update version to SPIR-V 1.5

Created with:
  roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers

Change-Id: I0396a3e0e20e7cfc74603ef60512c2c715eb2c70
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12440
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2019-10-17 19:23:02 +00:00
Austin Eng 92a011a253 Record and dump trace events in the perf tests
Trace data can be used to build additional metrics which measure
validation costs, GPU time, etc. It will also be helpful to store in
the test output for later analysis.

This CL also adds jsoncpp as a DEP so we can dump trace file json
output.

Bug: dawn:208
Change-Id: Ia6c05ca90aecae308ee6a4fd11e5f43bb03b1dc9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12080
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-10-17 19:00:32 +00:00
Bryan Bernhart 154badfe2f Resource Management 8: placed resource sub-allocation.
- Adds d3d allocators (placed resource + heap).
- Support for heap tier 1 but only buffers.
- Suballocation optimization is enabled for allocations under 4MB.

BUG=dawn:27

Change-Id: I79177830670d1f322bbadf45f797415a3e9208d9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5680
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2019-10-17 17:25:28 +00:00
Corentin Wallez 8d000e0cc2 Remove unneeded GN config removal after generated file cleanup
We now have a build step that ensures only the allowed generated file
directories are present so we don't need to remove the default includes
config anymore.

BUG=dawn:22

Change-Id: Id835d1bbb1f52a46ea6502f33b419e70207bba10
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12420
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2019-10-17 15:51:38 +00:00
Corentin Wallez 919812ed1c Use webgpu.h's bitmask type definitions.
BUG=dawn:22

Change-Id: Ib7cf75a1411a6ed86cc5abb1218beb924dbb9001
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12260
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-17 08:46:07 +00:00
Austin Eng 31bde95857 perf_tests: Replace WaitForGPU with maxStepsInFlight argument
The current BufferUpload perf test calls WaitForGPU at the end of
every step to time how long the batch of uploads took. Future tests
will want to have multiple Steps or Frames in flight to mimic real
applications that use double or triple buffering. This patch removes
WaitForGPU and adds a |maxStepsInFlight| argument which a test can
set to configure how many steps can be running on the GPU.
For the BufferUpload tests, this is still 1.

Bug: dawn:208
Change-Id: I95ae12b2358e0283088205bd2ffd20532ea62871
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12302
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-10-17 00:15:07 +00:00
Austin Eng 7f426898ef Skip BufferUploadPerf 16MB SetSubData on all backends.
This test is flaky on all backends.

Bug: dawn:239, chromium:1014946
TBR=cwallez@chromium.org

Change-Id: I77dd261420c78d4b7f21a9e54b835ee3466df97d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12360
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-10-16 18:59:04 +00:00
Stephen White f104ec23bc Fix missing #include.
BUG=

Change-Id: I2e659e9f86ef4757915aeb07ec96a83ea904cb1c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12340
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-10-16 15:36:12 +00:00
Corentin Wallez e180b591d1 Fix compilation with shared_library components on Windows
An exported function of libdawn_native wasn't in libdawn_native_sources
instead of libdawn_native which made it not exported on Windows.

BUG=dawn:22

Change-Id: I824f1d4af18f8308b88e1650837cbe62374ace72
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12320
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-16 15:31:31 +00:00
Corentin Wallez fb7508435f Add missing header for MSVC
BUG=dawn:22

Change-Id: I627768f450a42d6f3522156eb1702114040c8a39
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12321
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-16 11:44:11 +00:00
Austin Eng cc071e45bb Split generation of dawncpp headers from libdawncpp
libdawn_native also requires the dawncpp headers. When we separated
libdawn_cpp from the dawn_headers, libdawn_native lost the cpp headers
and caused a compile failure. This patch separates the dawncpp headers
as a separate target so both libdawncpp and libdawn_native can depend
on them.

Bug: dawn:22
Change-Id: I4172f1654377afac8c4314123ee8b5b81dc7c928
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12300
Reviewed-by: David Turner <digit@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-16 10:26:01 +00:00
Natasha Lee f3d50baf85 D3D12 replace ASSERT_SUCCESS with better error handling
Added D3D12Error to check HRESULTS and return error messages
with the correct error names.

Remove ASSERT_SUCCESS from D3D12 backend and use
MaybeError and ResultError instead to handle errors.


Bug: dawn:19
Change-Id: Idf2f1987725e7e658bd29a9b13653125ab43c564
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12000
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-16 09:26:54 +00:00
Li, Hao c7d535bd72 Prioritize discrete GPU in end2end tests
- Prefer discrete GPU on multi-GPU systems, otherwise get
integrated GPU.
- Add a test to check adapter filter.

BUG=dawn:184

Change-Id: Ib1c3e81e20a15aeaf18746892324ce5144b7fda1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/9320
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-10-16 09:24:55 +00:00
Stephen White fd90d767ba clang-win compile files for skia-dawn.
Do explicit uint8_t -> float conversions (as was previously done for TextureVk).
Add a missing #include.

Change-Id: If7616ec00e2ea2cf55b9b0cc966b0436a5a21d9d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12280
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-10-15 19:29:58 +00:00
Corentin Wallez c57b180208 Add dawnGetProcAddress.
This will become wgpuGetProcAddress that is part of the webgpu.h and the
last gap in functionality for dawn.h to match webgpu.h.

BUG=dawn:22

Change-Id: I0dcb3b5e6bd99cb10db273fc101d3ec0161b7da0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12120
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-10-15 12:08:48 +00:00
Corentin Wallez 96496828a0 Split the libdawn target in components with a single purpose.
The functionality of the dawn_headers and libdawn targets are split into
the following targets:

 - dawn_headers: the new version only exposes the "dawn.h" C API and no
   longer includes the C++ API.
 - dawncpp: the header and implementation of the C++ API that wraps the
   C API. This is unbundled from the rest so the C++ API can be used
   with libdawn_proc or other libraries implementing the C API.
 - libdawn_proc: A DawnProcTable-backend implementation of the C API.

This is needed because in follow-up commit there will be three libraries
implementing the C API: libdawn_proc that trampolines where we want, and
libdawn_native/wire that don't have trampolines for better perf.

BUG=dawn:22

Change-Id: I5d941f0d98e5a4b633e14d67eb5269f7924f0647
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12160
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-10-15 11:44:38 +00:00
Yizhou Jiang 1093c4de2c Add a toggle to turn off vsync in Dawn
This commit add a toggle to turn off vsync in Dawn.
When turn off vsync, choose vulkan present mode VK_PRESENT_MODE_IMMEDIATE_KHR
if the mode is available on the system, but if the mode isn't supported,
choose default mode VK_PRESENT_MODE_FIFO_KHR.

BUG=dawn:237

Change-Id: If400262b67cc8051422745e3bed737431183c0b6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12100
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com>
2019-10-15 07:43:05 +00:00
Austin Eng b0cdf95213 Fix compilation with MSVC of volatile assignment operator
Bug: dawn:230
Change-Id: Ie6e4ddf52132a6980d86c9d80524385b51d9d0d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12200
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-10-15 07:30:35 +00:00
Corentin Wallez 2e666bd5de Vulkan: Remove two ASSERT(false) with more detailed reading of Vk spec.
QueueWaitIdle can fail but if it fails, the error codes show that we
can't do anything about it so we just ignore the result.

BufferGetMemoryRequirements should always return memory types bits that
allow Dawn to select a good memory type of a resource.

BUG=dawn:19

Change-Id: I52beebf9f2be2bfb997ca9c1bf306618a73c9c4b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12183
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-15 07:29:55 +00:00
Li, Hao d59fec5d70 Skip LargeBufferFails test with NVIDIA for enabling Vulkan validation layers on Windows
Fails on NVIDIA cards when Vulkan validation layers are enabled becuase the maximum size of a single allocation cannot be larger than or equal to 4G on some platforms.

BUG=dawn:241

Change-Id: I863a2219287d3d363b3013027ba8fc9df846b42d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12141
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
2019-10-15 01:42:45 +00:00
Jiawei Shao 91fbfc34e8 ASSERT object is not nullptr in DeviceBase::ValidateObject
This patch adds an ASSERT expression on the object parameter of
DeviceBase::ValidateObject() so that Dawn won't crash in the debug
build when a nullptr object is being used unexpectedly.

BUG=dawn:209

Change-Id: I52ad57b58eb59edf04afc9963e260436d93e673e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12140
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2019-10-15 00:17:35 +00:00
Corentin Wallez ba9e1ff86f Fix compilation in MSVC that was missing a <utility> include
BUG=

Change-Id: I3090fec89bb9dd39d28997cb58943643e8c7ed6f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12182
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-14 14:24:50 +00:00
Corentin Wallez b6acae6d35 Suppress BufferUploadPerf for setSubData of 16MB on Vulkan
TBR=enga@chromium.org
BUG=dawn:239

Change-Id: Ie6dda6df45326d57d7ea8f04670904afee25b51d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12161
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-14 12:38:10 +00:00
Corentin Wallez c44b2d4881 Vulkan: Properly handle errors for fences and commands
This commit makes the following changes:
 - Unused fences are reset when they will next be used so there is a
   single place where error handling is needed, either for resetting
   an existing fence, or for creating a new fence.
 - All accesses to VkCommandBuffer are moved to using the
   CommandRecordingContext and GetPendingCommandBuffer is removed.
 - Instead of tracking both a current (VkCommandBuffer + Pool) and
   a command recording context that contains the same VkCommandBuffer,
   the RecordingContext now holds the pool too, as well as a tag to
   know if it was ever queried (meaning it contains commands).
 - mRecordingContext is now always valid, such that
   GetRecordingContext() doesn't need to return an error.

BUG=dawn:19

Change-Id: I853d4ecdc6905b66e842688f39d863e362f59b66
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12022
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-10-11 12:12:07 +00:00
Corentin Wallez 76e1e41cc7 Vulkan: Proper error handling for submission.
BUG=dawn:19

Change-Id: I457a7d3f95a9f486b6d7dbf5fe1885758362d504
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12021
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-11 11:29:46 +00:00
Corentin Wallez 18a5d42898 Vulkan: Handle errors when creating VkRenderPass
BUG=dawn:19

Change-Id: I6007fb594a7c073b835554ca6914453a67608947
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11863
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-10-11 11:17:22 +00:00