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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Upload perf depends on buffer size. Try small and large buffers
to ensure allocation tuning is more accurate.
BUG=dawn:208
Change-Id: I1ee23454e86a31cf0a316946bc87550dad51e5c2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11961
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This change refactors D3D12 backend to have CommandRecordingContext
CommandRecordingContext allows us to, in a future, add additional
data to the context such as textures that need to be acquired and
released before command lists are executed.
The Device's pending command list and the command list which resides
in the Queue object were converted to use CommandRecordingContext.
Bug=dawn:234
Change-Id: Ic13a229fc1f15895ef71117ce638c942de224743
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11940
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
According to https://github.com/gpuweb/gpuweb/issues/405, None is a
valid value for GPUBindGroupLayoutBinding visibility to be passed in.
Bug: dawn:22
Change-Id: I7b30b7ab8ed6824718573fa25fad5d509846db55
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11980
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Following WebGPU spec change at
https://github.com/gpuweb/gpuweb/pull/468, this CL changes all
occurrences of setVertexBuffers to setVertexBuffer.
Bug: dawn:22
Change-Id: I48b551a89dc0934dfa61e661e9546a2b7eafd2fc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12020
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Allows buffer/texture direct access to underlying resource rather than indirectly with a opaque memory type.
BUG=dawn:27
Change-Id: I2eb69f4e30c96c431dbc96094d671be1e0a29869
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11800
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Roll third_party/spirv-cross/ 5431e1da2..e5d3a6655 (8 commits)
5431e1da2d..e5d3a6655e
$ git log 5431e1da2..e5d3a6655 --date=short --no-merges --format='%ad %ae %s'
2019-10-07 rharrison Update SPV_VERSION from 1.4 to 1.5
2019-10-07 post Workaround MSVC issue.
2019-10-07 post Do not consider aliased struct types if the master is not a block.
2019-10-07 post Run format_all.sh.
2019-10-04 post Do not value compare JSON files for regression purposes.
2019-10-04 post Reflect: Deal with workgroup size being specialization constants.
2019-10-03 frank.richter reference: Update to include workgroup_size
2019-10-03 frank.richter reflection: Write workgroup_size to JSON for compute shaders
Created with:
roll-dep third_party/spirv-cross
Roll third_party/shaderc/ e849e6783..621605ce2 (10 commits)
$ git log e849e6783..621605ce2 --date=short --no-merges --format='%ad %ae %s'
2019-10-08 rharrison Fix various build issues for chromium & dawn (#835)
2019-10-08 stevenperron Use a better python idiom (#834)
2019-10-08 stevenperron Fix up use of private spirv-tools headers. (#833)
2019-10-07 rharrison Roll spirv-cross ahead and update known_failures to fix build breakage (#831)
2019-10-07 9856269+sarahM0 spvc: Add an empty opt pass (#816)
2019-10-07 9856269+sarahM0 spvc: Add known_invalid file (#823)
2019-10-04 dneto Add support for targeting SPIR-V 1.5 (#822)
2019-10-03 rharrison Revert "Add spvc compiler to returned result (#821)" (#827)
2019-10-03 rharrison Add spvc compiler to returned result (#821)
2019-10-02 rharrison Rolling 4 dependencies (#817)
Created with:
roll-dep third_party/shaderc
Change-Id: I9e77d5c78eb647c1f117c356306e6dff7613722a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11963
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This also introduces another combinator to ConsumeError for
ResultOrError.
BUG=dawn:19
Change-Id: Ic204313436f5e919473d604efd049fe3d3c27a66
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11862
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This makes all the regular WebGPU object creation handle errors properly
in the Vulkan backend instead of ASSERTing no Vulkan error is raised.
Static Create functions are added to all these types so that the details
of how the initialization is done is private, and it isn't possible to
construct an object but forget to initialize it.
BUG=dawn:19
Change-Id: I362b2d66b74dd7799ffbf69d732bc58caa97950b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11861
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This is necessary because @available(macOS 10.N, *) is taken on all iOS
versions but there is no way to say the branch is just not taken on any
iOS version. The proper way to deal with this is to add additional #if
guards to just not compile the code on iOS / macOS.
BUG=dawn:225
Change-Id: I76ec01f933364e9b47b5dda1198359f2ab4d1188
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11900
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This includes several changes to make dawn.h closer to webgpu.h (apart
from the renames and copyright changes):
- Make nextInChain follow the same type convention as the rest of the
header.
- Add defines that allow skipping the procs definition or the functions
declaration part of the header.
- Sort the methods by name for each object.
- Put the callback definition inside extern "C"
- Make the enums typedef have the name of the enum twice.
BUG=dawn:22
Change-Id: I36e4587d60ca43886636ebd19d54752004f4696d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11903
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
There was still some logic associated with push constants in Dawn. This
removes it to remove some code and reclaim one buffer in Metal. Related
code was found via `git grep "push constant"`.
BUG=
Change-Id: I17de9d47872483875b6fa292f8259ef1fc4ecaf3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11904
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>