Commit Graph

2434 Commits

Author SHA1 Message Date
Tomek Ponitka 1ea3a22f52 Adding a validation for destroyed textures in Queue::WriteTexture
That was missing. There's a new validation test for that and two
tests for submitting copy commands with destroyed buffer/texture
(I think only a mapped buffer was covered so far).
Also fixing some error state tests.

Bug: dawn:483
Change-Id: I691f34722e96866a06465b4b3b0cae9d31c08a84
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/26161
Commit-Queue: Tomek Ponitka <tommek@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-08-03 19:22:33 +00:00
Tomek Ponitka eac38cfbc1 Fixing a deprecated arrayLayer value inside Queue::WriteTexture
Chromium always sends arrayLayer instead of origin.depth since
the migration hasn't been finished yet. This wasn't caught
in Dawn's testing since we are using origin.depth everywhere.

Bug: dawn:483
Change-Id: I13b1ccfb016eea01a3291ca439457db09966e9a3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/26160
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Tomek Ponitka <tommek@google.com>
2020-08-03 09:11:52 +00:00
Corentin Wallez 8c201dfadc Allow arrayLayerCount=0 during the deprecation period.
The value 0 is the default value for default-constructed C descriptors
and should be allowed.

Bug: dawn:22
Change-Id: I876ec4d9c6d70a798b0d6cea5c2ccecaad850eff
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/26100
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-08-03 09:00:12 +00:00
Jiawei Shao 8c9858e9b8 Fix clearing sint/uint color attachments on Vulkan and OpenGL
This patch fixes a bug on the clear of color attachments with signed or
unsigned integer formats on Vulkan and OpenGL by using the correct APIs
to set the clear color for signed/unsigned integer formats.

BUG=dawn:497
Change-Id: If1bc9858875e6384e71c15bb6770fbbb10045037
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/26041
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2020-08-01 04:18:17 +00:00
Jiawei Shao fada501190 Metal: Add shader compilation error message to DAWN_VALIDATION_ERROR
BUG=dawn:498

Change-Id: I850956a6c57ffe9d77e0729e89da6d9a62076509
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/26060
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2020-07-31 00:03:43 +00:00
Bryan Bernhart f03590a754 D3D12: Dynamic shader-visible heap allocation.
Allocates shader-visible descriptor heaps at a much
smaller size then pool-allocates them upon reaching
the max size. This strategy avoids always wasting memory
for lighter users while still maximizing performance for
heavy users.

BUG=dawn:155

Change-Id: I0519235c901d0283b98ee824eeb0cda6de70b210
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25620
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-07-30 21:50:32 +00:00
Kai Ninomiya 05863e62f3 Niceify formatting in webgpu_cpp
Since now there's a copy (slightly hand-modified) saved into
Emscripten: https://github.com/emscripten-core/emscripten/pull/11737

Bug: None
Change-Id: I2677400f9e69a7fcd71f89bdaa04c642be357151
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/26005
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-07-30 19:02:43 +00:00
Austin Eng 0d9fce100d Add texture aspect to texture copy view and validation tests
Bug: dawn:439
Change-Id: I0ca283f58fe2b63ac3a8c468f8ea1bb2d300856f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24683
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-07-30 15:29:57 +00:00
Austin Eng b8a56af176 Rephrase Format::aspect enum as an enum class mask
Format::aspect should be a mask so that it is easier to iterate over
and test if an aspect is present.

This CL also re-exports wgpu's EnumClassBitMask helpers in dawn_native.
It also adds an EnumMaskIterator which wraps BitSetIterator to allow
iterating over the enums in an enum mask.

Bug: dawn:439
Change-Id: I08180a45b27c6031e2f80b0fa1801716677fd813
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24682
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-07-30 15:25:37 +00:00
Kai Ninomiya 38ba51ce7a Make shim headers at <webgpu/*> that point to <dawn/*>
Emscripten's headers live at <webgpu/*>; this makes it so projects don't
have to ifdef which #include path to use.

Bug: dawn:160
Change-Id: I39efee44447470551a78db0abd062f4a2fe9083a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/26020
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-30 09:15:27 +00:00
Jiawei Shao a36a91a445 Support lazy initialization on the buffers bound into a bind group
BUG=dawn:414

Change-Id: Ice592d6427747941406431709999d08778f0f221
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25861
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2020-07-30 08:20:17 +00:00
Bryan Bernhart 03cf7c3eae Enable GBV by default for correctness tests.
Dawn apps using debug builds may hang due to
GBV being always on by default. This change turns
on GBV for correctness tests only.

BUG=dawn:490

Change-Id: I2728d834ed53f9acc7556f8d1178d718c0b49457
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25421
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2020-07-29 19:44:41 +00:00
Tomek Ponitka 2c8e1f2f11 Optimizing memcpy inside Queue::WriteTexture
Fixing an earlier TODO.

Bug: dawn:483
Change-Id: I19d961512caea1f9d502d7e58b56cd3846c9f7f3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25983
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Tomek Ponitka <tommek@google.com>
2020-07-29 18:37:51 +00:00
Corentin Wallez f93fa6acd9 dawn_wire: Implement CreateBufferMapped on top of mappedAtCreation
Reland with a fix for narrowing of uint64_t to size_t of the buffer size
in 32 bit mode.

This inverts the shimming to have the old mapping at creation method
be implemented on top of the new method..

Also updates Wire tests to use mappedAtCreation instead of
CreateBufferMapped.

TBR=senorblanco@chromium.org
Bug: dawn:445
Change-Id: I89fe84b6e0b5d0d4a5c6a2db7b38cb7d6cd063f0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25981
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-29 17:01:11 +00:00
Tomek Ponitka ab04da48f4 Enabling alphaToCoverage
Added the alphaToCoverage functionality with some
end2end tests. There is no validation for disabling alphaToCoverage
mode if SV_Coverage is statically used by the shader yet.

Bug: dawn:494
Change-Id: I9df15b35697ea05a064b092edae9d5d20f73c4d8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25761
Commit-Queue: Tomek Ponitka <tommek@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-07-29 11:44:41 +00:00
Tomek Ponitka 9ecb99344f Roll third_party/spirv-cross/ to enable shader-output mask in HLSL
0376576d2d..f5e9f4a172

$ git log 0376576d2..f5e9f4a17 --date=short --no-merges --format='%ad %ae %s'
2020-07-23 tommek Adding BuiltInSampleMask in HLSL

Created with:
  roll-dep third_party/spirv-cross

Change-Id: I1a9702ce1da046e7c987deaa1994de019d570fb3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25900
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Tomek Ponitka <tommek@google.com>
2020-07-29 10:10:21 +00:00
Corentin Wallez 9d0b9d7212 D3D12Info: programmatically compute the shader profiles.
Bug: dawn:426
Change-Id: Ic360b95e908404137e01a00439b93e5b9b1828ce
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24380
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-07-29 09:34:11 +00:00
Corentin Wallez b88b1a15c7 Revert "dawn_wire: Implement CreateBufferMapped on top of mappedAtCreation"
This reverts commit 0811ecc775.

Reason for revert: Makes the Dawn roll fail.

Original change's description:
> dawn_wire: Implement CreateBufferMapped on top of mappedAtCreation
> 
> This inverts the shimming to have the old mapping at creation method
> be implemented on top of the new method..
> 
> Also updates Wire tests to use mappedAtCreation instead of
> CreateBufferMapped.
> 
> Bug: dawn:445
> 
> Change-Id: I77dcfe72040e5bf187c41fe99c8dd785d5156a07
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25701
> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Austin Eng <enga@chromium.org>

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

Change-Id: Ied940d505fdf576860697dee8df2548c73581eba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:445
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25980
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-29 09:10:13 +00:00
Tomek Ponitka 225a2b46b0 Enabling sampleMask usage in RenderPipelineMTL
Added the sampleMask functionality in Metal.

Bug: dawn:491
Change-Id: Id4a14d0cc715dc701c6f29e4588ce327c5b26cba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25481
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Tomek Ponitka <tommek@google.com>
2020-07-29 08:19:59 +00:00
Kai Ninomiya bce1cbd0e2 CMake: add -framework Metal to dawn_native
Bug: None
Change-Id: Ic71747e48e3d1a737f73bac37cced760af4f195d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25940
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-29 07:21:09 +00:00
Ryan Harrison c4c4ff9eb4 Enable WGSL support by default
Explictly turned off for Skia, since it does not yet have Tint in its DEPS.

Roll third_party/tint/ e8c12f32f..c5cd8f5bd (3 commits)

https://dawn.googlesource.com/tint/+log/e8c12f32f9a9..c5cd8f5bd382

$ git log e8c12f32f..c5cd8f5bd --date=short --no-merges --format='%ad %ae %s'
2020-07-28 rharrison Remove binutils from DEPS and pull in changes to build.gni from Dawn
2020-07-28 rharrison Get 'gn gen --check' passing
2020-07-28 idanr Fix Tint ninja build

Created with:
  roll-dep third_party/tint

BUG=tint:123

Change-Id: Icd26c2d1b7329c94afa6f23c5c057de8efaee3e8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25523
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-07-28 21:57:18 +00:00
Kai Ninomiya a390d7f84f Disable "all" warnings when compiling MSL code
Hopefully works around an issue where some Metal drivers treat warnings
as errors.

Bug: dawn:493
Change-Id: Ia535502a14fd4215ff74eee2662dfbde7e01bc4b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25841
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-07-28 18:51:28 +00:00
Corentin Wallez 0811ecc775 dawn_wire: Implement CreateBufferMapped on top of mappedAtCreation
This inverts the shimming to have the old mapping at creation method
be implemented on top of the new method..

Also updates Wire tests to use mappedAtCreation instead of
CreateBufferMapped.

Bug: dawn:445

Change-Id: I77dcfe72040e5bf187c41fe99c8dd785d5156a07
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25701
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-07-28 15:30:07 +00:00
Tomek Ponitka b7ce8970d2 Rolling shader deps
Roll third_party/glslang/ 9eef54b25..3ee5f2f1d (11 commits)

9eef54b251..3ee5f2f1d3

$ git log 9eef54b25..3ee5f2f1d --date=short --no-merges --format='%ad %ae %s'
2020-07-22 greg Update spirv-tools known-good to most recent stable
2020-07-19 vkushwaha Add changes for SPV_EXT_shader_atomic_float_add
2020-07-14 bclayton Limit visibility of symbols for internal libraries
2020-07-20 john SPV: Update to the latest SPIR-V headers.
2020-07-14 bclayton Deprecate InitializeDll functions
2020-07-14 bclayton Simplify PoolAlloc with use of thread_local.
2020-07-14 malcolm also search global variables assignment for live variables
2020-07-20 bclayton Drop support for VS2013
2020-07-20 bclayton Start glslang 11.0.0
2020-07-20 bclayton Finalize glslang 10.15.3847
2020-07-20 bclayton build_info: Fix parsing of versions with no flavor

Created with:
  roll-dep third_party/glslang

Roll third_party/shaderc/ 6af6e6255..cfacaaffd (10 commits; 1 trivial rolls)

6af6e62557..cfacaaffd1

$ git log 6af6e6255..cfacaaffd --date=short --no-merges --format='%ad %ae %s'
2020-07-28 tommek Adding support for the additional fixed sample mask in MSL (#1120)
2020-07-27 rharrison Rolling 2 dependencies and updating expectations (#1121)
2020-07-14 rharrison Clean up issues discovered by Infer
2020-07-23 dneto Start shaderc v2020.3 development
2020-07-23 dneto Finalize shaderc v2020.2
2020-07-23 dneto Update CHANGES
2020-07-23 dneto Use the non-posix MinGW compiler as fallback (#1117)
2020-07-22 dneto glslc: Add -mfmt=wgsl output format option (#1110)
2020-07-20 rharrison Roll 5 dependencies and update expectations (#1111)

Created with:
  roll-dep third_party/shaderc

Roll third_party/spirv-cross/ 6575e451f..0376576d2 (5 commits)

6575e451f5..0376576d2d

$ git log 6575e451f..0376576d2 --date=short --no-merges --format='%ad %ae %s'
2020-07-22 tommek Enabling setting a fixed sampleMask in Metal fragment shaders.
2020-02-20 cdavis MSL: Add support for processing more than one patch per workgroup.
2020-07-22 dsinclair Roll GLSLang, SPIRV-Headers and SPIRV-Tools.
2020-07-22 cdavis MSL: Factor creating a uint type into its own method.
2020-07-22 cdavis MSL: Factor a really gnarly condition into its own method.

Created with:
  roll-dep third_party/spirv-cross

Roll third_party/spirv-headers/ 7f2ae1193..979924c8b (1 commit)

7f2ae1193a..979924c8bc

$ git log 7f2ae1193..979924c8b --date=short --no-merges --format='%ad %ae %s'
2020-07-21 alanbaker Support SPV_KHR_terminate_invocation (#163)

Created with:
  roll-dep third_party/spirv-headers

Roll third_party/SPIRV-Tools/ c10d6cebb..150be20d4 (34 commits)

c10d6cebbc..150be20d43

$ git log c10d6cebb..150be20d4 --date=short --no-merges --format='%ad %ae %s'
2020-07-27 andreperezmaselco.developer spirv-fuzz: Add condition to make functions livesafe (#3587)
2020-07-27 rharrison Rolling 4 dependencies (#3601)
2020-07-27 andreperezmaselco.developer spirv-fuzz: Implement the OpTranspose linear algebra case (#3589)
2020-07-27 rdb Fix SyntaxWarning in Python 3.8 (#3388)
2020-07-27 bclayton CMake: Enable building with BUILD_SHARED_LIBS=1 (#3490)
2020-07-27 dneto Avoid operand type range checks (#3379)
2020-07-27 jaebaek Preserve debug info in scalar replacement pass (#3461)
2020-07-27 pierremoreau Update OpenCL capabilities validation (#3149)
2020-07-27 stevenperron build(deps): bump lodash from 4.17.15 to 4.17.19 in /tools/sva (#3596)
2020-07-27 antonikarp spirv-fuzz: adds TransformationReplaceLoadStoreWithCopyMemory (#3586)
2020-07-27 jaebaek Preserve OpenCL.DebugInfo.100 through private-to-local pass (#3571)
2020-07-27 stefanomil spirv-fuzz: Relax type checking for int contants (#3573)
2020-07-27 stefanomil spirv-fuzz: Generalise transformation access chain (#3546)
2020-07-27 stefanomil spirv-fuzz: Split blocks starting with OpPhi before trying to outline (#3581)
2020-07-27 afdx spirv-fuzz: Set message consumer in replayer when shrinking (#3591)
2020-07-24 vasniktel spirv-fuzz: Don't use default parameters (#3583)
2020-07-23 rharrison Change DEPS rolling script to point at external/ (#3584)
2020-07-23 vasniktel spirv-fuzz: Create a helper in fuzzerutil to reuse function type (#3572)
2020-07-23 vasniktel spirv-fuzz: Test usages of IdIsIrrelevant fact (#3578)
2020-07-23 antonikarp spirv-fuzz: adds TransformationReplaceCopyMemoryWithLoadStore (#3575)
2020-07-23 antonikarp spirv-fuzz: adds TransformationReplaceCopyObjectWithStoreLoad (#3567)
2020-07-22 stevenperron Start SPIRV-Tools v2020.5
2020-07-22 stevenperron Finalize SPIRV-Tools v2020.4
2020-07-22 vasniktel spirv-fuzz: Fix usages of irrelevant constants (#3566)
2020-07-22 stevenperron Update CHANGES
2020-07-22 alanbaker Support SPV_KHR_terminate_invocation (#3568)
2020-07-22 stevenperron Sink pointer instructions in merge return (#3569)
2020-07-21 greg Preserve OpenCL.DebugInfo.100 through elim-dead-code-aggressive (#3542)
2020-07-21 vasniktel spirv-fuzz: TransformationReplaceParamsWithStruct (#3455)
2020-07-21 38144211+vkushwaha-nv Add changes for SPV_EXT_shader_atomic_float (#3562)
2020-07-21 vasniktel spirv-fuzz: Use irrelevant constants (#3565)
2020-07-21 stefanomil spirv-fuzz: Extend TransformationRecordSynonymousConstants to allow composite constants (#3537)
2020-07-21 vasniktel spirv-fuzz: Add is_irrelevant parameter (#3563)
2020-07-20 vasniktel spirv-fuzz: Add IdIsIrrelevant fact (#3561)

Created with:
  roll-dep third_party/SPIRV-Tools

Roll third_party/tint/ 18c85f52e..e8c12f32f (53 commits)

https://dawn.googlesource.com/tint/+log/18c85f52e482..e8c12f32f9a9

$ git log 18c85f52e..e8c12f32f --date=short --no-merges --format='%ad %ae %s'
2020-07-27 dsinclair Remove StatementList.
2020-07-27 dsinclair [spirv-reader] Update to create BlockStatements
2020-07-27 dsinclair [wgsl-reader] Update to create BlockStatements
2020-07-27 dsinclair Convert LoopStatement to use BlockStatement.
2020-07-27 dsinclair Convert IfStatement and ElseStatement to use BlockStatement.
2020-07-27 dsinclair Convert CaseStatement to use BlockStatement.
2020-07-27 dsinclair Convert Function to use BlockStatement.
2020-07-27 dsinclair [spirv-writer] Add BlockStatement emission.
2020-07-27 dsinclair [msl-writer] Emit BlockStatement.
2020-07-27 dsinclair [wgsl-writer] Add emission of BlockStatement.
2020-07-27 dsinclair [ast] Add BlockStatement
2020-07-25 dsinclair [msl-writer] Emit intrinsics.
2020-07-25 dsinclair Remove KillStatement
2020-07-25 dsinclair [spirv-reader] Convert from KillStatement to DiscardStatement
2020-07-25 dsinclair [wgsl-reader] Add `discard` parsing.
2020-07-25 dsinclair [wgsl-writer] Add DiscardStatement support
2020-07-25 dsinclair [msl-writer] Emit DiscardStatement.
2020-07-25 dsinclair [spirv-writer] Add DiscardStatement support.
2020-07-25 dsinclair [ast] Add DiscardStatement AST node.
2020-07-24 sarahmashay [validation] Add a disabled test for re-assigning a constant.
2020-07-24 dsinclair Fixup some doc and compile issues.
2020-07-23 sarahmashay [validation] implement invalidate assignment to a different type.
2020-07-23 dsinclair Handle review feedback.
2020-07-23 dsinclair Add simple test runner.
2020-07-22 rharrison Fix BUILD.gn builds
2020-07-22 dsinclair [msl-writer] Only emit in/out structs if function call requires.
2020-07-22 rharrison Add usage of main from chromium when part of a chromium build
2020-07-22 dsinclair Add return to simple test
2020-07-22 sarahmashay [validation] Add a disabled test for assignment statement.
2020-07-22 dneto [spirv-reader] Support OpAny, OpAll, OpIsInf, OpIsNan
2020-07-21 dsinclair [spirv-writer] Emit select intrinsic.
2020-07-21 dsinclair Add type determination for the select intrinsic.
2020-07-21 dneto [spirv-reader] Add README.md
2020-07-21 dneto [spirv-reader] Support function call returning void
2020-07-21 dj2 [hlsl-writer] Add assignment statement.
2020-07-21 dj2 [hlsl-writer] Add switch statement support
2020-07-21 dj2 [hlsl-writer] Emit case statements.
2020-07-21 dj2 [hlsl-writer] Emit unary operators.
2020-07-21 dj2 [hlsl-writer] Emit break, return and continue.
2020-07-21 dsinclair [hlsl-writer] Add binary operator emission.
2020-07-21 dsinclair Parse void function call.
2020-07-21 dsinclair [hlsl-writer] Add emission of identifiers
2020-07-21 dj2 Emit call statements from the various backends.
2020-07-21 dj2 Type determine the call statement.
2020-07-21 dj2 Add a call ast statement.
2020-07-21 dneto [spirv-reader] Support select over scalars and vectors
2020-07-20 dneto Add missing Doxygen comments on two methods.
2020-07-20 dneto [spirv-reader] Support function calls, except returning void
2020-07-20 dsinclair [hlsl-writer] Scaffold the HLSL backend.
2020-07-20 dsinclair [msl-writer] Emit storage buffers.
2020-07-20 dsinclair [msl-writer] Add import emission.
2020-07-20 dneto [spirv-reader] Drop NonWritable NonReadable for now
2020-07-20 rharrison Fix issues with BUILD.gn

Created with:
  roll-dep third_party/tint

Change-Id: Ica53a9561d8161667b3d9ca013aa8b0bdf6afc96
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25880
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Tomek Ponitka <tommek@google.com>
2020-07-28 12:14:41 +00:00
Corentin Wallez 5b007a519a dawn_wire: Implement MapRead/WriteAsync on top of MapAsync
This inverts the shimming to have the old mapping entrypoints be
implemented on top of the new mapping entrypoint.

Bug: dawn:445

Change-Id: I98c81b2873d506790b1b19048c5289c62d1b83ae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25700
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-28 09:00:11 +00:00
Jiawei Shao c11a19145f Support buffer lazy initialization before CopyTextureToBuffer
BUG=dawn:414
TEST=dawn_end2end_tests

Change-Id: I5bdd6333029170d47ea240388e7b7d80750ae5d9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25643
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2020-07-28 01:58:50 +00:00
Austin Eng 361a0d8334 Update max storage buffer bindings per stage to 6
This is a temporary change to unblock Tensorflow.js until we
expose querying and setting GPULimits.

Bug: none
Change-Id: Iad851b2be260e9fade7c326bc7fcde39b46cf7fd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25840
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-07-27 21:24:17 +00:00
Bryan Bernhart 1f16229c9b Disable MultisampledRenderingTests on NV/D3D12.
E2E tests fail to pass with backend validation. Disable these tests
until there is resolution from the investigation.

BUG=dawn:462

Change-Id: I0325bafb31cc706be122a601ecfe154bf8880b5b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25680
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-07-27 19:50:21 +00:00
Hao Li d5a4775cfc Query API: QuerySet on D3D12
- Implement QuerySet object creation on D3D12 backend.
- Add end2end tests for the creation on D3D12 backend.

Bug: dawn:434
Change-Id: I9657792ca5cba8f156471783a7c13f6d36b7a19e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25225
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
2020-07-25 14:48:12 +00:00
Kai Ninomiya 0d158ac681 Fix some bugs in buffer mapping in the wire client
Bug: dawn:445
Change-Id: Ibfc55e26c2bc1757811669d84e54e9f775bee8f6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25440
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-07-23 18:27:56 +00:00
Corentin Wallez c7ae7a0012 Implement sampleMask in D3D12 and OpenGL.
Some tests are not enabled in D3D12 yet because SPIRV-Cross lacks
support for gl_SampleMask.

Bug: dawn:491

Change-Id: I6cce56b5d0ab883f39b8d58987246c08a23b6410
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25580
Reviewed-by: Tomek Ponitka <tommek@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-23 16:26:16 +00:00
Tomek Ponitka 4d9cadd58a Enabling sampleMask usage in RenderPipelineVk
Added the sampleMask functionality in Vulkan with some
end2end tests including tests for the shader-output
mask.

Bug: dawn:491
Change-Id: Ib39682d8857729adb4776bc2f2d8e759bf75677b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25340
Commit-Queue: Tomek Ponitka <tommek@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-07-23 11:30:56 +00:00
Ryan Harrison 9061d5d154 Remove deprecated use_relative_hooks reference
Change-Id: Ie035afafda60e10dd728706ad2652399d2a991f1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25521
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-07-22 18:31:17 +00:00
Corentin Wallez 8bd3bcf434 Revert "Turn on WGSL support by default in Dawn"
This reverts commit e1d976ed91.

Reason for revert: crbug.com/tint/123

Original change's description:
> Turn on WGSL support by default in Dawn
> 
> Tint is available in Chromium now, so we can turn this on. For situations were
> WGSL support is not needed it can still be turned off via args.gn.
> 
> Roll third_party/tint/ 16890b9ce..13904a612 (15 commits)
> 
> https://dawn.googlesource.com/tint/+log/16890b9ce8b7..5f43fedcd
> 
> $ git log 16890b9ce..5f43fedcd --date=short --no-merges --format='%ad %ae %s'
> 2020-07-16 rharrison Clean up how deps are defined in BUILD.gn
> 2020-07-16 dsinclair Remove refs.cfg.
> 2020-07-16 dsinclair Fixup group list name
> 2020-07-16 dsinclair [msl-writer] Emitting of program constants.
> 2020-07-16 dsinclair [msl-writer] Fixup matrix and array constructors.
> 2020-07-16 dsinclair Differentiate size and stride in array type name.
> 2020-07-16 dneto [spirv-reader] Support duplicate type definitions
> 2020-07-15 dsinclair [msl-writer] Add struct offset support.
> 2020-07-15 dsinclair [msl-writer] Add builtin support
> 2020-07-15 dsinclair Add helpers for referenced variables.
> 2020-07-15 dsinclair [msl-writer] Refactor some entry point variable code.
> 2020-07-15 dsinclair [msl-writer] Generate entry point functions.
> 2020-07-14 dsinclair [msl-writer] Handle emitting user function calls.
> 2020-07-14 dsinclair Inherit refererenced globals up the call stack.
> 2020-07-14 dsinclair [msl-writer] Generate input/output structs
> 
> Created with:
>   roll-dep third_party/tint
> 
> Change-Id: Ia437e8dc309b06a64ddd4d91ec3af1499af13553
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24920
> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
> Reviewed-by: dan sinclair <dsinclair@chromium.org>
> Reviewed-by: Ryan Harrison <rharrison@chromium.org>

TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org,dneto@google.com,rharrison@chromium.org,dsinclair@chromium.org

Change-Id: I21513d5b5d461eccd42aa650fa4b46e85daf642f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25480
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-22 14:34:49 +00:00
Ryan Harrison e1d976ed91 Turn on WGSL support by default in Dawn
Tint is available in Chromium now, so we can turn this on. For situations were
WGSL support is not needed it can still be turned off via args.gn.

Roll third_party/tint/ 16890b9ce..13904a612 (15 commits)

https://dawn.googlesource.com/tint/+log/16890b9ce8b7..5f43fedcd

$ git log 16890b9ce..5f43fedcd --date=short --no-merges --format='%ad %ae %s'
2020-07-16 rharrison Clean up how deps are defined in BUILD.gn
2020-07-16 dsinclair Remove refs.cfg.
2020-07-16 dsinclair Fixup group list name
2020-07-16 dsinclair [msl-writer] Emitting of program constants.
2020-07-16 dsinclair [msl-writer] Fixup matrix and array constructors.
2020-07-16 dsinclair Differentiate size and stride in array type name.
2020-07-16 dneto [spirv-reader] Support duplicate type definitions
2020-07-15 dsinclair [msl-writer] Add struct offset support.
2020-07-15 dsinclair [msl-writer] Add builtin support
2020-07-15 dsinclair Add helpers for referenced variables.
2020-07-15 dsinclair [msl-writer] Refactor some entry point variable code.
2020-07-15 dsinclair [msl-writer] Generate entry point functions.
2020-07-14 dsinclair [msl-writer] Handle emitting user function calls.
2020-07-14 dsinclair Inherit refererenced globals up the call stack.
2020-07-14 dsinclair [msl-writer] Generate input/output structs

Created with:
  roll-dep third_party/tint

Change-Id: Ia437e8dc309b06a64ddd4d91ec3af1499af13553
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24920
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-07-21 15:43:44 +00:00
Ryan Harrison c4cebc7efa Roll 5 dependencies
Roll third_party/glslang/ b481744ae..9eef54b25 (4 commits)

b481744aea..9eef54b251

$ git log b481744ae..9eef54b25 --date=short --no-merges --format='%ad %ae %s'
2020-07-17 bclayton Update license-checker.cfg with simplified rules
2020-07-17 bclayton Add new rules for update of license-checker
2020-07-15 cepheus GLSL/SPV: Propagaet precision qualifier from function to return value.
2020-07-14 bclayton runtests: Check error codes, set LD_LIBRARY_PATH

Created with:
  roll-dep third_party/glslang

Roll third_party/shaderc/ 5515d2a0c..6af6e6255 (4 commits)

5515d2a0c2..6af6e62557

$ git log 5515d2a0c..6af6e6255 --date=short --no-merges --format='%ad %ae %s'
2020-07-20 bclayton Update license-checker.cfg with simplified rules (#1107)
2020-07-18 bclayton Mingw - use `posix` toolchain flavor (#1108)
2020-07-17 bclayton Kokoro: Migrate linux bots to ubuntu docker image
2020-07-17 bclayton License checker (#1104)

Created with:
  roll-dep third_party/shaderc

Roll third_party/spirv-headers/ 308bd0742..7f2ae1193 (1 commit)

308bd07424..7f2ae1193a

$ git log 308bd0742..7f2ae1193 --date=short --no-merges --format='%ad %ae %s'
2020-07-19 vkushwaha Add changes for SPV_EXT_shader_atomic_float

Created with:
  roll-dep third_party/spirv-headers

Roll third_party/SPIRV-Tools/ 4c33fb0d3..c10d6cebb (15 commits)

4c33fb0d3d..c10d6cebbc

$ git log 4c33fb0d3..c10d6cebb --date=short --no-merges --format='%ad %ae %s'
2020-07-20 stefanomil spirv-fuzz: refactor to use RemoveAtRandomIndex (#3560)
2020-07-20 antonikarp spirv-fuzz: add TransformationAddRelaxedDecoration (#3545)
2020-07-17 alanbaker Store location values sparsely (#3488)
2020-07-17 dneto Permit Simple and GLSL450 memory model in WEBGPU_0 (#3463)
2020-07-17 antonikarp spirv-fuzz: support floating-point in TransformationInvertComparisonOperator (#3551)
2020-07-17 stefanomil Change MaybeApplyTransformation to return a boolean (#3555)
2020-07-17 stefanomil spirv-fuzz: Implement MaybeApplyTransformation helper function (#3540)
2020-07-17 stefanomil spirv-fuzz: Assert false in IsApplicable method of TransformationAccessChain (#3528)
2020-07-16 vasniktel spirv-fuzz: Add support for OpBitcast to TransformationEquationInstruction (#3523)
2020-07-16 vasniktel spirv-fuzz: Add support for OpConvert to TransformationEquationInstruction (#3472)
2020-07-15 alanbaker Fix reachability in the validator (#3541)
2020-07-15 vasniktel spirv-fuzz: Remove TransformationCopyObject (#3531)
2020-07-15 vasniktel spirv-opt: Add support for OpLabel to dominator analysis (#3516)
2020-07-15 stefanomil spirv-fuzz: Fuzzer pass to interchange zero-like constants (#3524)
2020-07-15 afdx spirv-fuzz: Add replay range option (#3535)

Created with:
  roll-dep third_party/SPIRV-Tools

Roll third_party/tint/ 16890b9ce..18c85f52e (23 commits)

https://dawn.googlesource.com/tint/+log/16890b9ce8b7..18c85f52e482

$ git log 16890b9ce..18c85f52e --date=short --no-merges --format='%ad %ae %s'
2020-07-20 dsinclair [msl-writer] Cleanups and refactors.
2020-07-20 dsinclair [msl-writer] Handle uniform buffers.
2020-07-20 dneto [spirv-reader] Support DescriptorSet and Binding
2020-07-20 dneto [spirv-reader] Handle old-style storage buffers
2020-07-17 dneto Rolling 6 dependencies
2020-07-16 dneto [spirv-reader] Support Location on module vars
2020-07-16 dneto [spirv-reader] Ignore empty string user names
2020-07-16 dneto [spirv-reader] Handle gl_Position
2020-07-16 rharrison Clean up how deps are defined in BUILD.gn
2020-07-16 dsinclair Remove refs.cfg.
2020-07-16 dsinclair Fixup group list name
2020-07-16 dsinclair [msl-writer] Emitting of program constants.
2020-07-16 dsinclair [msl-writer] Fixup matrix and array constructors.
2020-07-16 dsinclair Differentiate size and stride in array type name.
2020-07-16 dneto [spirv-reader] Support duplicate type definitions
2020-07-15 dsinclair [msl-writer] Add struct offset support.
2020-07-15 dsinclair [msl-writer] Add builtin support
2020-07-15 dsinclair Add helpers for referenced variables.
2020-07-15 dsinclair [msl-writer] Refactor some entry point variable code.
2020-07-15 dsinclair [msl-writer] Generate entry point functions.
2020-07-14 dsinclair [msl-writer] Handle emitting user function calls.
2020-07-14 dsinclair Inherit refererenced globals up the call stack.
2020-07-14 dsinclair [msl-writer] Generate input/output structs

Created with:
  roll-dep third_party/tint

Change-Id: I5c4e85a8a374d0467b40cc4529cb6ad4909faeb8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25263
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-07-20 19:21:00 +00:00
Corentin Wallez 3ed44f56c5 dawn.json: Noop argument rename for mapAsync
Bug: dawn:22
Change-Id: Ia7f8b5be8f5c7ff68625311e9a393da6c0d774de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25240
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-07-20 16:24:20 +00:00
Xinghua Cao 92ebe87b74 Vulkan: Set apiVersion dawn targets
Set apiVersion to Vulkan 1.0 if the instance only supports
Vulkan 1.0. Otherwise set apiVersion to Vulkan 1.2, treat
1.2 as the highest API version dawn targets.

Bug: dawn:426
Change-Id: I322eaa0a93a518df36b86717c2ed5a98c5d056ea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25065
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
2020-07-20 08:44:29 +00:00
Jiawei Shao d0dd661f18 Implement buffer lazy initialization before CopyBufferToTexture()
This patch adds the check and implementations of buffer lazy
initialization before CopyBufferToTexture().

The support of buffer lazy initialization before CopyTextureToBuffer()
is much more complicated than what we do for CopyBufferToTexture(), so
we decide to put it in another CL instead of writing them together with
CopyBufferToTexture().

BUG=dawn:414
TEST=dawn_end2end_tests

Change-Id: I45fdcdde2c9a0dafff23623815fc35c877990ef1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25140
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-07-20 02:08:59 +00:00
Austin Eng 1233b66c90 Guard [MTLDevice recommendedMaxWorkingSetSize] only on MacOS
Bug: none
Change-Id: Id5d23151953dfc5401776180b42d921adc22833b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25161
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-07-18 00:43:17 +00:00
Austin Eng 4a4c76b8b5 Add offset argument in BufferZeroInit mapping test
The CL that added offset/size args landed about the same time
as the CL that adding zero init mapping tests (without the args).

Tbr=cwallez@chromium.org
Bug: dawn:445, dawn:414

Change-Id: I388399d425c3a3c12be79b160686caaf3d81a89c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25162
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-07-18 00:22:27 +00:00
Corentin Wallez f6e7044697 Add offset and size to Get[Const]MappedRange.
Bug: dawn:445
Change-Id: I73758d95e61d1fbe69f328907a6170a1b27d785b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24983
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-07-17 18:50:37 +00:00
Austin Eng 4b7ca6bf96 Call vkFreeCommandBuffers before destroying the vkCommandPool
This should not be necessary as the command pool should own the
memory if it was created without the creation flag
VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT. However, some drivers
leak memory if vkFreeCommandBuffers is not called.

Bug: chromium:1082181
Change-Id: Ia437fc17b2a304a248b9227b43cfff1868f9f10e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25062
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2020-07-17 15:26:56 +00:00
Austin Eng 64dd82e94f Remove depth sampling tests of non-normalized depth values
Depth texture values outside the 0-1 range are not supported without
an extension.

Bug: dawn:413, dawn:367
Change-Id: I75e7f0de054d6f9a4bac7c6b955c65db810fe36e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24681
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-07-17 15:18:57 +00:00
Austin Eng e01dd678d3 Make common/ compile with Emscripten
Projects using Dawn that are compiled with Emscripten may use some
of our common headers and utilities. ex.) creating a ShaderModule
from SPIR-V. Add handling for __EMSCRIPTEN__ to Platform.h so
compiling to WASM works.

Also, implement GetExecutablePath on Emscripten as unreachable.
This is only ever used to search native paths in the Vulkan backend.

Bug: none
Change-Id: I5d9d6e27e287cb34e7af3214add1c4bc8c6a0f70
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25064
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-07-17 14:52:47 +00:00
Tomek Ponitka 7f4980e7d2 Optimizing WriteTexture offset on Vulkan
Added an additional alignment on the staging buffer offset in
WriteTexture on Vulkan to match
VkPhysicalDeviceLimits::optimalBufferCopyOffsetAlignment.
We now allocate some additional memory in the staging buffer for that
purpose.

Bug: dawn:483
Change-Id: Ic5b95aa57f6c241e0ab9f9853b4c3152e52e5630
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24982
Commit-Queue: Tomek Ponitka <tommek@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-07-17 09:45:26 +00:00
Tomek Ponitka 73652263df Changing validation order for linear texture data
Changed the order of validation blocks in ValidateLinearTextureData.
It doesn't match the order in spec now, but for the algorithm to
compute required bytes in copy we need the conditions which come
after the ones relating to it. Also switched the order of
ValidateLinearTextureData and ValidateTextureCopyRange for similar
reasons.

Bug: dawn:483
Change-Id: If00ae769d170ea12494258721916ec55d79e2880
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25041
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-17 09:44:46 +00:00
Hao Li 5c89c8dc70 Query API: ResolveQuerySet
Add ResovleQuerySet on CommandEncoder and its validation tests.

Bug: dawn:434
Change-Id: Ibba166dd11e15430cd5f6647676a47ce67481844
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24303
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
2020-07-17 09:02:46 +00:00
Jiawei Shao 77eb64eb8c Implement buffer lazy initialization before mapping
This patch implements buffer lazy initialization beffor MapAsync() and
buffer creation with BufferDescriptor.mappedAtCreation == true.

Note that this patch doesn't initialize buffers in MapReadAsyc() and
MapWriteAsync() because they are deprecated and will be removed soon.

BUG=dawn:414
TEST=dawn_end2end_tests

Change-Id: Ifea99833897081f599c45797e0829c57de1ac926
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24687
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2020-07-17 09:01:26 +00:00
Tomek Ponitka 2733af5c75 Optimizing WriteTexture row pitch on Vulkan
Fixing an earlier TODO about aligning bytesPerRow in WriteTextureImpl
to VkPhysicalDeviceLimits::optimalBufferCopyRowPitch.

Bug: dawn:483
Change-Id: Ided2d367177f2f886a84f232c77f1f9f0d50d05d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24981
Commit-Queue: Tomek Ponitka <tommek@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-07-17 08:33:16 +00:00