Commit Graph

1634 Commits

Author SHA1 Message Date
Corentin Wallez c81a717379 Remove indirection for colorStates
This is to match the work in progress webgpu.h header.

BUG=dawn:22

Change-Id: Ia1077fef95e6bda541cddbd2f6ce40b79138e960
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/9383
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-09-20 23:22:27 +00:00
Corentin Wallez b8dbada76d Make ComboRenderPipelineDescriptor non copyable.
This causes subtle bugs in tests when pointers in combo render pipeline
descriptors point at other combo render pipeline descriptors.

BUG=dawn:22

Change-Id: I5234df26895986fd1d7a9b4e835598177581803a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11340
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-09-20 23:15:47 +00:00
Yunchao He 394553b02e Set y-axis up in normalized coordinate system.
BUG=dawn:224

Change-Id: I6bb4946e87b593f1d62a13b3b8ab38f21d3e9ffb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10201
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2019-09-20 23:04:47 +00:00
Corentin Wallez a838c7d497 Remove indirection for colorAttachments
This is to match the work in progress webgpu.h header.

BUG=dawn:22

Change-Id: I1371cda1b7666de8eb8283fa7e5da935d17e1d52
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/9381
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-09-20 22:59:47 +00:00
Brian Sheedy 0c4d75931a Disable BufferSetSubData.ManySetSubData on Metal
Disables ManySetSubData on Intel/Metal configurations, as it has started
failing on Mac 10.14.6.

Bug: dawn:228
Change-Id: Ia7d27a698deb9abc08cc04660903e5c6c93bbf50
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11460
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-09-20 22:16:03 +00:00
Corentin Wallez 38b295de38 Fix availability check for MTLCopyAllDevices
This caused failure on macOS 10.11 because Dawn decided Metal is
supported but would go ahead and reach an UNREACHABLE() block.

BUG=chromium:1006181

Change-Id: I20739a058adaa60a71ec489e07b36ebf48ef871a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11420
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-09-20 17:40:53 +00:00
Corentin Wallez a9a84dfe1e BUILD.gn: Delete stale generated files in Dawn's gen dir.
This normalizes even more the directory structure of generated files in
Dawn and removes stale autogenerated files that could be included
wrongly using a GN action.

See comment on top of dawn_generator.gni in this commit for more
context.

BUG=dawn:22

Change-Id: I8ec038f949c048431b2b643af4462f98c4ae610b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11361
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-09-19 23:30:42 +00:00
Ryan Harrison f8c66c72c6 Rolling 4 dependencies
Roll third_party/SPIRV-Tools/ e2e95172d..08fcf8a4a (22 commits)

e2e95172df..08fcf8a4ab

$ git log e2e95172d..08fcf8a4a --date=short --no-merges --format='%ad %ae %s'
2019-09-19 ehsannas Fix header include syntax. (#2882)
2019-09-19 stevenperron Handle OpConstantNull in copy-prop-arrays. (#2870)
2019-09-19 dneto Fix comment typo found by protobufs linter (#2884)
2019-09-19 dsinclair Move docs into docs/ folder (#2872)
2019-09-18 dsinclair Add WebGPU SPIR-V Assembler in JavaScript. (#2876)
2019-09-18 dneto Android.mk: Add dependency from optimizer file to amd-shader-ballot-insts.inc (#2883)
2019-09-18 dneto Update SPIRV-Headers in DEPS (#2880)
2019-09-18 afdx  Fix detection of blocks bypassed by new edge (#2874)
2019-09-18 afdx Fix CMake issue related to spirv-fuzz (#2877)
2019-09-18 afdx Add fuzzer pass to replace ids with synonyms (#2857)
2019-09-18 alanbaker Relaxed bitcast with pointers (#2878)
2019-09-17 52076061+digit-google Fix Fuchsia build. (#2868)
2019-09-16 raun.krisch Adding valilidation checks for OpEntryPoint duplicate names and execution mode (#2862)
2019-09-16 alanbaker Extra resource interface validation (#2864)
2019-09-13 alanbaker Split capability tests (#2866)
2019-09-13 alanbaker SPIRV-Tools support for SPIR-V 1.5 (#2865)
2019-09-11 afdx Add fuzzer pass to copy objects (#2853)
2019-09-11 rharrison Handle another case where creating a constant can fail (#2854)
2019-09-11 stevenperron Don't inline function containing OpKill (#2842)
2019-09-11 stevenperron Handle id overflow in wrap op kill. (#2851)
2019-09-11 dneto Assembler: Can't set an ID in instruction without result ID (#2852)
2019-09-10 zoddicus Handle creating a new constant failing gracefully (#2848)

Roll third_party/glslang/ 664ad418f..f7a48b153 (14 commits)

664ad418f8..f7a48b153f

$ git log 664ad418f..f7a48b153 --date=short --no-merges --format='%ad %ae %s'
2019-09-17 cepheus SPV_KHR_physical_storage_buffer/SPV: Add GL_EXT_buffer_reference_uvec2
2019-09-16 digit Fix Fuchsia build.
2019-09-17 kainino use custom es6 modularization instead of MODULARIZE=1
2019-09-17 kainino Separate GLSLANG_WEB (min-size build) and Emscripten options
2019-09-18 cepheus README: Fix WASM typos.
2019-09-18 cepheus HLSL: Fix #1903 Catch 0-argument case to constructors.
2019-09-08 jbolz Add GL_EXT_shader_subgroup_extended_types support
2019-08-28 cepheus GLSL: Only require constant for subgroupBroadcast when SPV < 1.5.
2019-08-18 cepheus SPV: Support SPIR-V 1.5; five extensions no longer need OpExtension.
2019-09-09 laddoc Add flags for local size values ( compute shader )
2019-09-13 cepheus SPV 1.5: Switch to the 1.5 header, for SPIR-V 1.5.
2019-09-11 dsinclair Comment out params instead of removing
2019-09-10 dsinclair Remove unused params
2019-09-09 rex.xu Fix incorrect function prototypes of 64-bit findLSB/findMSB

Roll third_party/spirv-cross/ b32a1b415..5431e1da2 (7 commits)

b32a1b4150..5431e1da2d

$ git log b32a1b415..5431e1da2 --date=short --no-merges --format='%ad %ae %s'
2019-09-19 post Update SPIR-V headers.
2019-09-19 post MSL: Fix 16-bit integer literals.
2019-09-18 rharrison Update external/ to SPIR-V 1.5
2019-09-18 post CMake: Add option to force -fPIC.
2019-09-17 post Fix -Wshorten-64-to-32 warnings.
2019-09-16 post CMake: Add option to skip installation targets.
2019-09-12 post Consider discard and demote as impure statements.

Roll third_party/spirv-headers/ 38cafab37..601d73872 (2 commits)

38cafab379..601d738723

$ git log 38cafab37..601d73872 --date=short --no-merges --format='%ad %ae %s'
2019-09-18 cepheus Add SPV_KHR_physical_storage_buffer.
2019-09-13 cepheus 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: I9a50caaec13661e60126b9d3e6b4fc63863d25f3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11381
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-09-19 21:08:12 +00:00
Bryan Bernhart bdd88a7dc1 Check if allocation is valid before deallocating.
Ensure deallocate does not assert should allocation fail but still be used.

BUG=dawn:227

Change-Id: I5edd4c160bced7934970c5d59e541a3a8f7a8afb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11380
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-09-19 20:40:12 +00:00
Ryan Harrison ae4dbeb178 Roll ahead shaderc API and update API usage as needed
Roll third_party/shaderc/ 4baa46a5d..68b6857ac (2 commits)

4baa46a5d1..68b6857ac0

$ git log 4baa46a5d..68b6857ac --date=short --no-merges --format='%ad %ae %s'
2019-09-18 rharrison Code hygiene work for spvc (#808)
2019-09-10 stevenperron Have update_build_version.py new parameter (#805)

Change-Id: I06e0f62a1443741e8ac09a84ff63ddd100f6a656
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11341
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2019-09-19 14:20:46 +00:00
Corentin Wallez 05623df97f BUILD.gn: Add a check generated files are in allowed dirs.
This is important so that we know that the list of allowed directories
is in sync with other parts of the build in follow-up commits.

BUG=dawn:22

Change-Id: I202bec55b510989e43acf497956e2937c9a2f60a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11360
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-09-18 23:19:31 +00:00
Bryan Bernhart 450e212cf5 Remove device dependencies from ringbuffer.
Allows ringbuffer sub-allocator to be used for non-staging memory.

BUG=dawn:155

Change-Id: Id0021907f520909aaebaf79e992124a47797d38d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/9760
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2019-09-18 22:06:41 +00:00
Austin Eng b11bd2dfe5 Fix leak of ErrorData after Device::ConsumedError
The code to delete this ErrorData* was lost in the error scope
refactor.

Bug: chromium:1002783, chromium:1002888, dawn:153
Change-Id: Iebe13c778079501193b942ebd97a559041516c3d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11320
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-09-18 21:03:41 +00:00
Corentin Wallez 7dda7d0f2e Clarify disabled warning for Metal in BUILD.gn
BUG=

Change-Id: I7f0715bbaaae433d2f1a93c5a2496f28d466e150
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11220
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-09-18 04:40:32 +00:00
Corentin Wallez 897ebc7a71 Normalize generated file paths to match main tree.
Previously dawn_native files were in src/dawn_native/ while generated
files were in dawn_native/. This makes some things complicated when
integrating in other source trees so normalize all generated files to be
in paths that match the main tree.

BUG=dawn:225

Change-Id: I5b3e04d37a16251143578dfb7a31445b229fe4ac
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11300
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-09-18 04:33:12 +00:00
Corentin Wallez b495e48405 Support compilation of Dawn on iOS.
BUG=dawn:225

Change-Id: I618552c55c8472adc25625733b59d972d7297f57
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11040
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-09-18 04:32:52 +00:00
Corentin Wallez 45f9185de5 generator_lib.py: correctly handle lack of --jinja2-path.
Python's list.index() method raises an exception when the item isn't
present in the list. Fix this check that was instead expecting a
negative index.

BUG=dawn:225

Change-Id: I8e67d71ff7384f49533a95d5cbe04da1cf7bb0bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11301
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2019-09-18 00:59:40 +00:00
Corentin Wallez 5e9082daa4 Add some missing headers in BUILD.gn files.
BUG=dawn:225

Change-Id: Ie1ebe62caea48353b6b3579c9405b5cc700fba66
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11302
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-09-17 21:36:15 +00:00
Corentin Wallez f7c263624b Add missing include in the Vulkan backend.
BUG=dawn:225

Change-Id: I8dc0c5c884d8130b98a849e0d675e29d80aa4de8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11303
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-09-17 21:28:45 +00:00
Austin Eng 519b16c4b0 Add README.md for the Dawn perf test harness
Bug: dawn:208
Change-Id: Ic9b4c83ab3c27851d149adb5986f3a5556d0548a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11283
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-09-17 21:02:38 +00:00
Austin Eng 7f3f331ce6 Support setting bind groups before pipeline for all backends
This is to match WebGPU semantics.

Bug: dawn:201
Change-Id: I2aab671fc389edf1d2765395814a9c831afc653e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11080
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-09-17 19:25:27 +00:00
Natasha Lee 617e356580 OpenGL: clear nonrenderable texture formats
Clears nonrenderable color formats and merges zero vs nonzero clears
to use the same code path.

Bug: dawn:145
Change-Id: I8f2f36134b56787e07231d82e37c36897ba1d4ba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10820
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-09-17 18:54:47 +00:00
Austin Eng be990077f4 Support ErrorScopes for asynchronous GPU execution
This changes updates ErrorScopes so that scopes enclosing a
Queue::Submit or Queue::Signal resolve their callbacks asynchronously
after GPU execution is complete.

Bug: dawn:153
Change-Id: I0e0b8a9f19f3f29d1b6a3683938154b87f190a07
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10701
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-09-17 18:24:07 +00:00
Yunchao He bb3c895619 Fix a typo in viewport validation test
BUG=dawn:53

Change-Id: I793373fa6e1fb167d5a8fe0a064c57ddf2ceedba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11281
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-09-17 18:01:09 +00:00
Hao Li 2383fd4fbf Revert "Skip some end2end tests for Vulkan validation layers enable on Windows"
This reverts commit 4cc1891039.

Reason for revert: dawn:210 has been fixed, we can add these tests back.

Original change's description:
> Skip some end2end tests for Vulkan validation layers enable on Windows
> 
> Temporarily skip some tests to make Vulkan validation layers could be
> enabled on Windows, these tests are failing on Vulkan with validation
> layers enabled.
> 
> BUG=dawn:210
> 
> Change-Id: I03a6ab6aca94f7c7044cc27cc1ff5d79ad1f88d2
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11141
> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>

TBR=cwallez@chromium.org,yunchao.he@intel.com,jiawei.shao@intel.com,shaobo.yan@intel.com,hao.x.li@intel.com,enga@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: dawn:210
Change-Id: I4f86369aa0dbfe366b0597cc844af4e74d687eea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11280
Reviewed-by: Hao Li <hao.x.li@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
2019-09-17 02:36:22 +00:00
Corentin Wallez 785ec66b66 BUILD.gn: Correctly skip GLFW on ChromeOS
ChromeOS has is_linux = true so the code to skip compiling GLFW on
ChromeOS didn't work correctly.

BUG=dawn:221
BUG=chromium:1002895

Change-Id: Ifbf8527407ad20b4368531da1d7653ce620d37be
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11200
Reviewed-by: Mitsuru Oshima <oshima@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ahmed Fakhry <afakhry@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-09-12 16:33:31 +00:00
David 'Digit' Turner 47f3b0da28 [fuchsia]: Fix Fuchsia build.
A previous CL broke the build because a GLFW-related config
is no longer exposed. This fixes the issue.

Bug=dawn:221

Change-Id: I83d43b55d58d18e04ea20f732c76830a798f2487
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11181
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: David Turner <digit@google.com>
2019-09-12 12:50:31 +00:00
Natasha Lee 01600dfb3d Use clear loadop to lazy clear depth stencil attachments
Bug: dawn:210, dawn:145
Change-Id: I1eb990266ccd7b51b4a336b0d4d37e0195c6fe69
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11020
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-09-11 22:04:42 +00:00
Corentin Wallez fad96f6e59 BUILD.gn: Only expose the GLFW target on platforms that support it
Due to the way GN target discovery works, glfw would get discovered in
Fuchsia / Android / ChromeOS builds when it isn't supported causing
compilation failures. This changes third_party/BUILD.gn so that glfw
targets are only created on supported platforms. It also changes
dawn_glfw in BUILD.gn to be more robust to building on all platforms.

Bug=dawn:221
BUG=chromium:1002895

Change-Id: I8f40b06f680094406d24e9a6dea44b128e59b854
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11160
Reviewed-by: David Turner <digit@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-09-11 16:53:46 +00:00
Li, Hao 2a2392073b Set point size value for vertex shader in OptionalVertexInputTest
When pipeline topology is set to Point_List, PointSize must be written
in vertex shader for Vulkan backend.

BUG=dawn:146

Change-Id: I0ea6aa937866d1985287d353f82d344100b41acd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11140
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
2019-09-11 15:59:16 +00:00
Li, Hao 4cc1891039 Skip some end2end tests for Vulkan validation layers enable on Windows
Temporarily skip some tests to make Vulkan validation layers could be
enabled on Windows, these tests are failing on Vulkan with validation
layers enabled.

BUG=dawn:210

Change-Id: I03a6ab6aca94f7c7044cc27cc1ff5d79ad1f88d2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11141
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-09-11 15:08:16 +00:00
Rafael Cintron 03e31edd98 Cleanup d3d12::Device::ExecuteCommandLists
- All callers were passing either 0 or 1 commandlist to this
function. Removing the initializer list means we can save an
std::vector heap allocation.
- Checking the number of lists before calling ExecuteCommandLists
eliminates superfluous entries in PIX logs.

Bug:dawn:222
Change-Id: Ic50b9293c3f31bf8f52e7de10161fd284ef2e0f7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11060
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
2019-09-11 00:09:40 +00:00
Austin Eng f35dcfe60a Implement ErrorScopes for synchronous errors
This patch implements Push/PopErrorScope except for asynchronous
or GPU commands. These commands, such as Queue::Submit will need
to hold onto the ErrorScope until GPU execution is complete.

Bug: dawn:153
Change-Id: I2d340b8b391d117a59497f35690993a9cd7503e6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10700
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-09-10 23:19:11 +00:00
Ryan Harrison 619935f7f2 Rolling 4 dependencies
Roll third_party/SPIRV-Tools/ 19b256616..e2e95172d (9 commits)

19b256616d..e2e95172df

$ git log 19b256616..e2e95172d --date=short --no-merges --format='%ad %ae %s'
2019-09-10 afdx Rework management of probabilities in spirv-fuzz (#2839)
2019-09-10 afdx Fix add-dead-break and add-dead-continue passes to respect dominance (#2838)
2019-09-10 stevenperron Handle id overflow in the ssa rewriter. (#2845)
2019-09-09 stevenperron Handle id overflow in the constant manager. (#2844)
2019-09-09 alanbaker Add generic builtin validation of target (#2843)
2019-09-09 stevenperron Don't register duplicate decoration in validator. (#2841)
2019-09-06 stevenperron Replace CubeFaceCoord and CubeFaceIndexAMD (#2840)
2019-09-05 stevenperron Fold Min, Max, and Clamp instructions. (#2836)
2019-09-05 stevenperron Replace uses of SPV_AMD_shader_trinary_minmax extension (#2835)

Roll third_party/glslang/ 56f61ccce..664ad418f (2 commits)

56f61cccef..664ad418f8

$ git log 56f61ccce..664ad418f --date=short --no-merges --format='%ad %ae %s'
2019-09-05 cepheus Fix #1879: Check for valid variable before checking for unsized arrays.
2019-09-04 greg Update spirv-tools and spriv-headers known good.

Roll third_party/shaderc/ 3b038fa1c..4baa46a5d (3 commits)

3b038fa1c3..4baa46a5d1

$ git log 3b038fa1c..4baa46a5d --date=short --no-merges --format='%ad %ae %s'
2019-09-09 zoddicus Rolling 4 dependencies and update known_failures (#803)
2019-09-06 zoddicus Improve testing .asm., .nocompat., and .vk. chases (#797)
2019-09-05 zoddicus Remove unsetting compiler check variables (#801)

Roll third_party/spirv-cross/ f24654db8..b32a1b415 (8 commits)

f24654db8c..b32a1b4150

$ git log f24654db8..b32a1b415 --date=short --no-merges --format='%ad %ae %s'
2019-09-06 wadetb MSL: Fix array copies to/from interpolators
2019-09-06 post Run format_all.sh.
2019-09-05 post Refactor into stronger types in public API.
2019-09-06 post Add dynamic offsets to C API.
2019-09-06 post Fix some issues on certain compilers.
2019-09-05 cdavis MSL: Support dynamic offsets for buffers in argument buffers.
2019-09-04 cdavis MSL: Force storage images on iOS to use discrete descriptors.
2019-09-05 lifeng.pan Fix ParsedIR::mark_used_as_array_length(uint32_t id)

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

Change-Id: Id2e571ec15c78a43e3e435f25a0e8299ce82f623
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11100
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-09-10 21:28:49 +00:00
David 'Digit' Turner f60522f5a4 [fuchsia] Fix Chromium build.
For some unknown reason, during the Chromium build, the
third_party/dawn/third_party:glfw always get rebuilt even when
nothing actually references is (as is the case for "is_fuchsia ==
true").

This ends up in a build failure, since glfw doesn't support this
platform. See [1] for an example.

This CL is a work-around that makes the library empty for Fuchsia
instead. Note that this is never linked into anything so should
not be an issue for any Chromium-related code either.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1795302

Bug=dawn:221

Change-Id: Ia4344e93b01722b3dd0cddf70a5d13a5b71488b7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11041
Commit-Queue: David Turner <digit@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-09-10 13:01:59 +00:00
David 'Digit' Turner fa00c69506 [fuchsia] Implement external semaphore and memory support.
This CL adds Fuchsia-specific implementations to the following
classes:

  dawn_native::vulkan::external_memory::Service
  dawn_native::vulkan::external_semaphore::Service

The implementation is based on two Fuchsia Vulkan extensions
that are provides by the vulkan_fuchsia_extras.h header (i.e.
are not upstreamed to Khronos yet, but used/provided by the
Fuchsia platform):

  VK_FUCHSIA_external_memory
  VK_FUCHSIA_external_semaphore

Their details are similar to VK_KHR_external_XXXX_fd, but
uses Zircon handles instead of file decriptors.

BUG=dawn:221
Change-Id: I48238bcf3193433970cbe200a84b86a67103a2f2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10963
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: David Turner <digit@google.com>
2019-09-10 10:07:28 +00:00
Corentin Wallez 86e74e0dc1 Implement BGLBinding::textureDimension
In WebGPU the BGLBinding needs to know the texture dimension for
compatibility reasons between the texture views passed and the
pipelines.

This adds the member and implements the restriction.

BUG=dawn:22

Change-Id: I95204de1cd621c936994739e840c76351fea9035
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10960
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-09-10 08:58:28 +00:00
Corentin Wallez dbe74bc4a2 Add TextureViewDescriptor.aspect.
This is to match the WebGPU IDL, but currently that member defaults and
must be set to "all".

BUG=dawn:22

Change-Id: I5f4d160163cb45e0ef043853518fe91b47b00d0f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10961
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-09-10 08:30:43 +00:00
Corentin Wallez b8ea84cbb8 Implement debug markers and groups for CommandEncoder
BUG=dawn:22

Change-Id: I1fc6ac3dec936268a043753169ed1d4a405881bd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10962
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-09-10 08:20:40 +00:00
Austin Eng 57354037bd Metal: Support setting bind groups before pipeline to match WebGPU semantics
Bug: dawn:201
Change-Id: I3bd03bbce3c38d0182e5e93f3898a43183bd647d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10840
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-09-09 23:38:00 +00:00
Austin Eng f35420dfca D3D12: Add IndexBufferTracker
Setting an index buffer is dependent on getting the index format
from the pipeline. This adds a tracker to lazily apply the index
format before a draw call if it changes.

Bug: dawn:201
Change-Id: I83c87cc950bf6c93637dd14765c340c97b461061
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11001
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-09-09 21:26:01 +00:00
Austin Eng 8e37315012 D3D12: Factor SetVertexBuffer tracking to match other tracking classes
Bug: dawn:201
Change-Id: I711e93a706b5043318263b203d3f3dc7f1a675bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11000
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-09-09 21:09:11 +00:00
David 'Digit' Turner 882ff72742 [fuchsia] Add headers containing extra vulkan definitions.
The Fuchsia platforms relies on a number of Vulkan extensions
that have not been upstreamed to Khronos yet, and thus are not
part of the official Vulkan headers (i.e. <vulkan/vulkan.h>).

This CL adds a new header under src/common/ that contains these
declarations, extracted from the Fuchsia source tree, and ensures
they are included automatically from <common/vulkan_platform.h>

This is necessary to support certain features when building
Dawn on Fuchsia.

IMPORTANT NOTE: Some of the things declared in this header will
change once everything is upstreamed, which will require updating
the source code using them. For example,

  VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TEMP_ZIRCON_EVENT_BIT_FUCHSIA

Will likely be renamed officially as:

  VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT

And will be assigned a new value by Khronos.

BUG=dawn:221
Change-Id: If88a1dd06083a01d7b34b5cf5ab93f4e3f3681eb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10940
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: David Turner <digit@google.com>
2019-09-09 16:48:58 +00:00
David 'Digit' Turner b749d07ac9 Enable Vulkan for Chromium Fuchsia build.
Enable the Vulkan backend when building Dawn with
the Chromium build system for Fuchsia. To make this
work properly the following is required:

- Modify VulkanInfo.cpp and BackendVk.cpp to correctly probe
  the Fuchsia swapchain layer and its layer extension, as well
  as enabling them when creating a new VkInstance.

- Modify VulkanFunctions.cpp to load the Fuchsia swapchain
  related extension for this platform only.

- Provide a small mock GLFW library for Fuchsia under
  src/utils/Glfw3Fuchsia.cpp, since the upstream project
  does not support this platform at all. Its purpose is
  only to allow the creation of the right VulkanBinding
  instance, which depends on the creation of a display
  surface for latter swapchain creation.

- Add //third_party/fuchsia-sdk:vulkan_base and
  //third_party/fuchsia-sdk:vulkan_validation as
  data_deps of the libdawn_native_sources target in
  order to ensure that the Fuchsia package created by
  the build system will include the correct Vulkan
  libraries (loader and validation layers).

This builds correctly, and both dawn_unittests and
dawn_end2end_tests will run on a real Fuchsia device
or inside the Fuchsia emulator, using either GPU
virtualization or a software-based renderer.

Note: dawn_unittests will also run inside QEMU, but
not dawn_end2end_tests, since the latter requires
proper GPU emulation which is not available in this
environment.

NOTE: All end2end tests pass using a device with
      an "Intel HD Graphics 615 (Kaby Lake GT2)"
      adapter. However:

       - For some reason, a single test takes up
         to 129 seconds to pass
	 (BufferSetSubDataTests.ManySetSubData/Vulkan).

       - The test process crashes inside VkDestroyInstance(),
         apparently inside the Fuchsia-specific imagepipe
	 layer (which implements swapchain support).
	 This is likely a bug in the layer itself, and
	 not Dawn.

    Also, may end2end tests will crash when run inside
    the Fuchsia emulator (which uses GPU virtualization
    to talk to the host GPU). The crashes happen inside
    libvulkan-goldfish.so, the emulator-specific Vulkan
    ICD on this sytem. Not a Dawn bug either.

Bug=dawn:221
Change-Id: Id3598b673e8c6393f24db728b8da49fdde3cac76
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8963
Commit-Queue: David Turner <digit@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-09-09 10:52:08 +00:00
Austin Eng abec145b04 dawn_wire: Fix leak in Server::DoDevicePopErrorScope
Also fixes a uint64_t -> uint32_t narrowing conversion.

Bug: chromium:1001045, dawn:153
Change-Id: I0f94d201884071325c7c5bb40a8c9c67c066e251
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10980
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-09-09 09:41:28 +00:00
Li, Hao 77f091ce46 Align the size of Uniform and Storage buffer to 16 bytes in Metal
On Metal, it requires the size of the constant buffer to be no less
than the size of the constant buffer block defined in shader, and
the overall size of the constant buffer must be aligned to the
largest alignment of its members.

BUG=dawn:139

Change-Id: I37730b1415baecb6638aaaacec87789decf07606
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10920
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
2019-09-07 03:08:45 +00:00
Bryan Bernhart 22c3ff73c1 Resource Management 6: VK support for resource allocation.
Refactor existing memory allocators by using a common
memory type and handle.

BUG=dawn:27

Change-Id: Ieed4fa30a0bd8fedfb3a3c580920805f40b56fae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10680
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2019-09-05 17:36:47 +00:00
Corentin Wallez a900ccebcf Remove indirection for computeStage
This is to match the work in progress webgpu.h header.

BUG=dawn:22

Change-Id: I0904297bb4411b12f9d99e8457d32613058ef9b2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/9380
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-09-05 09:41:17 +00:00
Corentin Wallez a560104617 Match WebGPU's TextureViewDescriptor.dimension defaults.
This matches the choice made in https://github.com/gpuweb/gpuweb/pull/424

BUG=dawn:214

Change-Id: I9913f2c9c2f40b1ccc40c51cf79f50c171a48b3d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10861
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-09-05 09:35:57 +00:00
Corentin Wallez c6c7a42e6e Remove indirection for vertexStage
This is to match the work in progress webgpu.h header.

Also contains a fix for the wire where it wouldn't GetExtraRequiredSize
for structures that are by-value members of other structures.

BUG=dawn:22

Change-Id: I3c706bf9cd7a550d40fd667877f032c860d0a032
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/9382
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-09-05 09:35:07 +00:00