It will always use the "std::glsl" import name.
Remember all the IDs of such imports.
Never add more than one GLSL.std.450 import to the AST.
Also refactor the Assemble test helper into its own file.
Bug: tint:3
Change-Id: I5b2b70ea0f00d44aacf553aa009756dff2a4cecf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16662
Reviewed-by: dan sinclair <dsinclair@google.com>
This CL marks the specific `bool` test as NOLINT in fail_stream to stop
the linter from emitting errors.
Change-Id: Ifa3d9b0a2e0f06bcd0d48cbe79f8dbe91fe7b4ef
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17061
Reviewed-by: David Neto <dneto@google.com>
This CL adds unit tests for the VariableStatement AST element.
Bug: tint:11
Change-Id: I36d1b134e4c1c93ee414c29e8bb8d5e7e9704da6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16760
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds a test to the variable AST node to verify the initializer
is valid.
Bug: tint:11
Change-Id: I95553e8572124e8e2e861b451003e5c9bf6358f1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16743
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests for the UnlessStatement AST elements.
Bug: tint:11
Change-Id: Icd003e81925d60c6681e447be2f1a5610564eda7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16742
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds unit tests for the UnaryOpExpression AST element.
Bug: tint:11
Change-Id: I086d167c3b2ef0764a45a41268222254adba4017
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16741
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds unit tests for the UnaryMethodExpression AST element.
Bug: tint:11
Change-Id: I5e99bb15f1333c1fa7ff34efafd86739c6a1d662
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16740
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
Use D3D12's QueryDeviceVideoMemoryInfo to get the OS-determined process
budget. Also introduces an export for reserving some amount of process
memory - which keeps Dawn from using the entire process's budget.
Bug: dawn:193
Change-Id: I6c17bd703d7cb24759bcee89c03add46944fec8c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16383
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This patch adds the validation on the storage texture format declared in
shaders when we create a rendering or compute pipeline with read-only or
write-only storage textures.
This patch also fixes a typo in the TextureValidationTest.
BUG=dawn:267
TEST=dawn_unittests
Change-Id: Id302b4b7803d7e03b57c61de1290cc71ba940e2c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16940
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This CL adds tests for the UnaryDerivativeExpression AST element.
Bug: tint:11
Change-Id: Ieabfdcb7940aedc58a3455b74c0ddb508b4859ff
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16673
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds unit tests for the TypeInitializerExpression AST element.
Bug: tint:11
Change-Id: I92790563c995038cc5a09afd03e84496b8f41487
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16672
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests to the SwitchStatement AST element.
Bug: tint:11
Change-Id: I3e12667d14ab31cc15f6ea8595847f9daf55dc46
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16682
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This Cl adds more IsValid tests to the StructMember AST node.
Bug: tint:11
Change-Id: I7fec6fb5e96f025735fd444c74f97d4ded8b3ae6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16671
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This Cl adds tests for the Struct::IsValid to make sure struct members
are also valid.
Bug: tint:11
Change-Id: I49d9f1dd6a6d2da8c49a273466316a849e1d28cd
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16670
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds a test for the set decorations to_str method.
Bug: tint:11
Change-Id: I06396c1bf59c90aad6a6851cf9695fbee42546a8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16669
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests for the ReturnStatement AST node.
Bug: tint:11
Change-Id: Ib20e38e67e07e0ae03d359619cc260bc8d6e3a3b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16668
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds test for the RelationalExpression AST node.
Bug: tint:11
Change-Id: Id16e97110423dd9d987b045325696227df0d2913
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16667
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds the test for the RegardlessStatement AST element.
Bug: tint:11
Change-Id: Ide4a126e4fa68e84238985d1379dd80123aea5a8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16666
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests for the NopStatement AST node.
Bug: tint:11
Change-Id: I890b7f6bc6347ba4f5a67334385feffd24079d5d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16665
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds unit tests for the MemberArrayExpression.
Bug: tint:11
Change-Id: I790d27018b516b3b2b79b6ed892c1a0e00b65818
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16681
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests for the KillStatement AST element.
Bug: tint:11
Change-Id: I1388051ca0639ddaf6b3f2bd2fa5ea8e492b114c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16561
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests for the if statement AST node.
Bug: tint:11
Change-Id: Ice3f281e1dfd72d76f43767f7b3040af862f4a58
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16540
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests for the identifier expression AST node.
Bug: tint:11
Change-Id: Ie7dd4f1de3d8a23ac7e878285564d8c5fc9e1250
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16502
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This patch adds the validation on the creation of the bind group
layout with read-only storage texture, write-only storage texture
and read-write storage texture. Currently read-write storage textures
are not supported in any shader stages.
This patch also fixes chromium:1061156.
BUG=chromium:1061156, dawn:267
TEST=dawn_unittests, dawn_end2end_tests
Change-Id: Ib42678719df48565a46e39f21c34ec640960dcdc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16920
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Now that all backends use slab-allocated bind groups, this patch also
moves the BindGroup implementation with owned-data into the Null backend.
Bug: dawn:340
Change-Id: I08a952075b382008fb82f1fbab3f779cc05bc2a3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16747
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
For convenience, use the SPIRV-Tools' optimizer representation.
Bug: tint:3
Change-Id: I1b046209584e1e907045d496b0f8d7b36fca79bd
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16660
Reviewed-by: dan sinclair <dsinclair@google.com>
Use the SPIRV-Tools validator, with the WebGPU0 environment.
Bug: tint:3
Change-Id: Id1132d209fd939ed68587034761e97da9b35b21d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16821
Reviewed-by: dan sinclair <dsinclair@google.com>
The parser impl saves a copy of the SPIR-V binary.
Bug: tint:3
Change-Id: I5d61c87123c0bcb417d0c7004e0ef4e3c8fbb027
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16642
Reviewed-by: dan sinclair <dsinclair@google.com>
Track what heaps are required to be resident upon command list
submission.
Bug: dawn:193
Change-Id: Icefe5aed047140f401d51018937c5364b3ed7c4f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16382
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This CL extends the WGSL writer to output IdentiferExpression and fills
out the variable with initializer test case and implementation.
Bug: tint:4
Change-Id: I9db9affb5ec4c4c109488f60bbc81bf3a96eee35
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16744
Reviewed-by: David Neto <dneto@google.com>
This CL is the start of a WGSL writer.
Bug: tint:4
Change-Id: Ib2c2580d9e50c36664088556d9b8feec76935211
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16560
Reviewed-by: David Neto <dneto@google.com>
This CL always sets the define for building the SPV_PARSER. This fixes
undefined errors on certian platforms.
Change-Id: I5f84295cb7ddf23d64efd9a4d00717c84bc698aa
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16800
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: David Neto <dneto@google.com>
This patch adds the basic validation of read-only storage texture,
write-only storage texture and read-write storage texture as new
binding types with no bind group layout provided in the creation of
pipeline state objects.
- Read-only storage textures can be used in vertex, fragment and
compute shaders.
- Write-only storage textures can only be used in compute shaders
due to the limitation on Metal.
- Read-write storage textures are not allowed now and they are
reserved to be supported as an extension in the future.
BUG=dawn:267
TEST=dawn_unittests
Change-Id: Iffc432f29a855b85d59451cb3c50269e03b84627
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16661
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
- spv parser just errors out for now
- link against SPIRV-Tools-opt
- Fixe CMake variable TINT_ENABLE_SPV_PARSER --> TINT_BUILD_SPV_PARSER
Bug: tint:3
Change-Id: Ie4ef9b03e001fca3cc11f65a425612755857feac
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16600
Reviewed-by: dan sinclair <dsinclair@google.com>
This CL adds tests for the function node.
Bug: tint:11
Change-Id: I10b1fb73ae93bf90162948ab42e2a74d4aca7987
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16501
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests for the fallthrough statement.
Bug: tint:11
Change-Id: I1bc8677e00aa9eb446a096bd2600104550480d77
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16500
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>