Adds a new option to insert the needed flags, as well instructions on
how to run the checks to README.md.
BUG=tint:62
Change-Id: Id154555c4846f1dea29bad1fba5a3cd73ac7fb04
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20540
Reviewed-by: dan sinclair <dsinclair@google.com>
This CL adds the code to handle a swizzle of a single element (eg vec.x)
Bug: tint:5
Change-Id: If23979c8b715e6770e75fb72c92a91aec83c5b0d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20502
Reviewed-by: David Neto <dneto@google.com>
This CL updates the call code to emit an OpLoad if the parameter being
passed is a pointer.
Bug: tint:5
Change-Id: I19c2ffa1b55697173ded6d5509fecd37442e7966
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20501
Reviewed-by: David Neto <dneto@google.com>
When building in Chromium, Dawn's gtest targets use sources files
in Chromium so it can use Chromium's GTest harness. These source
files were compiled with the "dawn_internal" config included.
This made them include Dawn-specific warnings that trigger on parts
of Chromium's //base.
Instead compile these "main" files as separate source_sets without
dawn_internal and link them in the dawn test executables.
Bug: chromium:1075817
Change-Id: I573390ca3e6a7dfd1e8a949dc10ed268f0d0f63e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20520
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
GetResourceAllocationInfo() returns UINT_MAX64 when
the requested size is too large. This corrects the
validation to OOM when D3D considers the size
invalid.
Only validating for zero-size would cause a device
loss as certain D3D drivers may not always consider
zero-sized invalid and NextPowerOfTwo(UINT_MAX64)
would overflow the allocator.
BUG=dawn:393
Change-Id: Idaad10c139f6428d4f48bca24027a6691257aca9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20400
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
This patch adds the basic supports of both read-only and write-only
storage textures on Metal with several simple end2end tests that use
read-only or write-only storage textures in every shader stage.
Here are the follow-ups after this patch:
1. test all the texture formats that can be used as both read-only and
write-only storage textures.
2. support using a texture with multiple different binding types in one
rendering or compute encoders.
3. test image2DArray, imageCube and imageCubeArray.
BUG=dawn:267
TEST=dawn_end2end_tests
Change-Id: Id0de623f7c48389b3b1e90b34a34fd16b14e1477
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19420
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This CL adds the beginning of break and continue support. The
conditional versions are not supported, just the non-conditional.
Bug: tint:5
Change-Id: I84418cffd3e29dc011c4313bf9aa3da4833c009f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20500
Reviewed-by: David Neto <dneto@google.com>
Add missing includes:
- Add missing vector include WGPUHelper.h
- Add missing algorithm include as there is a std::transform used in DawnPerfTestPlatform.cpp
Remove c++20 designated initializers from tests.
Removing these as we target c++14 and they trigger warnings in MSVC.
Bug: dawn:394
Change-Id: Id7aea9ef953cc9baa5b7633a036dd09a96aca130
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20460
Commit-Queue: Felix Maier <xilefmai@gmail.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Label basic blocks with:
- their nearest enclosing structured control flow constructs.
- their nearest enclosing continue construct, if any
- their nearest enclosing loop construct, if any
A construct consists of a span of blocks in the computed block order.
It knows its parent construct, if any, and its nesting depth.
Bug: tint:3
Change-Id: Ia945706e8ea2435d6c40fb4e36dc2daeeb9780d0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20421
Reviewed-by: dan sinclair <dsinclair@google.com>
This is gives us the fundamental ordering of blocks in relation
to a structured construct.
Bug: tint:3
Change-Id: I76eb39403131305398808c33ce4cee256a1c23c2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20266
Reviewed-by: dan sinclair <dsinclair@google.com>
This will help avoid the introduction of additional non-standard
code and the warnings can be reintroduced one by one.
Bug: dawn:394
Change-Id: Ib3cd63058f47d17ae5ef67b047887a3b263a7e64
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20382
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This CL adds support for alias types in the members of structures.
Bug: tint:5
Change-Id: I22f19b9a57d0f1be0ec4d6299948c1a93766ff9d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20347
Reviewed-by: David Neto <dneto@google.com>
TEST=Built fuzzer in local checkout of Chromium with tint integrated.
BUG=dawn:14
Change-Id: I84aacd41f893070c3af40f5e640361e177689f9e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20343
Reviewed-by: dan sinclair <dsinclair@google.com>
The new warnings are:
- -Wdeprecated-copy
- -Winvalid-offsetof
- -Wpessimizing-move
And the list of warnings was sorted alphabetically.
Bug: chromium:1072449
Change-Id: I9f3eecae645455c481ecc2e0be4df350e1453907
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20381
Reviewed-by: Zhenyao Mo <zmo@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This CL adds the missing storage classes to the module scoped variables
in compute boids.
Change-Id: I59cbe0f9bcc4b235f2f9157801dcbc445a6bd5eb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20346
Reviewed-by: David Neto <dneto@google.com>
As long as a type constructor is not global the values can be non-const
which means they don't have to be constructors. This CL fixes an issue
where we incorrectly assumed the value was a constructor.
Change-Id: Ib1661830cbb14298ea9254145edd60b74e0dee1d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20344
Reviewed-by: David Neto <dneto@google.com>
The member accessors end up being aliases in a lot of cases because you
can't have a struct that isn't an alias. This Cl unwraps the aliases at
the start of the determination for member accessors.
Change-Id: Ib090ebd6aedd502c2812d95373c19d8eb831a361
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20342
Reviewed-by: David Neto <dneto@google.com>
Make sure we unwrap pointers in import determination so things like
passing a member of a struct will determine the import correctly.
Change-Id: Id4565351c45e7798664c3368e2dec19b1440492d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20341
Reviewed-by: David Neto <dneto@google.com>
This CL adds load and store tests for a member accessor result.
Bug: tint:5
Change-Id: I5b8da3bb8d3df2c150967c812ffe3eeae3189fa7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20340
Reviewed-by: David Neto <dneto@google.com>
This CL updates the type determiner such that variable result types
end up wrapped inside pointers, constants do not. The result of Member
and Array accessors are also pointers if the source was a pointer.
Change-Id: I6694367daf6ba1db929e54a975dfea8404fca40c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20265
Reviewed-by: David Neto <dneto@google.com>
Implements logic for managing the NON_LOCAL memory segment for UPLOAD
and READBACK heaps on Non-UMA devices.
Bug: dawn:193
Change-Id: I2426bf6b5f7a7ccd4420f830f344379af9faf73c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19901
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
Reland with a fix where commands only start being serialized by the
device after the first GetDevice() is called, not in the constructor.
This makes it so calling GetDefaultQueue always returns the same
object. It required updating various WireTests to account for the
additional wire calls.
Bug: dawn:22
Change-Id: Ibe43d84b25100f58a9ec5029a9341e400aec97f6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19982
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
The test failed to switch out because the same
bindgroups were being de-duped. This change encodes
as many bindgroups required to switch.
BUG=dawn:155
Change-Id: I238cd0cebf2f8372046fe0cf83a18570aca41761
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20241
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
This CL adds a DISABLED test for the single swizzle case.
Bug: tint:5
Change-Id: I75df147adba4e2e2b7eb6bfd0e0ede951502a73d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20300
Reviewed-by: David Neto <dneto@google.com>
Also, list remaining logical instructions to be tested
Bug: tint:3
Change-Id: I48dda1d3637bc7c4d75358e26fb9de8f0c6f0bb6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20261
Reviewed-by: dan sinclair <dsinclair@google.com>
Record header/merge cross-links, and single_block_loop attribute of BlockInfo.
Also checks that they are sane: only target blocks in the same function.
Bug: tint:3
Change-Id: I715f7ed354a556e92d58a4c9ba6f306c746c3641
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20080
Reviewed-by: dan sinclair <dsinclair@google.com>
This is a reland of 96c4019214
It includes a fix to add a dummy descriptor count if the
VkDescriptorPool would be empty, and adds a test that a bind group
with an empty bind group layout may be created and used.
Original change's description:
> Slab-allocate VkDescriptorSets
>
> This introduces a slab allocator for VkDescriptorSets which creates
> a VkDescriptorPool pre-allocated with multiple VkDescriptorSets per
> BindGroupLayout. In the future, we can deduplicate pools that have
> the same, or roughly the same, descriptor counts.
>
> This CL also removes the old DescriptorSetService and moves most of
> the functionality onto the DescriptorSetAllocator itself to keep
> the tracking logic in one place.
>
> Bug: dawn:340
> Change-Id: I785b17f4353fb3d40c9ccc33746600d6794efe7c
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19320
> Reviewed-by: Austin Eng <enga@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>
Bug: dawn:340
Change-Id: Iabb744f110d0cab442bb857b31c87ba46bf0ad7a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20321
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
To avoid accidental memory leaks on account of using raw pointers,
use Ref<TextureBase> as method return type except at Dawn interface
boundaries.
Change-Id: I6459062ee28984de2cb1d5a2059bc70cf82b2faf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19580
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
//build/config/gcc:rpath_for_built_shared_libraries is being pulled in
on Skia Linux builds. Don't include it if //build isn't present.
Bug: chromium:1072449
Change-Id: I92f2d0ae0b4325ae672a86d6a38caf241929b65b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20320
Commit-Queue: Sean Gilhuly <sgilhuly@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This is in anticipation of future fuzzer implementations.
BUG=tint:56
Change-Id: I73492c135bed7d5bee9c114ec336a837b4f447ac
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20243
Reviewed-by: David Neto <dneto@google.com>
This CL fixes up the member accessor code and adds tests.
Bug: tint:5
Change-Id: I139cb2e853da92e762255e4836daf2b9a437179d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20181
Reviewed-by: David Neto <dneto@google.com>
This reverts commit 96c4019214.
Reason for revert: Breaks the roll, WebGPU CTS hits the
ASSERT(totalDescriptorCount > 0)
Original change's description:
> Slab-allocate VkDescriptorSets
>
> This introduces a slab allocator for VkDescriptorSets which creates
> a VkDescriptorPool pre-allocated with multiple VkDescriptorSets per
> BindGroupLayout. In the future, we can deduplicate pools that have
> the same, or roughly the same, descriptor counts.
>
> This CL also removes the old DescriptorSetService and moves most of
> the functionality onto the DescriptorSetAllocator itself to keep
> the tracking logic in one place.
>
> Bug: dawn:340
> Change-Id: I785b17f4353fb3d40c9ccc33746600d6794efe7c
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19320
> Reviewed-by: Austin Eng <enga@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>
TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org,bryan.bernhart@intel.com
Change-Id: Icb58485f1080eab79b24fbcd834a89fc6206b80e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:340
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20280
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Resource usage tracking in compute pass is per dispatch. So readable
and writeable usages in pass granularity may be valid.
This patch also removes ComputePassValidationTests.cpp because it
is duplicated with ResourceUsageTrackingTests.cpp. The former actually
contains resource usage tracking tests only, and the latter is also
for the same purpose and it is much more comprehensive.
Bug: dawn:358
Change-Id: I53f8906660b348eeff4f2a061e3b829d1c2ceab8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20122
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Uses the staging descriptor allocator to enable
sub-allocation for RTV/DSVs.
This change also simplifies CPU descriptor heap
management for render-passes:
- Allocating slot-by-slot removes extra attachment
pass.
- No need for the slower direct allocation allocator.
- Move RP creation of view handles into RP builder.
BUG=dawn:155
Change-Id: I508492a2e56a897bf8c85f9a45cd13f62fa0a2ef
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20042
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This introduces a slab allocator for VkDescriptorSets which creates
a VkDescriptorPool pre-allocated with multiple VkDescriptorSets per
BindGroupLayout. In the future, we can deduplicate pools that have
the same, or roughly the same, descriptor counts.
This CL also removes the old DescriptorSetService and moves most of
the functionality onto the DescriptorSetAllocator itself to keep
the tracking logic in one place.
Bug: dawn:340
Change-Id: I785b17f4353fb3d40c9ccc33746600d6794efe7c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19320
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Adds functionality to query VideoMemoryInfo for the NON_LOCAL memory
segment.
Bug: dawn:193
Change-Id: I63c2f5a649c37617e7b39a60faa2d3b5b5077156
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19900
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>