Commit Graph

9990 Commits

Author SHA1 Message Date
Corentin Wallez ba3c6becdf Fix compilation error of MemoryServiceDmaBuf on ChromeOS
Bug: dawn:457
Change-Id: Id90d392470764b651bff8a804b8f3b54b6383047
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23100
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-06-11 13:37:36 +00:00
Corentin Wallez 0dc70785d8 Vulkan: handle Instance extensions more programmatically
At the moment each instance extension needs special handling
in 6+ places when added to the Vulkan backend. This is very
error-prone and makes it difficult to do changes in how they
are extensions are handled.

This CL makes instance extensions linked with an enum class
and a bitset to know which are available (instead of individual
booleans). A table of known extensions with more information like
`versionPromoted` so that they can be handled programmatically.

Bug: dawn:457

Change-Id: I266deb730eb2b7f3ab0ee7ada1b06ff9748a60e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22940
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-06-11 11:48:05 +00:00
Xing Xu 667238b97d Add storage texture case reading from read-only then writing into write-only
This case verifies that reading from one read-only storage texture then
writing into another write-only storage texture in one dispatch are
supported in compute shader.

Bug: dawn:458
Change-Id: If1b4c13da067fa39b45a378b54c22a4162695c8d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23040
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
2020-06-11 11:36:25 +00:00
Corentin Wallez 90ad1a34dd Add CopyB2B tests including for 0-sized copies
This catches a few driver bugs or validation errors when doing empty
copies.

Bug: dawn:446
Change-Id: Ibef50b0c03b2fa24bc00cf5c7b6d26b8ac6fae8a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19602
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-06-11 11:23:35 +00:00
Corentin Wallez 13f4650155 Add tests and fix (create) mapping zero-sized buffers
When creating a zero-sized buffer mapped, StagingBuffer creation
is skipped. This required adding a new MappedAtCreation state
since mStagingBuffer couldn't be used as a tag value for that.

Made the OpenGL backend always create non-zero-sized buffers.

Finally added tests for MapRead/WriteAsync and CreateBufferMapped
of zero-sized buffers.

Bug: dawn:446
Change-Id: I04f6fe98fd646f1867c21065cd1cd33a1595e19f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21481
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-06-11 11:07:05 +00:00
Hao Li b6eff5acf0 Query API: QuerySet
- Add QuerySet w/o backends implementation.
- Add validation tests

Bug: dawn:434
Change-Id: Id9fed4e42fac464b1254cd2e9cf5337a1d803089
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22440
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
2020-06-11 00:34:14 +00:00
Jiawei Shao 70d75c8c00 Vulkan: Enable nonzero_clear_resources_on_creation_for_testing on buffer
This patch enables nonzero_clear_resources_on_creation_for_testing
toggle on buffer on Vulkan backends as a preparation of supporting
buffer lazy-initialization in Dawn.

BUG=dawn:414
TEST=dawn_end2end_tests

Change-Id: I7619d02ae898e30fd15438d35437802a09e959cc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22981
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-06-10 21:40:10 +00:00
Jiawei Shao 15cbb6b76a Enable CopyTests_T2T/CopyWithinSameTexture* tests on D3D12
This patch enables the tests CopyTests_T2T/CopyWithinSameTexture* on
D3D12 after the D3D12 texture subresource tracking has been supported.

This patch also changes the related comment in Vulkan as WebGPU CG has
already decided to disallow the overlaps among source and destination
subresources in texture-to-texture copies.

BUG=dawn:453
TEST=dawn_end2end_tests

Change-Id: Ibf008c800cfea62658050f565f321a391412c54c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23000
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-06-10 21:38:50 +00:00
Ryan Harrison 3f3483be14 Fix BUILD.gn based builds
Change-Id: Iec5c7ee8d6f614f7a7301c023703650d4c4068d3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23061
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-10 19:45:00 +00:00
Bryan Bernhart 18992f7be9 D3D12: Fix pipeline layout overflow when using dynamic offsets.
Pipeline layout incorrectly indexes into a root table array
when there are more root descriptors than root tables.
To fix, the array is dynamically sized where parameters
are appended instead of indexed into the root signature.

Bug: dawn:449
Change-Id: I6d7f65fb791d323704b1c3a3af9c871a79e32a30
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22960
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-06-10 16:09:45 +00:00
Natasha Lee 4aca14ccb6 Unify TickImpl called during Device shutdown.
Bug: dawn:400
Change-Id: I26ad1a739d123ebc81a2e7d309c8a42f517be06c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22662
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-06-10 14:45:20 +00:00
Xinghua Cao 527080ff03 Check FP16 support on Metal backend
Metal supports FP16 on both macOS and iOS, so we can
unconditionally enable this extension on Metal backend.

BUG=dawn:426
TEST=dawn_end2end_tests

Change-Id: I16c9c907bb112a66e76506ede9bc89a04313d7b3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22882
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
2020-06-10 03:29:34 +00:00
David Neto 39e83353f0 [spirv-reader] Avoid emitting empty elses
Produce less noise in ASTs for a common case.

Also test that an empty continuing construct doesn't show up in the
AST.  That's currently handled by the AST code. We want to keep this
behaviour even if the AST implementation changes. Right now
code change is needed when emitting the start of a continuing
construct.

Bug: tint:3
Change-Id: I96a12087e305c64647561f65d87acda907ae9c42
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22844
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-09 20:07:48 +00:00
Jiawei Shao 14f20b0ab3 Metal: Enable nonzero_clear_resources_on_creation_for_testing on buffer
This patch enables nonzero_clear_resources_on_creation_for_testing
toggle on buffer on Metal backends as a preparation of supporting buffer
lazy-initializations in Dawn.

BUG=dawn:414
TEST=dawn_end2end_tests

Change-Id: Ia7106482922aeb0521affa206f459d40938a0131
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22861
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-06-09 17:09:04 +00:00
Jiawei Shao b6c8855e3a Output more details when pipeline layout mismatches shader declaration
This patch makes Dawn provide more detailed error messages when the
pipeline layout is not compatible with shader module, which is helpful
to debug such errors in WebGPU applications.

BUG=dawn:456

Change-Id: Ib5a870d8e66645481434c4d3dc6fdc1a585aac36
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22881
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-06-09 17:06:04 +00:00
Yunchao He 182af0a4c2 Implement texture subresource on D3D12
When we use a texture for different purpose, we need to add proper
barrier(s) in order to make it ready. Previously, the barrier is
done per entire texture. So it is invalid to sample/read/copy from
one subresource (say a mip/array slice) and render/write/copy to
another subresource of the same texture at the same time.

With this patch, barrier is set per each texture subresource. So it is
valid to use a subresource as source and use another subresource of the
same texture as destination at the same time.

However, planar slices like depth/stencil planes are not handled
gracefully. This is a TODO task. Another task is to combine barriers
into one if they can be combined. I will do this optimization in
another patch in near future.

Bug: dawn:157

Change-Id: I783a76cb88fcdffb60c307ddfb89d50f1583201a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22101
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2020-06-09 16:18:04 +00:00
Ryan Harrison c8000bb02b Rolling 5 dependencies
Roll third_party/SPIRV-Tools/ f050cca7e..7c213720b (6 commits)

f050cca7ec..7c213720bb

$ git log f050cca7e..7c213720b --date=short --no-merges --format='%ad %ae %s'
2020-06-05 vasniktel spirv-fuzz: Fix replayer bug (#3401)
2020-06-05 andreperezmaselco.developer Add value instruction condition (#3385)
2020-06-05 andreperezmaselco.developer Fix instruction function use (#3390)
2020-06-05 vasniktel spirv-fuzz: Fix regression (#3396)
2020-06-04 paulthomson Fix googletest inclusion (#3398)
2020-06-02 jaebaek Add tests for merge-return debug info preservation (#3389)

Roll third_party/glslang/ d39b8afc4..08328fea5 (10 commits)

d39b8afc47..08328fea5a

$ git log d39b8afc4..08328fea5 --date=short --no-merges --format='%ad %ae %s'
2020-06-09 lryer Fix xfb stride limit issue (#2088)
2020-06-04 laddoc Add Shared/Std140 SSBO process & top-level array elements related (#2231)
2020-06-04 apinheiro spirv: Support initializers on uniforms (#1588)
2020-06-03 47594367+rg3igalia Add SPIR-V capabilities needed for spec constants (#2199)
2020-06-02 rdb HLSL: Add better diagnostic when using in/out qualifiers in global scope (#2258)
2020-06-02 rdb HLSL: Recognize POSITION semantic et al in DX9 compatibility mode (#2255)
2020-06-02 rdb HLSL: fix handling of uniform qualifier in entry point parameters (#2254)
2020-06-01 40001162+alelenv Add default descriptorset decoration for acceleration structure (#2257)
2020-06-01 cepheus Update news for header location change and recommendation.
2020-06-02 dj2 Remove install to the SPIRV/ folder. (#2256)

Roll third_party/shaderc/ da87b8d8b..d8eca133b (1 commit)

da87b8d8b0..d8eca133b4

$ git log da87b8d8b..d8eca133b --date=short --no-merges --format='%ad %ae %s'
2020-06-01 rharrison Rolling 5 dependencies (#1078)

Roll third_party/spirv-cross/ d385bf096..92fcd7d2b (7 commits)

d385bf096f..92fcd7d2b0

$ git log d385bf096..92fcd7d2b --date=short --no-merges --format='%ad %ae %s'
2020-06-08 post GLSL: Handle the rest of GL_ARB_sparse_texture_clamp.
2020-06-08 post GLSL: Support uint code for sparse residency query.
2020-06-05 post Refactor texture fetch function generation.
2020-06-06 AlexanderMeissner Fix missing switch cases in Y'CbCr conversion
2020-06-04 post GLSL: Implement sparse feedback.
2020-06-04 post MSL: Remove obsolete MSLVertexAttr members.
2020-06-04 post HLSL: Add native support for 16-bit types.

Roll third_party/tint/ e2be48975..af5df70c7 (37 commits)

https://dawn.googlesource.com/tint/+log/e2be4897566d..af5df70c7bd0

$ git log e2be48975..af5df70c7 --date=short --no-merges --format='%ad %ae %s'
2020-06-08 dj2 Add GLSL FindILsb, FindUMsb, FindSMsb and InterpolateAtCentroid.
2020-06-08 dj2 Add support for GLSL cross.
2020-06-08 dj2 Add GLSL umin, umax, smin and smax support.
2020-06-08 dj2 Add ssign and sabs GLSL support.
2020-06-08 dj2 Refactor GLSL type determination code.
2020-06-08 dneto [spirv-reader] Emit non-header OpBranchConditional
2020-06-08 dneto [spirv-reader] Add cases for mergeless OpSwitch
2020-06-08 dneto [spirv-reader] Fix typo in test name
2020-06-08 dneto [spirv-reader] Check some merge block dominance
2020-06-08 dneto [spirv-reader] Add mergeless OpSwitch case
2020-06-08 dneto [spirv-reader] kIfBreak edge counts toward divergence
2020-06-04 dj2 [spirv-writer] Cleanup capabilities code.
2020-06-04 dj2 [spirv-writer] Add support for outer_product
2020-06-04 dj2 [spirv-writer] Add support for derivatives.
2020-06-04 dj2 [spirv-writer] Add support for dot call.
2020-06-04 dj2 [spirv-writer] Add support for is_inf
2020-06-04 dj2 [spirv-writer] Add is_nan support.
2020-06-04 dj2 [spirv-writer] Add support for all intrinsic.
2020-06-04 dj2 [spirv-writer] Generate any intrinsic
2020-06-04 dneto [spirv-reader] Refactor emission for OpBranch
2020-06-04 dneto [spirv-reader] Update test to show error caught
2020-06-04 dneto [spirv-reader] Update test to show error is caught
2020-06-03 rharrison Fix nit in PRESUBMIT.py
2020-06-03 dsinclair Remove right shift arithmetic operand.
2020-06-03 dsinclair Remove unless_stmt
2020-06-03 dsinclair Remove conditional break/continue.
2020-06-03 dneto [spirv-reader]: Support OpBranch
2020-06-03 rharrison Adding PRESUBMIT.py with a bunch of checks turned on
2020-06-02 dj2 Make case selectors an integer value
2020-06-02 dj2 Add IntLiteral parent for Sint and Uint literals.
2020-06-02 dj2 Rename the IntLiteral to SintLiteral.
2020-06-02 dneto [spirv-reader] Support unreachable, as a return
2020-06-02 dneto [spirv-reader] Support kill
2020-06-02 dj2 Rename case statement conditions to selectors.
2020-06-02 dneto [spirv-reader] Support return, return-value
2020-06-02 dneto [spirv-reader] Emit loop and continuing
2020-06-02 dneto [spirv-reader] Emit control flow: if/then/else

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

Change-Id: Ida82702401ba6fd4a53b98b3b51bee55ba9dd54b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22920
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-06-09 15:33:14 +00:00
Idan Raiter e5b40629ec Reset bind group aspect in SetBindGroup
Change-Id: Ic123578764266a913a3a9a814d5b6c01f47d4ff9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22860
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Idan Raiter <idanr@google.com>
2020-06-09 15:14:14 +00:00
Corentin Wallez 83faf15d21 infra: Migrate builders to Goma RBE
Bug: 950413
Change-Id: I95ff4bc6380eb2af210a8c264411d6064a9a8b32
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22900
Reviewed-by: Simon Que <sque@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-06-09 12:34:02 +00:00
dan sinclair af5df70c7b Add GLSL FindILsb, FindUMsb, FindSMsb and InterpolateAtCentroid.
This CL adds the type determination for the GLSL methods FindILsb,
FindUMsb, FindSMsb and InterpolateAtCentroid.

Change-Id: I2b1e9d021e6799ffe6b5b71c5cca947b8e6ccfa0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22843
Reviewed-by: David Neto <dneto@google.com>
2020-06-08 23:48:26 +00:00
dan sinclair ee39225c0b Add support for GLSL cross.
This CL adds support for the GLSL cross method.

Change-Id: Ib2e83a2ef2e580c6ca257851a76f3f66fa377d6f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22842
Reviewed-by: David Neto <dneto@google.com>
2020-06-08 23:48:15 +00:00
dan sinclair 92bb55777c Add GLSL umin, umax, smin and smax support.
This CL adds type determination for the umin, umax, smin and smax GLSL
methods.

Change-Id: Ib301da41baf718e309a940f4a3560088daa10741
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22841
Reviewed-by: David Neto <dneto@google.com>
2020-06-08 23:48:07 +00:00
Yunchao He 0a79bee135 Vulkan: Combine all pass barriers in a single call
This patch combines barriers in a render/compute pass into one
function call.

Previously, we need to dispatch barrier(s) for each buffer/texture
in a pass. So we may need quite a lot function calls to deliver
barriers in a pass in real web applications. One example is that
we did see that too many function calls to deliver barriers in
Aquarium (WebGPU porting) contributed to CPU usage and bottleneck.

Bug: dawn:441

Change-Id: Ibe44967fefd2e1e6e64df4587146c4fb7fbe8e73
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22700
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-06-08 22:27:18 +00:00
dan sinclair 5e5fb9cf37 Add ssign and sabs GLSL support.
This CL adds the SSign and SAbs GLSL methods to the type determination.

Change-Id: If0e25cd153bd3aaef1cb031d647a86e98ff917bf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22840
Reviewed-by: David Neto <dneto@google.com>
2020-06-08 19:01:07 +00:00
dan sinclair 53352044df Refactor GLSL type determination code.
This Cl cleanups and simplifies the type determination for the GLSL
imports.

Change-Id: I9dd85ac390ef37c91d9493f840f81ceb6736fc06
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22820
Reviewed-by: David Neto <dneto@google.com>
2020-06-08 18:49:31 +00:00
David Neto b0d308c9fe [spirv-reader] Emit non-header OpBranchConditional
This emits the equivalent of break-if, break-unless, continue-if,
continue-unless.  But we do it via a regular if-then-else.

Adds a test matrix.
Adds all required tests except for those needing OpSwitch.

Bug: tint:3
Change-Id: I960a40aa00f95f394a92a099c8b12104010ad49f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22603
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-08 18:26:03 +00:00
Corentin Wallez f5657af110 Fix use of bytesPerRows=0 in CppHelloTriangle
The defaulting when bytesPerRow is 0 has been removed so there was a
validation error.

Bug: dawn:432
Bug: dawn:455
Change-Id: I8e38eb7aeb315d93cc8a9528beb77b9285b368d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22800
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-06-08 16:13:41 +00:00
David Neto bff3b78313 [spirv-reader] Add cases for mergeless OpSwitch
This is a bit pathological.

Bug: tint:3
Change-Id: I448796c712049f88cef9a592c218d94a0daddb75
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22760
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-08 15:26:18 +00:00
David Neto 783938d173 [spirv-reader] Fix typo in test name
Prefix should match a method name on FunctionEmitter

Bug: tint:3
Change-Id: I0af9fb33210d09a59e5cacdade986668fe685682
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22681
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-08 15:14:22 +00:00
David Neto bdcd04b1a2 [spirv-reader] Check some merge block dominance
A merge block must be dominated by its own header.
This CL checks the cases where that fails because the
merge block is also the:
- the default or case header for a switch (a different header)
- the true-head, false-head, or premerge-head for an if-selection
  with a different header

Bug: tint:3
Change-Id: I6dd1fae162e9d33bd9a0b43d3ca9558cebed058b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22680
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-08 15:14:22 +00:00
David Neto dc8efd4095 [spirv-reader] Add mergeless OpSwitch case
This is a bit pathological.

Bug: tint:3
Change-Id: I820d7d1bfd298a22be6c6014e7d4d00f1097759e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22740
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-08 14:53:34 +00:00
David Neto 5d4c35f96e [spirv-reader] kIfBreak edge counts toward divergence
This fixes the pathological cases nobody wants, and arguably
should be added to the SPIR-V spec.

If we really really want to support these cases, we can revisit.

Bug: tint:3
Change-Id: I0a75490d451676caa0933e3761098ba1fe3f8b60
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22664
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-08 14:37:05 +00:00
Xinghua Cao db8f804bc3 Reland "Check FP16 support on vulkan backend"
This reverts commit 0357eed7de
and reland commit bdc05c3d5f.

The Vulkan-Loader has a bug where if the instance is created
with Vulkan 1.1 and not the promoted extensions, it will skip
emulation and if the ICD doesn't support Vulkan 1.1 nor the
extensions. Enable the promoted extensions, even when creating
a Vulkan 1.1 instance.

Original change's description:
> Check FP16 support on vulkan backend
>
> This patch check FP16 support on vulkan backend, and introduces
> the shader_float16 extension.
>
> BUG=dawn:426
> TEST=dawn_end2end_tests
>
> Change-Id: Ie09568a416ce9eb2c11afeede3e7da520550d5fb
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21901
> Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Reviewed-by: Austin Eng <enga@chromium.org>

Bug: chromium:1087896, dawn:426
Change-Id: I2c4465fb2fe957966b44d3e5840112219481c639
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22781
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-06-08 12:18:21 +00:00
Jiawei Shao e472c459b9 Add validations on the texture-to-texture copies within same texture
This patch adds validations on the texture-to-texture copies within the
same texture to align with the latest change in WebGPU SPEC: When the
source and destination textures are the same one, the source and the
destination subresources involved in the copy must not overlap.

Note that we don't enable the newly added end2end tests on D3D12
because when doing texture-to-texture copy within the same texture, we
need to set the source subresources into TRANSFER_SRC state and set the
destination subresources into TRANSFER_DEST state, while right now we
don't support subresource tracking on D3D12.

BUG=dawn:453
TEST=dawn_unittests
TEST=dawn_end2end_tests

Change-Id: I6408640d01beaf6ab9ef30b001e9c87cfecbdd65
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21601
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2020-06-08 11:30:01 +00:00
Austin Eng ee0516e398 D3D12: Properly compute rowsPerImage for lazy texture clear
This code was incorrectly passing 0 and dividing by zero for
non-renderable, unaligned-size textures.

Bug: dawn:451
Change-Id: Ic79183a7ccee712b9a9ee002056f090c8e9fae15
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22665
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-06-08 09:53:11 +00:00
Jiawei Shao a2fe305797 Add all formats used as writeonly storage texture in StorageTextureTests
This patch changes all the tests related to write-only storage textures
in dawn_end2end_tests StorageTextureTests to make them test all the
texture formats that support being used as storage textures in WebGPU.

BUG=dawn:267
TEST=dawn_end2end_tests

Change-Id: I4e49efc21f768a9b7645bf334bd41a97fd4838e7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22663
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2020-06-06 00:45:40 +00:00
Corentin Wallez 45aed839e9 CopyFromStagingToBuffer: ASSERT size is not 0
Zero-sized copies are invalid in a couple backends, and in follow up
CLs CreateBufferMapped will be change to handle zero-sized buffers
correctly.

Bug: chromium:1069076
Change-Id: Ieef62a13182bbe1e939a3847980c91339e42aa8f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22460
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-06-05 15:44:03 +00:00
Jiawei Shao 0a6a9d8692 Test all formats used as readonly storage texture in StorageTextureTests
This patch changes all the tests related to read-only storage textures
in dawn_end2end_tests StorageTextureTests to make them test all the
texture formats that support being used as storage textures in WebGPU.

BUG=dawn:267
TEST=dawn_end2end_tests

Change-Id: I4d6ddbee638a787a2dcfc626bd4963a9b9043772
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22640
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2020-06-05 01:02:57 +00:00
dan sinclair 7615d9468c [spirv-writer] Cleanup capabilities code.
This CL simplifies the capabilities code in the SPIR-V builder.

Bug: tint:5
Change-Id: Iff99350b2d6a2534c82ea3d47a0a9186d0dcb6ac
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22661
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-06-04 17:29:54 +00:00
dan sinclair 65cd5a8e0d [spirv-writer] Add support for outer_product
This CL adds support for generating OpOuterProduct.

Bug: tint:5
Change-Id: Iefbc91807850b7caf5dba393124f97417b7b0b09
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22660
Reviewed-by: David Neto <dneto@google.com>
2020-06-04 17:17:37 +00:00
dan sinclair 36471fe3eb [spirv-writer] Add support for derivatives.
This CL adds support for generating the various dpdx, dpdy and fwidth
instructions.

Bug: tint:5
Change-Id: I6d12c738b93931d1e740659d9c1871892b801f71
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22625
Reviewed-by: David Neto <dneto@google.com>
2020-06-04 17:14:43 +00:00
dan sinclair 2cbbb5d7c2 [spirv-writer] Add support for dot call.
This CL adds support for generating OpDot.

Bug: tint:5
Change-Id: I5a77e49ff26ff12b4ed7b2b01665f0928e51a568
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22624
Reviewed-by: David Neto <dneto@google.com>
2020-06-04 17:06:06 +00:00
dan sinclair 3c3cf3cc21 [spirv-writer] Add support for is_inf
This CL adds support for generating OpIsInf.

Bug: tint:5
Change-Id: Ia208695d78f9914000e893435f37be45adb81022
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22623
Reviewed-by: David Neto <dneto@google.com>
2020-06-04 17:05:55 +00:00
dan sinclair c31903d2ad [spirv-writer] Add is_nan support.
This Cl adds support for generating OpIsNan.

Bug: tint:5
Change-Id: If35e46c6cb2719771abdd425ff6116b539da0be0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22622
Reviewed-by: David Neto <dneto@google.com>
2020-06-04 17:05:49 +00:00
dan sinclair 0bcb50b04a [spirv-writer] Add support for all intrinsic.
This CL adds support for generating an OpAll .

Bug: tint:5
Change-Id: I70a92bc68064625324d6c7b59220a901ced76f96
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22621
Reviewed-by: David Neto <dneto@google.com>
2020-06-04 17:05:43 +00:00
dan sinclair 3e7dc82b35 [spirv-writer] Generate any intrinsic
This CL adds the necessary code to generate an OpAny instruction.

Bug: tint:5
Change-Id: I558b2cbf4bade3b4ab17997d24dcffddc32e2b41
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22620
Reviewed-by: David Neto <dneto@google.com>
2020-06-04 17:05:35 +00:00
David Neto 06d49471a0 [spirv-reader] Refactor emission for OpBranch
Bug: tint:3
Change-Id: If1d603990f133f8ba0b3a305f7f7f3db4623e9ce
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22602
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-04 15:28:10 +00:00
David Neto 3bbc45ded3 [spirv-reader] Update test to show error caught
This is the case where a block can't be a "continue block"
for more than one header.  It can only be a continue block for
the innermost loop it's inside of.

Bug: tint:3
Change-Id: Ic19ca544ab8a30cb1ff16d2c828abb260facba90
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22601
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-04 15:27:05 +00:00
David Neto 90d6b2d94f [spirv-reader] Update test to show error is caught
In this example, a branch escapes an if-selection.
This is caught by ClassifyCFGEdges

Bug: tint:3
Change-Id: I5586e8bb5f9de0cdf57ad46708fcee12cd31f6aa
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22600
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-06-04 15:26:31 +00:00
Natasha Lee 783cd5a79c Avoid processing already processed tick
To avoid overly ticking, we only want to tick when:
1. the last submitted serial has moved beyond the completed serial
2. or the completed serial has not reached the future command serial added
by the trackers (MapRequestTracker, FenceSignalTracker, ErrorScopeTracker).

Bug: dawn:400
Change-Id: Ie7c65acc332846ac1a27f9a18f230149d96d2189
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19062
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Natasha Lee <natlee@microsoft.com>
2020-06-04 02:26:46 +00:00