Commit Graph

264 Commits

Author SHA1 Message Date
Stephen White 9c5dd769c8 Fix the group decorations on ComputeBoids.
Change-Id: Icf4babde152dbaa75717689e96e641427d6870c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78220
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-01-25 18:22:02 +00:00
Ben Clayton a9ca8cb4ab wgsl: Replace use of [[attribute]] with @attribute
Bug: tint:1382
Change-Id: I58ad2c88fde1e7c96f2ae8257e6df924b94b61db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/77660
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-01-25 16:29:04 +00:00
Corentin Wallez ec9cf2a85c Rename namespace dawn_native to dawn::native.
But keep a namespace alias to avoid breaking project that depend on the
previous namespace name while they get updated.

Done with through the following steps:

 - git grep -l dawn_native:: | xargs sed -i "" "s/dawn_native::/dawn::native::/g"
 - git grep -l "namespace dawn_native" | xargs sed -i "" "s/namespace dawn_native/namespace dawn::native/g"
 - git cl format
 - Manual fixups in generator/templates (and the addition of
   namespace_case in dawn_json_generator.py).
 - The addition of the namespace alias in DawnNative.h

Bug: dawn:824
Change-Id: I676cc4e3ced2e0e4bab32a0d66d7eaf9537e3f09
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75982
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2022-01-12 09:17:35 +00:00
Corentin Wallez 5d846ab503 Rename namespace dawn_wire to dawn::wire.
But keep a namespace alias to avoid breaking project that depend on the
previous namespace name while they get updated.

Bug: dawn:824
Change-Id: I1e99c4d0d2acf7644a225a88d07806d1a64478e6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75540
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-01-11 09:57:33 +00:00
James Price d4f8c39f52 Remove [[block]] attribute from all shaders
This has been removed from WGSL and is now deprecated in Tint.

Bug: tint:1324
Change-Id: Ic187ce3c5ce0723db6f3ca6483e9f5e73ce27acc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/72880
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Corentin Wallez <cwallez@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2021-12-15 13:13:26 +00:00
Corentin Wallez 5bd9445127 Remove CubeReflection and the dependency on GLM
Bug: None
Change-Id: Ie0948a8c14751777754360d276ce212507b74642
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/72581
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2021-12-14 08:42:36 +00:00
Austin Eng 09c308cfcf Improve ScopedEnvironmentVar to distinguish between null and empty
Found while investigating Swiftshader support. Some Vulkan loaders
fail to create an instance if VK_ICD_FILENAMES is empty string
rather than entirely absent. It was set to empty string because
Dawn did not distinguish between nonexistent environment variables
and the empty string. This CL adds distinguishing between the two,
including tests for the behavior.

Bug: chromium:1266550
Change-Id: I1680a281f62e6b340009e01da65db9d485e2975e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/69520
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-11-16 23:37:15 +00:00
Corentin Wallez 983d13235d Add more / finer-grained OWNERS
This will help with review load and finding an owner once mandatory
owner review is enabled.

Change-Id: I1a90b83fed68f062c1406552aec218bf9c2092ce
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67821
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2021-11-02 09:30:52 +00:00
Austin Eng 91851e23a8 Remove several compile-time constants in favor of limits
Bug: dawn:685
Change-Id: Ifac25116c741fdab7b6a8093b4230065beca4773
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65483
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-10-13 18:57:18 +00:00
Corentin Wallez 1ac4565115 Remove deprecated RenderPass*Attachment.attachment
Bug: dawn:762
Change-Id: I86144f77ffd647d2e5c01742fb67367c7a5c914e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63382
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-14 10:42:22 +00:00
Corentin Wallez 363c28e5d1 Remove typedefs for deprecated types.
Bug: dawn:762
Change-Id: I1581d80898d4a98010bb14c5823a1a343c229664
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63383
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@google.com>
Reviewed-by: Brandon Jones <bajones@google.com>
2021-09-10 15:50:19 +00:00
Brandon Jones 27e17a6aad Update deprecated TextureUsage flag names
Older names are kept around as an alias for a while. Unfortunately we
have no mechanism for producing deprecation error messages when they
are used.

Bug: dawn:1035
Change-Id: Ic6716fd526ecbedaa8e7925ab93e3ff32f642d97
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61382
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2021-08-10 04:07:37 +00:00
Corentin Wallez ff6c9ca6f0 wgpu::InputStepMode -> VertexStepMode
See https://github.com/gpuweb/gpuweb/pull/1927

Adds a typedef to make a gradual deprecation.

Bug: dawn:1023
Change-Id: Ic81a933a95556fbf5726056530788dde017a1449
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/59442
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2021-07-25 18:40:19 +00:00
Ben Clayton bf832f07d6 Remove all use of deprecated tint APIs and WGSL syntax
Tint:
* Use the new transform::VertexFormat enum names

WGSL:
* The [[set(n)]] decoration is now [[group(n)]]
* [[builtin(vertex_idx)]] is now [[builtin(vertex_index)]]

Change-Id: I9cbf1368074488c4bb7fa81430bb12ec7581c1fb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56540
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-06-30 11:33:04 +00:00
Corentin Wallez 73b7cd624f Add missing WebGPU limits to Constants.h
This will help check that the Vulkan devices are enough for WebGPU in
a following CL.

In addition to additional limits this CL:

 - Change maxColorAttachments 4 -> 8 to match WebGPU
 - Renames kMinDynamicBufferOffsetAlignment to
   kMinUniformBufferOffsetAlignment.
 - Renames kMaxVertexBufferStride to kMaxVertexBufferArrayStride.
 - Changes validation of buffer offsets to use the separate uniform and
   storage limits (but no test is added because they are the same).
 - Adds validation and a test for kMaxStorageBufferBindingSize.
 - Augment the null::Device memory limit for that new test (it allocates
   a buffer of 512MB).
 - Fix the maxColorAttachment test to not use hardcoded values.

Bug: dawn:796
Change-Id: Ibe4219130a44355ae91c02aaa0a41cf5d9f9e234
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56081
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2021-06-29 08:12:00 +00:00
Sarah 98ab91b474 Update compute shaders tests to include workgroup_size
Change-Id: I97ef98c1cfc1a06c5072d1a52233100ad3d37c09
Bug: tint:884
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56142
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2021-06-29 00:10:01 +00:00
Austin Eng 700a5fb869 Add scoped autoreleasepool to tests and examples
This ensures ObjC objects do not leak. On non-Apple
platforms, the scope does nothing.

Fixed: dawn:546
Change-Id: Id43702e6536bf9cb37825a5449511e10cf0734f5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55841
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-06-24 19:21:31 +00:00
Corentin Wallez b86e45f8ca Omit types in most WGSL `var` statements.
Bug: None
Change-Id: Id6ed10d98a550d912784b688c5473f67f1889a8c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54882
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-06-17 21:36:11 +00:00
Ben Clayton 36edf8d850 wgsl: Fixes for new validation failures
Values of array and matrix can now only be indexed by a constant value.
Dynamic indexing requires the value to be held in memory.

See: https://github.com/gpuweb/gpuweb/issues/1782

Bug: tint:867
Change-Id: I2b9ad6e40fc8121e7aca3a71c190639b39b0b862
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54652
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
2021-06-17 11:25:09 +00:00
Brandon Jones 0d50a2c770 ComputePipelineDescriptor.computeStage->compute
Deprecates the computeStage member of the descriptor in favor of compute
as described by the spec. In order to support both variants without
breaking backwards compatibility some code had to be manually added to
the wire client to copy from the deprecated member to the new one and
visa versa.

Change-Id: I9d5c2fc9c446c927c5792c9af9ed56c90060b65b
Bug: dawn:800
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53884
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-06-09 18:07:32 +00:00
Ben Clayton 15eba9a048 WGSL: Migrate access control to var<>
Spec change: https://github.com/gpuweb/gpuweb/pull/1735

Bug: tint:846
Change-Id: Id2eddc4e8f3bdb86027db8d61bb96b9b8ef9778f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53386
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-06-08 15:36:44 +00:00
Brandon Jones 41c87d973a Removed deprecated CreateRenderPipeline path
Renames all the RenderPipeline*2 stuff to simple RenderPipeline* but
keeps *2 definitionas around as typedefs and wrappers so that users can
migrate away from it.

Bug: dawn:22
Change-Id: If301d81a829bba0646c3a61068f2279932b191e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51764
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2021-05-21 05:01:38 +00:00
Stephen White 21ce5d2965 Split #defines for OpenGL and OpenGL ES backends.
This permits enabling the OpenGL and OpenGL ES backends independently.
This change also enables the OpenGL ES backend on Windows.

This will cause the end2end tests to run on OpenGL ES on the
GPU-less bots, via SwANGLE.

Bug: dawn:580

Change-Id: I43d514b18862d176610b95e97013a67723ddac20
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50881
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2021-05-17 18:04:48 +00:00
James Price eae70b75ae Update WGSL in tests with renamed builtins
These builtins have been renamed:
* frag_coord -> position
* sample_mask_in -> sample_mask
* sample_mask_out -> sample_mask

Change-Id: Ic40dc9f4e509587b7ac82e43abbf9eec68225d9f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48300
Auto-Submit: James Price <jrprice@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-04-19 15:29:49 +00:00
James Price 9e0debd91e Update examples for recent WGSL changes
* Use new entry point IO syntax
* Use `let` instead of `const`
* Remove `-> void` from function headers

Bug: dawn:755
Change-Id: I39b5687a342ea2298c3d2e85517c9b8d9017727e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47500
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-04-13 14:52:44 +00:00
Corentin Wallez 21bd02becf Remove deprecated WGSL "-> void"
Bug: dawn:755
Change-Id: I10f2fb3afd26560df10b21d149a65b625bdb2b4b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47600
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2021-04-13 09:48:24 +00:00
Corentin Wallez 7aec4ae7c5 Remove utility to create shader modules from GLSL
And rename CreateShaderModuleFromWGSL to CreateShaderModule.

Bug: dawn:572
Change-Id: I80dab401078b2001d738b87d6e24437f93b690d1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45764
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2021-03-24 15:55:32 +00:00
Corentin Wallez 266bce86b4 Port Animometer's vertex shader to WGSL
Bug: dawn:572
Change-Id: I21093b5bd09cb319cdf92616cd95e64935fcd1ed
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33822
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2021-03-23 17:26:20 +00:00
shrekshao b00de7f8e8 API evolution GPUExtent3D.depth -> depthOrArrayLayers (Step 2)
Still leave deprecated `depth` functional as there are some references in
other clients. Using `depth` and `depthOrArrayLayers` at the same time is
invalid. Add DeprecatedAPITests.

Bug: chromium:1176969
Change-Id: Ia06645e4f3c17588323dd36b11f9f3988b2e3aba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/44640
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-03-22 21:12:36 +00:00
Ryan Harrison bbabda3590 Fix Storage Buffers in WGSL tests & examples
Converts var<storage_buffer> to var<storage>

Adds in [[access(read_write)]] when no access qualifier was supplied.

BUG=dawn:699

Change-Id: I9da95366d0bb8734f1d134ee2dc764a7c16ef0cf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45300
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-03-18 17:20:48 +00:00
Corentin Wallez 9895c273d6 Update samples to the new RenderPipelineDescriptor
Also does some updates for the new BindGroupLayoutEntry and
VertexFormats that were missed previously.

Bug: chromium:1177501
Change-Id: Icb336590673158538a1586a1f8d5ace398fb381e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45282
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2021-03-18 16:46:58 +00:00
Ben Clayton c56868420d Migrate all tests over to using Default Struct Layout
The WGSL spec has been updated with 'Default Struct Layouts':
https://github.com/gpuweb/gpuweb/pull/1447

This removes the `[[offset(n)]]` decoration, and replaces it with two optional decorations: `[[size(n)]]` and `[[align(n)]]`, and a sensible set of sizes and alignments for each type.

Most `[[stride(n)]]` decorations have also been removed from arrays.

Bug: tint:626
Bug: tint:629
Change-Id: Ib0d2741f61ea943e6fb99d00cbb5cab2f97ae7be
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/44280
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-03-17 09:48:19 +00:00
Jiawei Shao d41aa4378d Add "opengles" in the helper information of Dawn samples
BUG=dawn:707

Change-Id: Id45deb13d8afeef985d81ebc3f7a1a80040498bf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/44660
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-03-15 08:02:53 +00:00
Corentin Wallez 80915849ce Rename Buffer/TextureCopyView to ImageCopyBuffer/Texture.
This is to follow the renames in the upstream WebGPU specification.
Typedef are left in places to make a smooth deprecation period.

Bug: dawn:22

Change-Id: I5134b897930c1fa883c49dd80d2665d6684ec022
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/43882
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2021-03-04 18:13:45 +00:00
Stephen White e8d9843973 Set the default ANGLE backend to swiftshader for example code.
As was done for DawnTest, we should set ANGLE's default backend to
SwiftShader for the examples as well.

Bug: dawn:691
Change-Id: I6ced2ffbeed48a555e74a9373c52cbf9e1e3c708
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/42301
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2021-02-24 16:53:53 +00:00
Stephen White d67544797e Fix the ComputeBoids sample on the OpenGL backend.
Having the [[block]] decorator on the nested Particle struct causes
SPIRV-Cross to not emit it (see bug). Removing the decorator from
the Particle while leaving it on the top-level struct works fine.

This fixes the issue, but validation should be added to Tint
to catch the problem (this work is tracked in https://bugs.chromium.org/p/tint/issues/detail?id=320).

Bug: dawn:611
Change-Id: I8bef811e314ed758f805247977f8b129477abd39
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/42300
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2021-02-23 20:30:39 +00:00
James Price 7e80cce1a9 Remove explicit storage class from samplers/textures
Tint automatically infers a storage class of `handle` for these types
of variable, as per the WGSL spec. Explicitly specifying a storage
class for them will soon become an error.

Bug: tint:332
Change-Id: Ib67e44a5afcdd364470488fd4b456a2b42304daa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/41402
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-02-10 20:17:14 +00:00
Austin Eng 7fe5aa2eac Remove deprecated Wire APIs
Bug: dawn:565
Change-Id: I577532347c79e64b418a93551027e89910c3ce68
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/40480
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2021-02-05 23:36:30 +00:00
Corentin Wallez fb2e77106a Remove utils::GetDefaultSamplerDescriptor
This helper is no longer needed now that the descriptor has full
defaults and is even optional in CreateSampler.

Bug: dawn:599
Change-Id: I0d25233ebb1e817ad27f3ddaca988e01e2a5298c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/40520
Commit-Queue: Stephen White <senorblanco@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2021-02-05 20:26:54 +00:00
Corentin Wallez 6d315daa5d Device: Deprecated GetDefaultQueue in favor of ::GetQueue()
Bug: dawn:22

Change-Id: I103ea933ca5b93f20d8bf11c6671bd9f603d8ff3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/40061
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2021-02-04 15:33:42 +00:00
Corentin Wallez 49a1f72a4f Rename leftover references of output attachment to render attachment.
The CL doing the renaming didn't handle comments and the one string
where "output attachment" appeared.

Bug: None
Change-Id: Ie57159da8278970097271fa5706573444bcdaf61
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38383
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2021-01-22 19:51:37 +00:00
dan sinclair c2032ea637 Update vertex index decoration names.
This Cl updates the `vertex_idx` to the new `vertex_index` decoration
name.

Change-Id: Ic3688e1af87ed0d570b00ccb72d0e84ac920831b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38142
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-01-21 15:41:20 +00:00
dan sinclair 0f9c2d7b78 Update Dawn tests to use group instead of set.
This Cl updates the WGSL used by Dawn to use the new `group` decoration
instead of the deprecated `set` decoration.

Change-Id: I145aaff7721dfafff986ddc429c9cdc9389c2110
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38141
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-01-19 14:18:51 +00:00
Ben Clayton cd9dc36d2e [wgsl]: s/texture_sampled_/texture_
These texture types were renamed in October 2020:
https://github.com/gpuweb/gpuweb/pull/1180

Tint has supported both forms since November 2020:
https://dawn-review.googlesource.com/c/tint/+/31380

Finally migrate to the new form so we can drop support for the old.

Bug: tint:286
Change-Id: Id19b79be28152b3de163f9cce75eefff1ae31d76
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/37702
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2021-01-13 20:29:08 +00:00
shrekshao 7faa362ea9 Fix SamplerFilterAnisotropicTests mipmap
Fix a bug about mipmap level in SamplerFilterAnisotropicTests.
Sizes of the 3 miplevels should be 4,2,1.
The old code allocates 8,4,2 (which don't have a 1x1 level)
Expected rendered pixel values have to change.
The render result now fits the webgl demo at https://jsfiddle.net/t8k7c95o/5/
(Thanks Kai for the enlarged pixelated canvas)

ComputeBoids.cpp and DawnTest.cpp change is due to git cl format

Bug: dawn:568
Change-Id: I9069732208a16be285be13b8cd1ab19b211995a6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/37380
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2021-01-12 23:56:54 +00:00
dan sinclair e6ca254c72 Convert WGSL comments to //
This CL updates the tests with WGSL sources to use // for comments
instead of #. This matches the current WGSL spec.

Change-Id: I04e1a18630a16b794955cace7e55a89221c964fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/37520
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-01-12 22:11:14 +00:00
Corentin Wallez 4814bdbdea Port most of the samples to WGSL
Animometer's fragment shaders remains unported because it isn't clear
how to use modf in WGSL.

Bug: dawn:572

Change-Id: I29aa0ee657b813e7308f0300addd1d5795bfc16d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33821
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-11-26 16:39:46 +00:00
Corentin Wallez 5fad85bbd9 Remove deprecated SetIndexBuffer (without format).
This also simplifies a bunch of code in backends that was used to handle
getting the indexFormat from the pipeline "late".

Bug: dawn:502

Change-Id: Ibae50c8df21323fd391515f6036552e9fb868d93
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/32023
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2020-11-25 08:54:14 +00:00
Stephen White 70102b7190 Add preliminary OpenGL ES and EGL support to Dawn.
This is enough to get all of the sample apps running on a conformant ES 3.1 implementation, such as ANGLE/Vk or NVidia's OpenGL ES Linux driver.

Implements a new opengl::AdapterDiscoveryOptionsES subclass to specify its creation at adapter discovery time.
Adds a "-b opengles" command-line flag to the code samples.
Asserts on a call to glShaderStorageBlockBinding() on ES.
Works around missing indexed draw buffers support by asserting when a non-0 color attachment is specified.
Works around missing glClearTexSubImage() by asserting. :/
These will likely require front-end validation.

BUG=dawn:580
Change-Id: I4a4240ca695a22388c55073fd2aee0323cd4afc9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31000
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-11-24 20:57:23 +00:00
Kai Ninomiya 16036cf206 Add WGPU_STRIDE_UNDEFINED and update bytesPerRow/rowsPerImage validation
This makes a nearly one-to-one mapping between the JS and C APIs, which
benefits projects like Blink and Emscripten.

- JavaScript's `undefined` is equivalent to C `WGPU_STRIDE_UNDEFINED`.
- JavaScript's `0` is equivalent to C `0`.
- To implement the API correctly, Blink must special-case an actual
  value coming in from JS that is equal to WGPU_STRIDE_UNDEFINED
  (0xFFFF'FFFF), and inject an error.

Keeps but deprecates a reasonable approximation of the old behavior.

Bug: dawn:520
Change-Id: Ie9c992ffab82830090d0dfc3120731e89cd9691c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31140
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-11-06 13:41:50 +00:00