Commit Graph

12514 Commits

Author SHA1 Message Date
Austin Eng f0b761f116 Implement timeline fences in Dawn
This change implements timeline fences in Dawn.
It includes methods and descriptor members to eventually
support multi-queue, but does not implement them.

Bug: dawn:26
Change-Id: I81d5fee6acef402fe099227a034d9669a89ab6c3
Reviewed-on: https://dawn-review.googlesource.com/c/2460
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-12-03 16:57:34 +00:00
Stephen White d758e32610 Add some missing #includes.
MSC needs <string.h> for memcpy().

Change-Id: I1987ae29af32abe3d9e23a0a3cfd373aca22095d
Reviewed-on: https://dawn-review.googlesource.com/c/2820
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-12-03 14:28:04 +00:00
Corentin Wallez 85df07a1e5 Vulkan: Handle errors on device creation.
This is both something we should strive for for robustness of the
backends and in this case helped debug what the issue was on the
linux-dawn-rel builder that was failing all Vulkan tests.

BUG=dawn:19

Change-Id: Ibe9f5ad76b7766575bb74fe4993625cf82cdf13f
Reviewed-on: https://dawn-review.googlesource.com/c/2702
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-12-03 12:49:56 +00:00
Corentin Wallez 0f8b507888 Suppress tests failing on GPU FYI Mac Pro (AMD)
TBR=kainino@chromium.org
BUG=dawn:58

Change-Id: Ibd71a4a7cbc559b868ea8fd801d51ad4b3d7f6fd
Reviewed-on: https://dawn-review.googlesource.com/c/2803
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-03 12:22:06 +00:00
Corentin Wallez 9ca9435087 Rename BindGroupBinding -> BindGroupLayoutBinding
This makes the name match WebGPU's IDL

BUG=dawn:3

Change-Id: I1338fa07580ba8c0f6700b7765fb7389018a4126
Reviewed-on: https://dawn-review.googlesource.com/c/2801
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-03 09:58:09 +00:00
Austin Eng 8b07e43dad Let DeviceBase know about Completed and LastSubmitted command Serials
This is needed to implement the timeline fence signal tracker in the frontend

Bug: dawn:26
Change-Id: Id6eb2afb81385de5093b57c5cb23ace93c8aab1b
Reviewed-on: https://dawn-review.googlesource.com/c/2741
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2018-12-01 03:20:19 +00:00
Brandon Jones 179db44c25 Refactor Internal Command Buffer Copy APIs
Modify internal command buffer types to reflect the front end APIs for
copyTextureToBuffer and copyBufferToTexture.

Bug: dawn:17

Change-Id: I088a167ee7145d741e70ed28c1df7a12d24b72fc
Reviewed-on: https://dawn-review.googlesource.com/c/2740
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2018-11-30 17:39:24 +00:00
Corentin Wallez 5acd60c929 Revert "Run linux-dawn-rel on the CQ"
This reverts commit 0bd32409b7.

Reason for revert: linux-dawn-rel fails when new tests are added.

Original change's description:
> Run linux-dawn-rel on the CQ
> 
> TBR=kainino@chromium.org
> TBR=senorblanco@chromium.org
> BUG=chromium:901830
> 
> Change-Id: Ia6c4c967e3152c3c5abfeef4da2a85e8076072bc
> Reviewed-on: https://dawn-review.googlesource.com/c/2705
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Corentin Wallez <cwallez@chromium.org>

TBR=cwallez@chromium.org,kainino@chromium.org,senorblanco@chromium.org

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

Bug: chromium:901830
Change-Id: I16d4168620388826f3b3091e034fb64cc8a4342f
Reviewed-on: https://dawn-review.googlesource.com/c/2800
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-30 13:34:59 +00:00
Corentin Wallez 58017e91ad Use Chromium's dcheck_always_on when available.
This will make GPU tests running on Chromium-based builders respect this
configuration, which is important to have the same code run in Release
and Debug builds on the GPU FYI waterfall.

BUG=chromium:901830

Change-Id: Ia2f6f3585c4b6213fe7f55203c69d0ef4a620a67
Reviewed-on: https://dawn-review.googlesource.com/c/2708
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kenneth Russell <kbr@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-30 12:17:29 +00:00
Corentin Wallez df72914a60 Result: Add default template for Result<T, E>
It currently is a tagged pair instead of a tagged union because it was
much easier to write and the optimization can come later.

BUG=dawn:19

Change-Id: Idbfd86d559655b38871c2d1768bdd758e797dfbd
Reviewed-on: https://dawn-review.googlesource.com/c/2701
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-11-29 12:40:26 +00:00
Li Hao 813bfbd061 Collect device information on Metal
Becuase CGDisplayIOServicePort is deprecated in OSX >= 10.9, we create
an alternative function which manually finding a service port with
matching vendor and product IDs.

BUG=dawn:10
TEST=dawn_end2end_tests

Change-Id: I94ff65911e159c2b7075209d8902c1551560ed47
Reviewed-on: https://dawn-review.googlesource.com/c/2541
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-11-29 10:54:03 +00:00
Brandon Jones ac71e34d4a Change Copy Operation Interfaces to Match WebGPU IDL
Cosmetic changes to copyBufferToTexture and copyTextureToBuffer to
match WebGPU IDL. Introduces BufferCopyView, TextureCopyView,
TextureAspect, and Origin3D types.

Bug: dawn:17
Change-Id: Ic0e7f472a9dc1353d3fc3839ff02f348bb6067e8
Reviewed-on: https://dawn-review.googlesource.com/c/2520
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-11-28 17:54:13 +00:00
Austin Eng e06d57d338 Factor SerialQueue into SerialQueue and SerialMap
This change moves most of SerialQueue into SerialStorage
and factors it to make SerialMap and SerialQueue. SerialMap
does not enforce that items are Enqueue'd in monotonically
increasing order. This is useful for implement timeline fences
because OnCompletion callbacks may be added in an arbitrary order.

Bug: dawn:26
Change-Id: I03376117311112b0b94ed887a31974f36c4a5464
Reviewed-on: https://dawn-review.googlesource.com/c/2720
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-28 17:30:12 +00:00
Corentin Wallez d8c1a48fc4 WireCmd: require opt-in to treat ID 0 as nullptr instead of error.
In preparation for the descriptorization of BindGroup, support was added
to treat wire ID 0 as nullptr for a bunch of objects. Now that we have a
fuzzer for the wire+frontend, we need to validate when we have a 0 id.
Either the wire needs to reject the ID or the frontend needs to validate
against nullptrs. Since only few entrypoints will have a use for
nullptrs (bind groups, render pass resolve textures), we require an
opt-in in the JSON file for a structure member or an argument to be
optional.

This disables the tests related to ID 0 = nullptr, because we don't yet
have optional argument/members in dawn.json.

BUG=chromium:905273
BUG=chromium:906418
BUG=chromium:908678

Change-Id: If9a3c4857db43ca26a90abff2437e1cebb0ab79b
Reviewed-on: https://dawn-review.googlesource.com/c/2704
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-28 17:00:33 +00:00
Corentin Wallez 32abaffa73 Roll SPIRV-Tools and temporarily use Vulkan SPIRV validation
New additions to the validation for the WebGPU execution environment
broke all the tests that use shaders because tests don't produce valid
SPIR-V for WebGPU and also backends don't know how to lower
WebGPU-flavored SPIR-V to target languages.

Also rolls SPIRV-Headers to a version compatible with SPIRV-Tools

TBR=kainino@chromium.org
BUG=dawn:57

Change-Id: Icd9a199efc39cf143e38d64841eb4b122c9f54a9
Reviewed-on: https://dawn-review.googlesource.com/c/2706
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-28 16:54:31 +00:00
Corentin Wallez 596d6fe00d Result: Fix documentation and a typo
BUG=

Change-Id: I42425a1ee0a4e62a7c1e090878a9d61534eaf784
Reviewed-on: https://dawn-review.googlesource.com/c/2700
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-11-28 11:30:43 +00:00
Jiawei Shao cf714a81c8 Add checks on the texture view used as color or depth stencil attachment
This patch adds checks when we set a texture view as color or depth
stencil attachments:
1. The mipmap level of the texture view must be 1 as it is limited in
   D3D12, Metal and Vulkan.
2. The array layer count of the texture view must be 1 as currently we
   do not plan to support layered rendering in WebGPU.
3. The format of the texture view must be color renderable when it is
   used as a color attachment.
4. The format of the texture view must be a depth stencil format when it
   is used as a depth stencil attachment.

BUG=dawn:16
TEST=dawn_unittests

Change-Id: Ibce3bda20d49a725c26796aa627c5067532761ad
Reviewed-on: https://dawn-review.googlesource.com/c/2661
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-11-28 02:44:17 +00:00
Corentin Wallez 0bd32409b7 Run mac-dawn-rel on the CQ
TBR=kainino@chromium.org
TBR=senorblanco@chromium.org
BUG=chromium:901830

Change-Id: Ia6c4c967e3152c3c5abfeef4da2a85e8076072bc
Reviewed-on: https://dawn-review.googlesource.com/c/2705
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-27 15:40:30 +00:00
Corentin Wallez 0da9494a4f Run mac-dawn-rel on the CQ
TBR=kainino@chromium.org
TBR=senorblanco@chromium.org
BUG=chromium:901830

Change-Id: I28fd4b5d4c2326035a6d3538b9f9eeda9efecdcf
Reviewed-on: https://dawn-review.googlesource.com/c/2620
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2018-11-21 13:45:31 +00:00
Corentin Wallez 316243288c Suppress failing tests on Metal Intel.
Currently this suppresses them for all GPUs on Metal because
we there are no facilities to get the GPU vendor ID yet.

TBR=kainino@chromium.org
BUG=dawn:39

Change-Id: I8377016466da765a18f20ade5b277fa9cf1305c5
Reviewed-on: https://dawn-review.googlesource.com/c/2600
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-21 13:22:41 +00:00
Corentin Wallez a14a070de0 CommandBuffer/PassEncoders: Correctly validate we can record
BUG=

Change-Id: I2e2567942544d6c28ad5d948f5f7c5962790341e
Reviewed-on: https://dawn-review.googlesource.com/c/2564
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-11-21 11:19:36 +00:00
Corentin Wallez 3a5e765f23 BindGroupLayout: Fix off-by-one kMaxBindingsPerGroup validation
BUG=chromium:906370

Change-Id: I95659856398523931b8aacf1e9a9239ac85f1156
Reviewed-on: https://dawn-review.googlesource.com/c/2567
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-21 09:47:19 +00:00
Jiawei Shao ad3d9bafbc Fix missing validations and Vulkan flags on cube map texture views
This patch adds checks that we can only create cube map and cube
map array texture views on textures with width == height as is
required in Vulkan.

This patch enables the imageCubeArray feature on Vulkan back-ends
to ensure we can create cube map array image views on all Vulkan
back-ends.

This patch also adds a missing VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
flag when creating Vulkan images with arrayLayer >= 6. Without this
flag we cannot create cube map or cube map array views.

This patch fixes all the cube map end2end tests on Linux using
Vulkan back-ends.

BUG=dawn:16
TEST=dawn_end2end_tests

Change-Id: Id9386b9ee509d18a5ba8ae1ca085134486b242d7
Reviewed-on: https://dawn-review.googlesource.com/c/2522
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-11-21 01:00:20 +00:00
Corentin Wallez 63997221d7 Fix #include casing breaking linux->windows cross compilation
TBR=kainino@chromium.org
BUG=chromium:907093

Change-Id: I616f774e70871bf3e728178d8d41c18a488b6901
Reviewed-on: https://dawn-review.googlesource.com/c/2580
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-20 15:40:04 +00:00
Corentin Wallez c7d78088cd Make codegen not cast between fnptrs.
When generating the proc tables for dawn_native and dawn_wire (for the
client), we were casting between function pointers with the C types and
function pointers with the internal types. This is UB and was caught by
UBSan.

Replace casts between function pointers by casts between types inside
the functions themselves.

BUG=chromium:906349

Change-Id: Icd8f6eedfa729e767ae3bacb2d6951f5ad5c4c82
Reviewed-on: https://dawn-review.googlesource.com/c/2400
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-20 09:33:35 +00:00
Corentin Wallez c56860e27f WireServer: Check for ID 0 in hand-written handlers.
BUG=chromium:905272

Change-Id: Ib8efb307dbdd6fc57d2cc75366f238c4dfb2beea
Reviewed-on: https://dawn-review.googlesource.com/c/2563
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-20 09:31:45 +00:00
Corentin Wallez ece004fd69 DawnWireAndFrontendFuzzer: skip SwapChainBuilderSetImplementation
SetImplementation takes a pointer and would be shimmed by browsers so we
skip the call in the fuzzer, otherwise we'd dereference arbitrary
pointers.

BUG=chromium:906391

Change-Id: I61d8d729d3fb242e8ddf7452a88a653e05a82cc2
Reviewed-on: https://dawn-review.googlesource.com/c/2562
Reviewed-by: Dan Sinclair <dsinclair@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-20 09:30:15 +00:00
Corentin Wallez c1bb72c5d2 DawnWireAndFrontendFuzzer: don't leak the device.
The dawn::Device(dawnDevice) constructor was adding a reference which
caused the device to leak. Fix this by using dawn::Device::Acquire
instead.

BUG=chromium:904734

Change-Id: Id641459f9285c9da51a0d2a1f88126197bfd79a5
Reviewed-on: https://dawn-review.googlesource.com/c/2561
Reviewed-by: Dan Sinclair <dsinclair@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-20 09:14:40 +00:00
Ryan Harrison fbeca676d4 Tighten when signal trap is used in SPIRV-Cross fuzzers
Due the jump within the signal trap used in these fuzzers, local scope
allocations cannot occur while the signal trap is on, otherwise there
is a possibility of leaks. This CL rewrites how the code under test is
run, so that the potentially aborting code is tightly wrapped by
signal trap without any local scope allocations.

BUG=chromium:906416

Change-Id: Ie52647433dcac57e3ea065d5bdcb6e14c5929494
Reviewed-on: https://dawn-review.googlesource.com/c/2521
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2018-11-19 19:20:08 +00:00
Corentin Wallez 391c8a9224 Roll GLFW to pick up macOS Mojave fixes
BUG=dawn:35

Change-Id: Id9f71ab3a6023b21883d1b3d2f8afcebcf5b2f71
Reviewed-on: https://dawn-review.googlesource.com/c/2480
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-11-19 10:21:23 +00:00
Corentin Wallez 15d8cb765f Roll Chromium's build system to fix Windows builds
build/win_toolchain.json was updated out of band so we need to roll all
Chromium's build support repos to pick up the respective change to
build/vs_toolchain.py

In the meantime, LASTCHANGE-related functionality changed and requires a
new hook to run before we can call `gn gen`.

TBR=kainino@chromium.org
TBR=senorblanco@chromium.org
BUG=chromium:906559

Change-Id: Ic5d297b5700193ca72b02874073e6c553f06e04f
Reviewed-on: https://dawn-review.googlesource.com/c/2560
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-19 10:13:31 +00:00
Corentin Wallez ccfd89d1e3 Run win-dawn-rel on the CQ
BUG=chromium:901830
TBR-kainino@chromium.org
TBR=senorblanco@chromium.org

Change-Id: Ic8249f475f62bb39a8ff17fc6203dc56c6854176
Reviewed-on: https://dawn-review.googlesource.com/c/2501
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-16 13:01:23 +00:00
Jiawei Shao 5ab84ec0a6 Support cube map and cube map array
This patch implements cube map and cube map array texture views on
all back-ends and adds related end2end tests.

BUG=dawn:16
TEST=dawn_end2end_tests

Change-Id: I3ac3f493eb92ac551371041039bd5cf39df53050
Reviewed-on: https://dawn-review.googlesource.com/c/2220
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-11-16 12:11:20 +00:00
Corentin Wallez 69b44ee6a1 BUILD.gn: Fix libdawn_native missing dep on its own headers
BUG=chromium:904736
BUG=chromium:905442
TBR=kainino@chromium.org

Change-Id: Ie08b9c82f189e12ba42411e492190731daad5aca
Reviewed-on: https://dawn-review.googlesource.com/c/2441
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-15 12:38:12 +00:00
Corentin Wallez 2ec59d9fcc Don't use shared libraries in the wire fuzzer.
Otherwise UBSan complains that C++ types are different between the
shared libraries because libc++ is linked statically.

BUG=chromium:904736

Change-Id: I51ef40d1f7910fd693a4585c74ff404812472d2e
Reviewed-on: https://dawn-review.googlesource.com/c/2380
Reviewed-by: Dan Sinclair <dsinclair@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-14 21:04:26 +00:00
Ryan Harrison 499bc0318d Set correct ASAN flags for SPIRV-cross fuzzers
These fuzzers currently depend on being able to change the signal
handler at runtime, but the default flags being used forbid this. This
CL overrides the upstream default to allow changing the handler.

BUG=chromium:904725,chromium:904712

Change-Id: I68423564981b7f2e39f7c00744b92da982cf19e9
Reviewed-on: https://dawn-review.googlesource.com/c/2361
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2018-11-14 21:04:16 +00:00
David Neto b5bced2fce README.md: Need pkg-config on Linux
Change-Id: I32a2f8e2668514b6fc80163f1c567a4038c12d1c
Reviewed-on: https://dawn-review.googlesource.com/c/2340
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-13 09:10:37 +00:00
Corentin Wallez 597e1587b4 Build fuzzer tests in standalone builds too.
This will avoid compilation to break, and adds standalone reproducers
for the fuzzer_tests.

BUG=chromium:903380
BUG=dawn:34

Change-Id: I9995a852076d9f6d1ebdee5b999989c2d74d4709
Reviewed-on: https://dawn-review.googlesource.com/c/2321
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@google.com>
2018-11-12 18:09:56 +00:00
Corentin Wallez 45ee4c88c4 Add a fuzzer for the wire server and Dawn frontend
BUG=dawn:34

Change-Id: Ia82b52276c91ed3bd1a246548115e75ba0ede7f2
Reviewed-on: https://dawn-review.googlesource.com/c/2302
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-12 18:04:55 +00:00
Corentin Wallez 42a0a49318 Fix compilation of SPIRV-Cross fuzzers in Chromium
BUG=chromium:903380

Change-Id: Ic36c400339a2a1fd7dd99b928fec80ce98f6997b
Reviewed-on: https://dawn-review.googlesource.com/c/2320
Reviewed-by: Dan Sinclair <dsinclair@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-12 15:22:37 +00:00
Ryan Harrison 9854295ff6 Add fuzzers for SPIRV-Cross
This CL adds in fuzzers for SPIRV-Cross for HLSL, GLSL, and MSL
outputs. These fuzzers live in Dawn because there is not appropriate
location in the Chromium source repo for them and it is unlikely they
would be land-able in the SPIRV-Cross repo, because it is not coupled
with Chromium's build system and thus Clusterfuzz so would be
effectively dead code. Dawn depends on this code, but it is also
integrated into the Chromium build system, so this was the best place
I could find for them

The code under fuzz unfortunately uses exceptions/aborting as its
error reporting mechanism. This is an acknowledge short coming and
there are efforts to remove this behaviour. To work around this and
reduce the number of false positives found by the fuzzers, a signal
trap has been implemented which will be removed once the code under
fuzz has been updated.

The trap replaces the existing signal handler and silencing signals
while running the code under test. This allows the code under test to
call abort() and not crash the fuzzing process. Theoretically, only
SIGABRT should need to be trapped, but something is causing the signal
from abort() to be converted to SIGSEGV when running under ASAN.

This signal trap has been tested with the fuzzing/sanitizers by
intentionally inserting bad calls that will occur after a few thousand
test cases. It was confirmed that the fuzzer detected the issue and
stops fuzzing.

The alternate to implementing this signal trap would be to turn on
exceptions for the fuzzer. This was attempted, but proved to be
fruitless due to what was reported as an ODR issue, but couldn't
couldn't be silenced. The likely underlying issue was a pre-built
library or other object being built without exceptions was causing
different versions of symbols or the exception version of the standard
library not being instrumented by ASAN. Given the majority of Chromium
eco-system turns off exceptions, fixing this issue would not be
helpful to the larger community and was looking like it would require
significant effort.

BUG=chromium:903380

Change-Id: I63a5595383f99b7a0e150d72bb04c89b8d722631
Reviewed-on: https://dawn-review.googlesource.com/c/2260
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2018-11-12 12:20:21 +00:00
Corentin Wallez 6f86f176a9 Suppress tests failing on D3D12
BUG=chromium:901830
TBR=kainino@chromium.org

Change-Id: Ic70a9257433445eca6ac1fd650efdd51fcbe6174
Reviewed-on: https://dawn-review.googlesource.com/c/2280
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-12 09:04:58 +00:00
Corentin Wallez dcc488aa7c WireCmd: error out if "self" is null.
BUG=dawn:34

Change-Id: Ic77a6a1b2145ad9572abd6e2f3cd422d8c87f3eb
Reviewed-on: https://dawn-review.googlesource.com/c/2301
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-12 09:01:36 +00:00
Jiawei Shao 284f334398 Skip BindGroupTests.ReusedUBO and UBOSamplerAndTexture on Metal
BindGroupTests.ReusedUBO and BindGroupTests.UBOSamplerAndTexture fail on
Metal so we have to skip them temporarily.

BUG=dawn:33

Change-Id: I2875dab6d856eb207ee5b785ddf160df2cb9fd5b
Reviewed-on: https://dawn-review.googlesource.com/c/2240
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2018-11-09 00:48:43 +00:00
Corentin Wallez 679ff4ea86 Validate that mapped buffers aren't used in submits.
Likewise "presented" textures won't be available for use in submits so
this sets up state-tracking and validation for textures too.

Command buffer resource usage is now stored in the frontend instead of
done per-backend because it is used to validate resources are allowed in
the submits.

Also adds a test.

BUG=dawn:9

Change-Id: I0537c5113bb33a089509b4f2af4ddf4eff8051ea
Reviewed-on: https://dawn-review.googlesource.com/c/2142
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-07 10:02:43 +00:00
Corentin Wallez b04c728d54 Add tests for pass resource usage validation
BUG=dawn:9

Change-Id: I0ac62730bfe9ec521fa6da081ca50977c9fe4432
Reviewed-on: https://dawn-review.googlesource.com/c/2141
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-07 09:59:43 +00:00
Jiawei Shao db3b893675 Add entry points for creating a cube map/cube map array texture view
This patch adds the entry points for creating cube map and cube map
array texture views. This patch also adds validations that the array
layer in the texture view descriptor must be 6 when the texture view
dimension is cube map, and a multiple of 6 when the texture view
dimension is cube map array.

BUG=dawn:16
TEST=dawn_unittests

Change-Id: I86a66c3753a7678351f65b43f6cd54b96d1b762c
Reviewed-on: https://dawn-review.googlesource.com/c/2200
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-11-07 09:52:33 +00:00
Stephen White 6686fc8245 MSC build fix.
MSC doesn't like the use of sizeof(member) inside the same struct.
So hardcode the padding, and assert that the offset is 256.

Change-Id: I78bbca6871cf8227c90d00a03ccf8e3d955b7d21
Reviewed-on: https://dawn-review.googlesource.com/c/2160
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-11-04 00:53:18 +00:00
Corentin Wallez 2960ec3366 Add support for all of Chromium's CPU architectures.
BUG=chromium:870747

Change-Id: I421819871f5c45ac07850585e5dcc600d1ff8086
Reviewed-on: https://dawn-review.googlesource.com/c/2140
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-11-01 14:30:24 +00:00
Stephen White 4408b7f20c D3D12 fix for register binding offsets.
When both the vert and frag shaders have a UBO binding, the D3D12
backend was using register offset 0 for both, causing a collision,
and the wrong constant value used in one of the shaders.

The fix is to use the binding offsets computed by the BindGroupLayout,
since they know about all of the bindings, not just the ones computed
for each shader. This made it necessary to defer shader compilation
until pipeline layout creation time (as is done in the Metal backend
for similar reasons).

Finally, those bindings offsets computed by the BGL include an offset
for the CBV, UAV and SRV subgroups, so we must add the same register
offset when assigning the BaseShaderRegister to the descriptor ranges
in the PipelineLayout constructor so that they match.

Bug: dawn:20

Change-Id: I18287bf1c06f06dd61288e12da64752f54634466
Reviewed-on: https://dawn-review.googlesource.com/c/1960
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-11-01 13:59:19 +00:00