From 93e8f527ee9057ea67c36ada1965a31a8b0199ab Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Fri, 4 Jun 2021 20:41:47 +0000 Subject: [PATCH] wgsl: Deprecate [[access]] decorations Handle access control on var declarations instead of via [[access]] decorations. This change does the minimal work to migrate the WGSL parser over to the new syntax. Additional changes will be needed to correctly generate defaulted access qualifiers, as well as validating access usage. The [[access]] decorations are still supported by the WGSL parser, with new deprecated warnings, but not for aliases. Example: var x : [[access(x)]] alias_to_struct; Making this work is far more effort than I want to dedicate to backwards compatibility, and I do not beleive any real-world usage will be doing this. Still TODO: * Adding access control as the optional, third parameter to ptr<>. * Calculating default accesses for the various storage types. * Validating usage of variables against the different accesses. Bug: tint:846 Change-Id: If8ca82e5d16ec319ecd01f9a2cafffd930963bde Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53088 Commit-Queue: Ben Clayton Reviewed-by: James Price Reviewed-by: David Neto Kokoro: Kokoro --- docs/diagnostics_guide.md | 14 +- fuzzers/tint_common_fuzzer.cc | 9 +- src/BUILD.gn | 4 +- src/CMakeLists.txt | 7 +- src/ast/access.cc | 43 ++++ src/ast/access.h | 47 ++++ src/ast/access_control.cc | 97 ------- src/ast/access_control.h | 90 ------- src/ast/access_control_test.cc | 94 ------- src/ast/access_decoration.cc | 2 +- src/ast/access_decoration.h | 11 +- src/ast/access_decoration_test.cc | 8 +- src/ast/alias_test.cc | 19 +- src/ast/array_test.cc | 13 +- src/ast/ast_type.cc | 3 - src/ast/bool_test.cc | 13 +- src/ast/depth_texture_test.cc | 16 +- src/ast/external_texture_test.cc | 15 -- src/ast/f32_test.cc | 13 +- src/ast/function_test.cc | 1 + src/ast/i32_test.cc | 12 - src/ast/intrinsic_texture_helper_test.cc | 84 +++--- src/ast/intrinsic_texture_helper_test.h | 6 +- src/ast/matrix_test.cc | 2 +- src/ast/module_clone_test.cc | 14 +- src/ast/multisampled_texture_test.cc | 2 +- src/ast/pointer_test.cc | 12 +- src/ast/sampled_texture_test.cc | 14 - src/ast/sampler_test.cc | 13 +- src/ast/storage_texture.cc | 17 +- src/ast/storage_texture.h | 20 +- src/ast/storage_texture_test.cc | 60 ++--- src/ast/u32_test.cc | 12 - src/ast/variable.cc | 11 +- src/ast/variable.h | 8 + src/ast/variable_decl_statement_test.cc | 1 + src/ast/variable_test.cc | 8 +- src/ast/vector_test.cc | 12 +- src/inspector/inspector.cc | 5 +- src/inspector/inspector_test.cc | 176 +++++++------ src/intrinsic_table.cc | 6 +- src/intrinsic_table.inl | 14 +- src/intrinsic_table_test.cc | 4 +- src/intrinsics.def | 12 +- src/program_builder.h | 74 +++--- src/reader/spirv/function.cc | 27 +- src/reader/spirv/function_arithmetic_test.cc | 27 ++ src/reader/spirv/function_bit_test.cc | 22 ++ src/reader/spirv/function_call_test.cc | 6 + src/reader/spirv/function_cfg_test.cc | 3 + src/reader/spirv/function_composite_test.cc | 51 ++++ src/reader/spirv/function_conversion_test.cc | 17 ++ src/reader/spirv/function_decl_test.cc | 6 + .../spirv/function_glsl_std_450_test.cc | 45 ++++ src/reader/spirv/function_logical_test.cc | 26 ++ src/reader/spirv/function_memory_test.cc | 10 +- src/reader/spirv/function_misc_test.cc | 19 ++ src/reader/spirv/function_var_test.cc | 77 ++++++ src/reader/spirv/parser_impl.cc | 19 +- .../spirv/parser_impl_function_decl_test.cc | 8 + src/reader/spirv/parser_impl_handle_test.cc | 243 +++++++++++++++--- .../spirv/parser_impl_module_var_test.cc | 137 +++++++++- src/reader/spirv/parser_type.cc | 74 +----- src/reader/spirv/parser_type.h | 48 +--- src/reader/spirv/parser_type_test.cc | 34 ++- src/reader/wgsl/parser_impl.cc | 174 ++++++++----- src/reader/wgsl/parser_impl.h | 41 ++- src/reader/wgsl/parser_impl_error_msg_test.cc | 36 +-- .../parser_impl_global_variable_decl_test.cc | 2 +- .../parser_impl_texture_sampler_types_test.cc | 100 ++++--- .../wgsl/parser_impl_variable_decl_test.cc | 2 +- .../parser_impl_variable_ident_decl_test.cc | 106 +++++--- ...=> parser_impl_variable_qualifier_test.cc} | 80 ++++-- src/resolver/assignment_validation_test.cc | 12 +- src/resolver/decoration_validation_test.cc | 29 +-- .../host_shareable_validation_test.cc | 24 +- src/resolver/intrinsic_test.cc | 8 +- src/resolver/resolver.cc | 142 +++++----- src/resolver/resolver.h | 6 +- src/resolver/resolver_test.cc | 43 +++- src/resolver/resolver_test_helper.h | 6 - src/resolver/storage_class_validation_test.cc | 58 ++--- src/resolver/struct_storage_class_use_test.cc | 3 +- src/resolver/type_validation_test.cc | 101 ++++---- src/sem/storage_texture_type.cc | 13 +- src/sem/storage_texture_type.h | 10 +- src/sem/storage_texture_type_test.cc | 14 +- src/sem/variable.cc | 6 +- src/sem/variable.h | 10 +- src/transform/binding_remapper.cc | 5 +- src/transform/binding_remapper.h | 5 +- src/transform/binding_remapper_test.cc | 92 +++---- src/transform/bound_array_accessors_test.cc | 8 +- src/transform/calculate_array_length.cc | 3 +- src/transform/calculate_array_length_test.cc | 24 +- src/transform/decompose_storage_access.cc | 23 +- .../decompose_storage_access_test.cc | 214 +++++++-------- src/transform/external_texture_transform.cc | 5 +- src/transform/vertex_pulling.cc | 4 +- src/transform/vertex_pulling_test.cc | 38 +-- src/writer/hlsl/generator_impl.cc | 65 +++-- src/writer/hlsl/generator_impl.h | 7 +- .../hlsl/generator_impl_function_test.cc | 23 +- .../generator_impl_member_accessor_test.cc | 4 +- .../hlsl/generator_impl_sanitizer_test.cc | 3 +- src/writer/hlsl/generator_impl_type_test.cc | 53 ++-- src/writer/msl/generator_impl.cc | 8 +- .../msl/generator_impl_function_test.cc | 20 +- src/writer/msl/generator_impl_type_test.cc | 25 +- src/writer/spirv/builder.cc | 19 +- src/writer/spirv/builder.h | 6 +- src/writer/spirv/builder_function_test.cc | 4 +- .../spirv/builder_global_variable_test.cc | 77 +++--- src/writer/spirv/builder_intrinsic_test.cc | 6 +- src/writer/spirv/builder_type_test.cc | 41 ++- src/writer/wgsl/generator_impl.cc | 51 ++-- src/writer/wgsl/generator_impl.h | 4 + .../wgsl/generator_impl_function_test.cc | 6 +- .../wgsl/generator_impl_global_decl_test.cc | 7 +- src/writer/wgsl/generator_impl_type_test.cc | 77 ++---- .../wgsl/generator_impl_variable_test.cc | 54 +++- test/BUILD.gn | 3 +- test/array/assign_to_function_var.wgsl | 2 +- .../assign_to_function_var.wgsl.expected.wgsl | 2 +- test/array/assign_to_private_var.wgsl | 2 +- .../assign_to_private_var.wgsl.expected.wgsl | 2 +- test/array/assign_to_storage_var.wgsl | 6 +- .../assign_to_storage_var.wgsl.expected.wgsl | 6 +- test/array/assign_to_workgroup_var.wgsl | 2 +- ...assign_to_workgroup_var.wgsl.expected.wgsl | 2 +- test/bug/tint/221.wgsl | 2 +- test/bug/tint/221.wgsl.expected.wgsl | 2 +- test/bug/tint/492.wgsl | 2 +- test/bug/tint/492.wgsl.expected.wgsl | 2 +- test/bug/tint/744.wgsl | 6 +- test/bug/tint/744.wgsl.expected.wgsl | 6 +- .../access_deco/storage_buffer.wgsl | 12 + .../storage_buffer.wgsl.expected.hlsl | 13 + .../storage_buffer.wgsl.expected.msl | 16 ++ .../storage_buffer.wgsl.expected.spvasm | 41 +++ .../storage_buffer.wgsl.expected.wgsl | 15 ++ .../access_deco/storage_texture.wgsl | 6 + .../storage_texture.wgsl.expected.hlsl | 14 + .../storage_texture.wgsl.expected.msl | 12 + .../storage_texture.wgsl.expected.spvasm | 38 +++ .../storage_texture.wgsl.expected.wgsl | 10 + test/intrinsics/arrayLength.wgsl | 2 +- .../intrinsics/arrayLength.wgsl.expected.wgsl | 2 +- test/intrinsics/gen/arrayLength/647a40.wgsl | 2 +- .../gen/arrayLength/647a40.wgsl.expected.wgsl | 2 +- test/intrinsics/gen/arrayLength/721c9d.wgsl | 2 +- .../gen/arrayLength/721c9d.wgsl.expected.wgsl | 2 +- test/intrinsics/gen/arrayLength/b083be.wgsl | 2 +- .../gen/arrayLength/b083be.wgsl.expected.wgsl | 2 +- .../012b82.wgsl.expected.wgsl | 2 +- .../08753d.wgsl.expected.wgsl | 2 +- .../08a62e.wgsl.expected.wgsl | 2 +- .../0a5fcf.wgsl.expected.wgsl | 2 +- .../0bab57.wgsl.expected.wgsl | 2 +- .../0c4772.wgsl.expected.wgsl | 2 +- .../0cce40.wgsl.expected.wgsl | 2 +- .../0cf2ff.wgsl.expected.wgsl | 2 +- .../0d8b7e.wgsl.expected.wgsl | 2 +- .../0e32ee.wgsl.expected.wgsl | 2 +- .../1147d6.wgsl.expected.wgsl | 2 +- .../147998.wgsl.expected.wgsl | 2 +- .../16036c.wgsl.expected.wgsl | 2 +- .../168fcc.wgsl.expected.wgsl | 2 +- .../18bd57.wgsl.expected.wgsl | 2 +- .../19bffc.wgsl.expected.wgsl | 2 +- .../1a58e7.wgsl.expected.wgsl | 2 +- .../1aa199.wgsl.expected.wgsl | 2 +- .../1b71f0.wgsl.expected.wgsl | 2 +- .../1d6c26.wgsl.expected.wgsl | 2 +- .../1e189c.wgsl.expected.wgsl | 2 +- .../1e9e39.wgsl.expected.wgsl | 2 +- .../214b7b.wgsl.expected.wgsl | 2 +- .../214dd4.wgsl.expected.wgsl | 2 +- .../26ef6c.wgsl.expected.wgsl | 2 +- .../2ad087.wgsl.expected.wgsl | 2 +- .../2d32ae.wgsl.expected.wgsl | 2 +- .../2e0662.wgsl.expected.wgsl | 2 +- .../2f289f.wgsl.expected.wgsl | 2 +- .../318ecc.wgsl.expected.wgsl | 2 +- .../340d06.wgsl.expected.wgsl | 2 +- .../398e30.wgsl.expected.wgsl | 2 +- .../39a600.wgsl.expected.wgsl | 2 +- .../3a94ea.wgsl.expected.wgsl | 2 +- .../3aca08.wgsl.expected.wgsl | 2 +- .../3c5ad8.wgsl.expected.wgsl | 2 +- .../3d5817.wgsl.expected.wgsl | 2 +- .../40bc10.wgsl.expected.wgsl | 2 +- .../4267ee.wgsl.expected.wgsl | 2 +- .../42d4e6.wgsl.expected.wgsl | 2 +- .../441392.wgsl.expected.wgsl | 2 +- .../48cb89.wgsl.expected.wgsl | 2 +- .../48cbb2.wgsl.expected.wgsl | 2 +- .../48f360.wgsl.expected.wgsl | 2 +- .../49d274.wgsl.expected.wgsl | 2 +- .../4df9a8.wgsl.expected.wgsl | 2 +- .../55b23e.wgsl.expected.wgsl | 2 +- .../56ccfa.wgsl.expected.wgsl | 2 +- .../57da0b.wgsl.expected.wgsl | 2 +- .../57e7b3.wgsl.expected.wgsl | 2 +- .../58a515.wgsl.expected.wgsl | 2 +- .../5985f3.wgsl.expected.wgsl | 2 +- .../5caa5e.wgsl.expected.wgsl | 2 +- .../5e295d.wgsl.expected.wgsl | 2 +- .../60bf54.wgsl.expected.wgsl | 2 +- .../63f3cf.wgsl.expected.wgsl | 2 +- .../66dc4e.wgsl.expected.wgsl | 2 +- .../670d90.wgsl.expected.wgsl | 2 +- .../68105c.wgsl.expected.wgsl | 2 +- .../6adac6.wgsl.expected.wgsl | 2 +- .../6c08ab.wgsl.expected.wgsl | 2 +- .../6e2d12.wgsl.expected.wgsl | 2 +- .../6f0d79.wgsl.expected.wgsl | 2 +- .../702c53.wgsl.expected.wgsl | 2 +- .../70e26a.wgsl.expected.wgsl | 2 +- .../71e8f7.wgsl.expected.wgsl | 2 +- .../770103.wgsl.expected.wgsl | 2 +- .../7f5c2e.wgsl.expected.wgsl | 2 +- .../8028f3.wgsl.expected.wgsl | 2 +- .../811679.wgsl.expected.wgsl | 2 +- .../820596.wgsl.expected.wgsl | 2 +- .../82138e.wgsl.expected.wgsl | 2 +- .../8347ab.wgsl.expected.wgsl | 2 +- .../83ee5a.wgsl.expected.wgsl | 2 +- .../8799ee.wgsl.expected.wgsl | 2 +- .../89a864.wgsl.expected.wgsl | 2 +- .../8b4fff.wgsl.expected.wgsl | 2 +- .../8d89f8.wgsl.expected.wgsl | 2 +- .../8fca0f.wgsl.expected.wgsl | 2 +- .../9042ab.wgsl.expected.wgsl | 2 +- .../924742.wgsl.expected.wgsl | 2 +- .../92ad20.wgsl.expected.wgsl | 2 +- .../9572e5.wgsl.expected.wgsl | 2 +- .../998f6b.wgsl.expected.wgsl | 2 +- .../9abfe5.wgsl.expected.wgsl | 2 +- .../9da9e2.wgsl.expected.wgsl | 2 +- .../9eb8d8.wgsl.expected.wgsl | 2 +- .../a0aad1.wgsl.expected.wgsl | 2 +- .../a0e4ec.wgsl.expected.wgsl | 2 +- .../a863f2.wgsl.expected.wgsl | 2 +- .../ae457f.wgsl.expected.wgsl | 2 +- .../b91240.wgsl.expected.wgsl | 2 +- .../ba6e15.wgsl.expected.wgsl | 2 +- .../bb3dde.wgsl.expected.wgsl | 2 +- .../c2215f.wgsl.expected.wgsl | 2 +- .../c30e75.wgsl.expected.wgsl | 2 +- .../c60b66.wgsl.expected.wgsl | 2 +- .../c74533.wgsl.expected.wgsl | 2 +- .../c7943d.wgsl.expected.wgsl | 2 +- .../caaabb.wgsl.expected.wgsl | 2 +- .../cc5478.wgsl.expected.wgsl | 2 +- .../cc968c.wgsl.expected.wgsl | 2 +- .../cccc8f.wgsl.expected.wgsl | 2 +- .../cd76a7.wgsl.expected.wgsl | 2 +- .../cdaff9.wgsl.expected.wgsl | 2 +- .../cdf473.wgsl.expected.wgsl | 2 +- .../cf1d42.wgsl.expected.wgsl | 2 +- .../cf7e43.wgsl.expected.wgsl | 2 +- .../d40b9e.wgsl.expected.wgsl | 2 +- .../d4106f.wgsl.expected.wgsl | 2 +- .../d8f951.wgsl.expected.wgsl | 2 +- .../da3099.wgsl.expected.wgsl | 2 +- .../dba47c.wgsl.expected.wgsl | 2 +- .../dc2dd0.wgsl.expected.wgsl | 2 +- .../e10157.wgsl.expected.wgsl | 2 +- .../e93464.wgsl.expected.wgsl | 2 +- .../e9628c.wgsl.expected.wgsl | 2 +- .../e9e96c.wgsl.expected.wgsl | 2 +- .../e9fe54.wgsl.expected.wgsl | 2 +- .../e9fe58.wgsl.expected.wgsl | 2 +- .../f1b72b.wgsl.expected.wgsl | 2 +- .../f7aa9e.wgsl.expected.wgsl | 2 +- .../f7e436.wgsl.expected.wgsl | 2 +- .../f931c7.wgsl.expected.wgsl | 2 +- .../fa90e1.wgsl.expected.wgsl | 2 +- .../fb5670.wgsl.expected.wgsl | 2 +- .../fbbe4d.wgsl.expected.wgsl | 2 +- .../fcac78.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/050c33.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/072e26.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/078bc4.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/127e12.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/1561a7.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/1a062f.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/1a8452.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/20fa2f.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/276a2c.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/2887d7.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/2ae485.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/2d6cf7.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/3c0d9e.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/3c9587.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/3d001b.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/3d9c90.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/505aa2.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/519ab5.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/53378a.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/560573.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/582015.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/5bb7fb.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/5d0a2f.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/62d125.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/6678b6.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/67edca.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/749704.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/83cea4.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/8e5032.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/936952.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/9a7c90.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/9c2a14.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/a6a85a.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/a6b61d.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/a7a3c3.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/b1bf79.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/b58c6d.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/b6c458.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/bfd154.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/c02b74.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/c07013.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/c40dcb.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/c456bc.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/c7cbed.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/c9cc40.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/d5c48d.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/d81c57.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/d8617f.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/dbd554.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/ddeed3.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/dee8e7.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/e65916.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/e893d7.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/eb573b.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/ecc823.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/ef5405.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/f06b69.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/f379e2.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/f56e6f.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/f74bd8.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/fc6d36.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/fdebd0.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/fe222a.wgsl.expected.wgsl | 2 +- .../gen/textureLoad/feab99.wgsl.expected.wgsl | 2 +- .../058cc3.wgsl.expected.wgsl | 2 +- .../09d05d.wgsl.expected.wgsl | 2 +- .../13b4ce.wgsl.expected.wgsl | 2 +- .../22e53b.wgsl.expected.wgsl | 2 +- .../2f6bb3.wgsl.expected.wgsl | 2 +- .../315298.wgsl.expected.wgsl | 2 +- .../3615e3.wgsl.expected.wgsl | 2 +- .../390fd5.wgsl.expected.wgsl | 2 +- .../45155d.wgsl.expected.wgsl | 2 +- .../4bf67b.wgsl.expected.wgsl | 2 +- .../562013.wgsl.expected.wgsl | 2 +- .../57092f.wgsl.expected.wgsl | 2 +- .../68a65b.wgsl.expected.wgsl | 2 +- .../7f1937.wgsl.expected.wgsl | 2 +- .../938763.wgsl.expected.wgsl | 2 +- .../9700fb.wgsl.expected.wgsl | 2 +- .../a216d2.wgsl.expected.wgsl | 2 +- .../aa08a7.wgsl.expected.wgsl | 2 +- .../ab0c9b.wgsl.expected.wgsl | 2 +- .../b8cd76.wgsl.expected.wgsl | 2 +- .../be1d70.wgsl.expected.wgsl | 2 +- .../be3acb.wgsl.expected.wgsl | 2 +- .../c09917.wgsl.expected.wgsl | 2 +- .../c7c7f2.wgsl.expected.wgsl | 2 +- .../cd5dc8.wgsl.expected.wgsl | 2 +- .../d5b228.wgsl.expected.wgsl | 2 +- .../e15642.wgsl.expected.wgsl | 2 +- .../e31be1.wgsl.expected.wgsl | 2 +- .../ee942f.wgsl.expected.wgsl | 2 +- .../f33005.wgsl.expected.wgsl | 2 +- .../fcec98.wgsl.expected.wgsl | 2 +- .../ff5e89.wgsl.expected.wgsl | 2 +- .../textureStore/05ce15.wgsl.expected.wgsl | 2 +- .../textureStore/064c7f.wgsl.expected.wgsl | 2 +- .../textureStore/068641.wgsl.expected.wgsl | 2 +- .../textureStore/0af6b5.wgsl.expected.wgsl | 2 +- .../textureStore/0c3dff.wgsl.expected.wgsl | 2 +- .../textureStore/102722.wgsl.expected.wgsl | 2 +- .../textureStore/1bbd08.wgsl.expected.wgsl | 2 +- .../textureStore/1c02e7.wgsl.expected.wgsl | 2 +- .../textureStore/22d955.wgsl.expected.wgsl | 2 +- .../textureStore/26bf70.wgsl.expected.wgsl | 2 +- .../textureStore/2796b4.wgsl.expected.wgsl | 2 +- .../textureStore/2ac6c7.wgsl.expected.wgsl | 2 +- .../textureStore/2eb2a4.wgsl.expected.wgsl | 2 +- .../textureStore/2ed2a3.wgsl.expected.wgsl | 2 +- .../textureStore/31745b.wgsl.expected.wgsl | 2 +- .../textureStore/32f368.wgsl.expected.wgsl | 2 +- .../textureStore/331aee.wgsl.expected.wgsl | 2 +- .../textureStore/38e8d7.wgsl.expected.wgsl | 2 +- .../textureStore/3a52ac.wgsl.expected.wgsl | 2 +- .../textureStore/3bb7a1.wgsl.expected.wgsl | 2 +- .../textureStore/3bec15.wgsl.expected.wgsl | 2 +- .../textureStore/441ba8.wgsl.expected.wgsl | 2 +- .../textureStore/4fc057.wgsl.expected.wgsl | 2 +- .../textureStore/5a2f8f.wgsl.expected.wgsl | 2 +- .../textureStore/60975f.wgsl.expected.wgsl | 2 +- .../textureStore/682fd6.wgsl.expected.wgsl | 2 +- .../textureStore/6b75c3.wgsl.expected.wgsl | 2 +- .../textureStore/6b80d2.wgsl.expected.wgsl | 2 +- .../textureStore/6cff2e.wgsl.expected.wgsl | 2 +- .../textureStore/6da692.wgsl.expected.wgsl | 2 +- .../textureStore/731349.wgsl.expected.wgsl | 2 +- .../textureStore/752da6.wgsl.expected.wgsl | 2 +- .../textureStore/77c0ae.wgsl.expected.wgsl | 2 +- .../textureStore/7cec8d.wgsl.expected.wgsl | 2 +- .../textureStore/7f7fae.wgsl.expected.wgsl | 2 +- .../textureStore/804942.wgsl.expected.wgsl | 2 +- .../textureStore/805dae.wgsl.expected.wgsl | 2 +- .../textureStore/83bcc1.wgsl.expected.wgsl | 2 +- .../textureStore/872747.wgsl.expected.wgsl | 2 +- .../textureStore/8e0479.wgsl.expected.wgsl | 2 +- .../textureStore/8f71a1.wgsl.expected.wgsl | 2 +- .../textureStore/969534.wgsl.expected.wgsl | 2 +- .../textureStore/9a3ecc.wgsl.expected.wgsl | 2 +- .../textureStore/9d9cd5.wgsl.expected.wgsl | 2 +- .../textureStore/9e3ec5.wgsl.expected.wgsl | 2 +- .../textureStore/ac67aa.wgsl.expected.wgsl | 2 +- .../textureStore/b706b1.wgsl.expected.wgsl | 2 +- .../textureStore/bbcb7f.wgsl.expected.wgsl | 2 +- .../textureStore/be6e30.wgsl.expected.wgsl | 2 +- .../textureStore/bf775c.wgsl.expected.wgsl | 2 +- .../textureStore/c5af1e.wgsl.expected.wgsl | 2 +- .../textureStore/c863be.wgsl.expected.wgsl | 2 +- .../textureStore/d73b5c.wgsl.expected.wgsl | 2 +- .../textureStore/dd7d81.wgsl.expected.wgsl | 2 +- .../textureStore/dde364.wgsl.expected.wgsl | 2 +- .../textureStore/e885e8.wgsl.expected.wgsl | 2 +- .../textureStore/eb702f.wgsl.expected.wgsl | 2 +- .../textureStore/eb78b9.wgsl.expected.wgsl | 2 +- .../textureStore/ee6acc.wgsl.expected.wgsl | 2 +- .../textureStore/ef9f2f.wgsl.expected.wgsl | 2 +- .../textureStore/f8dead.wgsl.expected.wgsl | 2 +- .../textureStore/f9be83.wgsl.expected.wgsl | 2 +- .../textureStore/fb9a8f.wgsl.expected.wgsl | 2 +- .../textureStore/fbf53f.wgsl.expected.wgsl | 2 +- test/intrinsics/intrinsics.wgsl.tmpl | 2 +- test/ptr_ref/load/local/ptr_storage.wgsl | 2 +- .../load/local/ptr_storage.wgsl.expected.wgsl | 2 +- test/samples/compute_boids.wgsl | 4 +- test/samples/compute_boids.wgsl.expected.wgsl | 4 +- .../shared_struct_storage_buffer.wgsl | 2 +- ...d_struct_storage_buffer.wgsl.expected.wgsl | 2 +- tools/src/cmd/fix-tests/main.go | 6 +- 450 files changed, 2651 insertions(+), 2213 deletions(-) create mode 100644 src/ast/access.cc create mode 100644 src/ast/access.h delete mode 100644 src/ast/access_control.cc delete mode 100644 src/ast/access_control.h delete mode 100644 src/ast/access_control_test.cc rename src/reader/wgsl/{parser_impl_variable_storage_decoration_test.cc => parser_impl_variable_qualifier_test.cc} (52%) create mode 100644 test/deprecated/access_deco/storage_buffer.wgsl create mode 100644 test/deprecated/access_deco/storage_buffer.wgsl.expected.hlsl create mode 100644 test/deprecated/access_deco/storage_buffer.wgsl.expected.msl create mode 100644 test/deprecated/access_deco/storage_buffer.wgsl.expected.spvasm create mode 100644 test/deprecated/access_deco/storage_buffer.wgsl.expected.wgsl create mode 100644 test/deprecated/access_deco/storage_texture.wgsl create mode 100644 test/deprecated/access_deco/storage_texture.wgsl.expected.hlsl create mode 100644 test/deprecated/access_deco/storage_texture.wgsl.expected.msl create mode 100644 test/deprecated/access_deco/storage_texture.wgsl.expected.spvasm create mode 100644 test/deprecated/access_deco/storage_texture.wgsl.expected.wgsl diff --git a/docs/diagnostics_guide.md b/docs/diagnostics_guide.md index 00cdf41e97..b5def9026a 100644 --- a/docs/diagnostics_guide.md +++ b/docs/diagnostics_guide.md @@ -96,21 +96,21 @@ analysis, but can also greatly aid simple diagnostics like symbol collision erro **Don't:** ``` -shader.wgsl:7:1 error: the originating variable of the left-hand side must not have an access(read) access attribute. +shader.wgsl:7:1 error: the originating variable of the left-hand side of an assignment expression must not be declared with read access control. ``` **Do:** ``` -shader.wgsl:7:1 error: cannot assign to variable with [[access(read)]] decoration +shader.wgsl:7:1 error: cannot assign to variable with read access control -x = 1; -^ +x.y = 1; +^^^^^^^ -shader.wgsl:2:8 note: [[access(read)]] declared here +shader.wgsl:2:8 note: read access control declared here -var x : [[access(read)]] i32; - ^^^^^^^^^^^^^^^^ +var x : i32; + ^^^^ ``` **Justification:** diff --git a/fuzzers/tint_common_fuzzer.cc b/fuzzers/tint_common_fuzzer.cc index 38d4a7c73c..6bebfe8639 100644 --- a/fuzzers/tint_common_fuzzer.cc +++ b/fuzzers/tint_common_fuzzer.cc @@ -101,20 +101,19 @@ void ExtractBindingRemapperInputs(Reader* r, tint::transform::DataMap* inputs) { uint8_t old_binding; uint8_t new_group; uint8_t new_binding; - ast::AccessControl::Access new_ac; + ast::Access new_access; }; std::vector configs = r->vector(); transform::BindingRemapper::BindingPoints binding_points; - transform::BindingRemapper::AccessControls access_controls; + transform::BindingRemapper::Accesses accesses; for (const auto& config : configs) { binding_points[{config.old_binding, config.old_group}] = { config.new_binding, config.new_group}; - access_controls[{config.old_binding, config.old_group}] = config.new_ac; + accesss[{config.old_binding, config.old_group}] = config.new_access; } - inputs->Add(binding_points, - access_controls); + inputs->Add(binding_points, accesss); } void ExtractFirstIndexOffsetInputs(Reader* r, diff --git a/src/BUILD.gn b/src/BUILD.gn index 9498f0a79e..57b816def9 100644 --- a/src/BUILD.gn +++ b/src/BUILD.gn @@ -292,8 +292,8 @@ template("libtint_source_set") { libtint_source_set("libtint_core_all_src") { sources = [ - "ast/access_control.cc", - "ast/access_control.h", + "ast/access.cc", + "ast/access.h", "ast/access_decoration.cc", "ast/access_decoration.h", "ast/alias.cc", diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 268b037ea6..16d5a909c7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,8 +38,8 @@ endfunction() set(TINT_LIB_SRCS ../include/tint/tint.h - ast/access_control.cc - ast/access_control.h + ast/access.cc + ast/access.h ast/access_decoration.cc ast/access_decoration.h ast/alias.cc @@ -496,7 +496,6 @@ endif() if(${TINT_BUILD_TESTS}) set(TINT_TEST_SRCS - ast/access_control_test.cc ast/access_decoration_test.cc ast/alias_test.cc ast/array_accessor_expression_test.cc @@ -748,7 +747,7 @@ if(${TINT_BUILD_TESTS}) reader/wgsl/parser_impl_variable_decoration_test.cc reader/wgsl/parser_impl_variable_ident_decl_test.cc reader/wgsl/parser_impl_variable_stmt_test.cc - reader/wgsl/parser_impl_variable_storage_decoration_test.cc + reader/wgsl/parser_impl_variable_qualifier_test.cc reader/wgsl/token_test.cc ) endif() diff --git a/src/ast/access.cc b/src/ast/access.cc new file mode 100644 index 0000000000..a95753fade --- /dev/null +++ b/src/ast/access.cc @@ -0,0 +1,43 @@ +// Copyright 2020 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "src/ast/access.h" + +namespace tint { +namespace ast { + +std::ostream& operator<<(std::ostream& out, Access access) { + switch (access) { + case ast::Access::kUndefined: { + out << "undefined"; + break; + } + case ast::Access::kRead: { + out << "read"; + break; + } + case ast::Access::kReadWrite: { + out << "read_write"; + break; + } + case ast::Access::kWrite: { + out << "write"; + break; + } + } + return out; +} + +} // namespace ast +} // namespace tint diff --git a/src/ast/access.h b/src/ast/access.h new file mode 100644 index 0000000000..1faddbf915 --- /dev/null +++ b/src/ast/access.h @@ -0,0 +1,47 @@ +// Copyright 2020 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef SRC_AST_ACCESS_H_ +#define SRC_AST_ACCESS_H_ + +#include +#include + +namespace tint { +namespace ast { + +/// The access control settings +enum Access { + /// Not declared in the source + kUndefined, + /// Read only + kRead, + /// Write only + kWrite, + /// Read write + kReadWrite +}; + +/// @param out the std::ostream to write to +/// @param access the Access +/// @return the std::ostream so calls can be chained +std::ostream& operator<<(std::ostream& out, Access access); + +/// [DEPRECATED]: Old name in use by Dawn. +using AccessControl = Access; + +} // namespace ast +} // namespace tint + +#endif // SRC_AST_ACCESS_H_ diff --git a/src/ast/access_control.cc b/src/ast/access_control.cc deleted file mode 100644 index ad86d2c024..0000000000 --- a/src/ast/access_control.cc +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2020 The Tint Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "src/ast/access_control.h" - -#include "src/program_builder.h" - -TINT_INSTANTIATE_TYPEINFO(tint::ast::AccessControl); - -namespace tint { -namespace ast { - -AccessControl::AccessControl(ProgramID program_id, - const Source& source, - Access access, - const Type* subtype) - : Base(program_id, source), access_(access), subtype_(subtype) { - TINT_ASSERT(subtype_); - TINT_ASSERT(!subtype_->Is()); -} - -AccessControl::AccessControl(AccessControl&&) = default; - -AccessControl::~AccessControl() = default; - -std::string AccessControl::type_name() const { - std::string name = "__access_control_"; - switch (access_) { - case ast::AccessControl::kRead: - name += "read_only"; - break; - case ast::AccessControl::kWrite: - name += "write_only"; - break; - case ast::AccessControl::kReadWrite: - name += "read_write"; - break; - } - return name + subtype_->type_name(); -} - -std::string AccessControl::FriendlyName(const SymbolTable& symbols) const { - std::ostringstream out; - out << "[[access("; - switch (access_) { - case ast::AccessControl::kRead: - out << "read"; - break; - case ast::AccessControl::kWrite: - out << "write"; - break; - case ast::AccessControl::kReadWrite: - out << "read_write"; - break; - } - out << ")]] " << subtype_->FriendlyName(symbols); - return out.str(); -} - -AccessControl* AccessControl::Clone(CloneContext* ctx) const { - // Clone arguments outside of create() call to have deterministic ordering - auto src = ctx->Clone(source()); - auto* ty = ctx->Clone(type()); - return ctx->dst->create(src, access_, ty); -} - -std::ostream& operator<<(std::ostream& out, AccessControl::Access access) { - switch (access) { - case ast::AccessControl::kRead: { - out << "read_only"; - break; - } - case ast::AccessControl::kReadWrite: { - out << "read_write"; - break; - } - case ast::AccessControl::kWrite: { - out << "write_only"; - break; - } - } - return out; -} - -} // namespace ast -} // namespace tint diff --git a/src/ast/access_control.h b/src/ast/access_control.h deleted file mode 100644 index 705faca795..0000000000 --- a/src/ast/access_control.h +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2020 The Tint Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SRC_AST_ACCESS_CONTROL_H_ -#define SRC_AST_ACCESS_CONTROL_H_ - -#include -#include - -#include "src/ast/type.h" - -namespace tint { -namespace ast { - -/// An access control type. Holds an access setting and pointer to another type. -class AccessControl : public Castable { - public: - /// The access control settings - enum Access { - /// Read only - kRead, - /// Write only - kWrite, - /// Read write - kReadWrite - }; - - /// Constructor - /// @param program_id the identifier of the program that owns this node - /// @param source the source of this node - /// @param access the access control setting - /// @param subtype the access controlled type - AccessControl(ProgramID program_id, - const Source& source, - Access access, - const Type* subtype); - /// Move constructor - AccessControl(AccessControl&&); - ~AccessControl() override; - - /// @returns true if the access control is read only - bool IsReadOnly() const { return access_ == Access::kRead; } - /// @returns true if the access control is write only - bool IsWriteOnly() const { return access_ == Access::kWrite; } - /// @returns true if the access control is read/write - bool IsReadWrite() const { return access_ == Access::kReadWrite; } - - /// @returns the access control value - Access access_control() const { return access_; } - /// @returns the subtype type - Type* type() const { return const_cast(subtype_); } - - /// @returns the name for this type - std::string type_name() const override; - - /// @param symbols the program's symbol table - /// @returns the name for this type that closely resembles how it would be - /// declared in WGSL. - std::string FriendlyName(const SymbolTable& symbols) const override; - - /// Clones this type and all transitive types using the `CloneContext` `ctx`. - /// @param ctx the clone context - /// @return the newly cloned type - AccessControl* Clone(CloneContext* ctx) const override; - - private: - Access const access_; - const Type* const subtype_; -}; - -/// @param out the std::ostream to write to -/// @param access the AccessControl -/// @return the std::ostream so calls can be chained -std::ostream& operator<<(std::ostream& out, AccessControl::Access access); - -} // namespace ast -} // namespace tint - -#endif // SRC_AST_ACCESS_CONTROL_H_ diff --git a/src/ast/access_control_test.cc b/src/ast/access_control_test.cc deleted file mode 100644 index d8fca38f2c..0000000000 --- a/src/ast/access_control_test.cc +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2020 The Tint Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "src/ast/access_control.h" - -#include "src/ast/alias.h" -#include "src/ast/array.h" -#include "src/ast/bool.h" -#include "src/ast/f32.h" -#include "src/ast/i32.h" -#include "src/ast/matrix.h" -#include "src/ast/pointer.h" -#include "src/ast/sampler.h" -#include "src/ast/struct.h" -#include "src/ast/test_helper.h" -#include "src/ast/texture.h" -#include "src/ast/u32.h" -#include "src/ast/vector.h" - -namespace tint { -namespace ast { -namespace { - -using AstAccessControlTest = TestHelper; - -TEST_F(AstAccessControlTest, Create) { - auto* u32 = create(); - auto* a = create(AccessControl::kReadWrite, u32); - EXPECT_TRUE(a->IsReadWrite()); - EXPECT_EQ(a->type(), u32); -} - -TEST_F(AstAccessControlTest, AccessRead) { - auto* i32 = create(); - auto* ac = create(AccessControl::kRead, i32); - EXPECT_TRUE(ac->IsReadOnly()); - EXPECT_FALSE(ac->IsWriteOnly()); - EXPECT_FALSE(ac->IsReadWrite()); - - EXPECT_EQ(ac->type_name(), "__access_control_read_only__i32"); -} - -TEST_F(AstAccessControlTest, AccessWrite) { - auto* i32 = create(); - auto* ac = create(AccessControl::kWrite, i32); - EXPECT_FALSE(ac->IsReadOnly()); - EXPECT_TRUE(ac->IsWriteOnly()); - EXPECT_FALSE(ac->IsReadWrite()); - - EXPECT_EQ(ac->type_name(), "__access_control_write_only__i32"); -} - -TEST_F(AstAccessControlTest, AccessReadWrite) { - auto* i32 = create(); - auto* ac = create(AccessControl::kReadWrite, i32); - EXPECT_FALSE(ac->IsReadOnly()); - EXPECT_FALSE(ac->IsWriteOnly()); - EXPECT_TRUE(ac->IsReadWrite()); - - EXPECT_EQ(ac->type_name(), "__access_control_read_write__i32"); -} - -TEST_F(AstAccessControlTest, FriendlyNameReadOnly) { - auto* i32 = create(); - auto* ac = create(AccessControl::kRead, i32); - EXPECT_EQ(ac->FriendlyName(Symbols()), "[[access(read)]] i32"); -} - -TEST_F(AstAccessControlTest, FriendlyNameWriteOnly) { - auto* i32 = create(); - auto* ac = create(AccessControl::kWrite, i32); - EXPECT_EQ(ac->FriendlyName(Symbols()), "[[access(write)]] i32"); -} - -TEST_F(AstAccessControlTest, FriendlyNameReadWrite) { - auto* i32 = create(); - auto* ac = create(AccessControl::kReadWrite, i32); - EXPECT_EQ(ac->FriendlyName(Symbols()), "[[access(read_write)]] i32"); -} - -} // namespace -} // namespace ast -} // namespace tint diff --git a/src/ast/access_decoration.cc b/src/ast/access_decoration.cc index e00ace6c43..865422acdd 100644 --- a/src/ast/access_decoration.cc +++ b/src/ast/access_decoration.cc @@ -23,7 +23,7 @@ namespace ast { AccessDecoration::AccessDecoration(ProgramID program_id, const Source& source, - AccessControl::Access val) + Access val) : Base(program_id, source), value_(val) {} AccessDecoration::~AccessDecoration() = default; diff --git a/src/ast/access_decoration.h b/src/ast/access_decoration.h index 894bb69882..2b385e97e6 100644 --- a/src/ast/access_decoration.h +++ b/src/ast/access_decoration.h @@ -15,26 +15,25 @@ #ifndef SRC_AST_ACCESS_DECORATION_H_ #define SRC_AST_ACCESS_DECORATION_H_ -#include "src/ast/access_control.h" +#include "src/ast/access.h" #include "src/ast/decoration.h" namespace tint { namespace ast { /// An access decoration +/// [DEPRECATED]: TODO(crbug.com/tint/846): Remove this class class AccessDecoration : public Castable { public: /// constructor /// @param program_id the identifier of the program that owns this node /// @param source the source of this decoration /// @param value the access value - AccessDecoration(ProgramID program_id, - const Source& source, - AccessControl::Access value); + AccessDecoration(ProgramID program_id, const Source& source, Access value); ~AccessDecoration() override; /// @returns the access control value - AccessControl::Access value() const { return value_; } + Access value() const { return value_; } /// Outputs the decoration to the given stream /// @param sem the semantic info for the program @@ -51,7 +50,7 @@ class AccessDecoration : public Castable { AccessDecoration* Clone(CloneContext* ctx) const override; private: - AccessControl::Access const value_; + Access const value_; }; } // namespace ast diff --git a/src/ast/access_decoration_test.cc b/src/ast/access_decoration_test.cc index 047b170843..ecb6e0d377 100644 --- a/src/ast/access_decoration_test.cc +++ b/src/ast/access_decoration_test.cc @@ -23,13 +23,13 @@ namespace { using AccessDecorationTest = TestHelper; TEST_F(AccessDecorationTest, Creation) { - auto* d = create(ast::AccessControl::kWrite); - EXPECT_EQ(ast::AccessControl::kWrite, d->value()); + auto* d = create(ast::Access::kWrite); + EXPECT_EQ(ast::Access::kWrite, d->value()); } TEST_F(AccessDecorationTest, ToStr) { - auto* d = create(ast::AccessControl::kRead); - EXPECT_EQ(str(d), R"(AccessDecoration{read_only} + auto* d = create(ast::Access::kRead); + EXPECT_EQ(str(d), R"(AccessDecoration{read} )"); } diff --git a/src/ast/alias_test.cc b/src/ast/alias_test.cc index 1dc9710c7c..9adebbdf04 100644 --- a/src/ast/alias_test.cc +++ b/src/ast/alias_test.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "src/ast/alias.h" -#include "src/ast/access_control.h" +#include "src/ast/access.h" #include "src/ast/array.h" #include "src/ast/bool.h" #include "src/ast/f32.h" @@ -76,23 +76,6 @@ TEST_F(AstAliasTest, UnwrapAll_TwiceAliasPointerTwiceAlias) { EXPECT_EQ(aapaa->UnwrapAll(), u32); } -TEST_F(AstAliasTest, UnwrapAll_AccessControlPointer) { - auto* u32 = create(); - auto* a = create(AccessControl::kRead, u32); - auto* pa = create(a, StorageClass::kUniform); - EXPECT_EQ(pa->type(), a); - EXPECT_EQ(pa->UnwrapAll(), u32); -} - -TEST_F(AstAliasTest, UnwrapAll_PointerAccessControl) { - auto* u32 = create(); - auto* p = create(u32, StorageClass::kUniform); - auto* a = create(AccessControl::kRead, p); - - EXPECT_EQ(a->type(), p); - EXPECT_EQ(a->UnwrapAll(), u32); -} - } // namespace } // namespace ast } // namespace tint diff --git a/src/ast/array_test.cc b/src/ast/array_test.cc index dac15429de..5e8b9c81d6 100644 --- a/src/ast/array_test.cc +++ b/src/ast/array_test.cc @@ -13,19 +13,8 @@ // limitations under the License. #include "src/ast/array.h" -#include "src/ast/access_control.h" -#include "src/ast/alias.h" -#include "src/ast/bool.h" -#include "src/ast/f32.h" -#include "src/ast/i32.h" -#include "src/ast/matrix.h" -#include "src/ast/pointer.h" -#include "src/ast/sampler.h" -#include "src/ast/struct.h" + #include "src/ast/test_helper.h" -#include "src/ast/texture.h" -#include "src/ast/u32.h" -#include "src/ast/vector.h" namespace tint { namespace ast { diff --git a/src/ast/ast_type.cc b/src/ast/ast_type.cc index a9ea9d12b5..6702bd9fd6 100644 --- a/src/ast/ast_type.cc +++ b/src/ast/ast_type.cc @@ -14,7 +14,6 @@ #include "src/ast/type.h" -#include "src/ast/access_control.h" #include "src/ast/alias.h" #include "src/ast/bool.h" #include "src/ast/f32.h" @@ -43,8 +42,6 @@ Type* Type::UnwrapAll() { while (true) { if (auto* alias = type->As()) { type = alias->type(); - } else if (auto* access = type->As()) { - type = access->type(); } else if (auto* ptr = type->As()) { type = ptr->type(); } else { diff --git a/src/ast/bool_test.cc b/src/ast/bool_test.cc index d1668c7ace..7c8a32e86d 100644 --- a/src/ast/bool_test.cc +++ b/src/ast/bool_test.cc @@ -13,19 +13,8 @@ // limitations under the License. #include "src/ast/bool.h" -#include "src/ast/access_control.h" -#include "src/ast/alias.h" -#include "src/ast/array.h" -#include "src/ast/f32.h" -#include "src/ast/i32.h" -#include "src/ast/matrix.h" -#include "src/ast/pointer.h" -#include "src/ast/sampler.h" -#include "src/ast/struct.h" + #include "src/ast/test_helper.h" -#include "src/ast/texture.h" -#include "src/ast/u32.h" -#include "src/ast/vector.h" namespace tint { namespace ast { diff --git a/src/ast/depth_texture_test.cc b/src/ast/depth_texture_test.cc index a018e4a71e..d7b7249df6 100644 --- a/src/ast/depth_texture_test.cc +++ b/src/ast/depth_texture_test.cc @@ -13,22 +13,8 @@ // limitations under the License. #include "src/ast/depth_texture.h" -#include "src/ast/access_control.h" -#include "src/ast/alias.h" -#include "src/ast/array.h" -#include "src/ast/bool.h" -#include "src/ast/f32.h" -#include "src/ast/i32.h" -#include "src/ast/matrix.h" -#include "src/ast/pointer.h" -#include "src/ast/sampled_texture.h" -#include "src/ast/sampler.h" -#include "src/ast/storage_texture.h" -#include "src/ast/struct.h" + #include "src/ast/test_helper.h" -#include "src/ast/texture.h" -#include "src/ast/u32.h" -#include "src/ast/vector.h" namespace tint { namespace ast { diff --git a/src/ast/external_texture_test.cc b/src/ast/external_texture_test.cc index b8d75d1d38..ff11eae3a6 100644 --- a/src/ast/external_texture_test.cc +++ b/src/ast/external_texture_test.cc @@ -14,22 +14,7 @@ #include "src/ast/external_texture.h" -#include "src/ast/access_control.h" -#include "src/ast/alias.h" -#include "src/ast/array.h" -#include "src/ast/bool.h" -#include "src/ast/depth_texture.h" -#include "src/ast/f32.h" -#include "src/ast/i32.h" -#include "src/ast/matrix.h" -#include "src/ast/pointer.h" -#include "src/ast/sampler.h" -#include "src/ast/storage_texture.h" -#include "src/ast/struct.h" #include "src/ast/test_helper.h" -#include "src/ast/texture.h" -#include "src/ast/u32.h" -#include "src/ast/vector.h" namespace tint { namespace ast { diff --git a/src/ast/f32_test.cc b/src/ast/f32_test.cc index 220af9d086..12eeec8c7e 100644 --- a/src/ast/f32_test.cc +++ b/src/ast/f32_test.cc @@ -13,19 +13,8 @@ // limitations under the License. #include "src/ast/f32.h" -#include "src/ast/access_control.h" -#include "src/ast/alias.h" -#include "src/ast/array.h" -#include "src/ast/bool.h" -#include "src/ast/i32.h" -#include "src/ast/matrix.h" -#include "src/ast/pointer.h" -#include "src/ast/sampler.h" -#include "src/ast/struct.h" + #include "src/ast/test_helper.h" -#include "src/ast/texture.h" -#include "src/ast/u32.h" -#include "src/ast/vector.h" namespace tint { namespace ast { diff --git a/src/ast/function_test.cc b/src/ast/function_test.cc index a634e6fab8..61ee8a6ee7 100644 --- a/src/ast/function_test.cc +++ b/src/ast/function_test.cc @@ -189,6 +189,7 @@ TEST_F(FunctionTest, ToStr_WithParams) { VariableConst{ var none + undefined __i32 } ) diff --git a/src/ast/i32_test.cc b/src/ast/i32_test.cc index 5f1ae0a21f..6c224ca2e4 100644 --- a/src/ast/i32_test.cc +++ b/src/ast/i32_test.cc @@ -14,19 +14,7 @@ #include "src/ast/i32.h" -#include "src/ast/access_control.h" -#include "src/ast/alias.h" -#include "src/ast/array.h" -#include "src/ast/bool.h" -#include "src/ast/f32.h" -#include "src/ast/matrix.h" -#include "src/ast/pointer.h" -#include "src/ast/sampler.h" -#include "src/ast/struct.h" #include "src/ast/test_helper.h" -#include "src/ast/texture.h" -#include "src/ast/u32.h" -#include "src/ast/vector.h" namespace tint { namespace ast { diff --git a/src/ast/intrinsic_texture_helper_test.cc b/src/ast/intrinsic_texture_helper_test.cc index 82cf62331a..f5af1fbbb0 100644 --- a/src/ast/intrinsic_texture_helper_test.cc +++ b/src/ast/intrinsic_texture_helper_test.cc @@ -62,7 +62,7 @@ TextureOverloadCase::TextureOverloadCase( TextureOverloadCase::TextureOverloadCase( ValidTextureOverload o, const char* d, - AccessControl::Access access, + Access acc, ast::ImageFormat i, ast::TextureDimension dims, TextureDataType datatype, @@ -71,7 +71,7 @@ TextureOverloadCase::TextureOverloadCase( : overload(o), description(d), texture_kind(TextureKind::kStorage), - access_control(access), + access(acc), image_format(i), texture_dimension(dims), texture_data_type(datatype), @@ -124,7 +124,7 @@ std::ostream& operator<<(std::ostream& out, const TextureOverloadCase& data) { out << ""; } out << "\n"; - out << "access_control: " << data.access_control << "\n"; + out << "access: " << data.access << "\n"; out << "image_format: " << data.image_format << "\n"; out << "texture_dimension: " << data.texture_dimension << "\n"; out << "texture_data_type: " << data.texture_data_type << "\n"; @@ -157,23 +157,22 @@ ast::Variable* TextureOverloadCase::buildTextureVariable( return b->Global("texture", b->ty.sampled_texture(texture_dimension, buildResultVectorComponentType(b)), - ast::StorageClass::kNone, nullptr, decos); + decos); case ast::intrinsic::test::TextureKind::kDepth: return b->Global("texture", b->ty.depth_texture(texture_dimension), - ast::StorageClass::kNone, nullptr, decos); + decos); case ast::intrinsic::test::TextureKind::kMultisampled: return b->Global( "texture", b->ty.multisampled_texture(texture_dimension, buildResultVectorComponentType(b)), - ast::StorageClass::kNone, nullptr, decos); + decos); case ast::intrinsic::test::TextureKind::kStorage: { - auto* st = b->ty.storage_texture(texture_dimension, image_format); - auto* ac = b->ty.access(access_control, st); - return b->Global("texture", ac, ast::StorageClass::kNone, nullptr, decos); + auto* st = b->ty.storage_texture(texture_dimension, image_format, access); + return b->Global("texture", st, decos); } } @@ -187,8 +186,7 @@ ast::Variable* TextureOverloadCase::buildSamplerVariable( b->create(0), b->create(1), }; - return b->Global("sampler", b->ty.sampler(sampler_kind), - ast::StorageClass::kNone, nullptr, decos); + return b->Global("sampler", b->ty.sampler(sampler_kind), decos); } std::vector TextureOverloadCase::ValidCases() { @@ -405,7 +403,7 @@ std::vector TextureOverloadCase::ValidCases() { { ValidTextureOverload::kDimensionsStorageRO1d, "textureDimensions(t : texture_storage_1d) -> i32", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k1d, TextureDataType::kF32, @@ -416,7 +414,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kDimensionsStorageRO2d, "textureDimensions(t : texture_storage_2d) -> " "vec2", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k2d, TextureDataType::kF32, @@ -427,7 +425,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kDimensionsStorageRO2dArray, "textureDimensions(t : texture_storage_2d_array) -> " "vec2", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k2dArray, TextureDataType::kF32, @@ -438,7 +436,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kDimensionsStorageRO3d, "textureDimensions(t : texture_storage_3d) -> " "vec3", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k3d, TextureDataType::kF32, @@ -448,7 +446,7 @@ std::vector TextureOverloadCase::ValidCases() { { ValidTextureOverload::kDimensionsStorageWO1d, "textureDimensions(t : texture_storage_1d) -> i32", - ast::AccessControl::kWrite, + ast::Access::kWrite, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k1d, TextureDataType::kF32, @@ -459,7 +457,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kDimensionsStorageWO2d, "textureDimensions(t : texture_storage_2d) -> " "vec2", - ast::AccessControl::kWrite, + ast::Access::kWrite, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k2d, TextureDataType::kF32, @@ -470,7 +468,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kDimensionsStorageWO2dArray, "textureDimensions(t : texture_storage_2d_array) -> " "vec2", - ast::AccessControl::kWrite, + ast::Access::kWrite, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k2dArray, TextureDataType::kF32, @@ -481,7 +479,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kDimensionsStorageWO3d, "textureDimensions(t : texture_storage_3d) -> " "vec3", - ast::AccessControl::kWrite, + ast::Access::kWrite, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k3d, TextureDataType::kF32, @@ -531,7 +529,7 @@ std::vector TextureOverloadCase::ValidCases() { { ValidTextureOverload::kNumLayersStorageWO2dArray, "textureNumLayers(t : texture_storage_2d_array) -> i32", - ast::AccessControl::kWrite, + ast::Access::kWrite, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k2dArray, TextureDataType::kF32, @@ -1887,7 +1885,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO1dRgba32float, "textureLoad(t : texture_storage_1d,\n" " coords : i32) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k1d, TextureDataType::kF32, @@ -1901,7 +1899,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dRgba8unorm, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba8Unorm, ast::TextureDimension::k2d, TextureDataType::kF32, @@ -1915,7 +1913,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dRgba8snorm, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba8Snorm, ast::TextureDimension::k2d, TextureDataType::kF32, @@ -1929,7 +1927,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dRgba8uint, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba8Uint, ast::TextureDimension::k2d, TextureDataType::kU32, @@ -1943,7 +1941,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dRgba8sint, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba8Sint, ast::TextureDimension::k2d, TextureDataType::kI32, @@ -1957,7 +1955,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dRgba16uint, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba16Uint, ast::TextureDimension::k2d, TextureDataType::kU32, @@ -1971,7 +1969,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dRgba16sint, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba16Sint, ast::TextureDimension::k2d, TextureDataType::kI32, @@ -1985,7 +1983,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dRgba16float, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba16Float, ast::TextureDimension::k2d, TextureDataType::kF32, @@ -1999,7 +1997,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dR32uint, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kR32Uint, ast::TextureDimension::k2d, TextureDataType::kU32, @@ -2013,7 +2011,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dR32sint, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kR32Sint, ast::TextureDimension::k2d, TextureDataType::kI32, @@ -2027,7 +2025,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dR32float, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kR32Float, ast::TextureDimension::k2d, TextureDataType::kF32, @@ -2041,7 +2039,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dRg32uint, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRg32Uint, ast::TextureDimension::k2d, TextureDataType::kU32, @@ -2055,7 +2053,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dRg32sint, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRg32Sint, ast::TextureDimension::k2d, TextureDataType::kI32, @@ -2069,7 +2067,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dRg32float, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRg32Float, ast::TextureDimension::k2d, TextureDataType::kF32, @@ -2083,7 +2081,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dRgba32uint, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba32Uint, ast::TextureDimension::k2d, TextureDataType::kU32, @@ -2097,7 +2095,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dRgba32sint, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba32Sint, ast::TextureDimension::k2d, TextureDataType::kI32, @@ -2111,7 +2109,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO2dRgba32float, "textureLoad(t : texture_storage_2d,\n" " coords : vec2) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k2d, TextureDataType::kF32, @@ -2127,7 +2125,7 @@ std::vector TextureOverloadCase::ValidCases() { "texture_storage_2d_array,\n" " coords : vec2,\n" " array_index : i32) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k2dArray, TextureDataType::kF32, @@ -2142,7 +2140,7 @@ std::vector TextureOverloadCase::ValidCases() { ValidTextureOverload::kLoadStorageRO3dRgba32float, "textureLoad(t : texture_storage_3d,\n" " coords : vec3) -> vec4", - ast::AccessControl::kRead, + ast::Access::kRead, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k3d, TextureDataType::kF32, @@ -2157,7 +2155,7 @@ std::vector TextureOverloadCase::ValidCases() { "textureStore(t : texture_storage_1d,\n" " coords : i32,\n" " value : vec4)", - ast::AccessControl::kWrite, + ast::Access::kWrite, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k1d, TextureDataType::kF32, @@ -2173,7 +2171,7 @@ std::vector TextureOverloadCase::ValidCases() { "textureStore(t : texture_storage_2d,\n" " coords : vec2,\n" " value : vec4)", - ast::AccessControl::kWrite, + ast::Access::kWrite, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k2d, TextureDataType::kF32, @@ -2190,7 +2188,7 @@ std::vector TextureOverloadCase::ValidCases() { " coords : vec2,\n" " array_index : i32,\n" " value : vec4)", - ast::AccessControl::kWrite, + ast::Access::kWrite, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k2dArray, TextureDataType::kF32, @@ -2207,7 +2205,7 @@ std::vector TextureOverloadCase::ValidCases() { "textureStore(t : texture_storage_3d,\n" " coords : vec3,\n" " value : vec4)", - ast::AccessControl::kWrite, + ast::Access::kWrite, ast::ImageFormat::kRgba32Float, ast::TextureDimension::k3d, TextureDataType::kF32, diff --git a/src/ast/intrinsic_texture_helper_test.h b/src/ast/intrinsic_texture_helper_test.h index 2151e47ad2..38cc277758 100644 --- a/src/ast/intrinsic_texture_helper_test.h +++ b/src/ast/intrinsic_texture_helper_test.h @@ -17,7 +17,7 @@ #include -#include "src/ast/access_control.h" +#include "src/ast/access.h" #include "src/program_builder.h" #include "src/sem/storage_texture_type.h" @@ -192,7 +192,7 @@ struct TextureOverloadCase { /// Constructor for textureLoad() with storage textures TextureOverloadCase(ValidTextureOverload, const char*, - AccessControl::Access, + Access, ast::ImageFormat, ast::TextureDimension, TextureDataType, @@ -230,7 +230,7 @@ struct TextureOverloadCase { ast::SamplerKind const sampler_kind = ast::SamplerKind::kSampler; /// The access control for the storage texture /// Used only when texture_kind is kStorage - AccessControl::Access const access_control = AccessControl::kReadWrite; + Access const access = Access::kReadWrite; /// The image format for the storage texture /// Used only when texture_kind is kStorage ast::ImageFormat const image_format = ast::ImageFormat::kNone; diff --git a/src/ast/matrix_test.cc b/src/ast/matrix_test.cc index 38b5f23aeb..30b14a1401 100644 --- a/src/ast/matrix_test.cc +++ b/src/ast/matrix_test.cc @@ -13,7 +13,7 @@ // limitations under the License. #include "src/ast/matrix.h" -#include "src/ast/access_control.h" +#include "src/ast/access.h" #include "src/ast/alias.h" #include "src/ast/array.h" #include "src/ast/bool.h" diff --git a/src/ast/module_clone_test.cc b/src/ast/module_clone_test.cc index a1f49205f5..37a1129d4a 100644 --- a/src/ast/module_clone_test.cc +++ b/src/ast/module_clone_test.cc @@ -42,15 +42,15 @@ type t1 = array>; var g0 : u32 = 20u; var g1 : f32 = 123.0; [[group(0), binding(0)]] var g2 : texture_2d; -[[group(1), binding(0)]] var g3 : [[access(read)]] texture_storage_2d; -[[group(2), binding(0)]] var g4 : [[access(write)]] texture_storage_2d; -[[group(3), binding(0)]] var g5 : [[access(read)]] texture_storage_2d; -[[group(4), binding(0)]] var g6 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var g3 : texture_storage_2d; +[[group(2), binding(0)]] var g4 : texture_storage_2d; +[[group(3), binding(0)]] var g5 : texture_storage_2d; +[[group(4), binding(0)]] var g6 : texture_storage_2d; var g7 : vec3; -[[group(0), binding(1)]] var g8 : [[access(write)]] S; -[[group(1), binding(1)]] var g9 : [[access(read)]] S; -[[group(2), binding(1)]] var g10 : [[access(read_write)]] S; +[[group(0), binding(1)]] var g8 : S; +[[group(1), binding(1)]] var g9 : S; +[[group(2), binding(1)]] var g10 : S; fn f0(p0 : bool) -> f32 { if (p0) { diff --git a/src/ast/multisampled_texture_test.cc b/src/ast/multisampled_texture_test.cc index a4c55d9b2e..5671f1e6ae 100644 --- a/src/ast/multisampled_texture_test.cc +++ b/src/ast/multisampled_texture_test.cc @@ -14,7 +14,7 @@ #include "src/ast/multisampled_texture.h" -#include "src/ast/access_control.h" +#include "src/ast/access.h" #include "src/ast/alias.h" #include "src/ast/array.h" #include "src/ast/bool.h" diff --git a/src/ast/pointer_test.cc b/src/ast/pointer_test.cc index 6d0104f282..d2eaa9ec96 100644 --- a/src/ast/pointer_test.cc +++ b/src/ast/pointer_test.cc @@ -13,19 +13,9 @@ // limitations under the License. #include "src/ast/pointer.h" -#include "src/ast/access_control.h" -#include "src/ast/alias.h" -#include "src/ast/array.h" -#include "src/ast/bool.h" -#include "src/ast/f32.h" + #include "src/ast/i32.h" -#include "src/ast/matrix.h" -#include "src/ast/sampler.h" -#include "src/ast/struct.h" #include "src/ast/test_helper.h" -#include "src/ast/texture.h" -#include "src/ast/u32.h" -#include "src/ast/vector.h" namespace tint { namespace ast { diff --git a/src/ast/sampled_texture_test.cc b/src/ast/sampled_texture_test.cc index 6c94c0cd69..35e932e775 100644 --- a/src/ast/sampled_texture_test.cc +++ b/src/ast/sampled_texture_test.cc @@ -14,22 +14,8 @@ #include "src/ast/sampled_texture.h" -#include "src/ast/access_control.h" -#include "src/ast/alias.h" -#include "src/ast/array.h" -#include "src/ast/bool.h" -#include "src/ast/depth_texture.h" #include "src/ast/f32.h" -#include "src/ast/i32.h" -#include "src/ast/matrix.h" -#include "src/ast/pointer.h" -#include "src/ast/sampler.h" -#include "src/ast/storage_texture.h" -#include "src/ast/struct.h" #include "src/ast/test_helper.h" -#include "src/ast/texture.h" -#include "src/ast/u32.h" -#include "src/ast/vector.h" namespace tint { namespace ast { diff --git a/src/ast/sampler_test.cc b/src/ast/sampler_test.cc index 339e6fa07c..186eb486cd 100644 --- a/src/ast/sampler_test.cc +++ b/src/ast/sampler_test.cc @@ -13,19 +13,8 @@ // limitations under the License. #include "src/ast/sampler.h" -#include "src/ast/access_control.h" -#include "src/ast/alias.h" -#include "src/ast/array.h" -#include "src/ast/bool.h" -#include "src/ast/f32.h" -#include "src/ast/i32.h" -#include "src/ast/matrix.h" -#include "src/ast/pointer.h" -#include "src/ast/struct.h" + #include "src/ast/test_helper.h" -#include "src/ast/texture.h" -#include "src/ast/u32.h" -#include "src/ast/vector.h" namespace tint { namespace ast { diff --git a/src/ast/storage_texture.cc b/src/ast/storage_texture.cc index f1f23d61d4..38207dec48 100644 --- a/src/ast/storage_texture.cc +++ b/src/ast/storage_texture.cc @@ -144,8 +144,12 @@ StorageTexture::StorageTexture(ProgramID program_id, const Source& source, TextureDimension dim, ImageFormat format, - Type* subtype) - : Base(program_id, source, dim), image_format_(format), subtype_(subtype) {} + Type* subtype, + Access access) + : Base(program_id, source, dim), + image_format_(format), + subtype_(subtype), + access_(access) {} StorageTexture::StorageTexture(StorageTexture&&) = default; @@ -153,13 +157,15 @@ StorageTexture::~StorageTexture() = default; std::string StorageTexture::type_name() const { std::ostringstream out; - out << "__storage_texture_" << dim() << "_" << image_format_; + out << "__storage_texture_" << dim() << "_" << image_format_ << "_" + << access_; return out.str(); } std::string StorageTexture::FriendlyName(const SymbolTable&) const { std::ostringstream out; - out << "texture_storage_" << dim() << "<" << image_format_ << ">"; + out << "texture_storage_" << dim() << "<" << image_format_ << ", " << access_ + << ">"; return out.str(); } @@ -167,7 +173,8 @@ StorageTexture* StorageTexture::Clone(CloneContext* ctx) const { // Clone arguments outside of create() call to have deterministic ordering auto src = ctx->Clone(source()); auto* ty = ctx->Clone(type()); - return ctx->dst->create(src, dim(), image_format_, ty); + return ctx->dst->create(src, dim(), image_format(), ty, + access()); } Type* StorageTexture::SubtypeFor(ImageFormat format, ProgramBuilder& builder) { diff --git a/src/ast/storage_texture.h b/src/ast/storage_texture.h index bdf16b3902..9d45b95625 100644 --- a/src/ast/storage_texture.h +++ b/src/ast/storage_texture.h @@ -17,6 +17,7 @@ #include +#include "src/ast/access.h" #include "src/ast/texture.h" namespace tint { @@ -78,21 +79,33 @@ class StorageTexture : public Castable { /// @param dim the dimensionality of the texture /// @param format the image format of the texture /// @param subtype the storage subtype. Use SubtypeFor() to calculate this. + /// @param access_control the access control for the texture. StorageTexture(ProgramID program_id, const Source& source, TextureDimension dim, ImageFormat format, - Type* subtype); + Type* subtype, + Access access_control); /// Move constructor StorageTexture(StorageTexture&&); ~StorageTexture() override; + /// @returns the image format + ImageFormat image_format() const { return image_format_; } + /// @returns the storage subtype Type* type() const { return subtype_; } - /// @returns the image format - ImageFormat image_format() const { return image_format_; } + /// @returns the access control + Access access() const { return access_; } + + /// @returns true if the access control is read only + bool is_read_only() const { return access_ == Access::kRead; } + /// @returns true if the access control is write only + bool is_write_only() const { return access_ == Access::kWrite; } + /// @returns true if the access control is read/write + bool is_read_write() const { return access_ == Access::kReadWrite; } /// @returns the name for this type std::string type_name() const override; @@ -115,6 +128,7 @@ class StorageTexture : public Castable { private: ImageFormat const image_format_; Type* const subtype_; + Access const access_; }; } // namespace ast diff --git a/src/ast/storage_texture_test.cc b/src/ast/storage_texture_test.cc index e2ee6e6d97..6098ccb4b3 100644 --- a/src/ast/storage_texture_test.cc +++ b/src/ast/storage_texture_test.cc @@ -13,22 +13,8 @@ // limitations under the License. #include "src/ast/storage_texture.h" -#include "src/ast/access_control.h" -#include "src/ast/alias.h" -#include "src/ast/array.h" -#include "src/ast/bool.h" -#include "src/ast/depth_texture.h" -#include "src/ast/f32.h" -#include "src/ast/i32.h" -#include "src/ast/matrix.h" -#include "src/ast/pointer.h" -#include "src/ast/sampled_texture.h" -#include "src/ast/sampler.h" -#include "src/ast/struct.h" + #include "src/ast/test_helper.h" -#include "src/ast/texture.h" -#include "src/ast/u32.h" -#include "src/ast/vector.h" namespace tint { namespace ast { @@ -38,8 +24,9 @@ using AstStorageTextureTest = TestHelper; TEST_F(AstStorageTextureTest, IsTexture) { auto* subtype = StorageTexture::SubtypeFor(ImageFormat::kRgba32Float, *this); - Texture* ty = create(TextureDimension::k2dArray, - ImageFormat::kRgba32Float, subtype); + Texture* ty = + create(TextureDimension::k2dArray, + ImageFormat::kRgba32Float, subtype, Access::kRead); EXPECT_FALSE(ty->Is()); EXPECT_FALSE(ty->Is()); EXPECT_TRUE(ty->Is()); @@ -47,37 +34,42 @@ TEST_F(AstStorageTextureTest, IsTexture) { TEST_F(AstStorageTextureTest, Dim) { auto* subtype = StorageTexture::SubtypeFor(ImageFormat::kRgba32Float, *this); - auto* s = create(TextureDimension::k2dArray, - ImageFormat::kRgba32Float, subtype); + auto* s = + create(TextureDimension::k2dArray, + ImageFormat::kRgba32Float, subtype, Access::kRead); EXPECT_EQ(s->dim(), TextureDimension::k2dArray); } TEST_F(AstStorageTextureTest, Format) { auto* subtype = StorageTexture::SubtypeFor(ImageFormat::kRgba32Float, *this); - auto* s = create(TextureDimension::k2dArray, - ImageFormat::kRgba32Float, subtype); + auto* s = + create(TextureDimension::k2dArray, + ImageFormat::kRgba32Float, subtype, Access::kRead); EXPECT_EQ(s->image_format(), ImageFormat::kRgba32Float); } TEST_F(AstStorageTextureTest, TypeName) { auto* subtype = StorageTexture::SubtypeFor(ImageFormat::kRgba32Float, *this); - auto* s = create(TextureDimension::k2dArray, - ImageFormat::kRgba32Float, subtype); - EXPECT_EQ(s->type_name(), "__storage_texture_2d_array_rgba32float"); + auto* s = + create(TextureDimension::k2dArray, + ImageFormat::kRgba32Float, subtype, Access::kRead); + EXPECT_EQ(s->type_name(), "__storage_texture_2d_array_rgba32float_read"); } TEST_F(AstStorageTextureTest, FriendlyName) { auto* subtype = StorageTexture::SubtypeFor(ImageFormat::kRgba32Float, *this); - auto* s = create(TextureDimension::k2dArray, - ImageFormat::kRgba32Float, subtype); + auto* s = + create(TextureDimension::k2dArray, + ImageFormat::kRgba32Float, subtype, Access::kRead); EXPECT_EQ(s->FriendlyName(Symbols()), - "texture_storage_2d_array"); + "texture_storage_2d_array"); } TEST_F(AstStorageTextureTest, F32) { auto* subtype = StorageTexture::SubtypeFor(ImageFormat::kRgba32Float, *this); - Type* s = create(TextureDimension::k2dArray, - ImageFormat::kRgba32Float, subtype); + Type* s = + create(TextureDimension::k2dArray, + ImageFormat::kRgba32Float, subtype, Access::kRead); ASSERT_TRUE(s->Is()); ASSERT_TRUE(s->Is()); @@ -86,8 +78,9 @@ TEST_F(AstStorageTextureTest, F32) { TEST_F(AstStorageTextureTest, U32) { auto* subtype = StorageTexture::SubtypeFor(ImageFormat::kRg32Uint, *this); - Type* s = create(TextureDimension::k2dArray, - ImageFormat::kRg32Uint, subtype); + Type* s = + create(TextureDimension::k2dArray, ImageFormat::kRg32Uint, + subtype, Access::kRead); ASSERT_TRUE(s->Is()); ASSERT_TRUE(s->Is()); @@ -96,8 +89,9 @@ TEST_F(AstStorageTextureTest, U32) { TEST_F(AstStorageTextureTest, I32) { auto* subtype = StorageTexture::SubtypeFor(ImageFormat::kRgba32Sint, *this); - Type* s = create(TextureDimension::k2dArray, - ImageFormat::kRgba32Sint, subtype); + Type* s = + create(TextureDimension::k2dArray, + ImageFormat::kRgba32Sint, subtype, Access::kRead); ASSERT_TRUE(s->Is()); ASSERT_TRUE(s->Is()); diff --git a/src/ast/u32_test.cc b/src/ast/u32_test.cc index af57079834..e13ed8552e 100644 --- a/src/ast/u32_test.cc +++ b/src/ast/u32_test.cc @@ -14,19 +14,7 @@ #include "src/ast/u32.h" -#include "src/ast/access_control.h" -#include "src/ast/alias.h" -#include "src/ast/array.h" -#include "src/ast/bool.h" -#include "src/ast/f32.h" -#include "src/ast/i32.h" -#include "src/ast/matrix.h" -#include "src/ast/pointer.h" -#include "src/ast/sampler.h" -#include "src/ast/struct.h" #include "src/ast/test_helper.h" -#include "src/ast/texture.h" -#include "src/ast/vector.h" namespace tint { namespace ast { diff --git a/src/ast/variable.cc b/src/ast/variable.cc index d1f339585e..c473fbee87 100644 --- a/src/ast/variable.cc +++ b/src/ast/variable.cc @@ -27,6 +27,7 @@ Variable::Variable(ProgramID program_id, const Source& source, const Symbol& sym, StorageClass declared_storage_class, + Access declared_access, const ast::Type* type, bool is_const, Expression* constructor, @@ -37,7 +38,8 @@ Variable::Variable(ProgramID program_id, is_const_(is_const), constructor_(constructor), decorations_(std::move(decorations)), - declared_storage_class_(declared_storage_class) { + declared_storage_class_(declared_storage_class), + declared_access_(declared_access) { TINT_ASSERT(symbol_.IsValid()); TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(symbol_, program_id); TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(constructor, program_id); @@ -66,8 +68,9 @@ Variable* Variable::Clone(CloneContext* ctx) const { auto* ty = ctx->Clone(type()); auto* ctor = ctx->Clone(constructor()); auto decos = ctx->Clone(decorations()); - return ctx->dst->create(src, sym, declared_storage_class(), ty, - is_const_, ctor, decos); + return ctx->dst->create(src, sym, declared_storage_class(), + declared_access(), ty, is_const_, ctor, + decos); } void Variable::info_to_str(const sem::Info& sem, @@ -80,6 +83,8 @@ void Variable::info_to_str(const sem::Info& sem, out << (var_sem ? var_sem->StorageClass() : declared_storage_class()) << std::endl; make_indent(out, indent); + out << declared_access_ << std::endl; + make_indent(out, indent); out << type_->type_name() << std::endl; } diff --git a/src/ast/variable.h b/src/ast/variable.h index a345fcc131..a618b0b5a6 100644 --- a/src/ast/variable.h +++ b/src/ast/variable.h @@ -18,6 +18,7 @@ #include #include +#include "src/ast/access.h" #include "src/ast/decoration.h" #include "src/ast/expression.h" #include "src/ast/storage_class.h" @@ -103,6 +104,7 @@ class Variable : public Castable { /// @param source the variable source /// @param sym the variable symbol /// @param declared_storage_class the declared storage class + /// @param declared_access the declared access control /// @param type the declared variable type /// @param is_const true if the variable is const /// @param constructor the constructor expression @@ -111,6 +113,7 @@ class Variable : public Castable { const Source& source, const Symbol& sym, StorageClass declared_storage_class, + Access declared_access, const ast::Type* type, bool is_const, Expression* constructor, @@ -130,6 +133,10 @@ class Variable : public Castable { StorageClass declared_storage_class() const { return declared_storage_class_; } + + /// @returns the declared access control + Access declared_access() const { return declared_access_; } + /// @returns the constructor expression or nullptr if none set Expression* constructor() const { return constructor_; } /// @returns true if the variable has an constructor @@ -184,6 +191,7 @@ class Variable : public Castable { Expression* const constructor_; DecorationList const decorations_; StorageClass const declared_storage_class_; + Access const declared_access_; }; /// A list of variables diff --git a/src/ast/variable_decl_statement_test.cc b/src/ast/variable_decl_statement_test.cc index 37776e219a..e1deb63780 100644 --- a/src/ast/variable_decl_statement_test.cc +++ b/src/ast/variable_decl_statement_test.cc @@ -76,6 +76,7 @@ TEST_F(VariableDeclStatementTest, ToStr) { Variable{ a none + undefined __f32 } } diff --git a/src/ast/variable_test.cc b/src/ast/variable_test.cc index 5f7ce60ad2..fd223ac1fb 100644 --- a/src/ast/variable_test.cc +++ b/src/ast/variable_test.cc @@ -92,10 +92,12 @@ TEST_F(VariableTest, Assert_DifferentProgramID_Constructor) { } TEST_F(VariableTest, to_str) { - auto* v = Var("my_var", ty.f32(), StorageClass::kFunction); + auto* v = + Var("my_var", ty.f32(), StorageClass::kFunction, ast::Access::kReadWrite); EXPECT_EQ(str(v), R"(Variable{ my_var function + read_write __f32 } )"); @@ -161,7 +163,8 @@ TEST_F(VariableTest, BindingPointMissingBindingDecoration) { } TEST_F(VariableTest, Decorated_to_str) { - auto* var = Var("my_var", ty.f32(), StorageClass::kFunction, Expr("expr"), + auto* var = Var("my_var", ty.f32(), StorageClass::kFunction, + ast::Access::kRead, Expr("expr"), DecorationList{ create(2), create(1), @@ -174,6 +177,7 @@ TEST_F(VariableTest, Decorated_to_str) { } my_var function + read __f32 { Identifier[not set]{expr} diff --git a/src/ast/vector_test.cc b/src/ast/vector_test.cc index f4195581ab..4f4d0ed8f8 100644 --- a/src/ast/vector_test.cc +++ b/src/ast/vector_test.cc @@ -13,19 +13,9 @@ // limitations under the License. #include "src/ast/vector.h" -#include "src/ast/access_control.h" -#include "src/ast/alias.h" -#include "src/ast/array.h" -#include "src/ast/bool.h" -#include "src/ast/f32.h" + #include "src/ast/i32.h" -#include "src/ast/matrix.h" -#include "src/ast/pointer.h" -#include "src/ast/sampler.h" -#include "src/ast/struct.h" #include "src/ast/test_helper.h" -#include "src/ast/texture.h" -#include "src/ast/u32.h" namespace tint { namespace ast { diff --git a/src/inspector/inspector.cc b/src/inspector/inspector.cc index 51030f93a6..c0a100c888 100644 --- a/src/inspector/inspector.cc +++ b/src/inspector/inspector.cc @@ -641,7 +641,7 @@ std::vector Inspector::GetStorageBufferResourceBindingsImpl( auto* var = rsv.first; auto binding_info = rsv.second; - if (read_only != (var->AccessControl() == ast::AccessControl::kRead)) { + if (read_only != (var->Access() == ast::Access::kRead)) { continue; } @@ -723,8 +723,7 @@ std::vector Inspector::GetStorageTextureResourceBindingsImpl( auto* texture_type = var->Type()->UnwrapRef()->As(); - if (read_only != - (texture_type->access_control() == ast::AccessControl::kRead)) { + if (read_only != (texture_type->access() == ast::Access::kRead)) { continue; } diff --git a/src/inspector/inspector_test.cc b/src/inspector/inspector_test.cc index dd3f53408f..00bc302b39 100644 --- a/src/inspector/inspector_test.cc +++ b/src/inspector/inspector_test.cc @@ -235,47 +235,12 @@ class InspectorHelper : public ProgramBuilder { /// Generates types appropriate for using in a storage buffer /// @param name name for the type /// @param member_types a vector of member types - /// @returns a function that returns an ast::AccessControl to the created - /// structure. - std::function MakeStorageBufferTypes( + /// @returns a function that returns the created structure. + std::function MakeStorageBufferTypes( const std::string& name, std::vector member_types) { MakeStructType(name, member_types, true); - return [this, name] { - return ty.access(ast::AccessControl::kReadWrite, ty.type_name(name)); - }; - } - - /// Generates types appropriate for using in a read-only storage buffer - /// @param name name for the type - /// @param member_types a vector of member types - /// @returns a function that returns an ast::AccessControl to the created - /// structure. - std::function MakeReadOnlyStorageBufferTypes( - const std::string& name, - std::vector member_types) { - MakeStructType(name, member_types, true); - return [this, name] { - return ty.access(ast::AccessControl::kRead, ty.type_name(name)); - }; - } - - /// Adds a binding variable with a struct type to the program - /// @param name the name of the variable - /// @param type the type to use - /// @param storage_class the storage class to use - /// @param group the binding and group to use for the uniform buffer - /// @param binding the binding number to use for the uniform buffer - void AddBinding(const std::string& name, - ast::Type* type, - ast::StorageClass storage_class, - uint32_t group, - uint32_t binding) { - Global(name, type, storage_class, nullptr, - ast::DecorationList{ - create(binding), - create(group), - }); + return [this, name] { return ty.type_name(name); }; } /// Adds an uniform buffer variable to the program @@ -287,19 +252,29 @@ class InspectorHelper : public ProgramBuilder { ast::Type* type, uint32_t group, uint32_t binding) { - AddBinding(name, type, ast::StorageClass::kUniform, group, binding); + Global(name, type, ast::StorageClass::kUniform, + ast::DecorationList{ + create(binding), + create(group), + }); } /// Adds a storage buffer variable to the program /// @param name the name of the variable /// @param type the type to use + /// @param access the storage buffer access control /// @param group the binding/group to use for the storage buffer /// @param binding the binding number to use for the storage buffer void AddStorageBuffer(const std::string& name, ast::Type* type, + ast::Access access, uint32_t group, uint32_t binding) { - AddBinding(name, type, ast::StorageClass::kStorage, group, binding); + Global(name, type, ast::StorageClass::kStorage, access, + ast::DecorationList{ + create(binding), + create(group), + }); } /// Generates a function that references a specific struct variable @@ -341,7 +316,11 @@ class InspectorHelper : public ProgramBuilder { /// @param group the binding/group to use for the storage buffer /// @param binding the binding number to use for the storage buffer void AddSampler(const std::string& name, uint32_t group, uint32_t binding) { - AddBinding(name, sampler_type(), ast::StorageClass::kNone, group, binding); + Global(name, sampler_type(), + ast::DecorationList{ + create(binding), + create(group), + }); } /// Adds a comparison sampler variable to the program @@ -351,8 +330,11 @@ class InspectorHelper : public ProgramBuilder { void AddComparisonSampler(const std::string& name, uint32_t group, uint32_t binding) { - AddBinding(name, comparison_sampler_type(), ast::StorageClass::kNone, group, - binding); + Global(name, comparison_sampler_type(), + ast::DecorationList{ + create(binding), + create(group), + }); } /// Generates a SampledTexture appropriate for the params @@ -396,7 +378,11 @@ class InspectorHelper : public ProgramBuilder { ast::Type* type, uint32_t group, uint32_t binding) { - AddBinding(name, type, ast::StorageClass::kNone, group, binding); + Global(name, type, + ast::DecorationList{ + create(binding), + create(group), + }); } /// Adds a multi-sampled texture variable to the program @@ -408,7 +394,11 @@ class InspectorHelper : public ProgramBuilder { ast::Type* type, uint32_t group, uint32_t binding) { - AddBinding(name, type, ast::StorageClass::kNone, group, binding); + Global(name, type, + ast::DecorationList{ + create(binding), + create(group), + }); } void AddGlobalVariable(const std::string& name, ast::Type* type) { @@ -424,7 +414,11 @@ class InspectorHelper : public ProgramBuilder { ast::Type* type, uint32_t group, uint32_t binding) { - AddBinding(name, type, ast::StorageClass::kNone, group, binding); + Global(name, type, + ast::DecorationList{ + create(binding), + create(group), + }); } /// Adds an external texture variable to the program @@ -436,7 +430,11 @@ class InspectorHelper : public ProgramBuilder { ast::Type* type, uint32_t group, uint32_t binding) { - AddBinding(name, type, ast::StorageClass::kNone, group, binding); + Global(name, type, + ast::DecorationList{ + create(binding), + create(group), + }); } /// Generates a function that references a specific sampler variable @@ -571,15 +569,12 @@ class InspectorHelper : public ProgramBuilder { /// @param dim the texture dimension of the storage texture /// @param format the image format of the storage texture /// @param read_only should the access type be read only, otherwise write only - /// @returns the storage texture type, subtype & access control type + /// @returns the storage texture type ast::Type* MakeStorageTextureTypes(ast::TextureDimension dim, ast::ImageFormat format, bool read_only) { - auto ac = - read_only ? ast::AccessControl::kRead : ast::AccessControl::kWrite; - auto* tex = ty.storage_texture(dim, format); - - return ty.access(ac, tex); + auto access = read_only ? ast::Access::kRead : ast::Access::kWrite; + return ty.storage_texture(dim, format, access); } /// Adds a storage texture variable to the program @@ -591,7 +586,11 @@ class InspectorHelper : public ProgramBuilder { ast::Type* type, uint32_t group, uint32_t binding) { - AddBinding(name, type, ast::StorageClass::kNone, group, binding); + Global(name, type, + ast::DecorationList{ + create(binding), + create(group), + }); } /// Generates a function that references a storage texture variable. @@ -1664,11 +1663,11 @@ TEST_F(InspectorGetResourceBindingsTest, Simple) { MakeStructVariableReferenceBodyFunction("ub_func", "ub_var", {{0, ty.i32()}}); auto sb = MakeStorageBufferTypes("sb_type", {ty.i32()}); - AddStorageBuffer("sb_var", sb(), 1, 0); + AddStorageBuffer("sb_var", sb(), ast::Access::kReadWrite, 1, 0); MakeStructVariableReferenceBodyFunction("sb_func", "sb_var", {{0, ty.i32()}}); - auto ro_sb = MakeReadOnlyStorageBufferTypes("rosb_type", {ty.i32()}); - AddStorageBuffer("rosb_var", ro_sb(), 1, 1); + auto ro_sb = MakeStorageBufferTypes("rosb_type", {ty.i32()}); + AddStorageBuffer("rosb_var", ro_sb(), ast::Access::kRead, 1, 1); MakeStructVariableReferenceBodyFunction("rosb_func", "rosb_var", {{0, ty.i32()}}); @@ -1949,7 +1948,7 @@ TEST_F(InspectorGetUniformBufferResourceBindingsTest, ContainingArray) { TEST_F(InspectorGetStorageBufferResourceBindingsTest, Simple) { auto foo_struct_type = MakeStorageBufferTypes("foo_type", {ty.i32()}); - AddStorageBuffer("foo_sb", foo_struct_type(), 0, 0); + AddStorageBuffer("foo_sb", foo_struct_type(), ast::Access::kReadWrite, 0, 0); MakeStructVariableReferenceBodyFunction("sb_func", "foo_sb", {{0, ty.i32()}}); @@ -1978,7 +1977,7 @@ TEST_F(InspectorGetStorageBufferResourceBindingsTest, MultipleMembers) { ty.u32(), ty.f32(), }); - AddStorageBuffer("foo_sb", foo_struct_type(), 0, 0); + AddStorageBuffer("foo_sb", foo_struct_type(), ast::Access::kReadWrite, 0, 0); MakeStructVariableReferenceBodyFunction( "sb_func", "foo_sb", {{0, ty.i32()}, {1, ty.u32()}, {2, ty.f32()}}); @@ -2008,9 +2007,9 @@ TEST_F(InspectorGetStorageBufferResourceBindingsTest, MultipleStorageBuffers) { ty.u32(), ty.f32(), }); - AddStorageBuffer("sb_foo", sb_struct_type(), 0, 0); - AddStorageBuffer("sb_bar", sb_struct_type(), 0, 1); - AddStorageBuffer("sb_baz", sb_struct_type(), 2, 0); + AddStorageBuffer("sb_foo", sb_struct_type(), ast::Access::kReadWrite, 0, 0); + AddStorageBuffer("sb_bar", sb_struct_type(), ast::Access::kReadWrite, 0, 1); + AddStorageBuffer("sb_baz", sb_struct_type(), ast::Access::kReadWrite, 2, 0); auto AddReferenceFunc = [this](const std::string& func_name, const std::string& var_name) { @@ -2067,7 +2066,7 @@ TEST_F(InspectorGetStorageBufferResourceBindingsTest, MultipleStorageBuffers) { TEST_F(InspectorGetStorageBufferResourceBindingsTest, ContainingArray) { auto foo_struct_type = MakeStorageBufferTypes("foo_type", {ty.i32(), ty.array()}); - AddStorageBuffer("foo_sb", foo_struct_type(), 0, 0); + AddStorageBuffer("foo_sb", foo_struct_type(), ast::Access::kReadWrite, 0, 0); MakeStructVariableReferenceBodyFunction("sb_func", "foo_sb", {{0, ty.i32()}}); @@ -2095,7 +2094,7 @@ TEST_F(InspectorGetStorageBufferResourceBindingsTest, ContainingRuntimeArray) { ty.i32(), ty.array(), }); - AddStorageBuffer("foo_sb", foo_struct_type(), 0, 0); + AddStorageBuffer("foo_sb", foo_struct_type(), ast::Access::kReadWrite, 0, 0); MakeStructVariableReferenceBodyFunction("sb_func", "foo_sb", {{0, ty.i32()}}); @@ -2120,7 +2119,7 @@ TEST_F(InspectorGetStorageBufferResourceBindingsTest, ContainingRuntimeArray) { TEST_F(InspectorGetStorageBufferResourceBindingsTest, ContainingPadding) { auto foo_struct_type = MakeStorageBufferTypes("foo_type", {ty.vec3()}); - AddStorageBuffer("foo_sb", foo_struct_type(), 0, 0); + AddStorageBuffer("foo_sb", foo_struct_type(), ast::Access::kReadWrite, 0, 0); MakeStructVariableReferenceBodyFunction("sb_func", "foo_sb", {{0, ty.vec3()}}); @@ -2145,8 +2144,8 @@ TEST_F(InspectorGetStorageBufferResourceBindingsTest, ContainingPadding) { } TEST_F(InspectorGetStorageBufferResourceBindingsTest, SkipReadOnly) { - auto foo_struct_type = MakeReadOnlyStorageBufferTypes("foo_type", {ty.i32()}); - AddStorageBuffer("foo_sb", foo_struct_type(), 0, 0); + auto foo_struct_type = MakeStorageBufferTypes("foo_type", {ty.i32()}); + AddStorageBuffer("foo_sb", foo_struct_type(), ast::Access::kRead, 0, 0); MakeStructVariableReferenceBodyFunction("sb_func", "foo_sb", {{0, ty.i32()}}); @@ -2163,8 +2162,8 @@ TEST_F(InspectorGetStorageBufferResourceBindingsTest, SkipReadOnly) { } TEST_F(InspectorGetReadOnlyStorageBufferResourceBindingsTest, Simple) { - auto foo_struct_type = MakeReadOnlyStorageBufferTypes("foo_type", {ty.i32()}); - AddStorageBuffer("foo_sb", foo_struct_type(), 0, 0); + auto foo_struct_type = MakeStorageBufferTypes("foo_type", {ty.i32()}); + AddStorageBuffer("foo_sb", foo_struct_type(), ast::Access::kRead, 0, 0); MakeStructVariableReferenceBodyFunction("sb_func", "foo_sb", {{0, ty.i32()}}); @@ -2189,14 +2188,14 @@ TEST_F(InspectorGetReadOnlyStorageBufferResourceBindingsTest, Simple) { TEST_F(InspectorGetReadOnlyStorageBufferResourceBindingsTest, MultipleStorageBuffers) { - auto sb_struct_type = MakeReadOnlyStorageBufferTypes("sb_type", { - ty.i32(), - ty.u32(), - ty.f32(), - }); - AddStorageBuffer("sb_foo", sb_struct_type(), 0, 0); - AddStorageBuffer("sb_bar", sb_struct_type(), 0, 1); - AddStorageBuffer("sb_baz", sb_struct_type(), 2, 0); + auto sb_struct_type = MakeStorageBufferTypes("sb_type", { + ty.i32(), + ty.u32(), + ty.f32(), + }); + AddStorageBuffer("sb_foo", sb_struct_type(), ast::Access::kRead, 0, 0); + AddStorageBuffer("sb_bar", sb_struct_type(), ast::Access::kRead, 0, 1); + AddStorageBuffer("sb_baz", sb_struct_type(), ast::Access::kRead, 2, 0); auto AddReferenceFunc = [this](const std::string& func_name, const std::string& var_name) { @@ -2252,11 +2251,11 @@ TEST_F(InspectorGetReadOnlyStorageBufferResourceBindingsTest, TEST_F(InspectorGetReadOnlyStorageBufferResourceBindingsTest, ContainingArray) { auto foo_struct_type = - MakeReadOnlyStorageBufferTypes("foo_type", { - ty.i32(), - ty.array(), - }); - AddStorageBuffer("foo_sb", foo_struct_type(), 0, 0); + MakeStorageBufferTypes("foo_type", { + ty.i32(), + ty.array(), + }); + AddStorageBuffer("foo_sb", foo_struct_type(), ast::Access::kRead, 0, 0); MakeStructVariableReferenceBodyFunction("sb_func", "foo_sb", {{0, ty.i32()}}); @@ -2281,12 +2280,11 @@ TEST_F(InspectorGetReadOnlyStorageBufferResourceBindingsTest, ContainingArray) { TEST_F(InspectorGetReadOnlyStorageBufferResourceBindingsTest, ContainingRuntimeArray) { - auto foo_struct_type = - MakeReadOnlyStorageBufferTypes("foo_type", { - ty.i32(), - ty.array(), - }); - AddStorageBuffer("foo_sb", foo_struct_type(), 0, 0); + auto foo_struct_type = MakeStorageBufferTypes("foo_type", { + ty.i32(), + ty.array(), + }); + AddStorageBuffer("foo_sb", foo_struct_type(), ast::Access::kRead, 0, 0); MakeStructVariableReferenceBodyFunction("sb_func", "foo_sb", {{0, ty.i32()}}); @@ -2311,7 +2309,7 @@ TEST_F(InspectorGetReadOnlyStorageBufferResourceBindingsTest, TEST_F(InspectorGetReadOnlyStorageBufferResourceBindingsTest, SkipNonReadOnly) { auto foo_struct_type = MakeStorageBufferTypes("foo_type", {ty.i32()}); - AddStorageBuffer("foo_sb", foo_struct_type(), 0, 0); + AddStorageBuffer("foo_sb", foo_struct_type(), ast::Access::kReadWrite, 0, 0); MakeStructVariableReferenceBodyFunction("sb_func", "foo_sb", {{0, ty.i32()}}); diff --git a/src/intrinsic_table.cc b/src/intrinsic_table.cc index 4da8cbbabb..9cdeca766c 100644 --- a/src/intrinsic_table.cc +++ b/src/intrinsic_table.cc @@ -286,7 +286,7 @@ class OpenNumberMatcher : public NumberMatcher { // template //////////////////////////////////////////////////////////////////////////////// using TexelFormat = ast::ImageFormat; -using AccessControl = ast::AccessControl::Access; +using Access = ast::Access; using StorageClass = ast::StorageClass; using ParameterUsage = sem::ParameterUsage; using PipelineStageSet = sem::PipelineStageSet; @@ -577,7 +577,7 @@ bool match_texture_storage(const sem::Type* ty, if (auto* v = ty->As()) { if (v->dim() == dim) { F = Number(static_cast(v->image_format())); - A = Number(static_cast(v->access_control())); + A = Number(static_cast(v->access())); return true; } } @@ -592,7 +592,7 @@ bool match_texture_storage(const sem::Type* ty, const sem::StorageTexture* JOIN(build_texture_storage_, suffix)( \ MatchState & state, Number F, Number A) { \ auto format = static_cast(F.Value()); \ - auto access = static_cast(A.Value()); \ + auto access = static_cast(A.Value()); \ auto* T = sem::StorageTexture::SubtypeFor(format, state.builder.Types()); \ return state.builder.create(dim, format, access, T); \ } diff --git a/src/intrinsic_table.inl b/src/intrinsic_table.inl index 925b23b386..4fca42fe5e 100644 --- a/src/intrinsic_table.inl +++ b/src/intrinsic_table.inl @@ -1184,9 +1184,9 @@ class ReadOrWrite : public NumberMatcher { }; Number ReadOrWrite::Match(MatchState&, Number number) const { - switch (static_cast(number.Value())) { - case AccessControl::kRead: - case AccessControl::kWrite: + switch (static_cast(number.Value())) { + case Access::kRead: + case Access::kWrite: return number; default: return Number::invalid; @@ -1212,8 +1212,8 @@ class Write : public NumberMatcher { }; Number Write::Match(MatchState&, Number number) const { - if (number.IsAny() || number.Value() == static_cast(AccessControl::kWrite)) { - return Number(AccessControl::kWrite); + if (number.IsAny() || number.Value() == static_cast(Access::kWrite)) { + return Number(Access::kWrite); } return Number::invalid; } @@ -1237,8 +1237,8 @@ class Read : public NumberMatcher { }; Number Read::Match(MatchState&, Number number) const { - if (number.IsAny() || number.Value() == static_cast(AccessControl::kRead)) { - return Number(AccessControl::kRead); + if (number.IsAny() || number.Value() == static_cast(Access::kRead)) { + return Number(Access::kRead); } return Number::invalid; } diff --git a/src/intrinsic_table_test.cc b/src/intrinsic_table_test.cc index 4fcf033120..f6b994999d 100644 --- a/src/intrinsic_table_test.cc +++ b/src/intrinsic_table_test.cc @@ -338,7 +338,7 @@ TEST_F(IntrinsicTableTest, MatchROStorageTexture) { sem::StorageTexture::SubtypeFor(ast::ImageFormat::kR32Float, Types()); auto* tex = create(ast::TextureDimension::k2d, ast::ImageFormat::kR32Float, - ast::AccessControl::kRead, subtype); + ast::Access::kRead, subtype); auto* result = table->Lookup(IntrinsicType::kTextureLoad, {tex, vec2_i32}, Source{}); @@ -360,7 +360,7 @@ TEST_F(IntrinsicTableTest, MatchWOStorageTexture) { sem::StorageTexture::SubtypeFor(ast::ImageFormat::kR32Float, Types()); auto* tex = create(ast::TextureDimension::k2d, ast::ImageFormat::kR32Float, - ast::AccessControl::kWrite, subtype); + ast::Access::kWrite, subtype); auto* result = table->Lookup(IntrinsicType::kTextureStore, {tex, vec2_i32, vec4_f32}, Source{}); diff --git a/src/intrinsics.def b/src/intrinsics.def index d63d72a173..955b33fc4a 100644 --- a/src/intrinsics.def +++ b/src/intrinsics.def @@ -34,7 +34,7 @@ enum storage_class { } // https://gpuweb.github.io/gpuweb/wgsl/#memory-access-mode -enum access_control { +enum access { read write read_write @@ -89,10 +89,10 @@ type texture_depth_2d type texture_depth_2d_array type texture_depth_cube type texture_depth_cube_array -type texture_storage_1d -type texture_storage_2d -type texture_storage_2d_array -type texture_storage_3d +type texture_storage_1d +type texture_storage_2d +type texture_storage_2d_array +type texture_storage_3d type texture_external //////////////////////////////////////////////////////////////////////////////// @@ -245,7 +245,7 @@ match read_or_write: read | write // - Single parameter of vector type with open-number size N and element // // open-type T // // // -// fn F(texture_storage_1d) // +// fn F(texture_storage_1d) // // - Single parameter of texture_storage_1d type with open-number // // access-control C, and of a texel format that is listed in // // f32_texel_format // diff --git a/src/program_builder.h b/src/program_builder.h index 5319a13bdf..371ab4d040 100644 --- a/src/program_builder.h +++ b/src/program_builder.h @@ -101,11 +101,13 @@ class ProgramBuilder { ~VarOptionals(); ast::StorageClass storage = ast::StorageClass::kNone; + ast::Access access = ast::Access::kUndefined; ast::Expression* constructor = nullptr; ast::DecorationList decorations = {}; private: void Set(ast::StorageClass sc) { storage = sc; } + void Set(ast::Access ac) { access = ac; } void Set(ast::Expression* c) { constructor = c; } void Set(const ast::DecorationList& l) { decorations = l; } @@ -708,29 +710,6 @@ class ProgramBuilder { return builder->create(source, sym, type); } - /// Creates an access control qualifier type - /// @param access the access control - /// @param type the inner type - /// @returns the access control qualifier type - ast::AccessControl* access(ast::AccessControl::Access access, - const ast::Type* type) const { - type = MaybeCreateTypename(type); - return type ? builder->create(access, type) : nullptr; - } - - /// Creates an access control qualifier type - /// @param source the Source of the node - /// @param access the access control - /// @param type the inner type - /// @returns the access control qualifier type - ast::AccessControl* access(const Source& source, - ast::AccessControl::Access access, - const ast::Type* type) const { - type = MaybeCreateTypename(type); - return type ? builder->create(source, access, type) - : nullptr; - } - /// @param type the type of the pointer /// @param storage_class the storage class of the pointer /// @return the pointer to `type` with the given ast::StorageClass @@ -823,23 +802,28 @@ class ProgramBuilder { /// @param dims the dimensionality of the texture /// @param format the image format of the texture + /// @param access the access control of the texture /// @returns the storage texture ast::StorageTexture* storage_texture(ast::TextureDimension dims, - ast::ImageFormat format) const { + ast::ImageFormat format, + ast::Access access) const { auto* subtype = ast::StorageTexture::SubtypeFor(format, *builder); - return builder->create(dims, format, subtype); + return builder->create(dims, format, subtype, + access); } /// @param source the Source of the node /// @param dims the dimensionality of the texture /// @param format the image format of the texture + /// @param access the access control of the texture /// @returns the storage texture ast::StorageTexture* storage_texture(const Source& source, ast::TextureDimension dims, - ast::ImageFormat format) const { + ast::ImageFormat format, + ast::Access access) const { auto* subtype = ast::StorageTexture::SubtypeFor(format, *builder); - return builder->create(source, dims, format, - subtype); + return builder->create(source, dims, format, subtype, + access); } /// @returns the external texture @@ -1216,6 +1200,7 @@ class ProgramBuilder { /// @param optional the optional variable settings. /// Can be any of the following, in any order: /// * ast::StorageClass - specifies the variable storage class + /// * ast::Access - specifies the variable's access control /// * ast::Expression* - specifies the variable's initializer expression /// * ast::DecorationList - specifies the variable's decorations /// Note that repeated arguments of the same type will use the last argument's @@ -1229,7 +1214,7 @@ class ProgramBuilder { type = ty.MaybeCreateTypename(type); VarOptionals opts(std::forward(optional)...); return create(Sym(std::forward(name)), opts.storage, - type, false, opts.constructor, + opts.access, type, false, opts.constructor, std::move(opts.decorations)); } @@ -1239,6 +1224,7 @@ class ProgramBuilder { /// @param optional the optional variable settings. /// Can be any of the following, in any order: /// * ast::StorageClass - specifies the variable storage class + /// * ast::Access - specifies the variable's access control /// * ast::Expression* - specifies the variable's initializer expression /// * ast::DecorationList - specifies the variable's decorations /// Note that repeated arguments of the same type will use the last argument's @@ -1252,8 +1238,8 @@ class ProgramBuilder { type = ty.MaybeCreateTypename(type); VarOptionals opts(std::forward(optional)...); return create(source, Sym(std::forward(name)), - opts.storage, type, false, opts.constructor, - std::move(opts.decorations)); + opts.storage, opts.access, type, false, + opts.constructor, std::move(opts.decorations)); } /// @param name the variable name @@ -1267,9 +1253,9 @@ class ProgramBuilder { ast::Expression* constructor, ast::DecorationList decorations = {}) { type = ty.MaybeCreateTypename(type); - return create(Sym(std::forward(name)), - ast::StorageClass::kNone, type, true, - constructor, decorations); + return create( + Sym(std::forward(name)), ast::StorageClass::kNone, + ast::Access::kUndefined, type, true, constructor, decorations); } /// @param source the variable source @@ -1285,9 +1271,9 @@ class ProgramBuilder { ast::Expression* constructor, ast::DecorationList decorations = {}) { type = ty.MaybeCreateTypename(type); - return create(source, Sym(std::forward(name)), - ast::StorageClass::kNone, type, true, - constructor, decorations); + return create( + source, Sym(std::forward(name)), ast::StorageClass::kNone, + ast::Access::kUndefined, type, true, constructor, decorations); } /// @param name the parameter name @@ -1299,9 +1285,9 @@ class ProgramBuilder { ast::Type* type, ast::DecorationList decorations = {}) { type = ty.MaybeCreateTypename(type); - return create(Sym(std::forward(name)), - ast::StorageClass::kNone, type, true, nullptr, - decorations); + return create( + Sym(std::forward(name)), ast::StorageClass::kNone, + ast::Access::kUndefined, type, true, nullptr, decorations); } /// @param source the parameter source @@ -1315,9 +1301,9 @@ class ProgramBuilder { ast::Type* type, ast::DecorationList decorations = {}) { type = ty.MaybeCreateTypename(type); - return create(source, Sym(std::forward(name)), - ast::StorageClass::kNone, type, true, nullptr, - decorations); + return create( + source, Sym(std::forward(name)), ast::StorageClass::kNone, + ast::Access::kUndefined, type, true, nullptr, decorations); } /// @param name the variable name @@ -1325,6 +1311,7 @@ class ProgramBuilder { /// @param optional the optional variable settings. /// Can be any of the following, in any order: /// * ast::StorageClass - specifies the variable storage class + /// * ast::Access - specifies the variable's access control /// * ast::Expression* - specifies the variable's initializer expression /// * ast::DecorationList - specifies the variable's decorations /// Note that repeated arguments of the same type will use the last argument's @@ -1347,6 +1334,7 @@ class ProgramBuilder { /// @param optional the optional variable settings. /// Can be any of the following, in any order: /// * ast::StorageClass - specifies the variable storage class + /// * ast::Access - specifies the variable's access control /// * ast::Expression* - specifies the variable's initializer expression /// * ast::DecorationList - specifies the variable's decorations /// Note that repeated arguments of the same type will use the last argument's diff --git a/src/reader/spirv/function.cc b/src/reader/spirv/function.cc index 97d1f18796..da4f579812 100644 --- a/src/reader/spirv/function.cc +++ b/src/reader/spirv/function.cc @@ -962,7 +962,7 @@ bool FunctionEmitter::EmitEntryPointAsWrapper() { const auto param_name = namer_.MakeDerivedName(var_name + "_param"); const auto param_sym = builder_.Symbols().Register(param_name); auto* param = create( - source, param_sym, ast::StorageClass::kNone, + source, param_sym, ast::StorageClass::kNone, ast::Access::kUndefined, forced_store_type->Build(builder_), true /* is const */, nullptr /* no constructor */, param_decos); decl.params.push_back(param); @@ -2542,9 +2542,7 @@ bool FunctionEmitter::EmitIfStart(const BlockInfo& block_info) { if (!guard_name.empty()) { // Declare the guard variable just before the "if", initialized to true. auto* guard_var = - create(Source{}, builder_.Symbols().Register(guard_name), - ast::StorageClass::kNone, builder_.ty.bool_(), - false, MakeTrue(Source{}), ast::DecorationList{}); + builder_.Var(guard_name, builder_.ty.bool_(), MakeTrue(Source{})); auto* guard_decl = create(Source{}, guard_var); AddStatement(guard_decl); } @@ -3102,11 +3100,9 @@ bool FunctionEmitter::EmitStatementsInBasicBlock(const BlockInfo& block_info, TINT_ASSERT(def_inst); const auto phi_var_name = GetDefInfo(id)->phi_var; TINT_ASSERT(!phi_var_name.empty()); - auto* var = create( - Source{}, builder_.Symbols().Register(phi_var_name), - ast::StorageClass::kNone, - parser_impl_.ConvertType(def_inst->type_id())->Build(builder_), false, - nullptr, ast::DecorationList{}); + auto* var = builder_.Var( + phi_var_name, + parser_impl_.ConvertType(def_inst->type_id())->Build(builder_)); AddStatement(create(Source{}, var)); } @@ -5401,7 +5397,8 @@ bool FunctionEmitter::MakeVectorInsertDynamic( auto* temp_var = create( Source{}, registered_temp_name, ast::StorageClass::kNone, - ast_type->Build(builder_), false, src_vector.expr, ast::DecorationList{}); + ast::Access::kUndefined, ast_type->Build(builder_), false, + src_vector.expr, ast::DecorationList{}); AddStatement(create(Source{}, temp_var)); auto* lhs = create( @@ -5429,7 +5426,7 @@ bool FunctionEmitter::MakeCompositeInsert( // like this avoids constantly reloading the value many times. // // This technique is a combination of: - // - making a temporary variable and constant declaration, like what we do + // - making a temporary variable and constant declaration, like what we do // for VectorInsertDynamic, and // - building up an access-chain like access like for CompositeExtract, but // on the left-hand side of the assignment. @@ -5445,10 +5442,10 @@ bool FunctionEmitter::MakeCompositeInsert( auto temp_name = namer_.MakeDerivedName(result_name); auto registered_temp_name = builder_.Symbols().Register(temp_name); - auto* temp_var = - create(Source{}, registered_temp_name, - ast::StorageClass::kNone, ast_type->Build(builder_), - false, src_composite.expr, ast::DecorationList{}); + auto* temp_var = create( + Source{}, registered_temp_name, ast::StorageClass::kNone, + ast::Access::kUndefined, ast_type->Build(builder_), false, + src_composite.expr, ast::DecorationList{}); AddStatement(create(Source{}, temp_var)); TypedExpression seed_expr{ast_type, create( diff --git a/src/reader/spirv/function_arithmetic_test.cc b/src/reader/spirv/function_arithmetic_test.cc index e3a0f25931..4897015ddb 100644 --- a/src/reader/spirv/function_arithmetic_test.cc +++ b/src/reader/spirv/function_arithmetic_test.cc @@ -159,6 +159,7 @@ TEST_F(SpvUnaryArithTest, SNegate_Int_Int) { VariableConst{ x_1 none + undefined __i32 { UnaryOp[not set]{ @@ -187,6 +188,7 @@ TEST_F(SpvUnaryArithTest, SNegate_Int_Uint) { VariableConst{ x_1 none + undefined __i32 { UnaryOp[not set]{ @@ -217,6 +219,7 @@ TEST_F(SpvUnaryArithTest, SNegate_Uint_Int) { VariableConst{ x_1 none + undefined __u32 { Bitcast[not set]<__u32>{ @@ -247,6 +250,7 @@ TEST_F(SpvUnaryArithTest, SNegate_Uint_Uint) { VariableConst{ x_1 none + undefined __u32 { Bitcast[not set]<__u32>{ @@ -279,6 +283,7 @@ TEST_F(SpvUnaryArithTest, SNegate_SignedVec_SignedVec) { VariableConst{ x_1 none + undefined __vec_2__i32 { UnaryOp[not set]{ @@ -311,6 +316,7 @@ TEST_F(SpvUnaryArithTest, SNegate_SignedVec_UnsignedVec) { VariableConst{ x_1 none + undefined __vec_2__i32 { UnaryOp[not set]{ @@ -345,6 +351,7 @@ TEST_F(SpvUnaryArithTest, SNegate_UnsignedVec_SignedVec) { VariableConst{ x_1 none + undefined __vec_2__u32 { Bitcast[not set]<__vec_2__u32>{ @@ -379,6 +386,7 @@ TEST_F(SpvUnaryArithTest, SNegate_UnsignedVec_UnsignedVec) { VariableConst{ x_1 none + undefined __vec_2__u32 { Bitcast[not set]<__vec_2__u32>{ @@ -415,6 +423,7 @@ TEST_F(SpvUnaryArithTest, FNegate_Scalar) { VariableConst{ x_1 none + undefined __f32 { UnaryOp[not set]{ @@ -443,6 +452,7 @@ TEST_F(SpvUnaryArithTest, FNegate_Vector) { VariableConst{ x_1 none + undefined __vec_2__f32 { UnaryOp[not set]{ @@ -498,6 +508,7 @@ TEST_P(SpvBinaryArithTest, EmitExpression) { ss << R"(VariableConst{ x_1 none + undefined )" << GetParam().ast_type << "\n {\n Binary[not set]{" << "\n " << GetParam().ast_lhs << "\n " << GetParam().ast_op @@ -543,6 +554,7 @@ TEST_P(SpvBinaryArithGeneralTest, EmitExpression) { ss << R"(VariableConst{ x_1 none + undefined )" << GetParam().expected; auto got = ToString(p->builder(), fe.ast_body()); @@ -1021,6 +1033,7 @@ TEST_F(SpvBinaryArithTestBasic, SDiv_Scalar_UnsignedResult) { VariableConst{ x_1 none + undefined __u32 { Bitcast[not set]<__u32>{ @@ -1056,6 +1069,7 @@ TEST_F(SpvBinaryArithTestBasic, SDiv_Vector_UnsignedResult) { VariableConst{ x_1 none + undefined __vec_2__u32 { Bitcast[not set]<__vec_2__u32>{ @@ -1166,6 +1180,7 @@ TEST_F(SpvBinaryArithTestBasic, SMod_Scalar_UnsignedResult) { VariableConst{ x_1 none + undefined __u32 { Bitcast[not set]<__u32>{ @@ -1201,6 +1216,7 @@ TEST_F(SpvBinaryArithTestBasic, SMod_Vector_UnsignedResult) { VariableConst{ x_1 none + undefined __vec_2__u32 { Bitcast[not set]<__vec_2__u32>{ @@ -1253,6 +1269,7 @@ TEST_F(SpvBinaryArithTestBasic, VectorTimesScalar) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_10 none + undefined __vec_2__f32 { Binary[not set]{ @@ -1282,6 +1299,7 @@ TEST_F(SpvBinaryArithTestBasic, MatrixTimesScalar) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_10 none + undefined __mat_2_2__f32 { Binary[not set]{ @@ -1311,6 +1329,7 @@ TEST_F(SpvBinaryArithTestBasic, VectorTimesMatrix) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_10 none + undefined __vec_2__f32 { Binary[not set]{ @@ -1340,6 +1359,7 @@ TEST_F(SpvBinaryArithTestBasic, MatrixTimesVector) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_10 none + undefined __vec_2__f32 { Binary[not set]{ @@ -1369,6 +1389,7 @@ TEST_F(SpvBinaryArithTestBasic, MatrixTimesMatrix) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_10 none + undefined __mat_2_2__f32 { Binary[not set]{ @@ -1398,6 +1419,7 @@ TEST_F(SpvBinaryArithTestBasic, Dot) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_3 none + undefined __f32 { Call[not set]{ @@ -1432,6 +1454,7 @@ TEST_F(SpvBinaryArithTestBasic, OuterProduct) { EXPECT_THAT(got, HasSubstr(R"(VariableConst{ x_3 none + undefined __mat_3_2__f32 { TypeConstructor[not set]{ @@ -1560,6 +1583,7 @@ TEST_P(SpvBinaryDerivativeTest, Derivatives) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_2 none + undefined )" + arg.ast_type + R"( { Call[not set]{ @@ -1610,6 +1634,7 @@ VariableDeclStatement{ VariableConst{ x_2 none + undefined __mat_2_2__f32 { Call[not set]{ @@ -1648,6 +1673,7 @@ VariableDeclStatement{ VariableConst{ x_2 none + undefined __mat_2_3__f32 { Call[not set]{ @@ -1683,6 +1709,7 @@ VariableDeclStatement{ VariableConst{ x_2 none + undefined __mat_3_2__f32 { Call[not set]{ diff --git a/src/reader/spirv/function_bit_test.cc b/src/reader/spirv/function_bit_test.cc index 4632c19cdd..a8011cb995 100644 --- a/src/reader/spirv/function_bit_test.cc +++ b/src/reader/spirv/function_bit_test.cc @@ -163,6 +163,7 @@ TEST_P(SpvBinaryBitTest, EmitExpression) { ss << R"(VariableConst{ x_1 none + undefined )" << GetParam().ast_type << "\n {\n Binary[not set]{" << "\n " << GetParam().ast_lhs << "\n " << GetParam().ast_op @@ -208,6 +209,7 @@ TEST_P(SpvBinaryBitGeneralTest, EmitExpression) { ss << R"(VariableConst{ x_1 none + undefined )" << GetParam().expected; auto got = ToString(p->builder(), fe.ast_body()); @@ -1130,6 +1132,7 @@ TEST_F(SpvUnaryBitTest, Not_Int_Int) { VariableConst{ x_1 none + undefined __i32 { UnaryOp[not set]{ @@ -1156,6 +1159,7 @@ TEST_F(SpvUnaryBitTest, Not_Int_Uint) { VariableConst{ x_1 none + undefined __i32 { Bitcast[not set]<__i32>{ @@ -1184,6 +1188,7 @@ TEST_F(SpvUnaryBitTest, Not_Uint_Int) { VariableConst{ x_1 none + undefined __u32 { Bitcast[not set]<__u32>{ @@ -1212,6 +1217,7 @@ TEST_F(SpvUnaryBitTest, Not_Uint_Uint) { VariableConst{ x_1 none + undefined __u32 { UnaryOp[not set]{ @@ -1238,6 +1244,7 @@ TEST_F(SpvUnaryBitTest, Not_SignedVec_SignedVec) { VariableConst{ x_1 none + undefined __vec_2__i32 { UnaryOp[not set]{ @@ -1268,6 +1275,7 @@ TEST_F(SpvUnaryBitTest, Not_SignedVec_UnsignedVec) { VariableConst{ x_1 none + undefined __vec_2__i32 { Bitcast[not set]<__vec_2__i32>{ @@ -1300,6 +1308,7 @@ TEST_F(SpvUnaryBitTest, Not_UnsignedVec_SignedVec) { VariableConst{ x_1 none + undefined __vec_2__u32 { Bitcast[not set]<__vec_2__u32>{ @@ -1331,6 +1340,7 @@ TEST_F(SpvUnaryBitTest, Not_UnsignedVec_UnsignedVec) { VariableConst{ x_1 none + undefined __vec_2__u32 { UnaryOp[not set]{ @@ -1386,6 +1396,7 @@ TEST_F(SpvUnaryBitTest, BitCount_Uint_Uint) { VariableConst{ x_1 none + undefined __u32 { Call[not set]{ @@ -1414,6 +1425,7 @@ TEST_F(SpvUnaryBitTest, BitCount_Uint_Int) { VariableConst{ x_1 none + undefined __u32 { Bitcast[not set]<__u32>{ @@ -1444,6 +1456,7 @@ TEST_F(SpvUnaryBitTest, BitCount_Int_Uint) { VariableConst{ x_1 none + undefined __i32 { Bitcast[not set]<__i32>{ @@ -1474,6 +1487,7 @@ TEST_F(SpvUnaryBitTest, BitCount_Int_Int) { VariableConst{ x_1 none + undefined __i32 { Call[not set]{ @@ -1502,6 +1516,7 @@ TEST_F(SpvUnaryBitTest, BitCount_UintVector_UintVector) { VariableConst{ x_1 none + undefined __vec_2__u32 { Call[not set]{ @@ -1530,6 +1545,7 @@ TEST_F(SpvUnaryBitTest, BitCount_UintVector_IntVector) { VariableConst{ x_1 none + undefined __vec_2__u32 { Bitcast[not set]<__vec_2__u32>{ @@ -1560,6 +1576,7 @@ TEST_F(SpvUnaryBitTest, BitCount_IntVector_UintVector) { VariableConst{ x_1 none + undefined __vec_2__i32 { Bitcast[not set]<__vec_2__i32>{ @@ -1590,6 +1607,7 @@ TEST_F(SpvUnaryBitTest, BitCount_IntVector_IntVector) { VariableConst{ x_1 none + undefined __vec_2__i32 { Call[not set]{ @@ -1618,6 +1636,7 @@ TEST_F(SpvUnaryBitTest, BitReverse_Uint_Uint) { VariableConst{ x_1 none + undefined __u32 { Call[not set]{ @@ -1674,6 +1693,7 @@ TEST_F(SpvUnaryBitTest, BitReverse_Int_Int) { VariableConst{ x_1 none + undefined __i32 { Call[not set]{ @@ -1702,6 +1722,7 @@ TEST_F(SpvUnaryBitTest, BitReverse_UintVector_UintVector) { VariableConst{ x_1 none + undefined __vec_2__u32 { Call[not set]{ @@ -1758,6 +1779,7 @@ TEST_F(SpvUnaryBitTest, BitReverse_IntVector_IntVector) { VariableConst{ x_1 none + undefined __vec_2__i32 { Call[not set]{ diff --git a/src/reader/spirv/function_call_test.cc b/src/reader/spirv/function_call_test.cc index c9ec4fcd22..638cb455c2 100644 --- a/src/reader/spirv/function_call_test.cc +++ b/src/reader/spirv/function_call_test.cc @@ -92,6 +92,7 @@ TEST_F(SpvParserTest, EmitStatement_ScalarCallNoParams) { VariableConst{ x_1 none + undefined __u32 { Call[not set]{ @@ -148,6 +149,7 @@ TEST_F(SpvParserTest, EmitStatement_ScalarCallNoParamsUsedTwice) { Variable{ x_10 none + undefined __u32 } } @@ -155,6 +157,7 @@ VariableDeclStatement{ VariableConst{ x_1 none + undefined __u32 { Call[not set]{ @@ -218,11 +221,13 @@ TEST_F(SpvParserTest, EmitStatement_CallWithParams) { VariableConst{ x_51 none + undefined __u32 } VariableConst{ x_52 none + undefined __u32 } ) @@ -244,6 +249,7 @@ TEST_F(SpvParserTest, EmitStatement_CallWithParams) { VariableConst{ x_1 none + undefined __u32 { Call[not set]{ diff --git a/src/reader/spirv/function_cfg_test.cc b/src/reader/spirv/function_cfg_test.cc index 044e7ae4cf..a369ac665f 100644 --- a/src/reader/spirv/function_cfg_test.cc +++ b/src/reader/spirv/function_cfg_test.cc @@ -7910,6 +7910,7 @@ VariableDeclStatement{ Variable{ guard10 none + undefined __bool { ScalarConstructor[not set]{true} @@ -8022,6 +8023,7 @@ VariableDeclStatement{ Variable{ guard10 none + undefined __bool { ScalarConstructor[not set]{true} @@ -8149,6 +8151,7 @@ VariableDeclStatement{ Variable{ guard10 none + undefined __bool { ScalarConstructor[not set]{true} diff --git a/src/reader/spirv/function_composite_test.cc b/src/reader/spirv/function_composite_test.cc index 4fd0f0755a..392d02159c 100644 --- a/src/reader/spirv/function_composite_test.cc +++ b/src/reader/spirv/function_composite_test.cc @@ -92,6 +92,7 @@ TEST_F(SpvParserTest_Composite_Construct, Vector) { VariableConst{ x_1 none + undefined __vec_2__u32 { TypeConstructor[not set]{ @@ -106,6 +107,7 @@ VariableDeclStatement{ VariableConst{ x_2 none + undefined __vec_2__i32 { TypeConstructor[not set]{ @@ -120,6 +122,7 @@ VariableDeclStatement{ VariableConst{ x_3 none + undefined __vec_2__f32 { TypeConstructor[not set]{ @@ -148,6 +151,7 @@ TEST_F(SpvParserTest_Composite_Construct, Matrix) { VariableConst{ x_1 none + undefined __mat_2_3__f32 { TypeConstructor[not set]{ @@ -188,6 +192,7 @@ TEST_F(SpvParserTest_Composite_Construct, Array) { VariableConst{ x_1 none + undefined __array__u32_5 { TypeConstructor[not set]{ @@ -218,6 +223,7 @@ TEST_F(SpvParserTest_Composite_Construct, Struct) { VariableConst{ x_1 none + undefined __type_name_S { TypeConstructor[not set]{ @@ -252,6 +258,7 @@ TEST_F(SpvParserTest_CompositeExtract, Vector) { VariableConst{ x_1 none + undefined __f32 { MemberAccessor[not set]{ @@ -302,6 +309,7 @@ TEST_F(SpvParserTest_CompositeExtract, Matrix) { VariableConst{ x_2 none + undefined __vec_2__f32 { ArrayAccessor[not set]{ @@ -352,6 +360,7 @@ TEST_F(SpvParserTest_CompositeExtract, Matrix_Vector) { VariableConst{ x_2 none + undefined __f32 { MemberAccessor[not set]{ @@ -385,6 +394,7 @@ TEST_F(SpvParserTest_CompositeExtract, Array) { VariableConst{ x_2 none + undefined __u32 { ArrayAccessor[not set]{ @@ -436,6 +446,7 @@ TEST_F(SpvParserTest_CompositeExtract, Struct) { VariableConst{ x_2 none + undefined __i32 { MemberAccessor[not set]{ @@ -478,6 +489,7 @@ TEST_F(SpvParserTest_CompositeExtract, Struct_DifferOnlyInMemberName) { VariableConst{ x_2 none + undefined __u32 { MemberAccessor[not set]{ @@ -491,6 +503,7 @@ TEST_F(SpvParserTest_CompositeExtract, Struct_DifferOnlyInMemberName) { VariableConst{ x_4 none + undefined __u32 { MemberAccessor[not set]{ @@ -544,6 +557,7 @@ TEST_F(SpvParserTest_CompositeExtract, Struct_Array_Matrix_Vector) { VariableConst{ x_2 none + undefined __f32 { MemberAccessor[not set]{ @@ -582,6 +596,7 @@ TEST_F(SpvParserTest_CompositeInsert, Vector) { Variable{ x_1_1 none + undefined __vec_2__f32 { TypeConstructor[not set]{ @@ -603,6 +618,7 @@ VariableDeclStatement{ VariableConst{ x_1 none + undefined __vec_2__f32 { Identifier[not set]{x_1_1} @@ -648,6 +664,7 @@ TEST_F(SpvParserTest_CompositeInsert, Matrix) { Variable{ x_2_1 none + undefined __mat_2_3__f32 { Identifier[not set]{x_1} @@ -669,6 +686,7 @@ VariableDeclStatement{ VariableConst{ x_2 none + undefined __mat_2_3__f32 { Identifier[not set]{x_2_1} @@ -718,6 +736,7 @@ TEST_F(SpvParserTest_CompositeInsert, Matrix_Vector) { Variable{ x_2_1 none + undefined __mat_2_3__f32 { Identifier[not set]{x_1} @@ -739,6 +758,7 @@ VariableDeclStatement{ VariableConst{ x_2 none + undefined __mat_2_3__f32 { Identifier[not set]{x_2_1} @@ -768,6 +788,7 @@ TEST_F(SpvParserTest_CompositeInsert, Array) { Variable{ x_2_1 none + undefined __array__u32_5 { Identifier[not set]{x_1} @@ -785,6 +806,7 @@ VariableDeclStatement{ VariableConst{ x_2 none + undefined __array__u32_5 { Identifier[not set]{x_2_1} @@ -835,6 +857,7 @@ TEST_F(SpvParserTest_CompositeInsert, Struct) { Variable{ x_35 none + undefined __type_name_S } } @@ -842,6 +865,7 @@ VariableDeclStatement{ VariableConst{ x_1 none + undefined __type_name_S { Identifier[not set]{x_35} @@ -852,6 +876,7 @@ VariableDeclStatement{ Variable{ x_2_1 none + undefined __type_name_S { Identifier[not set]{x_1} @@ -869,6 +894,7 @@ VariableDeclStatement{ VariableConst{ x_2 none + undefined __type_name_S { Identifier[not set]{x_2_1} @@ -909,6 +935,7 @@ TEST_F(SpvParserTest_CompositeInsert, Struct_DifferOnlyInMemberName) { Variable{ x_40 none + undefined __type_name_S_2 } } @@ -916,6 +943,7 @@ VariableDeclStatement{ Variable{ x_41 none + undefined __type_name_S_2 } } @@ -923,6 +951,7 @@ VariableDeclStatement{ VariableConst{ x_1 none + undefined __type_name_S_2 { Identifier[not set]{x_40} @@ -933,6 +962,7 @@ VariableDeclStatement{ Variable{ x_2_1 none + undefined __type_name_S_1 { Identifier[not set]{x_1} @@ -950,6 +980,7 @@ VariableDeclStatement{ VariableConst{ x_2 none + undefined __type_name_S_1 { Identifier[not set]{x_2_1} @@ -960,6 +991,7 @@ VariableDeclStatement{ VariableConst{ x_3 none + undefined __type_name_S_2 { Identifier[not set]{x_41} @@ -970,6 +1002,7 @@ VariableDeclStatement{ Variable{ x_4_1 none + undefined __type_name_S_2 { Identifier[not set]{x_3} @@ -987,6 +1020,7 @@ VariableDeclStatement{ VariableConst{ x_4 none + undefined __type_name_S_2 { Identifier[not set]{x_4_1} @@ -998,6 +1032,7 @@ VariableDeclStatement{ Variable{ x_4_1 none + undefined __type_name_S_2 { Identifier[not set]{x_3} @@ -1015,6 +1050,7 @@ VariableDeclStatement{ VariableConst{ x_4 none + undefined __type_name_S_2 { Identifier[not set]{x_4_1} @@ -1066,6 +1102,7 @@ TEST_F(SpvParserTest_CompositeInsert, Struct_Array_Matrix_Vector) { Variable{ x_37 none + undefined __type_name_S_1 } } @@ -1073,6 +1110,7 @@ VariableDeclStatement{ VariableConst{ x_1 none + undefined __type_name_S_1 { Identifier[not set]{x_37} @@ -1083,6 +1121,7 @@ VariableDeclStatement{ Variable{ x_2_1 none + undefined __type_name_S_1 { Identifier[not set]{x_1} @@ -1109,6 +1148,7 @@ VariableDeclStatement{ VariableConst{ x_2 none + undefined __type_name_S_1 { Identifier[not set]{x_2_1} @@ -1137,6 +1177,7 @@ TEST_F(SpvParserTest_CopyObject, Scalar) { VariableConst{ x_1 none + undefined __u32 { ScalarConstructor[not set]{3u} @@ -1147,6 +1188,7 @@ VariableDeclStatement{ VariableConst{ x_2 none + undefined __u32 { Identifier[not set]{x_1} @@ -1176,6 +1218,7 @@ TEST_F(SpvParserTest_CopyObject, Pointer) { VariableConst{ x_1 none + undefined __ptr_function__u32 { UnaryOp[not set]{ @@ -1189,6 +1232,7 @@ VariableDeclStatement{ VariableConst{ x_2 none + undefined __ptr_function__u32 { Identifier[not set]{x_1} @@ -1218,6 +1262,7 @@ TEST_F(SpvParserTest_VectorShuffle, FunctionScopeOperands_UseBoth) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_10 none + undefined __vec_4__u32 { TypeConstructor[not set]{ @@ -1260,6 +1305,7 @@ TEST_F(SpvParserTest_VectorShuffle, ConstantOperands_UseBoth) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_10 none + undefined __vec_4__u32 { TypeConstructor[not set]{ @@ -1318,6 +1364,7 @@ TEST_F(SpvParserTest_VectorShuffle, ConstantOperands_AllOnesMapToNull) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_10 none + undefined __vec_2__u32 { TypeConstructor[not set]{ @@ -1370,6 +1417,7 @@ TEST_F(SpvParserTest_VectorExtractDynamic, SignedIndex) { EXPECT_THAT(got, HasSubstr(R"(VariableConst{ x_10 none + undefined __u32 { ArrayAccessor[not set]{ @@ -1400,6 +1448,7 @@ TEST_F(SpvParserTest_VectorExtractDynamic, UnsignedIndex) { EXPECT_THAT(got, HasSubstr(R"(VariableConst{ x_10 none + undefined __u32 { ArrayAccessor[not set]{ @@ -1435,6 +1484,7 @@ VariableDeclStatement{ Variable{ x_10_1 none + undefined __vec_2__u32 { Identifier[not set]{x_1} @@ -1452,6 +1502,7 @@ VariableDeclStatement{ VariableConst{ x_10 none + undefined __vec_2__u32 { Identifier[not set]{x_10_1} diff --git a/src/reader/spirv/function_conversion_test.cc b/src/reader/spirv/function_conversion_test.cc index 6d77b2704a..cb3d381786 100644 --- a/src/reader/spirv/function_conversion_test.cc +++ b/src/reader/spirv/function_conversion_test.cc @@ -86,6 +86,7 @@ TEST_F(SpvUnaryConversionTest, Bitcast_Scalar) { VariableConst{ x_1 none + undefined __u32 { Bitcast[not set]<__u32>{ @@ -111,6 +112,7 @@ TEST_F(SpvUnaryConversionTest, Bitcast_Vector) { VariableConst{ x_1 none + undefined __vec_2__f32 { Bitcast[not set]<__vec_2__f32>{ @@ -239,6 +241,7 @@ TEST_F(SpvUnaryConversionTest, ConvertSToF_Scalar_FromSigned) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_1 none + undefined __f32 { TypeConstructor[not set]{ @@ -265,6 +268,7 @@ TEST_F(SpvUnaryConversionTest, ConvertSToF_Scalar_FromUnsigned) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_1 none + undefined __f32 { TypeConstructor[not set]{ @@ -293,6 +297,7 @@ TEST_F(SpvUnaryConversionTest, ConvertSToF_Vector_FromSigned) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_1 none + undefined __vec_2__f32 { TypeConstructor[not set]{ @@ -319,6 +324,7 @@ TEST_F(SpvUnaryConversionTest, ConvertSToF_Vector_FromUnsigned) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_1 none + undefined __vec_2__f32 { TypeConstructor[not set]{ @@ -382,6 +388,7 @@ TEST_F(SpvUnaryConversionTest, ConvertUToF_Scalar_FromSigned) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_1 none + undefined __f32 { TypeConstructor[not set]{ @@ -410,6 +417,7 @@ TEST_F(SpvUnaryConversionTest, ConvertUToF_Scalar_FromUnsigned) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_1 none + undefined __f32 { TypeConstructor[not set]{ @@ -436,6 +444,7 @@ TEST_F(SpvUnaryConversionTest, ConvertUToF_Vector_FromSigned) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_1 none + undefined __vec_2__f32 { TypeConstructor[not set]{ @@ -464,6 +473,7 @@ TEST_F(SpvUnaryConversionTest, ConvertUToF_Vector_FromUnsigned) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_1 none + undefined __vec_2__f32 { TypeConstructor[not set]{ @@ -526,6 +536,7 @@ TEST_F(SpvUnaryConversionTest, ConvertFToS_Scalar_ToSigned) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_1 none + undefined __i32 { TypeConstructor[not set]{ @@ -552,6 +563,7 @@ TEST_F(SpvUnaryConversionTest, ConvertFToS_Scalar_ToUnsigned) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_1 none + undefined __u32 { Bitcast[not set]<__u32>{ @@ -580,6 +592,7 @@ TEST_F(SpvUnaryConversionTest, ConvertFToS_Vector_ToSigned) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_1 none + undefined __vec_2__i32 { TypeConstructor[not set]{ @@ -606,6 +619,7 @@ TEST_F(SpvUnaryConversionTest, ConvertFToS_Vector_ToUnsigned) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_1 none + undefined __vec_2__u32 { Bitcast[not set]<__vec_2__u32>{ @@ -686,6 +700,7 @@ TEST_F(SpvUnaryConversionTest, ConvertFToU_Scalar_ToUnsigned) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_1 none + undefined __u32 { TypeConstructor[not set]{ @@ -728,6 +743,7 @@ TEST_F(SpvUnaryConversionTest, ConvertFToU_Vector_ToUnsigned) { EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_1 none + undefined __vec_2__u32 { TypeConstructor[not set]{ @@ -778,6 +794,7 @@ OpFunctionEnd EXPECT_THAT(ToString(p->builder(), fe.ast_body()), HasSubstr(R"(VariableConst{ x_82 none + undefined __u32 { TypeConstructor[not set]{ diff --git a/src/reader/spirv/function_decl_test.cc b/src/reader/spirv/function_decl_test.cc index cb38e8f0ed..41cc2f0d2f 100644 --- a/src/reader/spirv/function_decl_test.cc +++ b/src/reader/spirv/function_decl_test.cc @@ -118,16 +118,19 @@ TEST_F(SpvParserTest, Emit_MixedParamTypes) { VariableConst{ a none + undefined __u32 } VariableConst{ b none + undefined __f32 } VariableConst{ c none + undefined __i32 } ) @@ -162,16 +165,19 @@ TEST_F(SpvParserTest, Emit_GenerateParamNames) { VariableConst{ x_14 none + undefined __u32 } VariableConst{ x_15 none + undefined __f32 } VariableConst{ x_16 none + undefined __i32 } ) diff --git a/src/reader/spirv/function_glsl_std_450_test.cc b/src/reader/spirv/function_glsl_std_450_test.cc index bb5756c099..3e5b5e4b42 100644 --- a/src/reader/spirv/function_glsl_std_450_test.cc +++ b/src/reader/spirv/function_glsl_std_450_test.cc @@ -188,6 +188,7 @@ TEST_P(SpvParserTest_GlslStd450_Float_Floating, Scalar) { VariableConst{ x_1 none + undefined __f32 { Call[not set]{ @@ -219,6 +220,7 @@ TEST_P(SpvParserTest_GlslStd450_Float_Floating, Vector) { VariableConst{ x_1 none + undefined __f32 { Call[not set]{ @@ -250,6 +252,7 @@ TEST_P(SpvParserTest_GlslStd450_Float_FloatingFloating, Scalar) { VariableConst{ x_1 none + undefined __f32 { Call[not set]{ @@ -282,6 +285,7 @@ TEST_P(SpvParserTest_GlslStd450_Float_FloatingFloating, Vector) { VariableConst{ x_1 none + undefined __f32 { Call[not set]{ @@ -314,6 +318,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_Floating, Scalar) { VariableConst{ x_1 none + undefined __f32 { Call[not set]{ @@ -345,6 +350,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_Floating, Vector) { VariableConst{ x_1 none + undefined __vec_2__f32 { Call[not set]{ @@ -376,6 +382,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloating, Scalar) { VariableConst{ x_1 none + undefined __f32 { Call[not set]{ @@ -408,6 +415,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloating, Vector) { VariableConst{ x_1 none + undefined __vec_2__f32 { Call[not set]{ @@ -440,6 +448,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloatingFloating, Scalar) { VariableConst{ x_1 none + undefined __f32 { Call[not set]{ @@ -474,6 +483,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloatingFloating, Vector) { VariableConst{ x_1 none + undefined __vec_2__f32 { Call[not set]{ @@ -507,6 +517,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingUinting, Scalar) { VariableConst{ x_1 none + undefined __f32 { Call[not set]{ @@ -540,6 +551,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingUinting, Vector) { VariableConst{ x_1 none + undefined __vec_2__f32 { Call[not set]{ @@ -572,6 +584,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingInting, Scalar) { VariableConst{ x_1 none + undefined __f32 { Call[not set]{ @@ -605,6 +618,7 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingInting, Vector) { VariableConst{ x_1 none + undefined __vec_2__f32 { Call[not set]{ @@ -638,6 +652,7 @@ TEST_P(SpvParserTest_GlslStd450_Float3_Float3Float3, Samples) { VariableConst{ x_1 none + undefined __vec_3__f32 { Call[not set]{ @@ -744,6 +759,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_Inting, Scalar) { VariableConst{ x_1 none + undefined __i32 { Call[not set]{ @@ -776,6 +792,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_Inting, Vector) { VariableConst{ x_1 none + undefined __vec_2__i32 { Call[not set]{ @@ -808,6 +825,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_IntingInting, Scalar) { VariableConst{ x_1 none + undefined __i32 { Call[not set]{ @@ -841,6 +859,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_IntingInting, Vector) { VariableConst{ x_1 none + undefined __vec_2__i32 { Call[not set]{ @@ -874,6 +893,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_IntingIntingInting, Scalar) { VariableConst{ x_1 none + undefined __i32 { Call[not set]{ @@ -908,6 +928,7 @@ TEST_P(SpvParserTest_GlslStd450_Inting_IntingIntingInting, Vector) { VariableConst{ x_1 none + undefined __vec_2__i32 { Call[not set]{ @@ -954,6 +975,7 @@ TEST_P(SpvParserTest_GlslStd450_Uinting_UintingUinting, Scalar) { VariableConst{ x_1 none + undefined __u32 { Call[not set]{ @@ -987,6 +1009,7 @@ TEST_P(SpvParserTest_GlslStd450_Uinting_UintingUinting, Vector) { VariableConst{ x_1 none + undefined __vec_2__u32 { Call[not set]{ @@ -1019,6 +1042,7 @@ TEST_P(SpvParserTest_GlslStd450_Uinting_UintingUintingUinting, Scalar) { VariableConst{ x_1 none + undefined __u32 { Call[not set]{ @@ -1053,6 +1077,7 @@ TEST_P(SpvParserTest_GlslStd450_Uinting_UintingUintingUinting, Vector) { VariableConst{ x_1 none + undefined __vec_2__u32 { Call[not set]{ @@ -1099,6 +1124,7 @@ TEST_F(SpvParserTest, Normalize_Scalar) { VariableConst{ x_1 none + undefined __f32 { ScalarConstructor[not set]{1.000000} @@ -1123,6 +1149,7 @@ TEST_F(SpvParserTest, Normalize_Vector2) { VariableConst{ x_1 none + undefined __vec_2__f32 { Call[not set]{ @@ -1152,6 +1179,7 @@ TEST_F(SpvParserTest, Normalize_Vector3) { VariableConst{ x_1 none + undefined __vec_3__f32 { Call[not set]{ @@ -1181,6 +1209,7 @@ TEST_F(SpvParserTest, Normalize_Vector4) { VariableConst{ x_1 none + undefined __vec_4__f32 { Call[not set]{ @@ -1213,6 +1242,7 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_SAbs) { VariableConst{ x_1 none + undefined __u32 { Bitcast[not set]<__u32>{ @@ -1232,6 +1262,7 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_SAbs) { VariableConst{ x_2 none + undefined __vec_2__u32 { Bitcast[not set]<__vec_2__u32>{ @@ -1265,6 +1296,7 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_SMax) { VariableConst{ x_1 none + undefined __u32 { Bitcast[not set]<__u32>{ @@ -1287,6 +1319,7 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_SMax) { VariableConst{ x_2 none + undefined __vec_2__u32 { Bitcast[not set]<__vec_2__u32>{ @@ -1323,6 +1356,7 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_SMin) { VariableConst{ x_1 none + undefined __u32 { Bitcast[not set]<__u32>{ @@ -1345,6 +1379,7 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_SMin) { VariableConst{ x_2 none + undefined __vec_2__u32 { Bitcast[not set]<__vec_2__u32>{ @@ -1381,6 +1416,7 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_SClamp) { VariableConst{ x_1 none + undefined __u32 { Bitcast[not set]<__u32>{ @@ -1404,6 +1440,7 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_SClamp) { VariableConst{ x_2 none + undefined __vec_2__u32 { Bitcast[not set]<__vec_2__u32>{ @@ -1441,6 +1478,7 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_UMax) { VariableConst{ x_1 none + undefined __i32 { Bitcast[not set]<__i32>{ @@ -1463,6 +1501,7 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_UMax) { VariableConst{ x_2 none + undefined __vec_2__i32 { Bitcast[not set]<__vec_2__i32>{ @@ -1499,6 +1538,7 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_UMin) { VariableConst{ x_1 none + undefined __i32 { Bitcast[not set]<__i32>{ @@ -1521,6 +1561,7 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_UMin) { VariableConst{ x_2 none + undefined __vec_2__i32 { Bitcast[not set]<__vec_2__i32>{ @@ -1557,6 +1598,7 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_UClamp) { VariableConst{ x_1 none + undefined __i32 { Bitcast[not set]<__i32>{ @@ -1580,6 +1622,7 @@ TEST_F(SpvParserTest, RectifyOperandsAndResult_UClamp) { VariableConst{ x_2 none + undefined __vec_2__i32 { Bitcast[not set]<__vec_2__i32>{ @@ -1633,6 +1676,7 @@ TEST_P(SpvParserTest_GlslStd450_DataPacking, Valid) { VariableConst{ x_1 none + undefined __u32 { Call[not set]{ @@ -1677,6 +1721,7 @@ TEST_P(SpvParserTest_GlslStd450_DataUnpacking, Valid) { VariableConst{ x_1 none + undefined )" + std::string(param.vec_size == 2 ? "__vec_2__f32" : "__vec_4__f32") + R"( { diff --git a/src/reader/spirv/function_logical_test.cc b/src/reader/spirv/function_logical_test.cc index e1f3f44ad8..180e115d5b 100644 --- a/src/reader/spirv/function_logical_test.cc +++ b/src/reader/spirv/function_logical_test.cc @@ -210,6 +210,7 @@ TEST_F(SpvUnaryLogicalTest, LogicalNot_Scalar) { VariableConst{ x_1 none + undefined __bool { UnaryOp[not set]{ @@ -236,6 +237,7 @@ TEST_F(SpvUnaryLogicalTest, LogicalNot_Vector) { VariableConst{ x_1 none + undefined __vec_2__bool { UnaryOp[not set]{ @@ -290,6 +292,7 @@ TEST_P(SpvBinaryLogicalTest, EmitExpression) { ss << R"(VariableConst{ x_1 none + undefined )" << GetParam().ast_type << "\n {\n Binary[not set]{" << "\n " << GetParam().ast_lhs << "\n " << GetParam().ast_op @@ -728,6 +731,7 @@ TEST_F(SpvFUnordTest, FUnordEqual_Scalar) { VariableConst{ x_1 none + undefined __bool { UnaryOp[not set]{ @@ -758,6 +762,7 @@ TEST_F(SpvFUnordTest, FUnordEqual_Vector) { VariableConst{ x_1 none + undefined __vec_2__bool { UnaryOp[not set]{ @@ -796,6 +801,7 @@ TEST_F(SpvFUnordTest, FUnordNotEqual_Scalar) { VariableConst{ x_1 none + undefined __bool { UnaryOp[not set]{ @@ -826,6 +832,7 @@ TEST_F(SpvFUnordTest, FUnordNotEqual_Vector) { VariableConst{ x_1 none + undefined __vec_2__bool { UnaryOp[not set]{ @@ -864,6 +871,7 @@ TEST_F(SpvFUnordTest, FUnordLessThan_Scalar) { VariableConst{ x_1 none + undefined __bool { UnaryOp[not set]{ @@ -894,6 +902,7 @@ TEST_F(SpvFUnordTest, FUnordLessThan_Vector) { VariableConst{ x_1 none + undefined __vec_2__bool { UnaryOp[not set]{ @@ -932,6 +941,7 @@ TEST_F(SpvFUnordTest, FUnordLessThanEqual_Scalar) { VariableConst{ x_1 none + undefined __bool { UnaryOp[not set]{ @@ -962,6 +972,7 @@ TEST_F(SpvFUnordTest, FUnordLessThanEqual_Vector) { VariableConst{ x_1 none + undefined __vec_2__bool { UnaryOp[not set]{ @@ -1000,6 +1011,7 @@ TEST_F(SpvFUnordTest, FUnordGreaterThan_Scalar) { VariableConst{ x_1 none + undefined __bool { UnaryOp[not set]{ @@ -1030,6 +1042,7 @@ TEST_F(SpvFUnordTest, FUnordGreaterThan_Vector) { VariableConst{ x_1 none + undefined __vec_2__bool { UnaryOp[not set]{ @@ -1068,6 +1081,7 @@ TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Scalar) { VariableConst{ x_1 none + undefined __bool { UnaryOp[not set]{ @@ -1098,6 +1112,7 @@ TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Vector) { VariableConst{ x_1 none + undefined __vec_2__bool { UnaryOp[not set]{ @@ -1139,6 +1154,7 @@ TEST_F(SpvLogicalTest, Select_BoolCond_BoolParams) { VariableConst{ x_1 none + undefined __bool { Call[not set]{ @@ -1171,6 +1187,7 @@ TEST_F(SpvLogicalTest, Select_BoolCond_IntScalarParams) { VariableConst{ x_1 none + undefined __u32 { Call[not set]{ @@ -1203,6 +1220,7 @@ TEST_F(SpvLogicalTest, Select_BoolCond_FloatScalarParams) { VariableConst{ x_1 none + undefined __f32 { Call[not set]{ @@ -1238,6 +1256,7 @@ TEST_F(SpvLogicalTest, Select_BoolCond_VectorParams) { VariableConst{ x_1 none + undefined __vec_2__u32 { Call[not set]{ @@ -1284,6 +1303,7 @@ TEST_F(SpvLogicalTest, Select_VecBoolCond_VectorParams) { VariableConst{ x_1 none + undefined __vec_2__u32 { Call[not set]{ @@ -1328,6 +1348,7 @@ TEST_F(SpvLogicalTest, Any) { VariableConst{ x_1 none + undefined __bool { Call[not set]{ @@ -1362,6 +1383,7 @@ TEST_F(SpvLogicalTest, All) { VariableConst{ x_1 none + undefined __bool { Call[not set]{ @@ -1396,6 +1418,7 @@ TEST_F(SpvLogicalTest, IsNan_Scalar) { VariableConst{ x_1 none + undefined __bool { Call[not set]{ @@ -1426,6 +1449,7 @@ TEST_F(SpvLogicalTest, IsNan_Vector) { VariableConst{ x_1 none + undefined __vec_2__bool { Call[not set]{ @@ -1460,6 +1484,7 @@ TEST_F(SpvLogicalTest, IsInf_Scalar) { VariableConst{ x_1 none + undefined __bool { Call[not set]{ @@ -1490,6 +1515,7 @@ TEST_F(SpvLogicalTest, IsInf_Vector) { VariableConst{ x_1 none + undefined __vec_2__bool { Call[not set]{ diff --git a/src/reader/spirv/function_memory_test.cc b/src/reader/spirv/function_memory_test.cc index f44846aede..0ef89895fb 100644 --- a/src/reader/spirv/function_memory_test.cc +++ b/src/reader/spirv/function_memory_test.cc @@ -180,6 +180,7 @@ TEST_F(SpvParserMemoryTest, EmitStatement_LoadBool) { VariableConst{ x_2 none + undefined __bool { Identifier[not set]{x_1} @@ -210,6 +211,7 @@ TEST_F(SpvParserMemoryTest, EmitStatement_LoadScalar) { VariableConst{ x_2 none + undefined __u32 { Identifier[not set]{x_1} @@ -220,6 +222,7 @@ VariableDeclStatement{ VariableConst{ x_3 none + undefined __u32 { Identifier[not set]{x_1} @@ -252,6 +255,7 @@ TEST_F(SpvParserMemoryTest, EmitStatement_UseLoadedScalarTwice) { VariableConst{ x_2 none + undefined __u32 { Identifier[not set]{x_1} @@ -873,7 +877,8 @@ TEST_F(SpvParserMemoryTest, RemapStorageBuffer_TypesAndVarDeclarations) { } myvar storage - __access_control_read_write__type_name_S + read_write + __type_name_S })")); } @@ -1017,6 +1022,7 @@ TEST_F(SpvParserMemoryTest, VariableConst{ x_2 none + undefined __ptr_storage__u32 { UnaryOp[not set]{ @@ -1078,6 +1084,7 @@ TEST_F(SpvParserMemoryTest, RemapStorageBuffer_ThroughCopyObject_WithHoisting) { Variable{ x_2 none + undefined __ptr_storage__u32 } } @@ -1176,6 +1183,7 @@ TEST_F(SpvParserMemoryTest, ArrayLength) { VariableConst{ x_1 none + undefined __u32 { Call[not set]{ diff --git a/src/reader/spirv/function_misc_test.cc b/src/reader/spirv/function_misc_test.cc index c22e4d1d0e..4ecea5567f 100644 --- a/src/reader/spirv/function_misc_test.cc +++ b/src/reader/spirv/function_misc_test.cc @@ -78,6 +78,7 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_BeforeFunction_Scalar) { VariableConst{ x_11 none + undefined __bool { ScalarConstructor[not set]{false} @@ -88,6 +89,7 @@ VariableDeclStatement{ VariableConst{ x_12 none + undefined __u32 { ScalarConstructor[not set]{0u} @@ -98,6 +100,7 @@ VariableDeclStatement{ VariableConst{ x_13 none + undefined __i32 { ScalarConstructor[not set]{0} @@ -108,6 +111,7 @@ VariableDeclStatement{ VariableConst{ x_14 none + undefined __f32 { ScalarConstructor[not set]{0.000000} @@ -142,6 +146,7 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_BeforeFunction_Vector) { VariableConst{ x_14 none + undefined __vec_2__bool { TypeConstructor[not set]{ @@ -156,6 +161,7 @@ VariableDeclStatement{ VariableConst{ x_11 none + undefined __vec_2__u32 { TypeConstructor[not set]{ @@ -170,6 +176,7 @@ VariableDeclStatement{ VariableConst{ x_12 none + undefined __vec_2__i32 { TypeConstructor[not set]{ @@ -184,6 +191,7 @@ VariableDeclStatement{ VariableConst{ x_13 none + undefined __vec_2__f32 { TypeConstructor[not set]{ @@ -221,6 +229,7 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Scalar) { VariableConst{ x_11 none + undefined __bool { ScalarConstructor[not set]{false} @@ -231,6 +240,7 @@ VariableDeclStatement{ VariableConst{ x_12 none + undefined __u32 { ScalarConstructor[not set]{0u} @@ -241,6 +251,7 @@ VariableDeclStatement{ VariableConst{ x_13 none + undefined __i32 { ScalarConstructor[not set]{0} @@ -251,6 +262,7 @@ VariableDeclStatement{ VariableConst{ x_14 none + undefined __f32 { ScalarConstructor[not set]{0.000000} @@ -282,6 +294,7 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Vector) { VariableConst{ x_11 none + undefined __vec_2__u32 { TypeConstructor[not set]{ @@ -296,6 +309,7 @@ VariableDeclStatement{ VariableConst{ x_12 none + undefined __vec_2__i32 { TypeConstructor[not set]{ @@ -310,6 +324,7 @@ VariableDeclStatement{ VariableConst{ x_13 none + undefined __vec_2__f32 { TypeConstructor[not set]{ @@ -343,6 +358,7 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Matrix) { VariableConst{ x_11 none + undefined __mat_2_2__f32 { TypeConstructor[not set]{ @@ -385,6 +401,7 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Array) { VariableConst{ x_11 none + undefined __array__u32_2 { TypeConstructor[not set]{ @@ -418,6 +435,7 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Struct) { VariableConst{ x_11 none + undefined __type_name_S { TypeConstructor[not set]{ @@ -541,6 +559,7 @@ TEST_F(SpvParserTest, ValueFromBlockNotInBlockOrder) { VariableConst{ x_81 none + undefined __f32 { Binary[not set]{ diff --git a/src/reader/spirv/function_var_test.cc b/src/reader/spirv/function_var_test.cc index dc474a0cec..c2ba7ec378 100644 --- a/src/reader/spirv/function_var_test.cc +++ b/src/reader/spirv/function_var_test.cc @@ -108,6 +108,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_AnonymousVars) { Variable{ x_1 none + undefined __u32 } } @@ -115,6 +116,7 @@ VariableDeclStatement{ Variable{ x_2 none + undefined __u32 } } @@ -122,6 +124,7 @@ VariableDeclStatement{ Variable{ x_3 none + undefined __u32 } } @@ -147,6 +150,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_NamedVars) { Variable{ a none + undefined __u32 } } @@ -154,6 +158,7 @@ VariableDeclStatement{ Variable{ b none + undefined __u32 } } @@ -161,6 +166,7 @@ VariableDeclStatement{ Variable{ c none + undefined __u32 } } @@ -186,6 +192,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_MixedTypes) { Variable{ a none + undefined __u32 } } @@ -193,6 +200,7 @@ VariableDeclStatement{ Variable{ b none + undefined __i32 } } @@ -200,6 +208,7 @@ VariableDeclStatement{ Variable{ c none + undefined __f32 } } @@ -227,6 +236,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ScalarInitializers) { Variable{ a none + undefined __bool { ScalarConstructor[not set]{true} @@ -237,6 +247,7 @@ VariableDeclStatement{ Variable{ b none + undefined __bool { ScalarConstructor[not set]{false} @@ -247,6 +258,7 @@ VariableDeclStatement{ Variable{ c none + undefined __i32 { ScalarConstructor[not set]{-1} @@ -257,6 +269,7 @@ VariableDeclStatement{ Variable{ d none + undefined __u32 { ScalarConstructor[not set]{1u} @@ -267,6 +280,7 @@ VariableDeclStatement{ Variable{ e none + undefined __f32 { ScalarConstructor[not set]{1.500000} @@ -301,6 +315,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ScalarNullInitializers) { Variable{ a none + undefined __bool { ScalarConstructor[not set]{false} @@ -311,6 +326,7 @@ VariableDeclStatement{ Variable{ b none + undefined __i32 { ScalarConstructor[not set]{0} @@ -321,6 +337,7 @@ VariableDeclStatement{ Variable{ c none + undefined __u32 { ScalarConstructor[not set]{0u} @@ -331,6 +348,7 @@ VariableDeclStatement{ Variable{ d none + undefined __f32 { ScalarConstructor[not set]{0.000000} @@ -361,6 +379,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_VectorInitializer) { Variable{ x_200 none + undefined __vec_2__f32 { TypeConstructor[not set]{ @@ -400,6 +419,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_MatrixInitializer) { Variable{ x_200 none + undefined __mat_2_3__f32 { TypeConstructor[not set]{ @@ -447,6 +467,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ArrayInitializer) { Variable{ x_200 none + undefined __array__u32_2 { TypeConstructor[not set]{ @@ -486,6 +507,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ArrayInitializer_Alias) { Variable{ x_200 none + undefined __type_name_Arr { TypeConstructor[not set]{ @@ -521,6 +543,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ArrayInitializer_Null) { Variable{ x_200 none + undefined __array__u32_2 { TypeConstructor[not set]{ @@ -561,6 +584,7 @@ TEST_F(SpvParserFunctionVarTest, Variable{ x_200 none + undefined __type_name_Arr { TypeConstructor[not set]{ @@ -596,6 +620,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_StructInitializer) { Variable{ x_200 none + undefined __type_name_S { TypeConstructor[not set]{ @@ -636,6 +661,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_StructInitializer_Null) { Variable{ x_200 none + undefined __type_name_S { TypeConstructor[not set]{ @@ -682,6 +708,7 @@ TEST_F(SpvParserFunctionVarTest, Variable{ x_25 none + undefined __u32 } } @@ -730,6 +757,7 @@ TEST_F(SpvParserFunctionVarTest, Variable{ x_25 none + undefined __u32 } } @@ -737,6 +765,7 @@ VariableDeclStatement{ VariableConst{ x_2 none + undefined __u32 { Binary[not set]{ @@ -802,6 +831,7 @@ TEST_F(SpvParserFunctionVarTest, Variable{ x_25 none + undefined __u32 } } @@ -809,6 +839,7 @@ VariableDeclStatement{ VariableConst{ x_2 none + undefined __u32 { Binary[not set]{ @@ -906,6 +937,7 @@ Loop{ Variable{ x_2 none + undefined __u32 } } @@ -1019,6 +1051,7 @@ TEST_F( VariableConst{ x_1 none + undefined __u32 { ScalarConstructor[not set]{1u} @@ -1036,6 +1069,7 @@ VariableDeclStatement{ VariableConst{ x_3 none + undefined __u32 { Identifier[not set]{x_1} @@ -1109,6 +1143,7 @@ TEST_F(SpvParserFunctionVarTest, VariableConst{ x_1 none + undefined __u32 { ScalarConstructor[not set]{1u} @@ -1126,6 +1161,7 @@ TEST_F(SpvParserFunctionVarTest, VariableConst{ x_3 none + undefined __u32 { Identifier[not set]{x_1} @@ -1196,6 +1232,7 @@ TEST_F( VariableConst{ x_1 none + undefined __u32 { ScalarConstructor[not set]{1u} @@ -1215,6 +1252,7 @@ TEST_F( VariableConst{ x_3 none + undefined __u32 { Identifier[not set]{x_1} @@ -1274,6 +1312,7 @@ TEST_F(SpvParserFunctionVarTest, VariableConst{ x_1 none + undefined __u32 { ScalarConstructor[not set]{1u} @@ -1284,6 +1323,7 @@ VariableDeclStatement{ VariableConst{ x_2 none + undefined __u32 { Identifier[not set]{x_1} @@ -1352,6 +1392,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_SingleBlockLoopIndex) { Variable{ x_2_phi none + undefined __u32 } } @@ -1359,6 +1400,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_SingleBlockLoopIndex) { Variable{ x_3_phi none + undefined __u32 } } @@ -1366,6 +1408,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_SingleBlockLoopIndex) { VariableConst{ x_101 none + undefined __bool { Identifier[not set]{x_7} @@ -1376,6 +1419,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_SingleBlockLoopIndex) { VariableConst{ x_102 none + undefined __bool { Identifier[not set]{x_8} @@ -1403,6 +1447,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_SingleBlockLoopIndex) { VariableConst{ x_2 none + undefined __u32 { Identifier[not set]{x_2_phi} @@ -1413,6 +1458,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_SingleBlockLoopIndex) { VariableConst{ x_3 none + undefined __u32 { Identifier[not set]{x_3_phi} @@ -1499,6 +1545,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_MultiBlockLoopIndex) { Variable{ x_2_phi none + undefined __u32 } } @@ -1506,6 +1553,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_MultiBlockLoopIndex) { Variable{ x_3_phi none + undefined __u32 } } @@ -1513,6 +1561,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_MultiBlockLoopIndex) { VariableConst{ x_101 none + undefined __bool { Identifier[not set]{x_7} @@ -1523,6 +1572,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_MultiBlockLoopIndex) { VariableConst{ x_102 none + undefined __bool { Identifier[not set]{x_8} @@ -1550,6 +1600,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_MultiBlockLoopIndex) { Variable{ x_4 none + undefined __u32 } } @@ -1557,6 +1608,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_MultiBlockLoopIndex) { VariableConst{ x_2 none + undefined __u32 { Identifier[not set]{x_2_phi} @@ -1567,6 +1619,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_MultiBlockLoopIndex) { VariableConst{ x_3 none + undefined __u32 { Identifier[not set]{x_3_phi} @@ -1660,6 +1713,7 @@ TEST_F(SpvParserFunctionVarTest, VariableConst{ x_101 none + undefined __bool { Identifier[not set]{x_17} @@ -1671,6 +1725,7 @@ Loop{ Variable{ x_2_phi none + undefined __u32 } } @@ -1678,6 +1733,7 @@ Loop{ Variable{ x_5_phi none + undefined __u32 } } @@ -1694,6 +1750,7 @@ Loop{ Variable{ x_7 none + undefined __u32 } } @@ -1701,6 +1758,7 @@ Loop{ VariableConst{ x_2 none + undefined __u32 { Identifier[not set]{x_2_phi} @@ -1711,6 +1769,7 @@ Loop{ VariableConst{ x_5 none + undefined __u32 { Identifier[not set]{x_5_phi} @@ -1721,6 +1780,7 @@ Loop{ VariableConst{ x_4 none + undefined __u32 { Binary[not set]{ @@ -1735,6 +1795,7 @@ Loop{ VariableConst{ x_6 none + undefined __u32 { Binary[not set]{ @@ -1832,6 +1893,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_FromElseAndThen) { VariableConst{ x_101 none + undefined __bool { Identifier[not set]{x_7} @@ -1842,6 +1904,7 @@ VariableDeclStatement{ VariableConst{ x_102 none + undefined __bool { Identifier[not set]{x_8} @@ -1853,6 +1916,7 @@ Loop{ Variable{ x_2_phi none + undefined __u32 } } @@ -1890,6 +1954,7 @@ Loop{ VariableConst{ x_2 none + undefined __u32 { Identifier[not set]{x_2_phi} @@ -1958,6 +2023,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_Phi_FromHeaderAndThen) { VariableConst{ x_101 none + undefined __bool { Identifier[not set]{x_7} @@ -1968,6 +2034,7 @@ VariableDeclStatement{ VariableConst{ x_102 none + undefined __bool { Identifier[not set]{x_8} @@ -1979,6 +2046,7 @@ Loop{ Variable{ x_2_phi none + undefined __u32 } } @@ -2017,6 +2085,7 @@ Loop{ VariableConst{ x_2 none + undefined __u32 { Identifier[not set]{x_2_phi} @@ -2084,6 +2153,7 @@ TEST_F(SpvParserFunctionVarTest, Variable{ x_35_phi none + undefined __u32 } } @@ -2124,6 +2194,7 @@ VariableDeclStatement{ VariableConst{ x_35 none + undefined __u32 { Identifier[not set]{x_35_phi} @@ -2174,6 +2245,7 @@ TEST_F(SpvParserFunctionVarTest, EmitStatement_UseInPhiCountsAsUse) { Variable{ x_101_phi none + undefined __bool } } @@ -2181,6 +2253,7 @@ VariableDeclStatement{ VariableConst{ x_11 none + undefined __bool { Binary[not set]{ @@ -2195,6 +2268,7 @@ VariableDeclStatement{ VariableConst{ x_12 none + undefined __bool { UnaryOp[not set]{ @@ -2223,6 +2297,7 @@ VariableDeclStatement{ VariableConst{ x_101 none + undefined __bool { Identifier[not set]{x_101_phi} @@ -2291,6 +2366,7 @@ TEST_F(SpvParserFunctionVarTest, Variable{ x_81_phi_1 none + undefined __f32 } } @@ -2298,6 +2374,7 @@ TEST_F(SpvParserFunctionVarTest, VariableConst{ x_81 none + undefined __f32 { Identifier[not set]{x_81_phi_1} diff --git a/src/reader/spirv/parser_impl.cc b/src/reader/spirv/parser_impl.cc index a573634224..9f6a865f93 100644 --- a/src/reader/spirv/parser_impl.cc +++ b/src/reader/spirv/parser_impl.cc @@ -1354,6 +1354,7 @@ ast::Variable* ParserImpl::MakeVariable(uint32_t id, return nullptr; } + ast::Access access = ast::Access::kUndefined; if (sc == ast::StorageClass::kStorage) { bool read_only = false; if (auto* tn = storage_type->As()) { @@ -1361,9 +1362,7 @@ ast::Variable* ParserImpl::MakeVariable(uint32_t id, } // Apply the access(read) or access(read_write) modifier. - auto access = - read_only ? ast::AccessControl::kRead : ast::AccessControl::kReadWrite; - storage_type = ty_.AccessControl(storage_type, access); + access = read_only ? ast::Access::kRead : ast::Access::kReadWrite; } // Handle variables (textures and samplers) are always in the handle @@ -1387,7 +1386,7 @@ ast::Variable* ParserImpl::MakeVariable(uint32_t id, // `var` declarations will have a resolved type of ref, but at the // AST level both `var` and `let` are declared with the same type. return create(Source{}, builder_.Symbols().Register(name), sc, - storage_type->Build(builder_), is_const, + access, storage_type->Build(builder_), is_const, constructor, decorations); } @@ -1501,7 +1500,7 @@ TypedExpression ParserImpl::MakeConstantExpression(uint32_t id) { } auto source = GetSourceForInst(inst); - auto* ast_type = original_ast_type->UnwrapAliasAndAccess(); + auto* ast_type = original_ast_type->UnwrapAlias(); // TODO(dneto): Note: NullConstant for int, uint, float map to a regular 0. // So canonicalization should map that way too. @@ -1577,7 +1576,7 @@ ast::Expression* ParserImpl::MakeNullValue(const Type* type) { } auto* original_type = type; - type = type->UnwrapAliasAndAccess(); + type = type->UnwrapAlias(); if (type->Is()) { return create( @@ -2123,15 +2122,13 @@ const Pointer* ParserImpl::GetTypeForHandleVar( ast_store_type = ty_.SampledTexture(dim, ast_sampled_component_type); } } else { - const auto access = usage.IsStorageReadTexture() - ? ast::AccessControl::kRead - : ast::AccessControl::kWrite; + const auto access = usage.IsStorageReadTexture() ? ast::Access::kRead + : ast::Access::kWrite; const auto format = enum_converter_.ToImageFormat(image_type->format()); if (format == ast::ImageFormat::kNone) { return nullptr; } - ast_store_type = - ty_.AccessControl(ty_.StorageTexture(dim, format), access); + ast_store_type = ty_.StorageTexture(dim, format, access); } } else { Fail() << "unsupported: UniformConstant variable is not a recognized " diff --git a/src/reader/spirv/parser_impl_function_decl_test.cc b/src/reader/spirv/parser_impl_function_decl_test.cc index 5b2e753bd5..a78ce0a7b7 100644 --- a/src/reader/spirv/parser_impl_function_decl_test.cc +++ b/src/reader/spirv/parser_impl_function_decl_test.cc @@ -220,6 +220,7 @@ TEST_F(SpvParserTest, EmitFunctions_CalleePrecedesCaller) { VariableConst{ leaf_result none + undefined __u32 { Call[not set]{ @@ -243,6 +244,7 @@ TEST_F(SpvParserTest, EmitFunctions_CalleePrecedesCaller) { VariableConst{ branch_result none + undefined __u32 { Call[not set]{ @@ -307,16 +309,19 @@ TEST_F(SpvParserTest, EmitFunctions_MixedParamTypes) { VariableConst{ a none + undefined __u32 } VariableConst{ b none + undefined __f32 } VariableConst{ c none + undefined __i32 } ) @@ -347,16 +352,19 @@ TEST_F(SpvParserTest, EmitFunctions_GenerateParamNames) { VariableConst{ x_14 none + undefined __u32 } VariableConst{ x_15 none + undefined __f32 } VariableConst{ x_16 none + undefined __i32 } ) diff --git a/src/reader/spirv/parser_impl_handle_test.cc b/src/reader/spirv/parser_impl_handle_test.cc index 8569bb50fb..116b7bc084 100644 --- a/src/reader/spirv/parser_impl_handle_test.cc +++ b/src/reader/spirv/parser_impl_handle_test.cc @@ -1270,6 +1270,7 @@ INSTANTIATE_TEST_SUITE_P(Samplers, } x_10 none + undefined __sampler_sampler })"})); @@ -1288,6 +1289,7 @@ INSTANTIATE_TEST_SUITE_P(Images, } x_10 none + undefined __sampled_texture_1d__f32 })"}, DeclUnderspecifiedHandleCase{R"( @@ -1304,7 +1306,8 @@ INSTANTIATE_TEST_SUITE_P(Images, } x_10 none - __access_control_read_only__storage_texture_1d_rg32float + undefined + __storage_texture_1d_rg32float_read })"}, DeclUnderspecifiedHandleCase{R"( OpDecorate %10 NonReadable @@ -1320,7 +1323,8 @@ INSTANTIATE_TEST_SUITE_P(Images, } x_10 none - __access_control_write_only__storage_texture_1d_rg32float + undefined + __storage_texture_1d_rg32float_write })"})); // Test handle declaration or error, when there is an image access. @@ -1453,6 +1457,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __multisampled_texture_2d__f32 } )"}, @@ -1639,6 +1644,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -1648,6 +1654,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"( @@ -1672,6 +1679,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -1681,6 +1689,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d_array__f32 })", R"( @@ -1716,6 +1725,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -1725,6 +1735,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"( @@ -1755,6 +1766,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -1764,6 +1776,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d_array__f32 })", R"( @@ -1803,6 +1816,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -1812,6 +1826,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"( @@ -1837,6 +1852,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -1846,6 +1862,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d_array__f32 })", R"( @@ -1882,6 +1899,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -1891,6 +1909,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"( @@ -1923,6 +1942,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -1932,6 +1952,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"( @@ -1965,6 +1986,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -1974,6 +1996,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d_array__f32 })", R"( @@ -2026,6 +2049,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -2035,6 +2059,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_2d } Variable{ @@ -2044,6 +2069,7 @@ INSTANTIATE_TEST_SUITE_P( } x_30 none + undefined __sampler_comparison })", R"( @@ -2051,6 +2077,7 @@ INSTANTIATE_TEST_SUITE_P( VariableConst{ x_200 none + undefined __vec_4__f32 { TypeConstructor[not set]{ @@ -2074,6 +2101,7 @@ INSTANTIATE_TEST_SUITE_P( VariableConst{ x_210 none + undefined __f32 { Call[not set]{ @@ -2105,6 +2133,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_comparison } Variable{ @@ -2114,6 +2143,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_2d })", R"( @@ -2138,6 +2168,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_comparison } Variable{ @@ -2147,6 +2178,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_2d_array })", R"( @@ -2182,6 +2214,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_comparison } Variable{ @@ -2191,6 +2224,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_2d })", R"( @@ -2221,6 +2255,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_comparison } Variable{ @@ -2230,6 +2265,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_2d_array })", R"( @@ -2276,6 +2312,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_comparison } Variable{ @@ -2285,6 +2322,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_2d })", R"( @@ -2309,6 +2347,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_comparison } Variable{ @@ -2318,6 +2357,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_2d_array })", R"( @@ -2353,6 +2393,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_comparison } Variable{ @@ -2362,6 +2403,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_2d })", R"( @@ -2392,6 +2434,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_comparison } Variable{ @@ -2401,6 +2444,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_2d_array })", R"( @@ -2440,6 +2484,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_comparison } Variable{ @@ -2449,6 +2494,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_cube })", R"( @@ -2473,6 +2519,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_comparison } Variable{ @@ -2482,6 +2529,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_cube_array })", R"( @@ -2522,6 +2570,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -2531,6 +2580,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"( @@ -2556,6 +2606,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -2565,6 +2616,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d_array__f32 })", R"( @@ -2601,6 +2653,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -2610,6 +2663,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"( @@ -2642,6 +2696,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -2651,6 +2706,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"( @@ -2685,6 +2741,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -2694,6 +2751,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d_array__f32 })", R"( @@ -2739,6 +2797,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -2748,6 +2807,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"( @@ -2774,6 +2834,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -2783,6 +2844,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d_array__f32 })", R"( @@ -2820,6 +2882,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -2829,6 +2892,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"( @@ -2861,6 +2925,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -2870,6 +2935,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"( @@ -2905,6 +2971,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -2914,6 +2981,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d_array__f32 })", R"( @@ -2957,6 +3025,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -2966,6 +3035,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d_array__f32 })", R"( @@ -3020,6 +3090,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -3029,6 +3100,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"( @@ -3053,6 +3125,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -3062,6 +3135,7 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_2d })", R"( @@ -3165,7 +3239,8 @@ INSTANTIATE_TEST_SUITE_P(ImageWrite_OptionalParams, } x_20 none - __access_control_write_only__storage_texture_2d_rgba32float + undefined + __storage_texture_2d_rgba32float_write })", R"(Call[not set]{ Identifier[not set]{textureStore} @@ -3195,7 +3270,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_r32float + undefined + __storage_texture_2d_r32float_write })", R"(Call[not set]{ Identifier[not set]{textureStore} @@ -3221,7 +3297,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_r32float + undefined + __storage_texture_2d_r32float_write })", R"(Call[not set]{ Identifier[not set]{textureStore} @@ -3246,7 +3323,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_r32float + undefined + __storage_texture_2d_r32float_write })", R"(Call[not set]{ Identifier[not set]{textureStore} @@ -3270,7 +3348,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_r32float + undefined + __storage_texture_2d_r32float_write })", R"(Call[not set]{ Identifier[not set]{textureStore} @@ -3290,7 +3369,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_rg32float + undefined + __storage_texture_2d_rg32float_write })", R"(Call[not set]{ Identifier[not set]{textureStore} @@ -3315,7 +3395,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_rg32float + undefined + __storage_texture_2d_rg32float_write })", R"(Call[not set]{ Identifier[not set]{textureStore} @@ -3339,7 +3420,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_rg32float + undefined + __storage_texture_2d_rg32float_write })", R"(Call[not set]{ Identifier[not set]{textureStore} @@ -3360,7 +3442,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_rgba32float + undefined + __storage_texture_2d_rgba32float_write })", R"(Call[not set]{ Identifier[not set]{textureStore} @@ -3456,7 +3539,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_rgba32uint + undefined + __storage_texture_2d_rgba32uint_write })", R"(Call[not set]{ Identifier[not set]{textureStore} @@ -3476,7 +3560,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_rgba32sint + undefined + __storage_texture_2d_rgba32sint_write })", R"(Call[not set]{ Identifier[not set]{textureStore} @@ -3506,7 +3591,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_rgba32float + undefined + __storage_texture_2d_rgba32float_write })"}, // Sampled type is float, texel is unsigned int {"%int 2D 0 0 0 2 Rgba32f", "OpImageWrite %im %vi12 %vu1234", @@ -3521,7 +3607,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_rgba32float + undefined + __storage_texture_2d_rgba32float_write })"}, // Sampled type is unsigned int, texel is float {"%uint 2D 0 0 0 2 Rgba32ui", "OpImageWrite %im %vi12 %vf1234", @@ -3536,7 +3623,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_rgba32uint + undefined + __storage_texture_2d_rgba32uint_write })"}, // Sampled type is signed int, texel is float {"%int 2D 0 0 0 2 Rgba32i", "OpImageWrite %im %vi12 %vf1234", @@ -3551,7 +3639,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_rgba32sint + undefined + __storage_texture_2d_rgba32sint_write })"}})); INSTANTIATE_TEST_SUITE_P( @@ -3573,7 +3662,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_rgba32uint + undefined + __storage_texture_2d_rgba32uint_write })"}, // Sampled type is signed int, texel is unsigned int {"%int 2D 0 0 0 2 Rgba32i", "OpImageWrite %im %vi12 %vu1234", @@ -3588,7 +3678,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_rgba32sint + undefined + __storage_texture_2d_rgba32sint_write })"}})); INSTANTIATE_TEST_SUITE_P( @@ -3607,7 +3698,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_r32uint + undefined + __storage_texture_2d_r32uint_write })", R"(Call[not set]{ Identifier[not set]{textureStore} @@ -3632,7 +3724,8 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_write_only__storage_texture_2d_r32sint + undefined + __storage_texture_2d_r32sint_write })", R"(Call[not set]{ Identifier[not set]{textureStore} @@ -3661,12 +3754,14 @@ INSTANTIATE_TEST_SUITE_P(ImageRead_OptionalParams, } x_20 none - __access_control_read_only__storage_texture_2d_rgba32float + undefined + __storage_texture_2d_rgba32float_read })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_4__f32 { Call[not set]{ @@ -3694,12 +3789,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_4__f32 { Call[not set]{ @@ -3723,12 +3820,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_4__f32 { Call[not set]{ @@ -3752,12 +3851,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_2d })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_4__f32 { TypeConstructor[not set]{ @@ -3787,12 +3888,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_2d })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_4__f32 { TypeConstructor[not set]{ @@ -3830,12 +3933,14 @@ INSTANTIATE_TEST_SUITE_P(ImageFetch_Depth, } x_20 none + undefined __depth_texture_2d })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_4__f32 { TypeConstructor[not set]{ @@ -3876,12 +3981,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __multisampled_texture_2d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_4__f32 { Call[not set]{ @@ -3909,12 +4016,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __multisampled_texture_2d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_4__f32 { Call[not set]{ @@ -3959,12 +4068,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_4__f32 { Call[not set]{ @@ -3987,12 +4098,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__u32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_4__u32 { Call[not set]{ @@ -4020,12 +4133,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__i32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_4__i32 { Call[not set]{ @@ -4057,12 +4172,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_read_only__storage_texture_2d_rgba32float + undefined + __storage_texture_2d_rgba32float_read })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_4__f32 { Call[not set]{ @@ -4084,12 +4201,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_read_only__storage_texture_2d_rgba32uint + undefined + __storage_texture_2d_rgba32uint_read })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_4__u32 { Call[not set]{ @@ -4117,12 +4236,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_read_only__storage_texture_2d_rgba32sint + undefined + __storage_texture_2d_rgba32sint_read })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_4__i32 { Call[not set]{ @@ -4158,6 +4279,7 @@ INSTANTIATE_TEST_SUITE_P( } x_10 none + undefined __sampler_sampler } Variable{ @@ -4167,12 +4289,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_4__f32 { Call[not set]{ @@ -4206,12 +4330,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_read_only__storage_texture_1d_rgba32float + undefined + __storage_texture_1d_rgba32float_read })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __i32 { TypeConstructor[not set]{ @@ -4238,12 +4364,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_read_only__storage_texture_2d_rgba32float + undefined + __storage_texture_2d_rgba32float_read })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_2__i32 { TypeConstructor[not set]{ @@ -4270,12 +4398,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_read_only__storage_texture_3d_rgba32float + undefined + __storage_texture_3d_rgba32float_read })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_3__i32 { TypeConstructor[not set]{ @@ -4300,12 +4430,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __multisampled_texture_2d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_2__i32 { TypeConstructor[not set]{ @@ -4341,12 +4473,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none - __access_control_read_only__storage_texture_2d_array_rgba32float + undefined + __storage_texture_2d_array_rgba32float_read })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_3__i32 { TypeConstructor[not set]{ @@ -4388,12 +4522,14 @@ INSTANTIATE_TEST_SUITE_P(ImageQuerySizeLod_NonArrayed_SignedResult_SignedLevel, } x_20 none + undefined __sampled_texture_1d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __i32 { TypeConstructor[not set]{ @@ -4420,12 +4556,14 @@ INSTANTIATE_TEST_SUITE_P(ImageQuerySizeLod_NonArrayed_SignedResult_SignedLevel, } x_20 none + undefined __sampled_texture_2d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_2__i32 { TypeConstructor[not set]{ @@ -4452,12 +4590,14 @@ INSTANTIATE_TEST_SUITE_P(ImageQuerySizeLod_NonArrayed_SignedResult_SignedLevel, } x_20 none + undefined __sampled_texture_3d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_3__i32 { TypeConstructor[not set]{ @@ -4484,12 +4624,14 @@ INSTANTIATE_TEST_SUITE_P(ImageQuerySizeLod_NonArrayed_SignedResult_SignedLevel, } x_20 none + undefined __sampled_texture_cube__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_2__i32 { TypeConstructor[not set]{ @@ -4519,12 +4661,14 @@ INSTANTIATE_TEST_SUITE_P(ImageQuerySizeLod_NonArrayed_SignedResult_SignedLevel, } x_20 none + undefined __depth_texture_2d })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_2__i32 { TypeConstructor[not set]{ @@ -4551,12 +4695,14 @@ INSTANTIATE_TEST_SUITE_P(ImageQuerySizeLod_NonArrayed_SignedResult_SignedLevel, } x_20 none + undefined __depth_texture_cube })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_2__i32 { TypeConstructor[not set]{ @@ -4596,12 +4742,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d_array__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_3__i32 { TypeConstructor[not set]{ @@ -4640,12 +4788,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_cube_array__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_3__i32 { TypeConstructor[not set]{ @@ -4681,12 +4831,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_2d_array })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_3__i32 { TypeConstructor[not set]{ @@ -4723,12 +4875,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_cube_array })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __vec_3__i32 { TypeConstructor[not set]{ @@ -4771,12 +4925,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_1d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __i32 { TypeConstructor[not set]{ @@ -4814,12 +4970,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_1d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __u32 { TypeConstructor[not set]{ @@ -4854,12 +5012,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __i32 { Call[not set]{ @@ -4881,12 +5041,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d_array__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __i32 { Call[not set]{ @@ -4908,12 +5070,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_3d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __i32 { Call[not set]{ @@ -4935,12 +5099,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_cube__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __i32 { Call[not set]{ @@ -4962,12 +5128,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_cube_array__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __i32 { Call[not set]{ @@ -4989,12 +5157,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_2d })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __i32 { Call[not set]{ @@ -5016,12 +5186,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_2d_array })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __i32 { Call[not set]{ @@ -5043,12 +5215,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_cube })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __i32 { Call[not set]{ @@ -5070,12 +5244,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __depth_texture_cube_array })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __i32 { Call[not set]{ @@ -5102,12 +5278,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __sampled_texture_2d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __u32 { TypeConstructor[not set]{ @@ -5136,12 +5314,14 @@ INSTANTIATE_TEST_SUITE_P(ImageQuerySamples_SignedResult, } x_20 none + undefined __multisampled_texture_2d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __i32 { Call[not set]{ @@ -5172,12 +5352,14 @@ INSTANTIATE_TEST_SUITE_P( } x_20 none + undefined __multisampled_texture_2d__f32 })", R"(VariableDeclStatement{ VariableConst{ x_99 none + undefined __u32 { TypeConstructor[not set]{ @@ -6231,6 +6413,7 @@ TEST_F(SpvParserHandleTest, Variable{ var_1 none + undefined __vec_4__f32 } } @@ -6238,6 +6421,7 @@ VariableDeclStatement{ VariableConst{ x_22 none + undefined __vec_4__f32 { Call[not set]{ @@ -6259,6 +6443,7 @@ VariableDeclStatement{ VariableConst{ x_26 none + undefined __vec_4__f32 { Call[not set]{ diff --git a/src/reader/spirv/parser_impl_module_var_test.cc b/src/reader/spirv/parser_impl_module_var_test.cc index 78998962e8..6109957f8d 100644 --- a/src/reader/spirv/parser_impl_module_var_test.cc +++ b/src/reader/spirv/parser_impl_module_var_test.cc @@ -196,6 +196,7 @@ TEST_F(SpvModuleScopeVarParserTest, AnonWorkgroupVar) { Variable{ x_52 workgroup + undefined __f32 })")); } @@ -217,6 +218,7 @@ TEST_F(SpvModuleScopeVarParserTest, NamedWorkgroupVar) { Variable{ the_counter workgroup + undefined __f32 })")); } @@ -238,6 +240,7 @@ TEST_F(SpvModuleScopeVarParserTest, PrivateVar) { Variable{ my_own_private_idaho private + undefined __f32 })")); } @@ -267,6 +270,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinVertexIndex) { } x_52 in + undefined __u32 })")); } @@ -322,6 +326,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPosition_MapsToModuleScopeVec4Var) { } gl_Position out + undefined __vec_4__f32 })")) << module_str; @@ -547,6 +552,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPointSize_Write1_IsErased) { } gl_Position out + undefined __vec_4__f32 } Function main -> __void @@ -601,6 +607,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPointSize_ReadReplaced) { Variable{ x_900 private + undefined __f32 } Variable{ @@ -609,6 +616,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPointSize_ReadReplaced) { } gl_Position out + undefined __vec_4__f32 } Function main -> __void @@ -672,6 +680,7 @@ TEST_F(SpvModuleScopeVarParserTest, } gl_Position out + undefined __vec_4__f32 } Function main -> __void @@ -770,6 +779,7 @@ TEST_F(SpvModuleScopeVarParserTest, Variable{ x_900 private + undefined __f32 } Function main -> __void @@ -961,6 +971,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarInitializers) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_1 private + undefined __bool { ScalarConstructor[not set]{true} @@ -969,6 +980,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarInitializers) { Variable{ x_2 private + undefined __bool { ScalarConstructor[not set]{false} @@ -977,6 +989,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarInitializers) { Variable{ x_3 private + undefined __i32 { ScalarConstructor[not set]{-1} @@ -985,6 +998,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarInitializers) { Variable{ x_4 private + undefined __u32 { ScalarConstructor[not set]{1u} @@ -993,6 +1007,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarInitializers) { Variable{ x_5 private + undefined __f32 { ScalarConstructor[not set]{1.500000} @@ -1018,6 +1033,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarNullInitializers) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_1 private + undefined __bool { ScalarConstructor[not set]{false} @@ -1026,6 +1042,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarNullInitializers) { Variable{ x_2 private + undefined __i32 { ScalarConstructor[not set]{0} @@ -1034,6 +1051,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarNullInitializers) { Variable{ x_3 private + undefined __u32 { ScalarConstructor[not set]{0u} @@ -1042,6 +1060,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarNullInitializers) { Variable{ x_4 private + undefined __f32 { ScalarConstructor[not set]{0.000000} @@ -1067,6 +1086,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarUndefInitializers) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_1 private + undefined __bool { ScalarConstructor[not set]{false} @@ -1075,6 +1095,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarUndefInitializers) { Variable{ x_2 private + undefined __i32 { ScalarConstructor[not set]{0} @@ -1083,6 +1104,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarUndefInitializers) { Variable{ x_3 private + undefined __u32 { ScalarConstructor[not set]{0u} @@ -1091,6 +1113,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarUndefInitializers) { Variable{ x_4 private + undefined __f32 { ScalarConstructor[not set]{0.000000} @@ -1114,6 +1137,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __vec_2__f32 { TypeConstructor[not set]{ @@ -1137,6 +1161,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorBoolNullInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __vec_2__bool { TypeConstructor[not set]{ @@ -1160,6 +1185,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorBoolUndefInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __vec_2__bool { TypeConstructor[not set]{ @@ -1186,6 +1212,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorUintNullInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __vec_2__u32 { TypeConstructor[not set]{ @@ -1209,6 +1236,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorUintUndefInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __vec_2__u32 { TypeConstructor[not set]{ @@ -1235,6 +1263,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorIntNullInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __vec_2__i32 { TypeConstructor[not set]{ @@ -1258,6 +1287,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorIntUndefInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __vec_2__i32 { TypeConstructor[not set]{ @@ -1284,6 +1314,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorFloatNullInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __vec_2__f32 { TypeConstructor[not set]{ @@ -1307,6 +1338,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorFloatUndefInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __vec_2__f32 { TypeConstructor[not set]{ @@ -1339,6 +1371,7 @@ TEST_F(SpvModuleScopeVarParserTest, MatrixInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __mat_2_3__f32 { TypeConstructor[not set]{ @@ -1375,6 +1408,7 @@ TEST_F(SpvModuleScopeVarParserTest, MatrixNullInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __mat_2_3__f32 { TypeConstructor[not set]{ @@ -1411,6 +1445,7 @@ TEST_F(SpvModuleScopeVarParserTest, MatrixUndefInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __mat_2_3__f32 { TypeConstructor[not set]{ @@ -1451,6 +1486,7 @@ TEST_F(SpvModuleScopeVarParserTest, ArrayInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __array__u32_2 { TypeConstructor[not set]{ @@ -1474,6 +1510,7 @@ TEST_F(SpvModuleScopeVarParserTest, ArrayNullInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __array__u32_2 { TypeConstructor[not set]{ @@ -1497,6 +1534,7 @@ TEST_F(SpvModuleScopeVarParserTest, ArrayUndefInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __array__u32_2 { TypeConstructor[not set]{ @@ -1525,6 +1563,7 @@ TEST_F(SpvModuleScopeVarParserTest, StructInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __type_name_S { TypeConstructor[not set]{ @@ -1554,6 +1593,7 @@ TEST_F(SpvModuleScopeVarParserTest, StructNullInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __type_name_S { TypeConstructor[not set]{ @@ -1585,6 +1625,7 @@ TEST_F(SpvModuleScopeVarParserTest, StructUndefInitializer) { EXPECT_THAT(module_str, HasSubstr(R"(Variable{ x_200 private + undefined __type_name_S { TypeConstructor[not set]{ @@ -1623,6 +1664,7 @@ TEST_F(SpvModuleScopeVarParserTest, LocationDecoration_Valid) { } myvar in + undefined __u32 })")) << module_str; @@ -1674,7 +1716,8 @@ TEST_F(SpvModuleScopeVarParserTest, DescriptorGroupDecoration_Valid) { } x_1 storage - __access_control_read_write__type_name_S + read_write + __type_name_S })")) << module_str; } @@ -1727,7 +1770,8 @@ TEST_F(SpvModuleScopeVarParserTest, BindingDecoration_Valid) { } x_1 storage - __access_control_read_write__type_name_S + read_write + __type_name_S })")) << module_str; } @@ -1784,7 +1828,8 @@ TEST_F(SpvModuleScopeVarParserTest, Variable{ x_1 storage - __access_control_read_write__type_name_S + read_write + __type_name_S } )")) << module_str; } @@ -1817,7 +1862,8 @@ TEST_F(SpvModuleScopeVarParserTest, ColMajorDecoration_Dropped) { Variable{ myvar storage - __access_control_read_write__type_name_S + read_write + __type_name_S } })")) << module_str; } @@ -1849,7 +1895,8 @@ TEST_F(SpvModuleScopeVarParserTest, MatrixStrideDecoration_Dropped) { Variable{ myvar storage - __access_control_read_write__type_name_S + read_write + __type_name_S } })")) << module_str; } @@ -1905,7 +1952,8 @@ TEST_F(SpvModuleScopeVarParserTest, StorageBuffer_NonWritable_AllMembers) { Variable{ x_1 storage - __access_control_read_only__type_name_S + read + __type_name_S } })")) << module_str; } @@ -1937,7 +1985,8 @@ TEST_F(SpvModuleScopeVarParserTest, StorageBuffer_NonWritable_NotAllMembers) { Variable{ x_1 storage - __access_control_read_write__type_name_S + read_write + __type_name_S } })")) << module_str; } @@ -1972,7 +2021,8 @@ TEST_F( Variable{ x_1 storage - __access_control_read_write__type_name_S + read_write + __type_name_S } })")) << module_str; } @@ -1996,6 +2046,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarSpecConstant_DeclareConst_True) { } myconst none + undefined __bool { ScalarConstructor[not set]{true} @@ -2023,6 +2074,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarSpecConstant_DeclareConst_False) { } myconst none + undefined __bool { ScalarConstructor[not set]{false} @@ -2050,6 +2102,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarSpecConstant_DeclareConst_U32) { } myconst none + undefined __u32 { ScalarConstructor[not set]{42u} @@ -2077,6 +2130,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarSpecConstant_DeclareConst_I32) { } myconst none + undefined __i32 { ScalarConstructor[not set]{42} @@ -2104,6 +2158,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarSpecConstant_DeclareConst_F32) { } myconst none + undefined __f32 { ScalarConstructor[not set]{2.500000} @@ -2129,6 +2184,7 @@ TEST_F(SpvModuleScopeVarParserTest, VariableConst{ myconst none + undefined __f32 { ScalarConstructor[not set]{2.500000} @@ -2212,6 +2268,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_I32_Load_Direct) { } x_1 in + undefined __u32 })")); @@ -2221,6 +2278,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_I32_Load_Direct) { VariableConst{ x_2 none + undefined __i32 { TypeConstructor[not set]{ @@ -2254,6 +2312,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_I32_Load_CopyObject) { } x_1 in + undefined __u32 })")); @@ -2263,6 +2322,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_I32_Load_CopyObject) { VariableConst{ x_2 none + undefined __i32 { TypeConstructor[not set]{ @@ -2296,6 +2356,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_I32_Load_AccessChain) { } x_1 in + undefined __u32 })")); @@ -2305,6 +2366,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_I32_Load_AccessChain) { VariableConst{ x_2 none + undefined __i32 { TypeConstructor[not set]{ @@ -2363,6 +2425,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_Direct) { } x_1 in + undefined __u32 })")); @@ -2372,6 +2435,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_Direct) { VariableConst{ x_2 none + undefined __u32 { Identifier[not set]{x_1} @@ -2402,6 +2466,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_CopyObject) { } x_1 in + undefined __u32 })")); @@ -2411,6 +2476,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_CopyObject) { VariableConst{ x_11 none + undefined __ptr_in__u32 { UnaryOp[not set]{ @@ -2424,6 +2490,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_CopyObject) { VariableConst{ x_2 none + undefined __u32 { UnaryOp[not set]{ @@ -2457,6 +2524,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_AccessChain) { } x_1 in + undefined __u32 })")); @@ -2466,6 +2534,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleId_U32_Load_AccessChain) { VariableConst{ x_2 none + undefined __u32 { Identifier[not set]{x_1} @@ -2574,6 +2643,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_U32_Direct) { } x_1 in + undefined __u32 })")); @@ -2583,6 +2653,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_U32_Direct) { VariableConst{ x_3 none + undefined __u32 { Identifier[not set]{x_1} @@ -2616,6 +2687,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_U32_CopyObject) { } x_1 in + undefined __u32 })")); @@ -2625,6 +2697,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_U32_CopyObject) { VariableConst{ x_4 none + undefined __u32 { Identifier[not set]{x_1} @@ -2658,6 +2731,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_U32_AccessChain) { } x_1 in + undefined __u32 })")); @@ -2667,6 +2741,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_U32_AccessChain) { VariableConst{ x_4 none + undefined __u32 { Identifier[not set]{x_1} @@ -2699,6 +2774,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_Direct) { } x_1 in + undefined __u32 })")); @@ -2708,6 +2784,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_Direct) { VariableConst{ x_3 none + undefined __i32 { TypeConstructor[not set]{ @@ -2744,6 +2821,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_CopyObject) { } x_1 in + undefined __u32 })")); @@ -2753,6 +2831,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_CopyObject) { VariableConst{ x_4 none + undefined __i32 { TypeConstructor[not set]{ @@ -2789,6 +2868,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_AccessChain) { } x_1 in + undefined __u32 })")); @@ -2798,6 +2878,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_I32_AccessChain) { VariableConst{ x_4 none + undefined __i32 { TypeConstructor[not set]{ @@ -2852,6 +2933,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_U32_Direct) { } x_1 out + undefined __u32 })")); @@ -2888,6 +2970,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_U32_CopyObject) { } x_1 out + undefined __u32 })")); @@ -2924,6 +3007,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_U32_AccessChain) { } x_1 out + undefined __u32 })")); @@ -2959,6 +3043,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_I32_Direct) { } x_1 out + undefined __u32 })")); @@ -3001,6 +3086,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_I32_CopyObject) { } x_1 out + undefined __u32 })")); @@ -3043,6 +3129,7 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_I32_AccessChain) { } x_1 out + undefined __u32 })")); @@ -3100,6 +3187,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_Direct) { } x_1 in + undefined __u32 })")); @@ -3109,6 +3197,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_Direct) { VariableConst{ x_2 none + undefined __i32 { TypeConstructor[not set]{ @@ -3142,6 +3231,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_CopyObject) { } x_1 in + undefined __u32 })")); @@ -3151,6 +3241,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_CopyObject) { VariableConst{ x_2 none + undefined __i32 { TypeConstructor[not set]{ @@ -3184,6 +3275,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_AccessChain) { } x_1 in + undefined __u32 })")); @@ -3193,6 +3285,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_I32_Load_AccessChain) { VariableConst{ x_2 none + undefined __i32 { TypeConstructor[not set]{ @@ -3251,6 +3344,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_Direct) { } x_1 in + undefined __u32 })")); @@ -3260,6 +3354,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_Direct) { VariableConst{ x_2 none + undefined __u32 { Identifier[not set]{x_1} @@ -3290,6 +3385,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_CopyObject) { } x_1 in + undefined __u32 })")); @@ -3299,6 +3395,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_CopyObject) { VariableConst{ x_11 none + undefined __ptr_in__u32 { UnaryOp[not set]{ @@ -3312,6 +3409,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_CopyObject) { VariableConst{ x_2 none + undefined __u32 { UnaryOp[not set]{ @@ -3345,6 +3443,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_AccessChain) { } x_1 in + undefined __u32 })")); @@ -3354,6 +3453,7 @@ TEST_F(SpvModuleScopeVarParserTest, VertexIndex_U32_Load_AccessChain) { VariableConst{ x_2 none + undefined __u32 { Identifier[not set]{x_1} @@ -3427,6 +3527,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_Direct) { } x_1 in + undefined __u32 })")); @@ -3436,6 +3537,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_Direct) { VariableConst{ x_2 none + undefined __i32 { TypeConstructor[not set]{ @@ -3469,6 +3571,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_CopyObject) { } x_1 in + undefined __u32 })")); @@ -3478,6 +3581,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_CopyObject) { VariableConst{ x_2 none + undefined __i32 { TypeConstructor[not set]{ @@ -3511,6 +3615,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_AccessChain) { } x_1 in + undefined __u32 })")); @@ -3520,6 +3625,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_I32_Load_AccessChain) { VariableConst{ x_2 none + undefined __i32 { TypeConstructor[not set]{ @@ -3576,6 +3682,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_Direct) { } x_1 in + undefined __u32 })")); @@ -3585,6 +3692,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_Direct) { VariableConst{ x_2 none + undefined __u32 { Identifier[not set]{x_1} @@ -3615,6 +3723,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_CopyObject) { } x_1 in + undefined __u32 })")); @@ -3624,6 +3733,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_CopyObject) { VariableConst{ x_11 none + undefined __ptr_in__u32 { UnaryOp[not set]{ @@ -3637,6 +3747,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_CopyObject) { VariableConst{ x_2 none + undefined __u32 { UnaryOp[not set]{ @@ -3670,6 +3781,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_AccessChain) { } x_1 in + undefined __u32 })")); @@ -3679,6 +3791,7 @@ TEST_F(SpvModuleScopeVarParserTest, InstanceIndex_U32_Load_AccessChain) { VariableConst{ x_2 none + undefined __u32 { Identifier[not set]{x_1} @@ -3832,6 +3945,7 @@ TEST_F(SpvModuleScopeVarParserTest, InputVarsConvertedToPrivate) { R"(Variable{ x_1 private + undefined __u32 } )"; @@ -3856,6 +3970,7 @@ TEST_F(SpvModuleScopeVarParserTest, OutputVarsConvertedToPrivate) { R"(Variable{ x_1 private + undefined __u32 } )"; @@ -3903,21 +4018,25 @@ TEST_F(SpvModuleScopeVarParserTest, EntryPointWrapping_IOLocations) { Variable{ x_1 private + undefined __u32 } Variable{ x_2 private + undefined __u32 } Variable{ x_3 private + undefined __u32 } Variable{ x_4 private + undefined __u32 } Function main_1 -> __void @@ -3934,6 +4053,7 @@ TEST_F(SpvModuleScopeVarParserTest, EntryPointWrapping_IOLocations) { } x_1_param none + undefined __u32 } VariableConst{ @@ -3942,6 +4062,7 @@ TEST_F(SpvModuleScopeVarParserTest, EntryPointWrapping_IOLocations) { } x_3_param none + undefined __u32 } ) diff --git a/src/reader/spirv/parser_type.cc b/src/reader/spirv/parser_type.cc index a2db6821fe..4f46b7de54 100644 --- a/src/reader/spirv/parser_type.cc +++ b/src/reader/spirv/parser_type.cc @@ -33,7 +33,6 @@ TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::Reference); TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::Vector); TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::Matrix); TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::Array); -TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::AccessControl); TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::Sampler); TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::Texture); TINT_INSTANTIATE_TYPEINFO(tint::reader::spirv::DepthTexture); @@ -79,12 +78,6 @@ struct ArrayHasher { } }; -struct AccessControlHasher { - size_t operator()(const AccessControl& t) const { - return utils::Hash(t.type, t.access); - } -}; - struct MultisampledTextureHasher { size_t operator()(const MultisampledTexture& t) const { return utils::Hash(t.dims, t.type); @@ -99,7 +92,7 @@ struct SampledTextureHasher { struct StorageTextureHasher { size_t operator()(const StorageTexture& t) const { - return utils::Hash(t.dims, t.format); + return utils::Hash(t.dims, t.format, t.access); } }; } // namespace @@ -124,10 +117,6 @@ static bool operator==(const Array& a, const Array& b) { return a.type == b.type && a.size == b.size && a.stride == b.stride; } -static bool operator==(const AccessControl& a, const AccessControl& b) { - return a.type == b.type && a.access == b.access; -} - static bool operator==(const MultisampledTexture& a, const MultisampledTexture& b) { return a.dims == b.dims && a.type == b.type; @@ -200,14 +189,6 @@ ast::Type* Array::Build(ProgramBuilder& b) const { return b.ty.array(type->Build(b), size, stride); } -AccessControl::AccessControl(const Type* t, ast::AccessControl::Access a) - : type(t), access(a) {} -AccessControl::AccessControl(const AccessControl&) = default; - -ast::Type* AccessControl::Build(ProgramBuilder& b) const { - return b.ty.access(access, type->Build(b)); -} - Sampler::Sampler(ast::SamplerKind k) : kind(k) {} Sampler::Sampler(const Sampler&) = default; @@ -241,12 +222,14 @@ ast::Type* SampledTexture::Build(ProgramBuilder& b) const { return b.ty.sampled_texture(dims, type->Build(b)); } -StorageTexture::StorageTexture(ast::TextureDimension d, ast::ImageFormat f) - : Base(d), format(f) {} +StorageTexture::StorageTexture(ast::TextureDimension d, + ast::ImageFormat f, + ast::Access a) + : Base(d), format(f), access(a) {} StorageTexture::StorageTexture(const StorageTexture&) = default; ast::Type* StorageTexture::Build(ProgramBuilder& b) const { - return b.ty.storage_texture(dims, format); + return b.ty.storage_texture(dims, format, access); } Named::Named(Symbol n) : name(n) {} @@ -296,11 +279,6 @@ struct TypeManager::State { matrices_; /// Map of Array to the returned Array type instance std::unordered_map arrays_; - /// Map of AccessControl to the returned AccessControl type instance - std::unordered_map - access_controls_; /// Map of type name to returned Alias instance std::unordered_map aliases_; /// Map of type name to returned Struct instance @@ -352,27 +330,11 @@ const Type* Type::UnwrapAlias() const { return type; } -const Type* Type::UnwrapAliasAndAccess() const { - auto* type = this; - while (true) { - if (auto* alias = type->As()) { - type = alias->type; - } else if (auto* access = type->As()) { - type = access->type; - } else { - break; - } - } - return type; -} - const Type* Type::UnwrapAll() const { auto* type = this; while (true) { if (auto* alias = type->As()) { type = alias->type; - } else if (auto* access = type->As()) { - type = access->type; } else if (auto* ptr = type->As()) { type = ptr->type; } else { @@ -500,14 +462,6 @@ const spirv::Array* TypeManager::Array(const Type* el, [&] { return state->allocator_.Create(el, size, stride); }); } -const spirv::AccessControl* TypeManager::AccessControl( - const Type* ty, - ast::AccessControl::Access ac) { - return utils::GetOrCreate( - state->access_controls_, spirv::AccessControl(ty, ac), - [&] { return state->allocator_.Create(ty, ac); }); -} - const spirv::Alias* TypeManager::Alias(Symbol name, const Type* ty) { return utils::GetOrCreate(state->aliases_, name, [&] { return state->allocator_.Create(name, ty); @@ -553,10 +507,12 @@ const spirv::SampledTexture* TypeManager::SampledTexture( const spirv::StorageTexture* TypeManager::StorageTexture( ast::TextureDimension dims, - ast::ImageFormat fmt) { + ast::ImageFormat fmt, + ast::Access access) { return utils::GetOrCreate( - state->storage_textures_, spirv::StorageTexture(dims, fmt), [&] { - return state->allocator_.Create(dims, fmt); + state->storage_textures_, spirv::StorageTexture(dims, fmt, access), [&] { + return state->allocator_.Create(dims, fmt, + access); }); } @@ -614,12 +570,6 @@ std::string Array::String() const { return ss.str(); } -std::string AccessControl::String() const { - std::stringstream ss; - ss << "[[access(" << access << ")]] " << type->String(); - return ss.str(); -} - std::string Sampler::String() const { switch (kind) { case ast::SamplerKind::kSampler: @@ -650,7 +600,7 @@ std::string SampledTexture::String() const { std::string StorageTexture::String() const { std::stringstream ss; - ss << "texture_storage_" << dims << "<" << format << ">"; + ss << "texture_storage_" << dims << "<" << format << ", " << access << ">"; return ss.str(); } diff --git a/src/reader/spirv/parser_type.h b/src/reader/spirv/parser_type.h index c01c4e1a7e..85d80cdc22 100644 --- a/src/reader/spirv/parser_type.h +++ b/src/reader/spirv/parser_type.h @@ -19,7 +19,7 @@ #include #include -#include "src/ast/access_control.h" +#include "src/ast/access.h" #include "src/ast/sampler.h" #include "src/ast/storage_class.h" #include "src/ast/storage_texture.h" @@ -56,9 +56,6 @@ class Type : public Castable { /// @returns the inner most aliased type if this is an alias, `this` otherwise const Type* UnwrapAlias() const; - /// @returns the type with all aliasing and access control removed - const Type* UnwrapAliasAndAccess() const; - /// @returns the type with all aliasing, access control and pointers removed const Type* UnwrapAll() const; @@ -290,33 +287,6 @@ struct Array : public Castable { uint32_t const stride; }; -/// `[[access]]` type -struct AccessControl : public Castable { - /// Constructor - /// @param ty the inner type - /// @param ac the access control - AccessControl(const Type* ty, ast::AccessControl::Access ac); - - /// Copy constructor - /// @param other the other type to copy - AccessControl(const AccessControl& other); - - /// @return the - /// @param b the ProgramBuilder used to construct the AST types - /// @returns the constructed ast::Type node for the given type - ast::Type* Build(ProgramBuilder& b) const override; - -#ifndef NDEBUG - /// @returns a string representation of the type, for debug purposes only - std::string String() const override; -#endif // NDEBUG - - /// the inner type - Type const* const type; - /// the access control - ast::AccessControl::Access const access; -}; - /// `sampler` type struct Sampler : public Castable { /// Constructor @@ -427,7 +397,8 @@ struct StorageTexture : public Castable { /// Constructor /// @param d the texture dimensions /// @param f the storage image format - StorageTexture(ast::TextureDimension d, ast::ImageFormat f); + /// @param a the access control + StorageTexture(ast::TextureDimension d, ast::ImageFormat f, ast::Access a); /// Copy constructor /// @param other the other type to copy @@ -444,6 +415,9 @@ struct StorageTexture : public Castable { /// the storage image format ast::ImageFormat const format; + + /// the access control + ast::Access const access; }; /// Base class for named types @@ -556,12 +530,6 @@ class TypeManager { /// @return a Array type. Repeated calls with the same arguments will return /// the same pointer. const spirv::Array* Array(const Type* el, uint32_t sz, uint32_t st); - /// @param ty the inner type - /// @param ac the access control - /// @return a AccessControl type. Repeated calls with the same arguments will - /// return the same pointer. - const spirv::AccessControl* AccessControl(const Type* ty, - ast::AccessControl::Access ac); /// @param n the alias name /// @param t the aliased type /// @return a Alias type. Repeated calls with the same arguments will return @@ -594,10 +562,12 @@ class TypeManager { const Type* t); /// @param d the texture dimensions /// @param f the storage image format + /// @param a the access control /// @return a StorageTexture type. Repeated calls with the same arguments will /// return the same pointer. const spirv::StorageTexture* StorageTexture(ast::TextureDimension d, - ast::ImageFormat f); + ast::ImageFormat f, + ast::Access a); private: struct State; diff --git a/src/reader/spirv/parser_type_test.cc b/src/reader/spirv/parser_type_test.cc index fa89aa361b..8818e3f03e 100644 --- a/src/reader/spirv/parser_type_test.cc +++ b/src/reader/spirv/parser_type_test.cc @@ -35,8 +35,6 @@ TEST(SpvParserTypeTest, SameArgumentsGivesSamePointer) { EXPECT_EQ(ty.Vector(ty.I32(), 3), ty.Vector(ty.I32(), 3)); EXPECT_EQ(ty.Matrix(ty.I32(), 3, 2), ty.Matrix(ty.I32(), 3, 2)); EXPECT_EQ(ty.Array(ty.I32(), 3, 2), ty.Array(ty.I32(), 3, 2)); - EXPECT_EQ(ty.AccessControl(ty.I32(), ast::AccessControl::kRead), - ty.AccessControl(ty.I32(), ast::AccessControl::kRead)); EXPECT_EQ(ty.Alias(sym, ty.I32()), ty.Alias(sym, ty.I32())); EXPECT_EQ(ty.Struct(sym, {ty.I32()}), ty.Struct(sym, {ty.I32()})); EXPECT_EQ(ty.Sampler(ast::SamplerKind::kSampler), @@ -47,10 +45,10 @@ TEST(SpvParserTypeTest, SameArgumentsGivesSamePointer) { ty.MultisampledTexture(ast::TextureDimension::k2d, ty.I32())); EXPECT_EQ(ty.SampledTexture(ast::TextureDimension::k2d, ty.I32()), ty.SampledTexture(ast::TextureDimension::k2d, ty.I32())); - EXPECT_EQ( - ty.StorageTexture(ast::TextureDimension::k2d, ast::ImageFormat::kR16Sint), - ty.StorageTexture(ast::TextureDimension::k2d, - ast::ImageFormat::kR16Sint)); + EXPECT_EQ(ty.StorageTexture(ast::TextureDimension::k2d, + ast::ImageFormat::kR16Sint, ast::Access::kRead), + ty.StorageTexture(ast::TextureDimension::k2d, + ast::ImageFormat::kR16Sint, ast::Access::kRead)); } TEST(SpvParserTypeTest, DifferentArgumentsGivesDifferentPointer) { @@ -70,10 +68,6 @@ TEST(SpvParserTypeTest, DifferentArgumentsGivesDifferentPointer) { EXPECT_NE(ty.Array(ty.I32(), 3, 2), ty.Array(ty.U32(), 3, 2)); EXPECT_NE(ty.Array(ty.I32(), 3, 2), ty.Array(ty.I32(), 2, 2)); EXPECT_NE(ty.Array(ty.I32(), 3, 2), ty.Array(ty.I32(), 3, 3)); - EXPECT_NE(ty.AccessControl(ty.I32(), ast::AccessControl::kRead), - ty.AccessControl(ty.U32(), ast::AccessControl::kRead)); - EXPECT_NE(ty.AccessControl(ty.I32(), ast::AccessControl::kRead), - ty.AccessControl(ty.I32(), ast::AccessControl::kWrite)); EXPECT_NE(ty.Alias(sym_a, ty.I32()), ty.Alias(sym_b, ty.I32())); EXPECT_NE(ty.Struct(sym_a, {ty.I32()}), ty.Struct(sym_b, {ty.I32()})); EXPECT_NE(ty.Sampler(ast::SamplerKind::kSampler), @@ -88,14 +82,18 @@ TEST(SpvParserTypeTest, DifferentArgumentsGivesDifferentPointer) { ty.SampledTexture(ast::TextureDimension::k3d, ty.I32())); EXPECT_NE(ty.SampledTexture(ast::TextureDimension::k2d, ty.I32()), ty.SampledTexture(ast::TextureDimension::k2d, ty.U32())); - EXPECT_NE( - ty.StorageTexture(ast::TextureDimension::k2d, ast::ImageFormat::kR16Sint), - ty.StorageTexture(ast::TextureDimension::k3d, - ast::ImageFormat::kR16Sint)); - EXPECT_NE( - ty.StorageTexture(ast::TextureDimension::k2d, ast::ImageFormat::kR16Sint), - ty.StorageTexture(ast::TextureDimension::k2d, - ast::ImageFormat::kR32Sint)); + EXPECT_NE(ty.StorageTexture(ast::TextureDimension::k2d, + ast::ImageFormat::kR16Sint, ast::Access::kRead), + ty.StorageTexture(ast::TextureDimension::k3d, + ast::ImageFormat::kR16Sint, ast::Access::kRead)); + EXPECT_NE(ty.StorageTexture(ast::TextureDimension::k2d, + ast::ImageFormat::kR16Sint, ast::Access::kRead), + ty.StorageTexture(ast::TextureDimension::k2d, + ast::ImageFormat::kR32Sint, ast::Access::kRead)); + EXPECT_NE(ty.StorageTexture(ast::TextureDimension::k2d, + ast::ImageFormat::kR16Sint, ast::Access::kRead), + ty.StorageTexture(ast::TextureDimension::k2d, + ast::ImageFormat::kR16Sint, ast::Access::kWrite)); } } // namespace diff --git a/src/reader/wgsl/parser_impl.cc b/src/reader/wgsl/parser_impl.cc index 67bd0a365c..a45fe371ab 100644 --- a/src/reader/wgsl/parser_impl.cc +++ b/src/reader/wgsl/parser_impl.cc @@ -66,9 +66,9 @@ const char kVertexStage[] = "vertex"; const char kFragmentStage[] = "fragment"; const char kComputeStage[] = "compute"; -const char kReadAccessControl[] = "read"; -const char kWriteAccessControl[] = "write"; -const char kReadWriteAccessControl[] = "read_write"; +const char kReadAccess[] = "read"; +const char kWriteAccess[] = "write"; +const char kReadWriteAccess[] = "read_write"; ast::Builtin ident_to_builtin(const std::string& str) { if (str == "position") { @@ -204,9 +204,13 @@ ParserImpl::TypedIdentifier::TypedIdentifier() = default; ParserImpl::TypedIdentifier::TypedIdentifier(const TypedIdentifier&) = default; ParserImpl::TypedIdentifier::TypedIdentifier(ast::Type* type_in, + ast::Access access_in, std::string name_in, Source source_in) - : type(type_in), name(std::move(name_in)), source(std::move(source_in)) {} + : type(type_in), + access(access_in), + name(std::move(name_in)), + source(std::move(source_in)) {} ParserImpl::TypedIdentifier::~TypedIdentifier() = default; @@ -237,10 +241,12 @@ ParserImpl::VarDeclInfo::VarDeclInfo(const VarDeclInfo&) = default; ParserImpl::VarDeclInfo::VarDeclInfo(Source source_in, std::string name_in, ast::StorageClass storage_class_in, + ast::Access access_in, ast::Type* type_in) : source(std::move(source_in)), name(std::move(name_in)), storage_class(storage_class_in), + access(access_in), type(type_in) {} ParserImpl::VarDeclInfo::~VarDeclInfo() = default; @@ -477,7 +483,8 @@ Maybe ParserImpl::global_variable_decl( return create( decl->source, // source builder_.Symbols().Register(decl->name), // symbol - decl->storage_class, // storage_class + decl->storage_class, // storage class + decl->access, // access control decl->type, // type false, // is_const constructor, // constructor @@ -511,7 +518,8 @@ Maybe ParserImpl::global_constant_decl( return create( decl->source, // source builder_.Symbols().Register(decl->name), // symbol - ast::StorageClass::kNone, // storage_class + ast::StorageClass::kNone, // storage class + ast::Access::kUndefined, // access control decl->type, // type true, // is_const initializer, // constructor @@ -519,26 +527,27 @@ Maybe ParserImpl::global_constant_decl( } // variable_decl -// : VAR variable_storage_decoration? variable_ident_decl +// : VAR variable_qualifier? variable_ident_decl Maybe ParserImpl::variable_decl(bool allow_inferred) { - if (!match(Token::Type::kVar)) + Source source; + if (!match(Token::Type::kVar, &source)) return Failure::kNoMatch; - ast::StorageClass sc = ast::StorageClass::kNone; - auto explicit_sc = variable_storage_decoration(); - if (explicit_sc.errored) + VariableQualifier vq; + auto explicit_vq = variable_qualifier(); + if (explicit_vq.errored) return Failure::kErrored; - if (explicit_sc.matched) { - sc = explicit_sc.value; + if (explicit_vq.matched) { + vq = explicit_vq.value; // TODO(crbug.com/tint/697): Remove this. - if (sc == ast::StorageClass::kInput) { - deprecated(explicit_sc.source, + if (vq.storage_class == ast::StorageClass::kInput) { + deprecated(explicit_vq.source, "use an entry point parameter instead of a variable in the " "`in` storage class"); } - if (sc == ast::StorageClass::kOutput) { - deprecated(explicit_sc.source, + if (vq.storage_class == ast::StorageClass::kOutput) { + deprecated(explicit_vq.source, "use an entry point return value instead of a variable in the " "`out` storage class"); } @@ -549,7 +558,20 @@ Maybe ParserImpl::variable_decl(bool allow_inferred) { if (decl.errored) return Failure::kErrored; - return VarDeclInfo{decl->source, decl->name, sc, decl->type}; + auto access = vq.access; + + if (access == ast::Access::kUndefined && + decl->access != ast::Access::kUndefined) { + // TODO(crbug.com/tint/846): Remove this + access = decl->access; + std::stringstream msg; + msg << "declare access with var<" << vq.storage_class << ", " << access + << "> instead of using [[access]] decoration"; + deprecated(source, msg.str()); + } + + return VarDeclInfo{decl->source, decl->name, vq.storage_class, access, + decl->type}; } // texture_sampler_types @@ -559,7 +581,8 @@ Maybe ParserImpl::variable_decl(bool allow_inferred) { // | multisampled_texture_type LESS_THAN type_decl GREATER_THAN // | storage_texture_type LESS_THAN image_storage_type // COMMA access GREATER_THAN -Maybe ParserImpl::texture_sampler_types() { +Maybe ParserImpl::texture_sampler_types( + ast::DecorationList& decos) { auto type = sampler_type(); if (type.matched) return type; @@ -601,7 +624,7 @@ Maybe ParserImpl::texture_sampler_types() { if (storage.matched) { const char* use = "storage texture type"; using StorageTextureInfo = - std::pair; + std::pair; auto params = expect_lt_gt_block(use, [&]() -> Expect { auto format = expect_image_storage_type(use); if (format.errored) { @@ -609,14 +632,23 @@ Maybe ParserImpl::texture_sampler_types() { } if (!match(Token::Type::kComma)) { + // TODO(crbug.com/tint/846): Remove this, along with the decos parameter + auto access_decos = take_decorations(decos); + if (access_decos.size() > 1) { + return add_error(access_decos[1]->source(), + "multiple access decorations not allowed"); + } + if (access_decos.size() == 0) { + return add_error(source_range, "expected access control"); + } + deprecated( peek().source(), "access control is expected as last parameter of storage textures"); - return std::make_pair(format.value, - tint::ast::AccessControl::kReadWrite); + return std::make_pair(format.value, access_decos[0]->value()); } - auto access = expect_access_type(); + auto access = expect_access("access control"); if (access.errored) { return Failure::kErrored; } @@ -628,19 +660,8 @@ Maybe ParserImpl::texture_sampler_types() { return Failure::kErrored; } - ast::Type* ty = - builder_.ty.storage_texture(source_range, storage.value, params->first); - - if (params->second != tint::ast::AccessControl::kReadWrite) { - // TODO(crbug.com/tint/846): The ast::AccessControl decoration is - // deprecated, but while we're migrating existing WGSL over to the new - // style of having the access part of the storage texture, we need to - // support both old and new styles. For now, have the new syntax emulate - // the old style AST. - ty = builder_.ty.access(params->second, ty); - } - - return ty; + return builder_.ty.storage_texture(source_range, storage.value, + params->first, params->second); } return Failure::kNoMatch; @@ -906,7 +927,8 @@ Expect ParserImpl::expect_variable_ident_decl( return Failure::kErrored; if (allow_inferred && !peek().Is(Token::Type::kColon)) { - return TypedIdentifier{nullptr, ident.value, ident.source}; + return TypedIdentifier{nullptr, ast::Access::kUndefined, ident.value, + ident.source}; } if (!expect(use, Token::Type::kColon)) @@ -916,8 +938,6 @@ Expect ParserImpl::expect_variable_ident_decl( if (decos.errored) return Failure::kErrored; - auto access_decos = take_decorations(decos.value); - auto t = peek(); auto type = type_decl(decos.value); if (type.errored) @@ -925,52 +945,65 @@ Expect ParserImpl::expect_variable_ident_decl( if (!type.matched) return add_error(t.source(), "invalid type", use); + auto access_decos = take_decorations(decos.value); + if (!expect_decorations_consumed(decos.value)) return Failure::kErrored; if (access_decos.size() > 1) return add_error(ident.source, "multiple access decorations not allowed"); - ast::Type* ty = type.value; + auto access = + access_decos.empty() ? ast::Access::kUndefined : access_decos[0]->value(); - for (auto* deco : access_decos) { - // If we have an access control decoration then we take it and wrap our - // type up with that decoration - ty = builder_.ty.access(deco->source(), - deco->As()->value(), ty); - } - return TypedIdentifier{ty, ident.value, ident.source}; + return TypedIdentifier{type.value, access, ident.value, ident.source}; } -Expect ParserImpl::expect_access_type() { - auto ident = expect_ident("access_type"); +Expect ParserImpl::expect_access(const std::string& use) { + auto ident = expect_ident(use); if (ident.errored) return Failure::kErrored; - if (ident.value == kReadAccessControl) - return {ast::AccessControl::kRead, ident.source}; - if (ident.value == kWriteAccessControl) - return {ast::AccessControl::kWrite, ident.source}; - if (ident.value == kReadWriteAccessControl) - return {ast::AccessControl::kReadWrite, ident.source}; + if (ident.value == kReadAccess) + return {ast::Access::kRead, ident.source}; + if (ident.value == kWriteAccess) + return {ast::Access::kWrite, ident.source}; + if (ident.value == kReadWriteAccess) + return {ast::Access::kReadWrite, ident.source}; return add_error(ident.source, "invalid value for access decoration"); } -// variable_storage_decoration -// : LESS_THAN storage_class GREATER_THAN -Maybe ParserImpl::variable_storage_decoration() { - if (!peek().IsLessThan()) +// variable_qualifier +// : LESS_THAN storage_class (COMMA access_mode)? GREATER_THAN +Maybe ParserImpl::variable_qualifier() { + if (!peek().IsLessThan()) { return Failure::kNoMatch; + } - const char* use = "variable decoration"; + auto* use = "variable declaration"; + auto vq = expect_lt_gt_block(use, [&]() -> Expect { + auto source = make_source_range(); + auto sc = expect_storage_class(use); + if (sc.errored) { + return Failure::kErrored; + } + if (match(Token::Type::kComma)) { + auto ac = expect_access(use); + if (ac.errored) { + return Failure::kErrored; + } + return VariableQualifier{sc.value, ac.value}; + } + return Expect{ + VariableQualifier{sc.value, ast::Access::kUndefined}, source}; + }); - auto sc = expect_lt_gt_block(use, [&] { return expect_storage_class(use); }); - - if (sc.errored) + if (vq.errored) { return Failure::kErrored; + } - return sc; + return vq; } // type_alias @@ -1088,7 +1121,7 @@ Maybe ParserImpl::type_decl(ast::DecorationList& decos) { return expect_type_decl_matrix(t); } - auto texture_or_sampler = texture_sampler_types(); + auto texture_or_sampler = texture_sampler_types(decos); if (texture_or_sampler.errored) return Failure::kErrored; if (texture_or_sampler.matched) @@ -1449,7 +1482,8 @@ Expect ParserImpl::expect_param() { auto* var = create(decl->source, // source builder_.Symbols().Register(decl->name), // symbol - ast::StorageClass::kNone, // storage_class + ast::StorageClass::kNone, // storage class + ast::Access::kUndefined, // access control decl->type, // type true, // is_const nullptr, // constructor @@ -1712,7 +1746,8 @@ Maybe ParserImpl::variable_stmt() { auto* var = create( decl->source, // source builder_.Symbols().Register(decl->name), // symbol - ast::StorageClass::kNone, // storage_class + ast::StorageClass::kNone, // storage class + ast::Access::kUndefined, // access control decl->type, // type true, // is_const constructor.value, // constructor @@ -1741,7 +1776,8 @@ Maybe ParserImpl::variable_stmt() { auto* var = create(decl->source, // source builder_.Symbols().Register(decl->name), // symbol - decl->storage_class, // storage_class + decl->storage_class, // storage class + decl->access, // access control decl->type, // type false, // is_const constructor, // constructor @@ -2947,7 +2983,7 @@ Maybe ParserImpl::decoration() { if (s == kAccessDecoration) { const char* use = "access decoration"; return expect_paren_block(use, [&]() -> Result { - auto val = expect_access_type(); + auto val = expect_access("access control"); if (val.errored) return Failure::kErrored; diff --git a/src/reader/wgsl/parser_impl.h b/src/reader/wgsl/parser_impl.h index 5a583597d8..afbcce1e9d 100644 --- a/src/reader/wgsl/parser_impl.h +++ b/src/reader/wgsl/parser_impl.h @@ -22,7 +22,7 @@ #include #include -#include "src/ast/access_control.h" +#include "src/ast/access.h" #include "src/program_builder.h" #include "src/reader/wgsl/parser_impl_detail.h" #include "src/reader/wgsl/token.h" @@ -208,14 +208,20 @@ class ParserImpl { TypedIdentifier(const TypedIdentifier& other); /// Constructor /// @param type_in parsed type + /// @param access_in parsed access /// @param name_in parsed identifier /// @param source_in source to the identifier - TypedIdentifier(ast::Type* type_in, std::string name_in, Source source_in); + TypedIdentifier(ast::Type* type_in, + ast::Access access_in, + std::string name_in, + Source source_in); /// Destructor ~TypedIdentifier(); /// Parsed type. May be nullptr for inferred types. ast::Type* type = nullptr; + /// The access control. TODO(crbug.com/tint/846): Remove + ast::Access access = ast::Access::kUndefined; /// Parsed identifier. std::string name; /// Source to the identifier. @@ -270,10 +276,12 @@ class ParserImpl { /// @param source_in variable declaration source /// @param name_in variable name /// @param storage_class_in variable storage class + /// @param access_in variable access control /// @param type_in variable type VarDeclInfo(Source source_in, std::string name_in, ast::StorageClass storage_class_in, + ast::Access access_in, ast::Type* type_in); /// Destructor ~VarDeclInfo(); @@ -283,11 +291,21 @@ class ParserImpl { /// Variable name std::string name; /// Variable storage class - ast::StorageClass storage_class; + ast::StorageClass storage_class = ast::StorageClass::kNone; + /// Variable access control + ast::Access access = ast::Access::kUndefined; /// Variable type ast::Type* type = nullptr; }; + /// VariableQualifier contains the parsed information for a variable qualifier + struct VariableQualifier { + /// The variable's storage class + ast::StorageClass storage_class = ast::StorageClass::kNone; + /// The variable's access control + ast::Access access = ast::Access::kUndefined; + }; + /// Creates a new parser using the given file /// @param file the input source file to parse explicit ParserImpl(Source::File const* file); @@ -400,9 +418,9 @@ class ParserImpl { Expect expect_variable_ident_decl( const std::string& use, bool allow_inferred = false); - /// Parses a `variable_storage_decoration` grammar element - /// @returns the storage class or StorageClass::kNone if none matched - Maybe variable_storage_decoration(); + /// Parses a `variable_qualifier` grammar element + /// @returns the variable qualifier information + Maybe variable_qualifier(); /// Parses a `type_alias` grammar element /// @returns the type alias or nullptr on error Maybe type_alias(); @@ -438,8 +456,10 @@ class ParserImpl { /// @returns the parsed function, nullptr otherwise Maybe function_decl(ast::DecorationList& decos); /// Parses a `texture_sampler_types` grammar element + /// TODO(crbug.com/tint/864): Remove decos parameter + /// @param decos the list of decorations for the type declaration. /// @returns the parsed Type or nullptr if none matched. - Maybe texture_sampler_types(); + Maybe texture_sampler_types(ast::DecorationList& decos); /// Parses a `sampler_type` grammar element /// @returns the parsed Type or nullptr if none matched. Maybe sampler_type(); @@ -477,10 +497,11 @@ class ParserImpl { /// not match a stage name. /// @returns the pipeline stage. Expect expect_pipeline_stage(); - /// Parses an access type identifier, erroring if the next token does not - /// match a valid access type name. + /// Parses an access control identifier, erroring if the next token does not + /// match a valid access control. + /// @param use a description of what was being parsed if an error was raised /// @returns the parsed access control. - Expect expect_access_type(); + Expect expect_access(const std::string& use); /// Parses a builtin identifier, erroring if the next token does not match a /// valid builtin name. /// @returns the parsed builtin. diff --git a/src/reader/wgsl/parser_impl_error_msg_test.cc b/src/reader/wgsl/parser_impl_error_msg_test.cc index dfb4c7f85f..0de748091d 100644 --- a/src/reader/wgsl/parser_impl_error_msg_test.cc +++ b/src/reader/wgsl/parser_impl_error_msg_test.cc @@ -548,31 +548,31 @@ TEST_F(ParserImplErrorTest, GlobalDeclMultisampledTextureInvalidSubtype) { } TEST_F(ParserImplErrorTest, GlobalDeclStorageTextureMissingLessThan) { - EXPECT("var x : [[access(read)]] texture_storage_2d;", - "test.wgsl:1:44 error: expected '<' for storage texture type\n" - "var x : [[access(read)]] texture_storage_2d;\n" - " ^\n"); + EXPECT("var x : texture_storage_2d;", + "test.wgsl:1:27 error: expected '<' for storage texture type\n" + "var x : texture_storage_2d;\n" + " ^\n"); } TEST_F(ParserImplErrorTest, GlobalDeclStorageTextureMissingGreaterThan) { - EXPECT("var x : [[access(read)]] texture_storage_2d' for storage texture type\n" - "var x : [[access(read)]] texture_storage_2d' for storage texture type\n" + "var x : texture_storage_2d;", - "test.wgsl:1:45 error: invalid format for storage texture type\n" - "var x : [[access(read)]] texture_storage_2d<>;\n" - " ^\n"); + EXPECT("var x : texture_storage_2d<>;", + "test.wgsl:1:28 error: invalid format for storage texture type\n" + "var x : texture_storage_2d<>;\n" + " ^\n"); } TEST_F(ParserImplErrorTest, GlobalDeclStorageTextureMissingInvalidSubtype) { - EXPECT("var x : [[access(read)]] texture_storage_2d<1>;", - "test.wgsl:1:45 error: invalid format for storage texture type\n" - "var x : [[access(read)]] texture_storage_2d<1>;\n" - " ^\n"); + EXPECT("var x : texture_storage_2d<1>;", + "test.wgsl:1:28 error: invalid format for storage texture type\n" + "var x : texture_storage_2d<1>;\n" + " ^\n"); } TEST_F(ParserImplErrorTest, GlobalDeclStructDecoMissingStruct) { @@ -1018,14 +1018,14 @@ TEST_F(ParserImplErrorTest, GlobalDeclVarPtrMissingType) { TEST_F(ParserImplErrorTest, GlobalDeclVarStorageDeclInvalidClass) { EXPECT("var i : i32", - "test.wgsl:1:5 error: invalid storage class for variable decoration\n" + "test.wgsl:1:5 error: invalid storage class for variable declaration\n" "var i : i32\n" " ^^^^\n"); } TEST_F(ParserImplErrorTest, GlobalDeclVarStorageDeclMissingGThan) { EXPECT("var' for variable decoration\n" + "test.wgsl:1:8 error: expected '>' for variable declaration\n" "varerror(), "1:5: invalid storage class for variable decoration"); + EXPECT_EQ(p->error(), "1:5: invalid storage class for variable declaration"); } TEST_F(ParserImplTest, GlobalVariableDecl_StorageClassIn_Deprecated) { diff --git a/src/reader/wgsl/parser_impl_texture_sampler_types_test.cc b/src/reader/wgsl/parser_impl_texture_sampler_types_test.cc index a574a06f47..76a0528bcc 100644 --- a/src/reader/wgsl/parser_impl_texture_sampler_types_test.cc +++ b/src/reader/wgsl/parser_impl_texture_sampler_types_test.cc @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "src/ast/access_decoration.h" #include "src/reader/wgsl/parser_impl_test_helper.h" #include "src/sem/depth_texture_type.h" #include "src/sem/multisampled_texture_type.h" @@ -24,7 +25,8 @@ namespace { TEST_F(ParserImplTest, TextureSamplerTypes_Invalid) { auto p = parser("1234"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); EXPECT_EQ(t.value, nullptr); EXPECT_FALSE(t.matched); EXPECT_FALSE(t.errored); @@ -33,7 +35,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_Invalid) { TEST_F(ParserImplTest, TextureSamplerTypes_Sampler) { auto p = parser("sampler"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); ASSERT_FALSE(p->has_error()) << p->error(); EXPECT_TRUE(t.matched); EXPECT_FALSE(t.errored); @@ -45,7 +48,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_Sampler) { TEST_F(ParserImplTest, TextureSamplerTypes_SamplerComparison) { auto p = parser("sampler_comparison"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); ASSERT_FALSE(p->has_error()) << p->error(); EXPECT_TRUE(t.matched); EXPECT_FALSE(t.errored); @@ -57,7 +61,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_SamplerComparison) { TEST_F(ParserImplTest, TextureSamplerTypes_DepthTexture) { auto p = parser("texture_depth_2d"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); ASSERT_FALSE(p->has_error()) << p->error(); EXPECT_TRUE(t.matched); EXPECT_FALSE(t.errored); @@ -70,7 +75,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_DepthTexture) { TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_F32) { auto p = parser("texture_1d"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); ASSERT_FALSE(p->has_error()) << p->error(); EXPECT_TRUE(t.matched); EXPECT_FALSE(t.errored); @@ -84,7 +90,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_F32) { TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_I32) { auto p = parser("texture_2d"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); ASSERT_FALSE(p->has_error()) << p->error(); EXPECT_TRUE(t.matched); EXPECT_FALSE(t.errored); @@ -98,7 +105,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_I32) { TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_U32) { auto p = parser("texture_3d"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); ASSERT_FALSE(p->has_error()) << p->error(); EXPECT_TRUE(t.matched); EXPECT_FALSE(t.errored); @@ -112,7 +120,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_U32) { TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_Invalid) { auto p = parser("texture_1d"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); ASSERT_TRUE(p->has_error()); EXPECT_EQ(t.value, nullptr); EXPECT_FALSE(t.matched); @@ -122,7 +131,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_Invalid) { TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_MissingType) { auto p = parser("texture_1d<>"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); ASSERT_TRUE(p->has_error()); EXPECT_EQ(t.value, nullptr); EXPECT_FALSE(t.matched); @@ -132,7 +142,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_MissingType) { TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_MissingLessThan) { auto p = parser("texture_1d"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); ASSERT_TRUE(p->has_error()); EXPECT_EQ(t.value, nullptr); EXPECT_FALSE(t.matched); @@ -142,7 +153,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_MissingLessThan) { TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_MissingGreaterThan) { auto p = parser("texture_1dtexture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); ASSERT_TRUE(p->has_error()); EXPECT_EQ(t.value, nullptr); EXPECT_FALSE(t.matched); @@ -152,7 +164,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_MissingGreaterThan) { TEST_F(ParserImplTest, TextureSamplerTypes_MultisampledTexture_I32) { auto p = parser("texture_multisampled_2d"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); ASSERT_FALSE(p->has_error()) << p->error(); EXPECT_TRUE(t.matched); EXPECT_FALSE(t.errored); @@ -166,7 +179,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_MultisampledTexture_I32) { TEST_F(ParserImplTest, TextureSamplerTypes_MultisampledTexture_Invalid) { auto p = parser("texture_multisampled_2d"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); ASSERT_TRUE(p->has_error()); EXPECT_EQ(t.value, nullptr); EXPECT_FALSE(t.matched); @@ -176,7 +190,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_MultisampledTexture_Invalid) { TEST_F(ParserImplTest, TextureSamplerTypes_MultisampledTexture_MissingType) { auto p = parser("texture_multisampled_2d<>"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); ASSERT_TRUE(p->has_error()); EXPECT_EQ(t.value, nullptr); EXPECT_FALSE(t.matched); @@ -187,7 +202,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_MultisampledTexture_MissingType) { TEST_F(ParserImplTest, TextureSamplerTypes_MultisampledTexture_MissingLessThan) { auto p = parser("texture_multisampled_2d"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); EXPECT_EQ(t.value, nullptr); EXPECT_FALSE(t.matched); EXPECT_TRUE(t.errored); @@ -197,7 +213,8 @@ TEST_F(ParserImplTest, TEST_F(ParserImplTest, TextureSamplerTypes_MultisampledTexture_MissingGreaterThan) { auto p = parser("texture_multisampled_2dtexture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); EXPECT_EQ(t.value, nullptr); EXPECT_FALSE(t.matched); EXPECT_TRUE(t.errored); @@ -208,7 +225,8 @@ TEST_F(ParserImplTest, TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_Readonly1dR8Unorm_DEPRECATED) { auto p = parser("texture_storage_1d"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos{create(ast::Access::kRead)}; + auto t = p->texture_sampler_types(decos); ASSERT_FALSE(p->has_error()) << p->error(); EXPECT_TRUE(t.matched); EXPECT_FALSE(t.errored); @@ -218,26 +236,25 @@ TEST_F(ParserImplTest, ASSERT_TRUE(t->Is()); EXPECT_EQ(t->As()->image_format(), ast::ImageFormat::kR8Unorm); + EXPECT_EQ(t->As()->access(), ast::Access::kRead); EXPECT_EQ(t->As()->dim(), ast::TextureDimension::k1d); EXPECT_EQ(t.value->source().range, (Source::Range{{1u, 1u}, {1u, 28u}})); } TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_Readonly1dR8Unorm) { auto p = parser("texture_storage_1d"); - auto a = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); ASSERT_FALSE(p->has_error()) << p->error(); - EXPECT_TRUE(a.matched); - EXPECT_FALSE(a.errored); - ASSERT_NE(a.value, nullptr); + EXPECT_TRUE(t.matched); + EXPECT_FALSE(t.errored); + ASSERT_NE(t.value, nullptr); - ASSERT_TRUE(a->Is()); - EXPECT_TRUE(a->As()->IsReadOnly()); - - auto* t = a->As()->type(); ASSERT_TRUE(t->Is()); ASSERT_TRUE(t->Is()); EXPECT_EQ(t->As()->image_format(), ast::ImageFormat::kR8Unorm); + EXPECT_EQ(t->As()->access(), ast::Access::kRead); EXPECT_EQ(t->As()->dim(), ast::TextureDimension::k1d); EXPECT_EQ(t->source().range, (Source::Range{{1u, 1u}, {1u, 34u}})); } @@ -246,7 +263,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_Readonly1dR8Unorm) { TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_Writeonly2dR16Float_DEPRECATED) { auto p = parser("texture_storage_2d"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos{create(ast::Access::kWrite)}; + auto t = p->texture_sampler_types(decos); ASSERT_FALSE(p->has_error()) << p->error(); EXPECT_TRUE(t.matched); EXPECT_FALSE(t.errored); @@ -256,33 +274,33 @@ TEST_F(ParserImplTest, ASSERT_TRUE(t->Is()); EXPECT_EQ(t->As()->image_format(), ast::ImageFormat::kR16Float); + EXPECT_EQ(t->As()->access(), ast::Access::kWrite); EXPECT_EQ(t->As()->dim(), ast::TextureDimension::k2d); EXPECT_EQ(t.value->source().range, (Source::Range{{1u, 1u}, {1u, 29u}})); } TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_Writeonly2dR16Float) { auto p = parser("texture_storage_2d"); - auto a = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); ASSERT_FALSE(p->has_error()) << p->error(); - EXPECT_TRUE(a.matched); - EXPECT_FALSE(a.errored); - ASSERT_NE(a.value, nullptr); + EXPECT_TRUE(t.matched); + EXPECT_FALSE(t.errored); + ASSERT_NE(t.value, nullptr); - ASSERT_TRUE(a->Is()); - EXPECT_TRUE(a->As()->IsWriteOnly()); - - auto* t = a->As()->type(); ASSERT_TRUE(t->Is()); ASSERT_TRUE(t->Is()); EXPECT_EQ(t->As()->image_format(), ast::ImageFormat::kR16Float); + EXPECT_EQ(t->As()->access(), ast::Access::kWrite); EXPECT_EQ(t->As()->dim(), ast::TextureDimension::k2d); EXPECT_EQ(t->source().range, (Source::Range{{1u, 1u}, {1u, 36u}})); } TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_InvalidType) { auto p = parser("texture_storage_1d"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); EXPECT_EQ(t.value, nullptr); EXPECT_FALSE(t.matched); EXPECT_TRUE(t.errored); @@ -291,7 +309,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_InvalidType) { TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_InvalidAccess) { auto p = parser("texture_storage_1d"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); EXPECT_EQ(t.value, nullptr); EXPECT_FALSE(t.matched); EXPECT_TRUE(t.errored); @@ -300,7 +319,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_InvalidAccess) { TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_MissingType) { auto p = parser("texture_storage_1d<>"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); EXPECT_EQ(t.value, nullptr); EXPECT_FALSE(t.matched); EXPECT_TRUE(t.errored); @@ -309,7 +329,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_MissingType) { TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_MissingLessThan) { auto p = parser("texture_storage_1d"); - auto t = p->texture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); EXPECT_EQ(t.value, nullptr); EXPECT_FALSE(t.matched); EXPECT_TRUE(t.errored); @@ -318,7 +339,8 @@ TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_MissingLessThan) { TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_MissingGreaterThan) { auto p = parser("texture_storage_1dtexture_sampler_types(); + ast::DecorationList decos; + auto t = p->texture_sampler_types(decos); EXPECT_EQ(t.value, nullptr); EXPECT_FALSE(t.matched); EXPECT_TRUE(t.errored); diff --git a/src/reader/wgsl/parser_impl_variable_decl_test.cc b/src/reader/wgsl/parser_impl_variable_decl_test.cc index 367b3d483e..efb91d8d5a 100644 --- a/src/reader/wgsl/parser_impl_variable_decl_test.cc +++ b/src/reader/wgsl/parser_impl_variable_decl_test.cc @@ -87,7 +87,7 @@ TEST_F(ParserImplTest, VariableDecl_InvalidStorageClass) { EXPECT_FALSE(v.matched); EXPECT_TRUE(v.errored); EXPECT_TRUE(p->has_error()); - EXPECT_EQ(p->error(), "1:5: invalid storage class for variable decoration"); + EXPECT_EQ(p->error(), "1:5: invalid storage class for variable declaration"); } } // namespace diff --git a/src/reader/wgsl/parser_impl_variable_ident_decl_test.cc b/src/reader/wgsl/parser_impl_variable_ident_decl_test.cc index 35cd4190d4..59b8b837aa 100644 --- a/src/reader/wgsl/parser_impl_variable_ident_decl_test.cc +++ b/src/reader/wgsl/parser_impl_variable_ident_decl_test.cc @@ -84,7 +84,9 @@ TEST_F(ParserImplTest, VariableIdentDecl_InvalidType) { ASSERT_EQ(p->error(), "1:10: unknown constructed type 'invalid'"); } -TEST_F(ParserImplTest, VariableIdentDecl_ParsesWithTextureAccessDeco_Read) { +// TODO(crbug.com/tint/846): Remove +TEST_F(ParserImplTest, + VariableIdentDecl_ParsesWithTextureAccessDeco_Read_DEPRECATED) { auto p = parser("my_var : [[access(read)]] texture_storage_1d"); auto decl = p->expect_variable_ident_decl("test"); @@ -92,13 +94,17 @@ TEST_F(ParserImplTest, VariableIdentDecl_ParsesWithTextureAccessDeco_Read) { ASSERT_FALSE(decl.errored); ASSERT_EQ(decl->name, "my_var"); ASSERT_NE(decl->type, nullptr); - ASSERT_TRUE(decl->type->Is()); - EXPECT_TRUE(decl->type->As()->IsReadOnly()); - ASSERT_TRUE( - decl->type->As()->type()->Is()); + ASSERT_TRUE(decl->type->Is()); + EXPECT_TRUE(decl->type->As()->is_read_only()); + + EXPECT_EQ(p->error(), + "1:54: use of deprecated language feature: access control is " + "expected as last parameter of storage textures"); } -TEST_F(ParserImplTest, VariableIdentDecl_ParsesWithTextureAccessDeco_Write) { +// TODO(crbug.com/tint/846): Remove +TEST_F(ParserImplTest, + VariableIdentDecl_ParsesWithTextureAccessDeco_Write_DEPRECATED) { auto p = parser("my_var : [[access(write)]] texture_storage_1d"); auto decl = p->expect_variable_ident_decl("test"); @@ -106,14 +112,17 @@ TEST_F(ParserImplTest, VariableIdentDecl_ParsesWithTextureAccessDeco_Write) { ASSERT_FALSE(decl.errored); ASSERT_EQ(decl->name, "my_var"); ASSERT_NE(decl->type, nullptr); - ASSERT_TRUE(decl->type->Is()); - EXPECT_TRUE(decl->type->As()->IsWriteOnly()); - ASSERT_TRUE( - decl->type->As()->type()->Is()); + ASSERT_TRUE(decl->type->Is()); + EXPECT_TRUE(decl->type->As()->is_write_only()); + + EXPECT_EQ(p->error(), + "1:55: use of deprecated language feature: access control is " + "expected as last parameter of storage textures"); } -TEST_F(ParserImplTest, VariableIdentDecl_ParsesWithAccessDeco_Read) { - auto p = parser("my_var : [[access(read)]] S"); +// TODO(crbug.com/tint/846): Remove +TEST_F(ParserImplTest, VariableIdentDecl_ParsesWithAccessDeco_Read_DEPRECATED) { + auto p = parser("var my_var : [[access(read)]] S;"); auto* mem = Member("a", ty.i32(), ast::DecorationList{}); ast::StructMemberList members; @@ -127,17 +136,25 @@ TEST_F(ParserImplTest, VariableIdentDecl_ParsesWithAccessDeco_Read) { p->register_constructed("S", s); - auto decl = p->expect_variable_ident_decl("test"); - ASSERT_FALSE(p->has_error()) << p->error(); - ASSERT_FALSE(decl.errored); - ASSERT_EQ(decl->name, "my_var"); - ASSERT_NE(decl->type, nullptr); - ASSERT_TRUE(decl->type->Is()); - EXPECT_TRUE(decl->type->As()->IsReadOnly()); + auto res = p->expect_global_decl(); + ASSERT_FALSE(res.errored) << p->error(); + ASSERT_NE(p->builder().AST().GlobalVariables().size(), 0u); + auto* decl = p->builder().AST().GlobalVariables()[0]; + ASSERT_NE(decl, nullptr); + ASSERT_EQ(decl->symbol(), p->builder().Symbols().Get("my_var")); + ASSERT_NE(decl->type(), nullptr); + EXPECT_TRUE(decl->type()->Is()); + EXPECT_EQ(decl->declared_access(), ast::Access::kRead); + + EXPECT_EQ(p->error(), + "1:1: use of deprecated language feature: declare access with " + "var instead of using [[access]] decoration"); } -TEST_F(ParserImplTest, VariableIdentDecl_ParsesWithAccessDeco_ReadWrite) { - auto p = parser("my_var : [[access(read_write)]] S"); +// TODO(crbug.com/tint/846): Remove +TEST_F(ParserImplTest, + VariableIdentDecl_ParsesWithAccessDeco_ReadWrite_DEPRECATED) { + auto p = parser("var my_var : [[access(read_write)]] S;"); auto* mem = Member("a", ty.i32(), ast::DecorationList{}); ast::StructMemberList members; @@ -151,16 +168,23 @@ TEST_F(ParserImplTest, VariableIdentDecl_ParsesWithAccessDeco_ReadWrite) { p->register_constructed("S", s); - auto decl = p->expect_variable_ident_decl("test"); - ASSERT_FALSE(p->has_error()) << p->error(); - ASSERT_FALSE(decl.errored); - ASSERT_EQ(decl->name, "my_var"); - ASSERT_NE(decl->type, nullptr); - ASSERT_TRUE(decl->type->Is()); - EXPECT_TRUE(decl->type->As()->IsReadWrite()); + auto res = p->expect_global_decl(); + ASSERT_FALSE(res.errored) << p->error(); + ASSERT_NE(p->builder().AST().GlobalVariables().size(), 0u); + auto* decl = p->builder().AST().GlobalVariables()[0]; + ASSERT_NE(decl, nullptr); + ASSERT_EQ(decl->symbol(), p->builder().Symbols().Get("my_var")); + ASSERT_NE(decl->type(), nullptr); + EXPECT_TRUE(decl->type()->Is()); + EXPECT_EQ(decl->declared_access(), ast::Access::kReadWrite); + + EXPECT_EQ(p->error(), + "1:1: use of deprecated language feature: declare access with " + "var instead of using [[access]] decoration"); } -TEST_F(ParserImplTest, VariableIdentDecl_MultipleAccessDecoFail) { +// TODO(crbug.com/tint/846): Remove +TEST_F(ParserImplTest, VariableIdentDecl_MultipleAccessDecoFail_DEPRECATED) { auto p = parser("my_var : [[access(read), access(read_write)]] S"); auto* mem = Member("a", ty.i32(), ast::DecorationList{}); @@ -181,7 +205,9 @@ TEST_F(ParserImplTest, VariableIdentDecl_MultipleAccessDecoFail) { ASSERT_EQ(p->error(), "1:1: multiple access decorations not allowed"); } -TEST_F(ParserImplTest, VariableIdentDecl_MultipleAccessDeco_MultiBlock_Fail) { +// TODO(crbug.com/tint/846): Remove +TEST_F(ParserImplTest, + VariableIdentDecl_MultipleAccessDeco_MultiBlock_Fail_DEPRECATED) { auto p = parser("my_var : [[access(read)]][[access(read_write)]] S"); auto* mem = Member("a", ty.i32(), ast::DecorationList{}); @@ -202,7 +228,8 @@ TEST_F(ParserImplTest, VariableIdentDecl_MultipleAccessDeco_MultiBlock_Fail) { ASSERT_EQ(p->error(), "1:1: multiple access decorations not allowed"); } -TEST_F(ParserImplTest, VariableIdentDecl_AccessDecoBadValue) { +// TODO(crbug.com/tint/846): Remove +TEST_F(ParserImplTest, VariableIdentDecl_AccessDecoBadValue_DEPRECATED) { auto p = parser("my_var : [[access(unknown)]] S"); auto decl = p->expect_variable_ident_decl("test"); ASSERT_TRUE(p->has_error()); @@ -210,12 +237,13 @@ TEST_F(ParserImplTest, VariableIdentDecl_AccessDecoBadValue) { ASSERT_EQ(p->error(), "1:19: invalid value for access decoration"); } -TEST_F(ParserImplTest, VariableIdentDecl_AccessDecoIllegalValue) { +// TODO(crbug.com/tint/846): Remove +TEST_F(ParserImplTest, VariableIdentDecl_AccessDecoIllegalValue_DEPRECATED) { auto p = parser("my_var : [[access(1)]] S"); auto decl = p->expect_variable_ident_decl("test"); ASSERT_TRUE(p->has_error()); ASSERT_TRUE(decl.errored); - ASSERT_EQ(p->error(), "1:19: expected identifier for access_type"); + ASSERT_EQ(p->error(), "1:19: expected identifier for access control"); } TEST_F(ParserImplTest, VariableIdentDecl_NonAccessDecoFail) { @@ -240,27 +268,27 @@ TEST_F(ParserImplTest, VariableIdentDecl_NonAccessDecoFail) { } TEST_F(ParserImplTest, VariableIdentDecl_DecorationMissingRightBlock) { - auto p = parser("my_var : [[access(read) S"); + auto p = parser("my_var : [[stride(4) S"); auto decl = p->expect_variable_ident_decl("test"); ASSERT_TRUE(p->has_error()); ASSERT_TRUE(decl.errored); - ASSERT_EQ(p->error(), "1:25: expected ']]' for decoration list"); + ASSERT_EQ(p->error(), "1:22: expected ']]' for decoration list"); } TEST_F(ParserImplTest, VariableIdentDecl_DecorationMissingRightParen) { - auto p = parser("my_var : [[access(read]] S"); + auto p = parser("my_var : [[stride(4]] S"); auto decl = p->expect_variable_ident_decl("test"); ASSERT_TRUE(p->has_error()); ASSERT_TRUE(decl.errored); - ASSERT_EQ(p->error(), "1:23: expected ')' for access decoration"); + ASSERT_EQ(p->error(), "1:20: expected ')' for stride decoration"); } TEST_F(ParserImplTest, VariableIdentDecl_DecorationMissingLeftParen) { - auto p = parser("my_var : [[access read)]] S"); + auto p = parser("my_var : [[stride 4)]] S"); auto decl = p->expect_variable_ident_decl("test"); ASSERT_TRUE(p->has_error()); ASSERT_TRUE(decl.errored); - ASSERT_EQ(p->error(), "1:19: expected '(' for access decoration"); + ASSERT_EQ(p->error(), "1:19: expected '(' for stride decoration"); } TEST_F(ParserImplTest, VariableIdentDecl_DecorationEmpty) { diff --git a/src/reader/wgsl/parser_impl_variable_storage_decoration_test.cc b/src/reader/wgsl/parser_impl_variable_qualifier_test.cc similarity index 52% rename from src/reader/wgsl/parser_impl_variable_storage_decoration_test.cc rename to src/reader/wgsl/parser_impl_variable_qualifier_test.cc index 889f631782..b070d241a2 100644 --- a/src/reader/wgsl/parser_impl_variable_storage_decoration_test.cc +++ b/src/reader/wgsl/parser_impl_variable_qualifier_test.cc @@ -21,64 +21,81 @@ namespace { struct VariableStorageData { const char* input; - ast::StorageClass result; + ast::StorageClass storage_class; + ast::Access access; }; inline std::ostream& operator<<(std::ostream& out, VariableStorageData data) { out << std::string(data.input); return out; } -class VariableStorageTest +class VariableQualifierTest : public ParserImplTestWithParam {}; -TEST_P(VariableStorageTest, Parses) { +TEST_P(VariableQualifierTest, ParsesStorageClass) { auto params = GetParam(); auto p = parser(std::string("<") + params.input + ">"); - auto sc = p->variable_storage_decoration(); + auto sc = p->variable_qualifier(); EXPECT_FALSE(p->has_error()); EXPECT_FALSE(sc.errored); EXPECT_TRUE(sc.matched); - EXPECT_EQ(sc.value, params.result); + EXPECT_EQ(sc->storage_class, params.storage_class); + EXPECT_EQ(sc->access, params.access); auto t = p->next(); EXPECT_TRUE(t.IsEof()); } INSTANTIATE_TEST_SUITE_P( ParserImplTest, - VariableStorageTest, + VariableQualifierTest, testing::Values( - VariableStorageData{"in", ast::StorageClass::kInput}, - VariableStorageData{"out", ast::StorageClass::kOutput}, - VariableStorageData{"uniform", ast::StorageClass::kUniform}, - VariableStorageData{"workgroup", ast::StorageClass::kWorkgroup}, - VariableStorageData{"storage", ast::StorageClass::kStorage}, - VariableStorageData{"storage_buffer", ast::StorageClass::kStorage}, - VariableStorageData{"image", ast::StorageClass::kImage}, - VariableStorageData{"private", ast::StorageClass::kPrivate}, - VariableStorageData{"function", ast::StorageClass::kFunction})); + VariableStorageData{"in", ast::StorageClass::kInput, + ast::Access::kUndefined}, + VariableStorageData{"out", ast::StorageClass::kOutput, + ast::Access::kUndefined}, + VariableStorageData{"uniform", ast::StorageClass::kUniform, + ast::Access::kUndefined}, + VariableStorageData{"workgroup", ast::StorageClass::kWorkgroup, + ast::Access::kUndefined}, + VariableStorageData{"storage", ast::StorageClass::kStorage, + ast::Access::kUndefined}, + VariableStorageData{"storage_buffer", ast::StorageClass::kStorage, + ast::Access::kUndefined}, + VariableStorageData{"image", ast::StorageClass::kImage, + ast::Access::kUndefined}, + VariableStorageData{"private", ast::StorageClass::kPrivate, + ast::Access::kUndefined}, + VariableStorageData{"function", ast::StorageClass::kFunction, + ast::Access::kUndefined}, + VariableStorageData{"storage, read", ast::StorageClass::kStorage, + ast::Access::kRead}, + VariableStorageData{"storage, write", ast::StorageClass::kStorage, + ast::Access::kWrite}, + VariableStorageData{"storage, read_write", ast::StorageClass::kStorage, + ast::Access::kReadWrite})); -TEST_F(ParserImplTest, VariableStorageDecoration_NoMatch) { +TEST_F(ParserImplTest, VariableQualifier_NoMatch) { auto p = parser(""); - auto sc = p->variable_storage_decoration(); + auto sc = p->variable_qualifier(); EXPECT_TRUE(p->has_error()); EXPECT_TRUE(sc.errored); EXPECT_FALSE(sc.matched); - EXPECT_EQ(p->error(), "1:2: invalid storage class for variable decoration"); + EXPECT_EQ(p->error(), "1:2: invalid storage class for variable declaration"); } -TEST_F(ParserImplTest, VariableStorageDecoration_Empty) { +TEST_F(ParserImplTest, VariableQualifier_Empty) { auto p = parser("<>"); - auto sc = p->variable_storage_decoration(); + auto sc = p->variable_qualifier(); EXPECT_TRUE(p->has_error()); EXPECT_TRUE(sc.errored); EXPECT_FALSE(sc.matched); - EXPECT_EQ(p->error(), "1:2: invalid storage class for variable decoration"); + EXPECT_EQ(p->error(), "1:2: invalid storage class for variable declaration"); } -TEST_F(ParserImplTest, VariableStorageDecoration_MissingLessThan) { +TEST_F(ParserImplTest, VariableQualifier_MissingLessThan) { auto p = parser("in>"); - auto sc = p->variable_storage_decoration(); + auto sc = p->variable_qualifier(); EXPECT_FALSE(p->has_error()); EXPECT_FALSE(sc.errored); EXPECT_FALSE(sc.matched); @@ -87,13 +104,24 @@ TEST_F(ParserImplTest, VariableStorageDecoration_MissingLessThan) { ASSERT_TRUE(t.IsIn()); } -TEST_F(ParserImplTest, VariableStorageDecoration_MissingGreaterThan) { +TEST_F(ParserImplTest, VariableQualifier_MissingLessThan_AfterSC) { + auto p = parser("in, >"); + auto sc = p->variable_qualifier(); + EXPECT_FALSE(p->has_error()); + EXPECT_FALSE(sc.errored); + EXPECT_FALSE(sc.matched); + + auto t = p->next(); + ASSERT_TRUE(t.IsIn()); +} + +TEST_F(ParserImplTest, VariableQualifier_MissingGreaterThan) { auto p = parser("variable_storage_decoration(); + auto sc = p->variable_qualifier(); EXPECT_TRUE(p->has_error()); EXPECT_TRUE(sc.errored); EXPECT_FALSE(sc.matched); - EXPECT_EQ(p->error(), "1:4: expected '>' for variable decoration"); + EXPECT_EQ(p->error(), "1:4: expected '>' for variable declaration"); } } // namespace diff --git a/src/resolver/assignment_validation_test.cc b/src/resolver/assignment_validation_test.cc index dab2610e2e..b908662735 100644 --- a/src/resolver/assignment_validation_test.cc +++ b/src/resolver/assignment_validation_test.cc @@ -156,14 +156,14 @@ TEST_F(ResolverAssignmentValidationTest, AssignToConstant_Fail) { } TEST_F(ResolverAssignmentValidationTest, AssignNonStorable_Fail) { - // var a : [[access(read)]] texture_storage_1d; - // var b : [[access(read)]] texture_storage_1d; + // var a : texture_storage_1d; + // var b : texture_storage_1d; // a = b; auto make_type = [&] { - auto* tex_type = ty.storage_texture(ast::TextureDimension::k1d, - ast::ImageFormat::kRgba8Unorm); - return ty.access(ast::AccessControl::kRead, tex_type); + return ty.storage_texture(ast::TextureDimension::k1d, + ast::ImageFormat::kRgba8Unorm, + ast::Access::kRead); }; Global("a", make_type(), ast::StorageClass::kNone, @@ -182,7 +182,7 @@ TEST_F(ResolverAssignmentValidationTest, AssignNonStorable_Fail) { EXPECT_FALSE(r()->Resolve()); EXPECT_EQ( r()->error(), - R"(12:34 error: '[[access(read)]] texture_storage_1d' is not storable)"); + R"(12:34 error: 'texture_storage_1d' is not storable)"); } } // namespace diff --git a/src/resolver/decoration_validation_test.cc b/src/resolver/decoration_validation_test.cc index e24dc70332..1de719b092 100644 --- a/src/resolver/decoration_validation_test.cc +++ b/src/resolver/decoration_validation_test.cc @@ -30,7 +30,6 @@ namespace DecorationTests { namespace { enum class DecorationKind { - kAccess, kAlign, kBinding, kBuiltin, @@ -68,9 +67,6 @@ static ast::DecorationList createDecorations(const Source& source, ProgramBuilder& builder, DecorationKind kind) { switch (kind) { - case DecorationKind::kAccess: - return {builder.create(source, - ast::AccessControl::kRead)}; case DecorationKind::kAlign: return {builder.create(source, 4u)}; case DecorationKind::kBinding: @@ -122,8 +118,7 @@ TEST_P(FunctionReturnTypeDecorationTest, IsValid) { INSTANTIATE_TEST_SUITE_P( ResolverDecorationValidationTest, FunctionReturnTypeDecorationTest, - testing::Values(TestParams{DecorationKind::kAccess, false}, - TestParams{DecorationKind::kAlign, false}, + testing::Values(TestParams{DecorationKind::kAlign, false}, TestParams{DecorationKind::kBinding, false}, TestParams{DecorationKind::kBuiltin, true}, TestParams{DecorationKind::kGroup, false}, @@ -162,8 +157,7 @@ TEST_P(ArrayDecorationTest, IsValid) { INSTANTIATE_TEST_SUITE_P( ResolverDecorationValidationTest, ArrayDecorationTest, - testing::Values(TestParams{DecorationKind::kAccess, false}, - TestParams{DecorationKind::kAlign, false}, + testing::Values(TestParams{DecorationKind::kAlign, false}, TestParams{DecorationKind::kBinding, false}, TestParams{DecorationKind::kBuiltin, false}, TestParams{DecorationKind::kGroup, false}, @@ -197,8 +191,7 @@ TEST_P(StructDecorationTest, IsValid) { INSTANTIATE_TEST_SUITE_P( ResolverDecorationValidationTest, StructDecorationTest, - testing::Values(TestParams{DecorationKind::kAccess, false}, - TestParams{DecorationKind::kAlign, false}, + testing::Values(TestParams{DecorationKind::kAlign, false}, TestParams{DecorationKind::kBinding, false}, TestParams{DecorationKind::kBuiltin, false}, TestParams{DecorationKind::kGroup, false}, @@ -234,8 +227,7 @@ TEST_P(StructMemberDecorationTest, IsValid) { INSTANTIATE_TEST_SUITE_P( ResolverDecorationValidationTest, StructMemberDecorationTest, - testing::Values(TestParams{DecorationKind::kAccess, false}, - TestParams{DecorationKind::kAlign, true}, + testing::Values(TestParams{DecorationKind::kAlign, true}, TestParams{DecorationKind::kBinding, false}, TestParams{DecorationKind::kBuiltin, true}, TestParams{DecorationKind::kGroup, false}, @@ -277,8 +269,7 @@ TEST_P(VariableDecorationTest, IsValid) { INSTANTIATE_TEST_SUITE_P( ResolverDecorationValidationTest, VariableDecorationTest, - testing::Values(TestParams{DecorationKind::kAccess, false}, - TestParams{DecorationKind::kAlign, false}, + testing::Values(TestParams{DecorationKind::kAlign, false}, TestParams{DecorationKind::kBinding, false}, TestParams{DecorationKind::kBuiltin, true}, TestParams{DecorationKind::kGroup, false}, @@ -312,8 +303,7 @@ TEST_P(ConstantDecorationTest, IsValid) { INSTANTIATE_TEST_SUITE_P( ResolverDecorationValidationTest, ConstantDecorationTest, - testing::Values(TestParams{DecorationKind::kAccess, false}, - TestParams{DecorationKind::kAlign, false}, + testing::Values(TestParams{DecorationKind::kAlign, false}, TestParams{DecorationKind::kBinding, false}, TestParams{DecorationKind::kBuiltin, false}, TestParams{DecorationKind::kGroup, false}, @@ -346,8 +336,7 @@ TEST_P(FunctionDecorationTest, IsValid) { INSTANTIATE_TEST_SUITE_P( ResolverDecorationValidationTest, FunctionDecorationTest, - testing::Values(TestParams{DecorationKind::kAccess, false}, - TestParams{DecorationKind::kAlign, false}, + testing::Values(TestParams{DecorationKind::kAlign, false}, TestParams{DecorationKind::kBinding, false}, TestParams{DecorationKind::kBuiltin, false}, TestParams{DecorationKind::kGroup, false}, @@ -523,8 +512,8 @@ TEST_F(ResourceDecorationTest, UniformBufferMissingBinding) { TEST_F(ResourceDecorationTest, StorageBufferMissingBinding) { auto* s = Structure("S", {Member("x", ty.i32())}, {create()}); - auto* ac = ty.access(ast::AccessControl::kRead, s); - Global(Source{{12, 34}}, "G", ac, ast::StorageClass::kStorage); + Global(Source{{12, 34}}, "G", s, ast::StorageClass::kStorage, + ast::Access::kRead); EXPECT_FALSE(r()->Resolve()); EXPECT_EQ(r()->error(), diff --git a/src/resolver/host_shareable_validation_test.cc b/src/resolver/host_shareable_validation_test.cc index bb73ad9ac1..57e6fbc56d 100644 --- a/src/resolver/host_shareable_validation_test.cc +++ b/src/resolver/host_shareable_validation_test.cc @@ -28,8 +28,9 @@ using ResolverHostShareableValidationTest = ResolverTest; TEST_F(ResolverHostShareableValidationTest, BoolMember) { auto* s = Structure("S", {Member(Source{{12, 34}}, "x", ty.bool_())}, {create()}); - auto* a = ty.access(ast::AccessControl::kRead, s); - Global(Source{{56, 78}}, "g", a, ast::StorageClass::kStorage, + + Global(Source{{56, 78}}, "g", s, ast::StorageClass::kStorage, + ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -47,8 +48,9 @@ TEST_F(ResolverHostShareableValidationTest, BoolMember) { TEST_F(ResolverHostShareableValidationTest, BoolVectorMember) { auto* s = Structure("S", {Member(Source{{12, 34}}, "x", ty.vec3())}, {create()}); - auto* a = ty.access(ast::AccessControl::kRead, s); - Global(Source{{56, 78}}, "g", a, ast::StorageClass::kStorage, + + Global(Source{{56, 78}}, "g", s, ast::StorageClass::kStorage, + ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -68,10 +70,10 @@ TEST_F(ResolverHostShareableValidationTest, Aliases) { AST().AddConstructedType(a1); auto* s = Structure("S", {Member(Source{{12, 34}}, "x", a1)}, {create()}); - auto* ac = ty.access(ast::AccessControl::kRead, s); - auto* a2 = ty.alias("a2", ac); + auto* a2 = ty.alias("a2", s); AST().AddConstructedType(a2); Global(Source{{56, 78}}, "g", a2, ast::StorageClass::kStorage, + ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -93,8 +95,9 @@ TEST_F(ResolverHostShareableValidationTest, NestedStructures) { auto* s = Structure("S", {Member(Source{{7, 8}}, "m", i3)}, {create()}); - auto* a = ty.access(ast::AccessControl::kRead, s); - Global(Source{{9, 10}}, "g", a, ast::StorageClass::kStorage, + + Global(Source{{9, 10}}, "g", s, ast::StorageClass::kStorage, + ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -135,8 +138,9 @@ TEST_F(ResolverHostShareableValidationTest, NoError) { auto* s = Structure("S", {Member(Source{{7, 8}}, "m", i3)}, {create()}); - auto* a = ty.access(ast::AccessControl::kRead, s); - Global(Source{{9, 10}}, "g", a, ast::StorageClass::kStorage, + + Global(Source{{9, 10}}, "g", s, ast::StorageClass::kStorage, + ast::Access::kRead, ast::DecorationList{ create(0), create(0), diff --git a/src/resolver/intrinsic_test.cc b/src/resolver/intrinsic_test.cc index 701796f59e..39d1b18d25 100644 --- a/src/resolver/intrinsic_test.cc +++ b/src/resolver/intrinsic_test.cc @@ -276,12 +276,11 @@ TEST_P(ResolverIntrinsicTest_StorageTextureOperation, TextureLoadRo) { auto format = GetParam().format; auto* coords_type = GetCoordsType(dim, ty.i32()); - auto* texture_type = ty.storage_texture(dim, format); - auto* ro_texture_type = ty.access(ast::AccessControl::kRead, texture_type); + auto* texture_type = ty.storage_texture(dim, format, ast::Access::kRead); ast::ExpressionList call_params; - add_call_param("texture", ro_texture_type, &call_params); + add_call_param("texture", texture_type, &call_params); add_call_param("coords", coords_type, &call_params); if (ast::IsTextureArray(dim)) { @@ -769,8 +768,7 @@ TEST_F(ResolverIntrinsicDataTest, ArrayLength_Vector) { auto* ary = ty.array(); auto* str = Structure("S", {Member("x", ary)}, {create()}); - auto* ac = ty.access(ast::AccessControl::kRead, str); - Global("a", ac, ast::StorageClass::kStorage, + Global("a", str, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(0), diff --git a/src/resolver/resolver.cc b/src/resolver/resolver.cc index 9f81e32c4c..14f4b7df1d 100644 --- a/src/resolver/resolver.cc +++ b/src/resolver/resolver.cc @@ -287,13 +287,6 @@ sem::Type* Resolver::Type(const ast::Type* ty) { if (ty->Is()) { return builder_->create(); } - if (auto* t = ty->As()) { - TINT_SCOPED_ASSIGNMENT(current_access_control_, t); - if (auto* el = Type(t->type())) { - return el; - } - return nullptr; - } if (auto* t = ty->As()) { if (auto* el = Type(t->type())) { return builder_->create(const_cast(el), @@ -341,14 +334,11 @@ sem::Type* Resolver::Type(const ast::Type* ty) { } if (auto* t = ty->As()) { if (auto* el = Type(t->type())) { - if (!current_access_control_) { - diagnostics_.add_error("storage textures must have access control", - t->source()); + if (!ValidateStorageTexture(t)) { return nullptr; } return builder_->create( - t->dim(), t->image_format(), - current_access_control_->access_control(), + t->dim(), t->image_format(), t->access(), const_cast(el)); } return nullptr; @@ -377,6 +367,39 @@ sem::Type* Resolver::Type(const ast::Type* ty) { return s; } +bool Resolver::ValidateStorageTexture(const ast::StorageTexture* t) { + switch (t->access()) { + case ast::Access::kUndefined: + diagnostics_.add_error("storage textures must have access control", + t->source()); + return false; + case ast::Access::kReadWrite: + diagnostics_.add_error( + "storage textures only support read-only and write-only access", + t->source()); + return false; + + case ast::Access::kRead: + case ast::Access::kWrite: + break; + } + + if (!IsValidStorageTextureDimension(t->dim())) { + diagnostics_.add_error( + "cube dimensions for storage textures are not supported", t->source()); + return false; + } + + if (!IsValidStorageTextureImageFormat(t->image_format())) { + diagnostics_.add_error( + "image format must be one of the texel formats specified for storage " + "textues in https://gpuweb.github.io/gpuweb/wgsl/#texel-formats", + t->source()); + return false; + } + return true; +} + Resolver::VariableInfo* Resolver::Variable(ast::Variable* var, VariableKind kind) { if (variable_to_info_.count(var)) { @@ -466,35 +489,17 @@ Resolver::VariableInfo* Resolver::Variable(ast::Variable* var, return nullptr; } - // TODO(crbug.com/tint/802): Temporary while ast::AccessControl exits. - auto find_first_access_control = - [this](const ast::Type* ty) -> const ast::AccessControl* { - if (ty == nullptr) { - return nullptr; - } - if (const ast::AccessControl* ac = ty->As()) { - return ac; - } - while (auto* tn = ty->As()) { - auto it = named_type_info_.find(tn->name()); - if (it == named_type_info_.end()) { - break; - } - auto* alias = it->second.ast->As(); - if (!alias) { - break; - } - ty = alias->type(); - if (auto* ac = ty->As()) { - return ac; - } - } - return nullptr; - }; + auto access = var->declared_access(); + if (access == ast::Access::kUndefined && + storage_class == ast::StorageClass::kStorage) { + // https://gpuweb.github.io/gpuweb/wgsl/#access-mode-defaults + // For the storage storage class, the access mode is optional, and defaults + // to read. + access = ast::Access::kRead; + } - auto* access_control = find_first_access_control(var->type()); auto* info = variable_infos_.Create(var, const_cast(type), - type_name, storage_class, access_control); + type_name, storage_class, access); variable_to_info_.emplace(var, info); return info; @@ -658,25 +663,31 @@ bool Resolver::ValidateGlobalVariable(const VariableInfo* info) { } } + // https://gpuweb.github.io/gpuweb/wgsl/#variable-declaration + // The access mode always has a default, and except for variables in the + // storage storage class, must not be written. + if (info->storage_class != ast::StorageClass::kStorage && + info->declaration->declared_access() != ast::Access::kUndefined) { + diagnostics_.add_error( + "variables declared not declared in the storage class must " + "not declare an access control", + info->declaration->source()); + return false; + } + switch (info->storage_class) { case ast::StorageClass::kStorage: { - // https://gpuweb.github.io/gpuweb/wgsl/#variable-declaration - // Variables in the storage storage class and variables with a storage - // texture type must have an access attribute applied to the store type. - // https://gpuweb.github.io/gpuweb/wgsl/#module-scope-variables // A variable in the storage storage class is a storage buffer variable. // Its store type must be a host-shareable structure type with block // attribute, satisfying the storage class constraints. - auto* str = info->access_control - ? info->type->UnwrapRef()->As() - : nullptr; + auto* str = info->type->UnwrapRef()->As(); if (!str) { diagnostics_.add_error( - "variables declared in the storage class must be of an " - "[[access]] qualified structure type", + "variables declared in the storage class must be of a " + "structure type", info->declaration->source()); return false; } @@ -756,33 +767,6 @@ bool Resolver::ValidateVariable(const VariableInfo* info) { } } - if (auto* storage_tex = info->type->UnwrapRef()->As()) { - if (info->access_control->access_control() == - ast::AccessControl::kReadWrite) { - diagnostics_.add_error( - "storage textures only support read-only and write-only access", - var->source()); - return false; - } - - if (!IsValidStorageTextureDimension(storage_tex->dim())) { - diagnostics_.add_error( - "cube dimensions for storage textures are not " - "supported", - var->source()); - return false; - } - - if (!IsValidStorageTextureImageFormat(storage_tex->image_format())) { - diagnostics_.add_error( - "image format must be one of the texel formats specified for " - "storage textues in " - "https://gpuweb.github.io/gpuweb/wgsl/#texel-formats", - var->source()); - return false; - } - } - if (storage_type->is_handle() && var->declared_storage_class() != ast::StorageClass::kNone) { // https://gpuweb.github.io/gpuweb/wgsl/#module-scope-variables @@ -2584,9 +2568,7 @@ void Resolver::CreateSemanticNodes() const { sem_var = builder_->create(var, info->type, constant_id); } else { sem_var = builder_->create( - var, info->type, info->storage_class, - info->access_control ? info->access_control->access_control() - : ast::AccessControl::kReadWrite); + var, info->type, info->storage_class, info->access); } std::vector users; @@ -3274,12 +3256,12 @@ Resolver::VariableInfo::VariableInfo(const ast::Variable* decl, sem::Type* ty, const std::string& tn, ast::StorageClass sc, - const ast::AccessControl* ac) + ast::Access ac) : declaration(decl), type(ty), type_name(tn), storage_class(sc), - access_control(ac) {} + access(ac) {} Resolver::VariableInfo::~VariableInfo() = default; diff --git a/src/resolver/resolver.h b/src/resolver/resolver.h index 2efdf7cd23..4b893bf767 100644 --- a/src/resolver/resolver.h +++ b/src/resolver/resolver.h @@ -89,14 +89,14 @@ class Resolver { sem::Type* type, const std::string& type_name, ast::StorageClass storage_class, - const ast::AccessControl* ac); + ast::Access ac); ~VariableInfo(); ast::Variable const* const declaration; sem::Type* type; std::string const type_name; ast::StorageClass storage_class; - ast::AccessControl const* const access_control; + ast::Access const access; std::vector users; sem::BindingPoint binding_point; }; @@ -255,6 +255,7 @@ class Resolver { const sem::Matrix* matrix_type); bool ValidateParameter(const VariableInfo* info); bool ValidateReturn(const ast::ReturnStatement* ret); + bool ValidateStorageTexture(const ast::StorageTexture* t); bool ValidateStructure(const sem::Struct* str); bool ValidateSwitch(const ast::SwitchStatement* s); bool ValidateVariable(const VariableInfo* info); @@ -394,7 +395,6 @@ class Resolver { FunctionInfo* current_function_ = nullptr; sem::Statement* current_statement_ = nullptr; - const ast::AccessControl* current_access_control_ = nullptr; BlockAllocator variable_infos_; BlockAllocator function_infos_; }; diff --git a/src/resolver/resolver_test.cc b/src/resolver/resolver_test.cc index 84935c4e6b..ba3ef08763 100644 --- a/src/resolver/resolver_test.cc +++ b/src/resolver/resolver_test.cc @@ -784,15 +784,15 @@ TEST_F(ResolverTest, Function_Parameters) { TEST_F(ResolverTest, Function_RegisterInputOutputVariables) { auto* s = Structure("S", {Member("m", ty.u32())}, {create()}); - auto* a = ty.access(ast::AccessControl::kRead, s); auto* in_var = Global("in_var", ty.f32(), ast::StorageClass::kInput); auto* out_var = Global("out_var", ty.f32(), ast::StorageClass::kOutput); - auto* sb_var = Global("sb_var", a, ast::StorageClass::kStorage, - ast::DecorationList{ - create(0), - create(0), - }); + auto* sb_var = + Global("sb_var", s, ast::StorageClass::kStorage, ast::Access::kRead, + ast::DecorationList{ + create(0), + create(0), + }); auto* wg_var = Global("wg_var", ty.f32(), ast::StorageClass::kWorkgroup); auto* priv_var = Global("priv_var", ty.f32(), ast::StorageClass::kPrivate); @@ -823,15 +823,15 @@ TEST_F(ResolverTest, Function_RegisterInputOutputVariables) { TEST_F(ResolverTest, Function_RegisterInputOutputVariables_SubFunction) { auto* s = Structure("S", {Member("m", ty.u32())}, {create()}); - auto* a = ty.access(ast::AccessControl::kRead, s); auto* in_var = Global("in_var", ty.f32(), ast::StorageClass::kInput); auto* out_var = Global("out_var", ty.f32(), ast::StorageClass::kOutput); - auto* sb_var = Global("sb_var", a, ast::StorageClass::kStorage, - ast::DecorationList{ - create(0), - create(0), - }); + auto* sb_var = + Global("sb_var", s, ast::StorageClass::kStorage, ast::Access::kRead, + ast::DecorationList{ + create(0), + create(0), + }); auto* wg_var = Global("wg_var", ty.f32(), ast::StorageClass::kWorkgroup); auto* priv_var = Global("priv_var", ty.f32(), ast::StorageClass::kPrivate); @@ -1757,8 +1757,7 @@ TEST_F(ResolverTest, StorageClass_SetForSampler) { TEST_F(ResolverTest, StorageClass_SetForTexture) { auto* t = ty.sampled_texture(ast::TextureDimension::k1d, ty.f32()); - auto* ac = ty.access(ast::AccessControl::kRead, t); - auto* var = Global("var", ac, + auto* var = Global("var", t, ast::DecorationList{ create(0), create(0), @@ -1780,6 +1779,22 @@ TEST_F(ResolverTest, StorageClass_DoesNotSetOnConst) { EXPECT_EQ(Sem().Get(var)->StorageClass(), ast::StorageClass::kNone); } +TEST_F(ResolverTest, Access_SetForStorageBuffer) { + // [[block]] struct S { x : i32 }; + // var g : S; + auto* s = Structure("S", {Member(Source{{12, 34}}, "x", ty.i32())}, + {create()}); + auto* var = Global(Source{{56, 78}}, "g", s, ast::StorageClass::kStorage, + ast::DecorationList{ + create(0), + create(0), + }); + + EXPECT_TRUE(r()->Resolve()) << r()->error(); + + EXPECT_EQ(Sem().Get(var)->Access(), ast::Access::kRead); +} + TEST_F(ResolverTest, Function_EntryPoints_StageDecoration) { // fn b() {} // fn c() { b(); } diff --git a/src/resolver/resolver_test_helper.h b/src/resolver/resolver_test_helper.h index 675fa33889..3597e27566 100644 --- a/src/resolver/resolver_test_helper.h +++ b/src/resolver/resolver_test_helper.h @@ -226,12 +226,6 @@ ast::Type* ast_alias(const ProgramBuilder::TypesBuilder& ty) { return ty.builder->create(name); } -template -ast::Type* ast_access(const ProgramBuilder::TypesBuilder& ty) { - auto* type = create_type(ty); - return ty.access(ast::AccessControl::kRead, type); -} - inline sem::Type* sem_bool(const ProgramBuilder::TypesBuilder& ty) { return ty.builder->create(); } diff --git a/src/resolver/storage_class_validation_test.cc b/src/resolver/storage_class_validation_test.cc index 67efdd7648..29c89459e3 100644 --- a/src/resolver/storage_class_validation_test.cc +++ b/src/resolver/storage_class_validation_test.cc @@ -46,7 +46,7 @@ TEST_F(ResolverStorageClassValidationTest, StorageBufferBool) { EXPECT_EQ( r()->error(), - R"(56:78 error: variables declared in the storage class must be of an [[access]] qualified structure type)"); + R"(56:78 error: variables declared in the storage class must be of a structure type)"); } TEST_F(ResolverStorageClassValidationTest, StorageBufferPointer) { @@ -62,15 +62,15 @@ TEST_F(ResolverStorageClassValidationTest, StorageBufferPointer) { EXPECT_EQ( r()->error(), - R"(56:78 error: variables declared in the storage class must be of an [[access]] qualified structure type)"); + R"(56:78 error: variables declared in the storage class must be of a structure type)"); } TEST_F(ResolverStorageClassValidationTest, StorageBufferArray) { - // var g : [[access(read)]] array; + // var g : array; auto* s = Structure("S", {Member("a", ty.f32())}); auto* a = ty.array(s, 3); - auto* ac = ty.access(ast::AccessControl::kRead, a); - Global(Source{{56, 78}}, "g", ac, ast::StorageClass::kStorage, + Global(Source{{56, 78}}, "g", a, ast::StorageClass::kStorage, + ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -80,12 +80,12 @@ TEST_F(ResolverStorageClassValidationTest, StorageBufferArray) { EXPECT_EQ( r()->error(), - R"(56:78 error: variables declared in the storage class must be of an [[access]] qualified structure type)"); + R"(56:78 error: variables declared in the storage class must be of a structure type)"); } TEST_F(ResolverStorageClassValidationTest, StorageBufferBoolAlias) { // type a = bool; - // var g : [[access(read)]] a; + // var g : a; auto* a = ty.alias("a", ty.bool_()); AST().AddConstructedType(a); Global(Source{{56, 78}}, "g", a, ast::StorageClass::kStorage, @@ -98,31 +98,15 @@ TEST_F(ResolverStorageClassValidationTest, StorageBufferBoolAlias) { EXPECT_EQ( r()->error(), - R"(56:78 error: variables declared in the storage class must be of an [[access]] qualified structure type)"); -} - -TEST_F(ResolverStorageClassValidationTest, StorageBufferNoAccessControl) { - // var g : S; - auto* s = Structure("S", {Member(Source{{12, 34}}, "x", ty.i32())}); - Global(Source{{56, 78}}, "g", s, ast::StorageClass::kStorage, - ast::DecorationList{ - create(0), - create(0), - }); - - ASSERT_FALSE(r()->Resolve()); - - EXPECT_EQ( - r()->error(), - R"(56:78 error: variables declared in the storage class must be of an [[access]] qualified structure type)"); + R"(56:78 error: variables declared in the storage class must be of a structure type)"); } TEST_F(ResolverStorageClassValidationTest, StorageBufferNoBlockDecoration) { // struct S { x : i32 }; - // var g : [[access(read)]] S; + // var g : S; auto* s = Structure(Source{{12, 34}}, "S", {Member("x", ty.i32())}); - auto* a = ty.access(ast::AccessControl::kRead, s); - Global(Source{{56, 78}}, "g", a, ast::StorageClass::kStorage, + Global(Source{{56, 78}}, "g", s, ast::StorageClass::kStorage, + ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -138,11 +122,11 @@ TEST_F(ResolverStorageClassValidationTest, StorageBufferNoBlockDecoration) { TEST_F(ResolverStorageClassValidationTest, StorageBufferNoError_Basic) { // [[block]] struct S { x : i32 }; - // var g : [[access(read)]] S; + // var g : S; auto* s = Structure("S", {Member(Source{{12, 34}}, "x", ty.i32())}, {create()}); - auto* a = ty.access(ast::AccessControl::kRead, s); - Global(Source{{56, 78}}, "g", a, ast::StorageClass::kStorage, + Global(Source{{56, 78}}, "g", s, ast::StorageClass::kStorage, + ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -154,16 +138,15 @@ TEST_F(ResolverStorageClassValidationTest, StorageBufferNoError_Basic) { TEST_F(ResolverStorageClassValidationTest, StorageBufferNoError_Aliases) { // [[block]] struct S { x : i32 }; // type a1 = S; - // type a2 = [[access(read)]] a1; - // var g : a2; + // var g : a1; auto* s = Structure("S", {Member(Source{{12, 34}}, "x", ty.i32())}, {create()}); auto* a1 = ty.alias("a1", s); AST().AddConstructedType(a1); - auto* ac = ty.access(ast::AccessControl::kRead, a1); - auto* a2 = ty.alias("a2", ac); + auto* a2 = ty.alias("a2", a1); AST().AddConstructedType(a2); Global(Source{{56, 78}}, "g", a2, ast::StorageClass::kStorage, + ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -206,11 +189,10 @@ TEST_F(ResolverStorageClassValidationTest, UniformBufferPointer) { } TEST_F(ResolverStorageClassValidationTest, UniformBufferArray) { - // var g : [[access(read)]] array; + // var g : array; auto* s = Structure("S", {Member("a", ty.f32())}); auto* a = ty.array(s, 3); - auto* ac = ty.access(ast::AccessControl::kRead, a); - Global(Source{{56, 78}}, "g", ac, ast::StorageClass::kUniform, + Global(Source{{56, 78}}, "g", a, ast::StorageClass::kUniform, ast::DecorationList{ create(0), create(0), @@ -225,7 +207,7 @@ TEST_F(ResolverStorageClassValidationTest, UniformBufferArray) { TEST_F(ResolverStorageClassValidationTest, UniformBufferBoolAlias) { // type a = bool; - // var g : [[access(read)]] a; + // var g : a; auto* a = ty.alias("a", ty.bool_()); AST().AddConstructedType(a); Global(Source{{56, 78}}, "g", a, ast::StorageClass::kUniform, diff --git a/src/resolver/struct_storage_class_use_test.cc b/src/resolver/struct_storage_class_use_test.cc index 46fe48d36f..7a83ab07fb 100644 --- a/src/resolver/struct_storage_class_use_test.cc +++ b/src/resolver/struct_storage_class_use_test.cc @@ -172,13 +172,12 @@ TEST_F(ResolverStorageClassUseTest, StructReachableViaLocalArray) { TEST_F(ResolverStorageClassUseTest, StructMultipleStorageClassUses) { auto* s = Structure("S", {Member("a", ty.f32())}, {create()}); - auto* ac = ty.access(ast::AccessControl::kRead, s); Global("x", s, ast::StorageClass::kUniform, ast::DecorationList{ create(0), create(0), }); - Global("y", ac, ast::StorageClass::kStorage, + Global("y", s, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(1), create(0), diff --git a/src/resolver/type_validation_test.cc b/src/resolver/type_validation_test.cc index 38375f82b2..c7882c067c 100644 --- a/src/resolver/type_validation_test.cc +++ b/src/resolver/type_validation_test.cc @@ -66,10 +66,10 @@ TEST_F(ResolverTypeValidationTest, GlobalVariableWithStorageClass_Pass) { TEST_F(ResolverTypeValidationTest, GlobalConstantWithStorageClass_Fail) { // const global_var: f32; - AST().AddGlobalVariable( - create(Source{{12, 34}}, Symbols().Register("global_var"), - ast::StorageClass::kInput, ty.f32(), true, - Expr(1.23f), ast::DecorationList{})); + AST().AddGlobalVariable(create( + Source{{12, 34}}, Symbols().Register("global_var"), + ast::StorageClass::kInput, ast::Access::kUndefined, ty.f32(), true, + Expr(1.23f), ast::DecorationList{})); EXPECT_FALSE(r()->Resolve()); EXPECT_EQ(r()->error(), @@ -393,11 +393,9 @@ static constexpr Params cases[] = { Params{ast_alias>>>>, sem_mat3x3}, - Params{ast_alias>>, sem_bool}, - Params{ast_alias>>>>, - sem_vec3}, - Params{ast_alias>>>>, - sem_mat3x3}, + Params{ast_alias>, sem_bool}, + Params{ast_alias>>, sem_vec3}, + Params{ast_alias>>, sem_mat3x3}, }; using CanonicalTest = ResolverTestWithParam; @@ -526,13 +524,13 @@ static constexpr DimensionParams Dimension_cases[] = { using StorageTextureDimensionTest = ResolverTestWithParam; TEST_P(StorageTextureDimensionTest, All) { // [[group(0), binding(0)]] - // var a : [[access(read)]] texture_storage_*; + // var a : texture_storage_*; auto& params = GetParam(); - auto* st = ty.storage_texture(params.dim, ast::ImageFormat::kR32Uint); - auto* ac = ty.access(ast::AccessControl::kRead, st); + auto* st = ty.storage_texture(Source{{12, 34}}, params.dim, + ast::ImageFormat::kR32Uint, ast::Access::kRead); - Global(Source{{12, 34}}, "a", ac, ast::StorageClass::kNone, nullptr, + Global("a", st, ast::StorageClass::kNone, ast::DecorationList{ create(0), create(0), @@ -597,42 +595,41 @@ using StorageTextureFormatTest = ResolverTestWithParam; TEST_P(StorageTextureFormatTest, All) { auto& params = GetParam(); // [[group(0), binding(0)]] - // var a : [[access(read)]] texture_storage_1d<*>; + // var a : texture_storage_1d<*, read>; // [[group(0), binding(1)]] - // var b : [[access(read)]] texture_storage_2d<*>; + // var b : texture_storage_2d<*, read>; // [[group(0), binding(2)]] - // var c : [[access(read)]] texture_storage_2d_array<*>; + // var c : texture_storage_2d_array<*, read>; // [[group(0), binding(3)]] - // var d : [[access(read)]] texture_storage_3d<*>; + // var d : texture_storage_3d<*, read>; - auto* st_a = ty.storage_texture(ast::TextureDimension::k1d, params.format); - auto* ac_a = ty.access(ast::AccessControl::kRead, st_a); - Global(Source{{12, 34}}, "a", ac_a, ast::StorageClass::kNone, nullptr, + auto* st_a = ty.storage_texture(Source{{12, 34}}, ast::TextureDimension::k1d, + params.format, ast::Access::kRead); + Global("a", st_a, ast::StorageClass::kNone, ast::DecorationList{ create(0), create(0), }); - auto* st_b = ty.storage_texture(ast::TextureDimension::k2d, params.format); - auto* ac_b = ty.access(ast::AccessControl::kRead, st_b); - Global("b", ac_b, ast::StorageClass::kNone, nullptr, + auto* st_b = ty.storage_texture(ast::TextureDimension::k2d, params.format, + ast::Access::kRead); + Global("b", st_b, ast::StorageClass::kNone, ast::DecorationList{ create(0), create(1), }); - auto* st_c = - ty.storage_texture(ast::TextureDimension::k2dArray, params.format); - auto* ac_c = ty.access(ast::AccessControl::kRead, st_c); - Global("c", ac_c, ast::StorageClass::kNone, nullptr, + auto* st_c = ty.storage_texture(ast::TextureDimension::k2dArray, + params.format, ast::Access::kRead); + Global("c", st_c, ast::StorageClass::kNone, ast::DecorationList{ create(0), create(2), }); - auto* st_d = ty.storage_texture(ast::TextureDimension::k3d, params.format); - auto* ac_d = ty.access(ast::AccessControl::kRead, st_d); - Global("d", ac_d, ast::StorageClass::kNone, nullptr, + auto* st_d = ty.storage_texture(ast::TextureDimension::k3d, params.format, + ast::Access::kRead); + Global("d", st_d, ast::StorageClass::kNone, ast::DecorationList{ create(0), create(3), @@ -652,16 +649,17 @@ INSTANTIATE_TEST_SUITE_P(ResolverTypeValidationTest, StorageTextureFormatTest, testing::ValuesIn(format_cases)); -using StorageTextureAccessControlTest = ResolverTest; +using StorageTextureAccessTest = ResolverTest; -TEST_F(StorageTextureAccessControlTest, MissingAccessControl_Fail) { +TEST_F(StorageTextureAccessTest, MissingAccess_Fail) { // [[group(0), binding(0)]] // var a : texture_storage_1d; - auto* st = ty.storage_texture(Source{{12, 34}}, ast::TextureDimension::k1d, - ast::ImageFormat::kR32Uint); + auto* st = + ty.storage_texture(Source{{12, 34}}, ast::TextureDimension::k1d, + ast::ImageFormat::kR32Uint, ast::Access::kUndefined); - Global("a", st, ast::StorageClass::kNone, nullptr, + Global("a", st, ast::StorageClass::kNone, ast::DecorationList{ create(0), create(0), @@ -672,15 +670,15 @@ TEST_F(StorageTextureAccessControlTest, MissingAccessControl_Fail) { "12:34 error: storage textures must have access control"); } -TEST_F(StorageTextureAccessControlTest, RWAccessControl_Fail) { +TEST_F(StorageTextureAccessTest, RWAccess_Fail) { // [[group(0), binding(0)]] - // var a : [[access(readwrite)]] texture_storage_1d; + // var a : texture_storage_1d; - auto* st = ty.storage_texture(ast::TextureDimension::k1d, - ast::ImageFormat::kR32Uint); - auto* ac = ty.access(ast::AccessControl::kReadWrite, st); + auto* st = + ty.storage_texture(Source{{12, 34}}, ast::TextureDimension::k1d, + ast::ImageFormat::kR32Uint, ast::Access::kReadWrite); - Global(Source{{12, 34}}, "a", ac, ast::StorageClass::kNone, nullptr, + Global("a", st, ast::StorageClass::kNone, nullptr, ast::DecorationList{ create(0), create(0), @@ -692,15 +690,14 @@ TEST_F(StorageTextureAccessControlTest, RWAccessControl_Fail) { "write-only access"); } -TEST_F(StorageTextureAccessControlTest, ReadOnlyAccessControl_Pass) { +TEST_F(StorageTextureAccessTest, ReadOnlyAccess_Pass) { // [[group(0), binding(0)]] - // var a : [[access(read)]] texture_storage_1d; + // var a : texture_storage_1d; auto* st = ty.storage_texture(ast::TextureDimension::k1d, - ast::ImageFormat::kR32Uint); - auto* ac = ty.access(ast::AccessControl::kRead, st); + ast::ImageFormat::kR32Uint, ast::Access::kRead); - Global("a", ac, ast::StorageClass::kNone, nullptr, + Global("a", st, ast::StorageClass::kNone, nullptr, ast::DecorationList{ create(0), create(0), @@ -709,15 +706,15 @@ TEST_F(StorageTextureAccessControlTest, ReadOnlyAccessControl_Pass) { EXPECT_TRUE(r()->Resolve()) << r()->error(); } -TEST_F(StorageTextureAccessControlTest, WriteOnlyAccessControl_Pass) { +TEST_F(StorageTextureAccessTest, WriteOnlyAccess_Pass) { // [[group(0), binding(0)]] - // var a : [[access(write)]] texture_storage_1d; + // var a : texture_storage_1d; - auto* st = ty.storage_texture(ast::TextureDimension::k1d, - ast::ImageFormat::kR32Uint); - auto* ac = ty.access(ast::AccessControl::kWrite, st); + auto* st = + ty.storage_texture(ast::TextureDimension::k1d, ast::ImageFormat::kR32Uint, + ast::Access::kWrite); - Global("a", ac, ast::StorageClass::kNone, nullptr, + Global("a", st, ast::StorageClass::kNone, nullptr, ast::DecorationList{ create(0), create(0), diff --git a/src/sem/storage_texture_type.cc b/src/sem/storage_texture_type.cc index ab6e270691..d690354721 100644 --- a/src/sem/storage_texture_type.cc +++ b/src/sem/storage_texture_type.cc @@ -23,12 +23,9 @@ namespace sem { StorageTexture::StorageTexture(ast::TextureDimension dim, ast::ImageFormat format, - ast::AccessControl::Access access_control, + ast::Access access, sem::Type* subtype) - : Base(dim), - image_format_(format), - access_control_(access_control), - subtype_(subtype) {} + : Base(dim), image_format_(format), access_(access), subtype_(subtype) {} StorageTexture::StorageTexture(StorageTexture&&) = default; @@ -37,14 +34,14 @@ StorageTexture::~StorageTexture() = default; std::string StorageTexture::type_name() const { std::ostringstream out; out << "__storage_texture_" << dim() << "_" << image_format_ << "_" - << access_control_; + << access_; return out.str(); } std::string StorageTexture::FriendlyName(const SymbolTable&) const { std::ostringstream out; - out << "texture_storage_" << dim() << "<" << image_format_ << ", " - << access_control_ << ">"; + out << "texture_storage_" << dim() << "<" << image_format_ << ", " << access_ + << ">"; return out.str(); } diff --git a/src/sem/storage_texture_type.h b/src/sem/storage_texture_type.h index 3a36743bb3..216ed280a0 100644 --- a/src/sem/storage_texture_type.h +++ b/src/sem/storage_texture_type.h @@ -17,7 +17,7 @@ #include -#include "src/ast/access_control.h" +#include "src/ast/access.h" #include "src/ast/storage_texture.h" #include "src/sem/texture_type.h" @@ -32,11 +32,11 @@ class StorageTexture : public Castable { /// Constructor /// @param dim the dimensionality of the texture /// @param format the image format of the texture - /// @param access_control the access control type of the texture + /// @param access the access control type of the texture /// @param subtype the storage subtype. Use SubtypeFor() to calculate this. StorageTexture(ast::TextureDimension dim, ast::ImageFormat format, - ast::AccessControl::Access access_control, + ast::Access access, sem::Type* subtype); /// Move constructor @@ -50,7 +50,7 @@ class StorageTexture : public Castable { ast::ImageFormat image_format() const { return image_format_; } /// @returns the access control - ast::AccessControl::Access access_control() const { return access_control_; } + ast::Access access() const { return access_; } /// @returns the name for this type std::string type_name() const override; @@ -67,7 +67,7 @@ class StorageTexture : public Castable { private: ast::ImageFormat const image_format_; - ast::AccessControl::Access const access_control_; + ast::Access const access_; Type* const subtype_; }; diff --git a/src/sem/storage_texture_type_test.cc b/src/sem/storage_texture_type_test.cc index 80a078fab2..8917af0003 100644 --- a/src/sem/storage_texture_type_test.cc +++ b/src/sem/storage_texture_type_test.cc @@ -30,7 +30,7 @@ TEST_F(StorageTextureTest, Dim) { StorageTexture::SubtypeFor(ast::ImageFormat::kRgba32Float, Types()); auto* s = create(ast::TextureDimension::k2dArray, ast::ImageFormat::kRgba32Float, - ast::AccessControl::kReadWrite, subtype); + ast::Access::kReadWrite, subtype); EXPECT_EQ(s->dim(), ast::TextureDimension::k2dArray); } @@ -39,7 +39,7 @@ TEST_F(StorageTextureTest, Format) { StorageTexture::SubtypeFor(ast::ImageFormat::kRgba32Float, Types()); auto* s = create(ast::TextureDimension::k2dArray, ast::ImageFormat::kRgba32Float, - ast::AccessControl::kReadWrite, subtype); + ast::Access::kReadWrite, subtype); EXPECT_EQ(s->image_format(), ast::ImageFormat::kRgba32Float); } @@ -48,7 +48,7 @@ TEST_F(StorageTextureTest, TypeName) { StorageTexture::SubtypeFor(ast::ImageFormat::kRgba32Float, Types()); auto* s = create(ast::TextureDimension::k2dArray, ast::ImageFormat::kRgba32Float, - ast::AccessControl::kReadWrite, subtype); + ast::Access::kReadWrite, subtype); EXPECT_EQ(s->type_name(), "__storage_texture_2d_array_rgba32float_read_write"); } @@ -58,7 +58,7 @@ TEST_F(StorageTextureTest, FriendlyName) { StorageTexture::SubtypeFor(ast::ImageFormat::kRgba32Float, Types()); auto* s = create(ast::TextureDimension::k2dArray, ast::ImageFormat::kRgba32Float, - ast::AccessControl::kReadWrite, subtype); + ast::Access::kReadWrite, subtype); EXPECT_EQ(s->FriendlyName(Symbols()), "texture_storage_2d_array"); } @@ -68,7 +68,7 @@ TEST_F(StorageTextureTest, F32) { sem::StorageTexture::SubtypeFor(ast::ImageFormat::kRgba32Float, Types()); Type* s = create(ast::TextureDimension::k2dArray, ast::ImageFormat::kRgba32Float, - ast::AccessControl::kReadWrite, subtype); + ast::Access::kReadWrite, subtype); auto program = Build(); @@ -83,7 +83,7 @@ TEST_F(StorageTextureTest, U32) { sem::StorageTexture::SubtypeFor(ast::ImageFormat::kRg32Uint, Types()); Type* s = create(ast::TextureDimension::k2dArray, ast::ImageFormat::kRg32Uint, - ast::AccessControl::kReadWrite, subtype); + ast::Access::kReadWrite, subtype); auto program = Build(); @@ -98,7 +98,7 @@ TEST_F(StorageTextureTest, I32) { sem::StorageTexture::SubtypeFor(ast::ImageFormat::kRgba32Sint, Types()); Type* s = create(ast::TextureDimension::k2dArray, ast::ImageFormat::kRgba32Sint, - ast::AccessControl::kReadWrite, subtype); + ast::Access::kReadWrite, subtype); auto program = Build(); diff --git a/src/sem/variable.cc b/src/sem/variable.cc index a8cd0119ef..305b4ac26e 100644 --- a/src/sem/variable.cc +++ b/src/sem/variable.cc @@ -26,11 +26,11 @@ namespace sem { Variable::Variable(const ast::Variable* declaration, const sem::Type* type, ast::StorageClass storage_class, - ast::AccessControl::Access access_control) + ast::Access access) : declaration_(declaration), type_(type), storage_class_(storage_class), - access_control_(access_control), + access_(access), is_pipeline_constant_(false) {} Variable::Variable(const ast::Variable* declaration, @@ -39,7 +39,7 @@ Variable::Variable(const ast::Variable* declaration, : declaration_(declaration), type_(type), storage_class_(ast::StorageClass::kNone), - access_control_(ast::AccessControl::kReadWrite), + access_(ast::Access::kReadWrite), is_pipeline_constant_(true), constant_id_(constant_id) {} diff --git a/src/sem/variable.h b/src/sem/variable.h index 2b2b2e7dbe..ebe9c49299 100644 --- a/src/sem/variable.h +++ b/src/sem/variable.h @@ -17,7 +17,7 @@ #include -#include "src/ast/access_control.h" +#include "src/ast/access.h" #include "src/ast/storage_class.h" #include "src/sem/expression.h" @@ -42,11 +42,11 @@ class Variable : public Castable { /// @param declaration the AST declaration node /// @param type the variable type /// @param storage_class the variable storage class - /// @param access_control the variable access control type + /// @param access the variable access control type Variable(const ast::Variable* declaration, const sem::Type* type, ast::StorageClass storage_class, - ast::AccessControl::Access access_control); + ast::Access access); /// Constructor for overridable pipeline constants /// @param declaration the AST declaration node @@ -69,7 +69,7 @@ class Variable : public Castable { ast::StorageClass StorageClass() const { return storage_class_; } /// @returns the access control for the variable - ast::AccessControl::Access AccessControl() const { return access_control_; } + ast::Access Access() const { return access_; } /// @returns the expressions that use the variable const std::vector& Users() const { return users_; } @@ -87,7 +87,7 @@ class Variable : public Castable { const ast::Variable* const declaration_; const sem::Type* const type_; ast::StorageClass const storage_class_; - ast::AccessControl::Access const access_control_; + ast::Access const access_; std::vector users_; const bool is_pipeline_constant_; const uint16_t constant_id_ = 0; diff --git a/src/transform/binding_remapper.cc b/src/transform/binding_remapper.cc index f89bfd9d98..3755fff1ea 100644 --- a/src/transform/binding_remapper.cc +++ b/src/transform/binding_remapper.cc @@ -112,13 +112,12 @@ Output BindingRemapper::Run(const Program* in, const DataMap& datamap) { // Replace any access controls. auto ac_it = remappings->access_controls.find(from); if (ac_it != remappings->access_controls.end()) { - ast::AccessControl::Access ac = ac_it->second; + ast::Access ac = ac_it->second; auto* ty = in->Sem().Get(var)->Type()->UnwrapRef(); ast::Type* inner_ty = CreateASTTypeFor(&ctx, ty); - auto* new_ty = ctx.dst->create(ac, inner_ty); auto* new_var = ctx.dst->create( ctx.Clone(var->source()), ctx.Clone(var->symbol()), - var->declared_storage_class(), new_ty, var->is_const(), + var->declared_storage_class(), ac, inner_ty, var->is_const(), ctx.Clone(var->constructor()), ctx.Clone(var->decorations())); ctx.Replace(var, new_var); } diff --git a/src/transform/binding_remapper.h b/src/transform/binding_remapper.h index 81efa25747..b271c1f497 100644 --- a/src/transform/binding_remapper.h +++ b/src/transform/binding_remapper.h @@ -17,7 +17,7 @@ #include -#include "src/ast/access_control.h" +#include "src/ast/access.h" #include "src/sem/binding_point.h" #include "src/transform/transform.h" @@ -35,8 +35,7 @@ class BindingRemapper : public Transform { using BindingPoints = std::unordered_map; /// AccessControls is a map of old binding point to new access control - using AccessControls = - std::unordered_map; + using AccessControls = std::unordered_map; /// Remappings is consumed by the BindingRemapper transform. /// Data holds information about shader usage and constant buffer offsets. diff --git a/src/transform/binding_remapper_test.cc b/src/transform/binding_remapper_test.cc index 2015a01b8c..ed8ce0aa73 100644 --- a/src/transform/binding_remapper_test.cc +++ b/src/transform/binding_remapper_test.cc @@ -30,9 +30,9 @@ TEST_F(BindingRemapperTest, NoRemappings) { struct S { }; -[[group(2), binding(1)]] var a : [[access(read)]] S; +[[group(2), binding(1)]] var a : S; -[[group(3), binding(2)]] var b : [[access(read)]] S; +[[group(3), binding(2)]] var b : S; [[stage(compute)]] fn f() { @@ -55,9 +55,9 @@ TEST_F(BindingRemapperTest, RemapBindingPoints) { struct S { }; -[[group(2), binding(1)]] var a : [[access(read)]] S; +[[group(2), binding(1)]] var a : S; -[[group(3), binding(2)]] var b : [[access(read)]] S; +[[group(3), binding(2)]] var b : S; [[stage(compute)]] fn f() { @@ -69,9 +69,9 @@ fn f() { struct S { }; -[[group(1), binding(2)]] var a : [[access(read)]] S; +[[group(1), binding(2)]] var a : S; -[[group(3), binding(2)]] var b : [[access(read)]] S; +[[group(3), binding(2)]] var b : S; [[stage(compute)]] fn f() { @@ -97,11 +97,11 @@ TEST_F(BindingRemapperTest, RemapAccessControls) { struct S { }; -[[group(2), binding(1)]] var a : [[access(read)]] S; +[[group(2), binding(1)]] var a : S; -[[group(3), binding(2)]] var b : [[access(write)]] S; +[[group(3), binding(2)]] var b : S; -[[group(4), binding(3)]] var c : [[access(read)]] S; +[[group(4), binding(3)]] var c : S; [[stage(compute)]] fn f() { @@ -113,11 +113,11 @@ fn f() { struct S { }; -[[group(2), binding(1)]] var a : [[access(write)]] S; +[[group(2), binding(1)]] var a : S; -[[group(3), binding(2)]] var b : [[access(write)]] S; +[[group(3), binding(2)]] var b : S; -[[group(4), binding(3)]] var c : [[access(read)]] S; +[[group(4), binding(3)]] var c : S; [[stage(compute)]] fn f() { @@ -128,9 +128,9 @@ fn f() { data.Add( BindingRemapper::BindingPoints{}, BindingRemapper::AccessControls{ - {{2, 1}, ast::AccessControl::kWrite}, // Modify access control + {{2, 1}, ast::Access::kWrite}, // Modify access control // Keep [[group(3), binding(2)]] as is - {{4, 3}, ast::AccessControl::kRead}, // Add access control + {{4, 3}, ast::Access::kRead}, // Add access control }); auto got = Run(src, data); @@ -145,9 +145,9 @@ TEST_F(BindingRemapperTest, DISABLED_RemapAccessControlsWithAliases) { struct S { }; -type ReadOnlyS = [[access(read)]] S; +type, read ReadOnlyS = S; -type WriteOnlyS = [[access(write)]] S; +type, write WriteOnlyS = S; type A = S; @@ -167,17 +167,17 @@ fn f() { struct S { }; -type ReadOnlyS = [[access(read)]] S; +type, read ReadOnlyS = S; -type WriteOnlyS = [[access(write)]] S; +type, write WriteOnlyS = S; type A = S; -[[group(2), binding(1)]] var a : [[access(write)]] S; +[[group(2), binding(1)]] var a : S; [[group(3), binding(2)]] var b : WriteOnlyS; -[[group(4), binding(3)]] var c : [[access(write)]] S; +[[group(4), binding(3)]] var c : S; [[stage(compute)]] fn f() { @@ -188,9 +188,9 @@ fn f() { data.Add( BindingRemapper::BindingPoints{}, BindingRemapper::AccessControls{ - {{2, 1}, ast::AccessControl::kWrite}, // Modify access control + {{2, 1}, ast::Access::kWrite}, // Modify access control // Keep [[group(3), binding(2)]] as is - {{4, 3}, ast::AccessControl::kRead}, // Add access control + {{4, 3}, ast::Access::kRead}, // Add access control }); auto got = Run(src, data); @@ -203,9 +203,9 @@ TEST_F(BindingRemapperTest, RemapAll) { struct S { }; -[[group(2), binding(1)]] var a : [[access(read)]] S; +[[group(2), binding(1)]] var a : S; -[[group(3), binding(2)]] var b : [[access(read)]] S; +[[group(3), binding(2)]] var b : S; [[stage(compute)]] fn f() { @@ -217,9 +217,9 @@ fn f() { struct S { }; -[[group(4), binding(5)]] var a : [[access(write)]] S; +[[group(4), binding(5)]] var a : S; -[[group(6), binding(7)]] var b : [[access(write)]] S; +[[group(6), binding(7)]] var b : S; [[stage(compute)]] fn f() { @@ -233,8 +233,8 @@ fn f() { {{3, 2}, {6, 7}}, }, BindingRemapper::AccessControls{ - {{2, 1}, ast::AccessControl::kWrite}, - {{3, 2}, ast::AccessControl::kWrite}, + {{2, 1}, ast::Access::kWrite}, + {{3, 2}, ast::Access::kWrite}, }); auto got = Run(src, data); @@ -248,13 +248,13 @@ struct S { i : i32; }; -[[group(2), binding(1)]] var a : [[access(read)]] S; +[[group(2), binding(1)]] var a : S; -[[group(3), binding(2)]] var b : [[access(read)]] S; +[[group(3), binding(2)]] var b : S; -[[group(4), binding(3)]] var c : [[access(read)]] S; +[[group(4), binding(3)]] var c : S; -[[group(5), binding(4)]] var d : [[access(read)]] S; +[[group(5), binding(4)]] var d : S; [[stage(compute)]] fn f() { @@ -268,13 +268,13 @@ struct S { i : i32; }; -[[internal(disable_validation__binding_point_collision), group(1), binding(1)]] var a : [[access(read)]] S; +[[internal(disable_validation__binding_point_collision), group(1), binding(1)]] var a : S; -[[internal(disable_validation__binding_point_collision), group(1), binding(1)]] var b : [[access(read)]] S; +[[internal(disable_validation__binding_point_collision), group(1), binding(1)]] var b : S; -[[internal(disable_validation__binding_point_collision), group(5), binding(4)]] var c : [[access(read)]] S; +[[internal(disable_validation__binding_point_collision), group(5), binding(4)]] var c : S; -[[internal(disable_validation__binding_point_collision), group(5), binding(4)]] var d : [[access(read)]] S; +[[internal(disable_validation__binding_point_collision), group(5), binding(4)]] var d : S; [[stage(compute)]] fn f() { @@ -302,13 +302,13 @@ struct S { i : i32; }; -[[group(2), binding(1)]] var a : [[access(read)]] S; +[[group(2), binding(1)]] var a : S; -[[group(3), binding(2)]] var b : [[access(read)]] S; +[[group(3), binding(2)]] var b : S; -[[group(4), binding(3)]] var c : [[access(read)]] S; +[[group(4), binding(3)]] var c : S; -[[group(5), binding(4)]] var d : [[access(read)]] S; +[[group(5), binding(4)]] var d : S; [[stage(compute)]] fn f1() { @@ -327,13 +327,13 @@ struct S { i : i32; }; -[[group(1), binding(1)]] var a : [[access(read)]] S; +[[group(1), binding(1)]] var a : S; -[[group(1), binding(1)]] var b : [[access(read)]] S; +[[group(1), binding(1)]] var b : S; -[[group(5), binding(4)]] var c : [[access(read)]] S; +[[group(5), binding(4)]] var c : S; -[[group(5), binding(4)]] var d : [[access(read)]] S; +[[group(5), binding(4)]] var d : S; [[stage(compute)]] fn f1() { @@ -365,8 +365,8 @@ TEST_F(BindingRemapperTest, NoData) { struct S { }; -[[group(2), binding(1)]] var a : [[access(read)]] S; -[[group(3), binding(2)]] var b : [[access(read)]] S; +[[group(2), binding(1)]] var a : S; +[[group(3), binding(2)]] var b : S; [[stage(compute)]] fn f() {} diff --git a/src/transform/bound_array_accessors_test.cc b/src/transform/bound_array_accessors_test.cc index b9120d4917..53e15d3458 100644 --- a/src/transform/bound_array_accessors_test.cc +++ b/src/transform/bound_array_accessors_test.cc @@ -540,7 +540,7 @@ struct S { a : f32; b : array; }; -[[group(0), binding(0)]] var s : [[access(read)]] S; +[[group(0), binding(0)]] var s : S; fn f() { var d : f32 = s.b[25]; @@ -554,7 +554,7 @@ struct S { b : array; }; -[[group(0), binding(0)]] var s : [[access(read)]] S; +[[group(0), binding(0)]] var s : S; fn f() { var d : f32 = s.b[min(u32(25), (arrayLength(s.b) - 1u))]; @@ -601,7 +601,7 @@ struct S { b : array; }; -[[group(0), binding(0)]] var s : [[access(read)]] S; +[[group(0), binding(0)]] var s : S; let c : u32 = 1u; @@ -619,7 +619,7 @@ struct S { b : array; }; -[[group(0), binding(0)]] var s : [[access(read)]] S; +[[group(0), binding(0)]] var s : S; let c : u32 = 1u; diff --git a/src/transform/calculate_array_length.cc b/src/transform/calculate_array_length.cc index e6becb424f..19490dfaa9 100644 --- a/src/transform/calculate_array_length.cc +++ b/src/transform/calculate_array_length.cc @@ -91,7 +91,8 @@ Output CalculateArrayLength::Run(const Program* in, const DataMap&) { // in order for HLSL to emit this as a ByteAddressBuffer. ctx.dst->create( ctx.dst->Sym("buffer"), ast::StorageClass::kStorage, - buffer_typename, true, nullptr, ast::DecorationList{}), + ast::Access::kUndefined, buffer_typename, true, nullptr, + ast::DecorationList{}), ctx.dst->Param("result", ctx.dst->ty.pointer(ctx.dst->ty.u32(), ast::StorageClass::kFunction)), diff --git a/src/transform/calculate_array_length_test.cc b/src/transform/calculate_array_length_test.cc index 30083c3c2b..557454b719 100644 --- a/src/transform/calculate_array_length_test.cc +++ b/src/transform/calculate_array_length_test.cc @@ -30,7 +30,7 @@ struct SB { arr : array; }; -[[group(0), binding(0)]] var sb : [[access(read)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -48,7 +48,7 @@ struct SB { [[internal(intrinsic_buffer_size)]] fn tint_symbol(buffer : SB, result : ptr) -[[group(0), binding(0)]] var sb : [[access(read)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -72,7 +72,7 @@ struct SB { arr : array; }; -[[group(0), binding(0)]] var sb : [[access(read)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -92,7 +92,7 @@ struct SB { [[internal(intrinsic_buffer_size)]] fn tint_symbol(buffer : SB, result : ptr) -[[group(0), binding(0)]] var sb : [[access(read)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -119,7 +119,7 @@ struct SB { arr : [[stride(64)]] array; }; -[[group(0), binding(0)]] var sb : [[access(read)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -138,7 +138,7 @@ struct SB { [[internal(intrinsic_buffer_size)]] fn tint_symbol(buffer : SB, result : ptr) -[[group(0), binding(0)]] var sb : [[access(read)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -162,7 +162,7 @@ struct SB { arr : array; }; -[[group(0), binding(0)]] var sb : [[access(read)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -186,7 +186,7 @@ struct SB { [[internal(intrinsic_buffer_size)]] fn tint_symbol(buffer : SB, result : ptr) -[[group(0), binding(0)]] var sb : [[access(read)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -225,9 +225,9 @@ struct SB2 { arr2 : array>; }; -[[group(0), binding(0)]] var sb1 : [[access(read)]] SB1; +[[group(0), binding(0)]] var sb1 : SB1; -[[group(0), binding(1)]] var sb2 : [[access(read)]] SB2; +[[group(0), binding(1)]] var sb2 : SB2; [[stage(compute)]] fn main() { @@ -256,9 +256,9 @@ struct SB2 { [[internal(intrinsic_buffer_size)]] fn tint_symbol_3(buffer : SB2, result : ptr) -[[group(0), binding(0)]] var sb1 : [[access(read)]] SB1; +[[group(0), binding(0)]] var sb1 : SB1; -[[group(0), binding(1)]] var sb2 : [[access(read)]] SB2; +[[group(0), binding(1)]] var sb2 : SB2; [[stage(compute)]] fn main() { diff --git a/src/transform/decompose_storage_access.cc b/src/transform/decompose_storage_access.cc index e718b137f2..c89288cb82 100644 --- a/src/transform/decompose_storage_access.cc +++ b/src/transform/decompose_storage_access.cc @@ -360,17 +360,6 @@ struct Store { StorageBufferAccess target; // The target for the write }; -ast::Type* MaybeCreateASTAccessControl(CloneContext* ctx, - const sem::VariableUser* var_user, - ast::Type* ty) { - if (var_user && - var_user->Variable()->StorageClass() == ast::StorageClass::kStorage) { - return ctx->dst->create( - var_user->Variable()->AccessControl(), ty); - } - return ty; -} - } // namespace /// State holds the current transform state @@ -431,14 +420,14 @@ struct DecomposeStorageAccess::State { const sem::VariableUser* var_user) { return utils::GetOrCreate(load_funcs, TypePair{buf_ty, el_ty}, [&] { auto* buf_ast_ty = CreateASTTypeFor(&ctx, buf_ty); - buf_ast_ty = MaybeCreateASTAccessControl(&ctx, var_user, buf_ast_ty); ast::VariableList params = { // Note: The buffer parameter requires the kStorage StorageClass in // order for HLSL to emit this as a ByteAddressBuffer. ctx.dst->create( - ctx.dst->Sym("buffer"), ast::StorageClass::kStorage, buf_ast_ty, - true, nullptr, ast::DecorationList{}), + ctx.dst->Sym("buffer"), ast::StorageClass::kStorage, + var_user->Variable()->Access(), buf_ast_ty, true, nullptr, + ast::DecorationList{}), ctx.dst->Param("offset", ctx.dst->ty.u32()), }; @@ -507,14 +496,14 @@ struct DecomposeStorageAccess::State { const sem::VariableUser* var_user) { return utils::GetOrCreate(store_funcs, TypePair{buf_ty, el_ty}, [&] { auto* buf_ast_ty = CreateASTTypeFor(&ctx, buf_ty); - buf_ast_ty = MaybeCreateASTAccessControl(&ctx, var_user, buf_ast_ty); auto* el_ast_ty = CreateASTTypeFor(&ctx, el_ty); ast::VariableList params{ // Note: The buffer parameter requires the kStorage StorageClass in // order for HLSL to emit this as a ByteAddressBuffer. ctx.dst->create( - ctx.dst->Sym("buffer"), ast::StorageClass::kStorage, buf_ast_ty, - true, nullptr, ast::DecorationList{}), + ctx.dst->Sym("buffer"), ast::StorageClass::kStorage, + var_user->Variable()->Access(), buf_ast_ty, true, nullptr, + ast::DecorationList{}), ctx.dst->Param("offset", ctx.dst->ty.u32()), ctx.dst->Param("value", el_ast_ty), }; diff --git a/src/transform/decompose_storage_access_test.cc b/src/transform/decompose_storage_access_test.cc index 62fa75c7ce..5d870f9175 100644 --- a/src/transform/decompose_storage_access_test.cc +++ b/src/transform/decompose_storage_access_test.cc @@ -50,7 +50,7 @@ struct SB { v : array, 2>; }; -[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -107,82 +107,82 @@ struct SB { }; [[internal(intrinsic_load_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol(buffer : [[access(read_write)]] SB, offset : u32) -> i32 +fn tint_symbol(buffer : SB, offset : u32) -> i32 [[internal(intrinsic_load_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_1(buffer : [[access(read_write)]] SB, offset : u32) -> u32 +fn tint_symbol_1(buffer : SB, offset : u32) -> u32 [[internal(intrinsic_load_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_2(buffer : [[access(read_write)]] SB, offset : u32) -> f32 +fn tint_symbol_2(buffer : SB, offset : u32) -> f32 [[internal(intrinsic_load_vec2_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_3(buffer : [[access(read_write)]] SB, offset : u32) -> vec2 +fn tint_symbol_3(buffer : SB, offset : u32) -> vec2 [[internal(intrinsic_load_vec2_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_4(buffer : [[access(read_write)]] SB, offset : u32) -> vec2 +fn tint_symbol_4(buffer : SB, offset : u32) -> vec2 [[internal(intrinsic_load_vec2_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_5(buffer : [[access(read_write)]] SB, offset : u32) -> vec2 +fn tint_symbol_5(buffer : SB, offset : u32) -> vec2 [[internal(intrinsic_load_vec3_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_6(buffer : [[access(read_write)]] SB, offset : u32) -> vec3 +fn tint_symbol_6(buffer : SB, offset : u32) -> vec3 [[internal(intrinsic_load_vec3_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_7(buffer : [[access(read_write)]] SB, offset : u32) -> vec3 +fn tint_symbol_7(buffer : SB, offset : u32) -> vec3 [[internal(intrinsic_load_vec3_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_8(buffer : [[access(read_write)]] SB, offset : u32) -> vec3 +fn tint_symbol_8(buffer : SB, offset : u32) -> vec3 [[internal(intrinsic_load_vec4_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_9(buffer : [[access(read_write)]] SB, offset : u32) -> vec4 +fn tint_symbol_9(buffer : SB, offset : u32) -> vec4 [[internal(intrinsic_load_vec4_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_10(buffer : [[access(read_write)]] SB, offset : u32) -> vec4 +fn tint_symbol_10(buffer : SB, offset : u32) -> vec4 [[internal(intrinsic_load_vec4_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_11(buffer : [[access(read_write)]] SB, offset : u32) -> vec4 +fn tint_symbol_11(buffer : SB, offset : u32) -> vec4 -fn tint_symbol_12(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x2 { +fn tint_symbol_12(buffer : SB, offset : u32) -> mat2x2 { return mat2x2(tint_symbol_5(buffer, (offset + 0u)), tint_symbol_5(buffer, (offset + 8u))); } -fn tint_symbol_13(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x3 { +fn tint_symbol_13(buffer : SB, offset : u32) -> mat2x3 { return mat2x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u))); } -fn tint_symbol_14(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x4 { +fn tint_symbol_14(buffer : SB, offset : u32) -> mat2x4 { return mat2x4(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 16u))); } -fn tint_symbol_15(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x2 { +fn tint_symbol_15(buffer : SB, offset : u32) -> mat3x2 { return mat3x2(tint_symbol_5(buffer, (offset + 0u)), tint_symbol_5(buffer, (offset + 8u)), tint_symbol_5(buffer, (offset + 16u))); } -fn tint_symbol_16(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x3 { +fn tint_symbol_16(buffer : SB, offset : u32) -> mat3x3 { return mat3x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 32u))); } -fn tint_symbol_17(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x4 { +fn tint_symbol_17(buffer : SB, offset : u32) -> mat3x4 { return mat3x4(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 16u)), tint_symbol_11(buffer, (offset + 32u))); } -fn tint_symbol_18(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x2 { +fn tint_symbol_18(buffer : SB, offset : u32) -> mat4x2 { return mat4x2(tint_symbol_5(buffer, (offset + 0u)), tint_symbol_5(buffer, (offset + 8u)), tint_symbol_5(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 24u))); } -fn tint_symbol_19(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x3 { +fn tint_symbol_19(buffer : SB, offset : u32) -> mat4x3 { return mat4x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 32u)), tint_symbol_8(buffer, (offset + 48u))); } -fn tint_symbol_20(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x4 { +fn tint_symbol_20(buffer : SB, offset : u32) -> mat4x4 { return mat4x4(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 16u)), tint_symbol_11(buffer, (offset + 32u)), tint_symbol_11(buffer, (offset + 48u))); } -fn tint_symbol_21(buffer : [[access(read_write)]] SB, offset : u32) -> array, 2> { +fn tint_symbol_21(buffer : SB, offset : u32) -> array, 2> { return array, 2>(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u))); } -[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -244,7 +244,7 @@ struct SB { v : array, 2>; }; -[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -301,101 +301,101 @@ struct SB { }; [[internal(intrinsic_store_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol(buffer : [[access(read_write)]] SB, offset : u32, value : i32) +fn tint_symbol(buffer : SB, offset : u32, value : i32) [[internal(intrinsic_store_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_1(buffer : [[access(read_write)]] SB, offset : u32, value : u32) +fn tint_symbol_1(buffer : SB, offset : u32, value : u32) [[internal(intrinsic_store_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_2(buffer : [[access(read_write)]] SB, offset : u32, value : f32) +fn tint_symbol_2(buffer : SB, offset : u32, value : f32) [[internal(intrinsic_store_vec2_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_3(buffer : [[access(read_write)]] SB, offset : u32, value : vec2) +fn tint_symbol_3(buffer : SB, offset : u32, value : vec2) [[internal(intrinsic_store_vec2_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_4(buffer : [[access(read_write)]] SB, offset : u32, value : vec2) +fn tint_symbol_4(buffer : SB, offset : u32, value : vec2) [[internal(intrinsic_store_vec2_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_5(buffer : [[access(read_write)]] SB, offset : u32, value : vec2) +fn tint_symbol_5(buffer : SB, offset : u32, value : vec2) [[internal(intrinsic_store_vec3_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_6(buffer : [[access(read_write)]] SB, offset : u32, value : vec3) +fn tint_symbol_6(buffer : SB, offset : u32, value : vec3) [[internal(intrinsic_store_vec3_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_7(buffer : [[access(read_write)]] SB, offset : u32, value : vec3) +fn tint_symbol_7(buffer : SB, offset : u32, value : vec3) [[internal(intrinsic_store_vec3_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_8(buffer : [[access(read_write)]] SB, offset : u32, value : vec3) +fn tint_symbol_8(buffer : SB, offset : u32, value : vec3) [[internal(intrinsic_store_vec4_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_9(buffer : [[access(read_write)]] SB, offset : u32, value : vec4) +fn tint_symbol_9(buffer : SB, offset : u32, value : vec4) [[internal(intrinsic_store_vec4_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_10(buffer : [[access(read_write)]] SB, offset : u32, value : vec4) +fn tint_symbol_10(buffer : SB, offset : u32, value : vec4) [[internal(intrinsic_store_vec4_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_11(buffer : [[access(read_write)]] SB, offset : u32, value : vec4) +fn tint_symbol_11(buffer : SB, offset : u32, value : vec4) -fn tint_symbol_12(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x2) { +fn tint_symbol_12(buffer : SB, offset : u32, value : mat2x2) { tint_symbol_5(buffer, (offset + 0u), value[0u]); tint_symbol_5(buffer, (offset + 8u), value[1u]); } -fn tint_symbol_13(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x3) { +fn tint_symbol_13(buffer : SB, offset : u32, value : mat2x3) { tint_symbol_8(buffer, (offset + 0u), value[0u]); tint_symbol_8(buffer, (offset + 16u), value[1u]); } -fn tint_symbol_14(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x4) { +fn tint_symbol_14(buffer : SB, offset : u32, value : mat2x4) { tint_symbol_11(buffer, (offset + 0u), value[0u]); tint_symbol_11(buffer, (offset + 16u), value[1u]); } -fn tint_symbol_15(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x2) { +fn tint_symbol_15(buffer : SB, offset : u32, value : mat3x2) { tint_symbol_5(buffer, (offset + 0u), value[0u]); tint_symbol_5(buffer, (offset + 8u), value[1u]); tint_symbol_5(buffer, (offset + 16u), value[2u]); } -fn tint_symbol_16(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x3) { +fn tint_symbol_16(buffer : SB, offset : u32, value : mat3x3) { tint_symbol_8(buffer, (offset + 0u), value[0u]); tint_symbol_8(buffer, (offset + 16u), value[1u]); tint_symbol_8(buffer, (offset + 32u), value[2u]); } -fn tint_symbol_17(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x4) { +fn tint_symbol_17(buffer : SB, offset : u32, value : mat3x4) { tint_symbol_11(buffer, (offset + 0u), value[0u]); tint_symbol_11(buffer, (offset + 16u), value[1u]); tint_symbol_11(buffer, (offset + 32u), value[2u]); } -fn tint_symbol_18(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x2) { +fn tint_symbol_18(buffer : SB, offset : u32, value : mat4x2) { tint_symbol_5(buffer, (offset + 0u), value[0u]); tint_symbol_5(buffer, (offset + 8u), value[1u]); tint_symbol_5(buffer, (offset + 16u), value[2u]); tint_symbol_5(buffer, (offset + 24u), value[3u]); } -fn tint_symbol_19(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x3) { +fn tint_symbol_19(buffer : SB, offset : u32, value : mat4x3) { tint_symbol_8(buffer, (offset + 0u), value[0u]); tint_symbol_8(buffer, (offset + 16u), value[1u]); tint_symbol_8(buffer, (offset + 32u), value[2u]); tint_symbol_8(buffer, (offset + 48u), value[3u]); } -fn tint_symbol_20(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x4) { +fn tint_symbol_20(buffer : SB, offset : u32, value : mat4x4) { tint_symbol_11(buffer, (offset + 0u), value[0u]); tint_symbol_11(buffer, (offset + 16u), value[1u]); tint_symbol_11(buffer, (offset + 32u), value[2u]); tint_symbol_11(buffer, (offset + 48u), value[3u]); } -fn tint_symbol_21(buffer : [[access(read_write)]] SB, offset : u32, value : array, 2>) { +fn tint_symbol_21(buffer : SB, offset : u32, value : array, 2>) { tint_symbol_8(buffer, (offset + 0u), value[0u]); tint_symbol_8(buffer, (offset + 16u), value[1u]); } -[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -457,7 +457,7 @@ struct SB { v : array, 2>; }; -[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -493,86 +493,86 @@ struct SB { }; [[internal(intrinsic_load_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol(buffer : [[access(read_write)]] SB, offset : u32) -> i32 +fn tint_symbol(buffer : SB, offset : u32) -> i32 [[internal(intrinsic_load_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_1(buffer : [[access(read_write)]] SB, offset : u32) -> u32 +fn tint_symbol_1(buffer : SB, offset : u32) -> u32 [[internal(intrinsic_load_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_2(buffer : [[access(read_write)]] SB, offset : u32) -> f32 +fn tint_symbol_2(buffer : SB, offset : u32) -> f32 [[internal(intrinsic_load_vec2_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_3(buffer : [[access(read_write)]] SB, offset : u32) -> vec2 +fn tint_symbol_3(buffer : SB, offset : u32) -> vec2 [[internal(intrinsic_load_vec2_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_4(buffer : [[access(read_write)]] SB, offset : u32) -> vec2 +fn tint_symbol_4(buffer : SB, offset : u32) -> vec2 [[internal(intrinsic_load_vec2_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_5(buffer : [[access(read_write)]] SB, offset : u32) -> vec2 +fn tint_symbol_5(buffer : SB, offset : u32) -> vec2 [[internal(intrinsic_load_vec3_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_6(buffer : [[access(read_write)]] SB, offset : u32) -> vec3 +fn tint_symbol_6(buffer : SB, offset : u32) -> vec3 [[internal(intrinsic_load_vec3_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_7(buffer : [[access(read_write)]] SB, offset : u32) -> vec3 +fn tint_symbol_7(buffer : SB, offset : u32) -> vec3 [[internal(intrinsic_load_vec3_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_8(buffer : [[access(read_write)]] SB, offset : u32) -> vec3 +fn tint_symbol_8(buffer : SB, offset : u32) -> vec3 [[internal(intrinsic_load_vec4_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_9(buffer : [[access(read_write)]] SB, offset : u32) -> vec4 +fn tint_symbol_9(buffer : SB, offset : u32) -> vec4 [[internal(intrinsic_load_vec4_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_10(buffer : [[access(read_write)]] SB, offset : u32) -> vec4 +fn tint_symbol_10(buffer : SB, offset : u32) -> vec4 [[internal(intrinsic_load_vec4_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_11(buffer : [[access(read_write)]] SB, offset : u32) -> vec4 +fn tint_symbol_11(buffer : SB, offset : u32) -> vec4 -fn tint_symbol_12(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x2 { +fn tint_symbol_12(buffer : SB, offset : u32) -> mat2x2 { return mat2x2(tint_symbol_5(buffer, (offset + 0u)), tint_symbol_5(buffer, (offset + 8u))); } -fn tint_symbol_13(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x3 { +fn tint_symbol_13(buffer : SB, offset : u32) -> mat2x3 { return mat2x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u))); } -fn tint_symbol_14(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x4 { +fn tint_symbol_14(buffer : SB, offset : u32) -> mat2x4 { return mat2x4(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 16u))); } -fn tint_symbol_15(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x2 { +fn tint_symbol_15(buffer : SB, offset : u32) -> mat3x2 { return mat3x2(tint_symbol_5(buffer, (offset + 0u)), tint_symbol_5(buffer, (offset + 8u)), tint_symbol_5(buffer, (offset + 16u))); } -fn tint_symbol_16(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x3 { +fn tint_symbol_16(buffer : SB, offset : u32) -> mat3x3 { return mat3x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 32u))); } -fn tint_symbol_17(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x4 { +fn tint_symbol_17(buffer : SB, offset : u32) -> mat3x4 { return mat3x4(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 16u)), tint_symbol_11(buffer, (offset + 32u))); } -fn tint_symbol_18(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x2 { +fn tint_symbol_18(buffer : SB, offset : u32) -> mat4x2 { return mat4x2(tint_symbol_5(buffer, (offset + 0u)), tint_symbol_5(buffer, (offset + 8u)), tint_symbol_5(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 24u))); } -fn tint_symbol_19(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x3 { +fn tint_symbol_19(buffer : SB, offset : u32) -> mat4x3 { return mat4x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 32u)), tint_symbol_8(buffer, (offset + 48u))); } -fn tint_symbol_20(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x4 { +fn tint_symbol_20(buffer : SB, offset : u32) -> mat4x4 { return mat4x4(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 16u)), tint_symbol_11(buffer, (offset + 32u)), tint_symbol_11(buffer, (offset + 48u))); } -fn tint_symbol_21(buffer : [[access(read_write)]] SB, offset : u32) -> array, 2> { +fn tint_symbol_21(buffer : SB, offset : u32) -> array, 2> { return array, 2>(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u))); } -fn tint_symbol_22(buffer : [[access(read_write)]] SB, offset : u32) -> SB { +fn tint_symbol_22(buffer : SB, offset : u32) -> SB { return SB(tint_symbol(buffer, (offset + 0u)), tint_symbol_1(buffer, (offset + 4u)), tint_symbol_2(buffer, (offset + 8u)), tint_symbol_3(buffer, (offset + 16u)), tint_symbol_4(buffer, (offset + 24u)), tint_symbol_5(buffer, (offset + 32u)), tint_symbol_6(buffer, (offset + 48u)), tint_symbol_7(buffer, (offset + 64u)), tint_symbol_8(buffer, (offset + 80u)), tint_symbol_9(buffer, (offset + 96u)), tint_symbol_10(buffer, (offset + 112u)), tint_symbol_11(buffer, (offset + 128u)), tint_symbol_12(buffer, (offset + 144u)), tint_symbol_13(buffer, (offset + 160u)), tint_symbol_14(buffer, (offset + 192u)), tint_symbol_15(buffer, (offset + 224u)), tint_symbol_16(buffer, (offset + 256u)), tint_symbol_17(buffer, (offset + 304u)), tint_symbol_18(buffer, (offset + 352u)), tint_symbol_19(buffer, (offset + 384u)), tint_symbol_20(buffer, (offset + 448u)), tint_symbol_21(buffer, (offset + 512u))); } -[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -613,7 +613,7 @@ struct SB { v : array, 2>; }; -[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -649,101 +649,101 @@ struct SB { }; [[internal(intrinsic_store_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol(buffer : [[access(read_write)]] SB, offset : u32, value : i32) +fn tint_symbol(buffer : SB, offset : u32, value : i32) [[internal(intrinsic_store_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_1(buffer : [[access(read_write)]] SB, offset : u32, value : u32) +fn tint_symbol_1(buffer : SB, offset : u32, value : u32) [[internal(intrinsic_store_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_2(buffer : [[access(read_write)]] SB, offset : u32, value : f32) +fn tint_symbol_2(buffer : SB, offset : u32, value : f32) [[internal(intrinsic_store_vec2_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_3(buffer : [[access(read_write)]] SB, offset : u32, value : vec2) +fn tint_symbol_3(buffer : SB, offset : u32, value : vec2) [[internal(intrinsic_store_vec2_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_4(buffer : [[access(read_write)]] SB, offset : u32, value : vec2) +fn tint_symbol_4(buffer : SB, offset : u32, value : vec2) [[internal(intrinsic_store_vec2_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_5(buffer : [[access(read_write)]] SB, offset : u32, value : vec2) +fn tint_symbol_5(buffer : SB, offset : u32, value : vec2) [[internal(intrinsic_store_vec3_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_6(buffer : [[access(read_write)]] SB, offset : u32, value : vec3) +fn tint_symbol_6(buffer : SB, offset : u32, value : vec3) [[internal(intrinsic_store_vec3_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_7(buffer : [[access(read_write)]] SB, offset : u32, value : vec3) +fn tint_symbol_7(buffer : SB, offset : u32, value : vec3) [[internal(intrinsic_store_vec3_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_8(buffer : [[access(read_write)]] SB, offset : u32, value : vec3) +fn tint_symbol_8(buffer : SB, offset : u32, value : vec3) [[internal(intrinsic_store_vec4_u32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_9(buffer : [[access(read_write)]] SB, offset : u32, value : vec4) +fn tint_symbol_9(buffer : SB, offset : u32, value : vec4) [[internal(intrinsic_store_vec4_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_10(buffer : [[access(read_write)]] SB, offset : u32, value : vec4) +fn tint_symbol_10(buffer : SB, offset : u32, value : vec4) [[internal(intrinsic_store_vec4_i32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol_11(buffer : [[access(read_write)]] SB, offset : u32, value : vec4) +fn tint_symbol_11(buffer : SB, offset : u32, value : vec4) -fn tint_symbol_12(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x2) { +fn tint_symbol_12(buffer : SB, offset : u32, value : mat2x2) { tint_symbol_5(buffer, (offset + 0u), value[0u]); tint_symbol_5(buffer, (offset + 8u), value[1u]); } -fn tint_symbol_13(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x3) { +fn tint_symbol_13(buffer : SB, offset : u32, value : mat2x3) { tint_symbol_8(buffer, (offset + 0u), value[0u]); tint_symbol_8(buffer, (offset + 16u), value[1u]); } -fn tint_symbol_14(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x4) { +fn tint_symbol_14(buffer : SB, offset : u32, value : mat2x4) { tint_symbol_11(buffer, (offset + 0u), value[0u]); tint_symbol_11(buffer, (offset + 16u), value[1u]); } -fn tint_symbol_15(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x2) { +fn tint_symbol_15(buffer : SB, offset : u32, value : mat3x2) { tint_symbol_5(buffer, (offset + 0u), value[0u]); tint_symbol_5(buffer, (offset + 8u), value[1u]); tint_symbol_5(buffer, (offset + 16u), value[2u]); } -fn tint_symbol_16(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x3) { +fn tint_symbol_16(buffer : SB, offset : u32, value : mat3x3) { tint_symbol_8(buffer, (offset + 0u), value[0u]); tint_symbol_8(buffer, (offset + 16u), value[1u]); tint_symbol_8(buffer, (offset + 32u), value[2u]); } -fn tint_symbol_17(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x4) { +fn tint_symbol_17(buffer : SB, offset : u32, value : mat3x4) { tint_symbol_11(buffer, (offset + 0u), value[0u]); tint_symbol_11(buffer, (offset + 16u), value[1u]); tint_symbol_11(buffer, (offset + 32u), value[2u]); } -fn tint_symbol_18(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x2) { +fn tint_symbol_18(buffer : SB, offset : u32, value : mat4x2) { tint_symbol_5(buffer, (offset + 0u), value[0u]); tint_symbol_5(buffer, (offset + 8u), value[1u]); tint_symbol_5(buffer, (offset + 16u), value[2u]); tint_symbol_5(buffer, (offset + 24u), value[3u]); } -fn tint_symbol_19(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x3) { +fn tint_symbol_19(buffer : SB, offset : u32, value : mat4x3) { tint_symbol_8(buffer, (offset + 0u), value[0u]); tint_symbol_8(buffer, (offset + 16u), value[1u]); tint_symbol_8(buffer, (offset + 32u), value[2u]); tint_symbol_8(buffer, (offset + 48u), value[3u]); } -fn tint_symbol_20(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x4) { +fn tint_symbol_20(buffer : SB, offset : u32, value : mat4x4) { tint_symbol_11(buffer, (offset + 0u), value[0u]); tint_symbol_11(buffer, (offset + 16u), value[1u]); tint_symbol_11(buffer, (offset + 32u), value[2u]); tint_symbol_11(buffer, (offset + 48u), value[3u]); } -fn tint_symbol_21(buffer : [[access(read_write)]] SB, offset : u32, value : array, 2>) { +fn tint_symbol_21(buffer : SB, offset : u32, value : array, 2>) { tint_symbol_8(buffer, (offset + 0u), value[0u]); tint_symbol_8(buffer, (offset + 16u), value[1u]); } -fn tint_symbol_22(buffer : [[access(read_write)]] SB, offset : u32, value : SB) { +fn tint_symbol_22(buffer : SB, offset : u32, value : SB) { tint_symbol(buffer, (offset + 0u), value.a); tint_symbol_1(buffer, (offset + 4u), value.b); tint_symbol_2(buffer, (offset + 8u), value.c); @@ -768,7 +768,7 @@ fn tint_symbol_22(buffer : [[access(read_write)]] SB, offset : u32, value : SB) tint_symbol_21(buffer, (offset + 512u), value.v); } -[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -802,7 +802,7 @@ struct SB { b : [[stride(256)]] array; }; -[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -838,9 +838,9 @@ struct SB { }; [[internal(intrinsic_load_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol(buffer : [[access(read_write)]] SB, offset : u32) -> f32 +fn tint_symbol(buffer : SB, offset : u32) -> f32 -[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -874,7 +874,7 @@ struct SB { b : [[stride(256)]] array; }; -[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -906,9 +906,9 @@ struct SB { }; [[internal(intrinsic_load_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol(buffer : [[access(read_write)]] SB, offset : u32) -> f32 +fn tint_symbol(buffer : SB, offset : u32) -> f32 -[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -953,7 +953,7 @@ struct SB { b : A2_Array; }; -[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { @@ -993,9 +993,9 @@ struct SB { }; [[internal(intrinsic_load_f32), internal(disable_validation__function_has_no_body)]] -fn tint_symbol(buffer : [[access(read_write)]] SB, offset : u32) -> f32 +fn tint_symbol(buffer : SB, offset : u32) -> f32 -[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; +[[group(0), binding(0)]] var sb : SB; [[stage(compute)]] fn main() { diff --git a/src/transform/external_texture_transform.cc b/src/transform/external_texture_transform.cc index 036c296f0c..81e4fab964 100644 --- a/src/transform/external_texture_transform.cc +++ b/src/transform/external_texture_transform.cc @@ -115,8 +115,9 @@ Output ExternalTextureTransform::Run(const Program* in, const DataMap&) { auto* clonedConstructor = ctx.Clone(var->constructor()); auto clonedDecorations = ctx.Clone(var->decorations()); auto* newVar = ctx.dst->create( - clonedSrc, clonedSym, var->declared_storage_class(), newType, - var->is_const(), clonedConstructor, clonedDecorations); + clonedSrc, clonedSym, var->declared_storage_class(), + var->declared_access(), newType, var->is_const(), clonedConstructor, + clonedDecorations); ctx.Replace(var, newVar); } diff --git a/src/transform/vertex_pulling.cc b/src/transform/vertex_pulling.cc index 296e2d8ea9..9f3b3bf5c2 100644 --- a/src/transform/vertex_pulling.cc +++ b/src/transform/vertex_pulling.cc @@ -214,10 +214,10 @@ struct State { ctx.dst->create(), }); for (uint32_t i = 0; i < cfg.vertex_state.size(); ++i) { - auto* access = ctx.dst->ty.access(ast::AccessControl::kRead, struct_type); // The decorated variable with struct type ctx.dst->Global( - GetVertexBufferName(i), access, ast::StorageClass::kStorage, nullptr, + GetVertexBufferName(i), struct_type, ast::StorageClass::kStorage, + ast::Access::kRead, ast::DecorationList{ ctx.dst->create(i), ctx.dst->create(cfg.pulling_group), diff --git a/src/transform/vertex_pulling_test.cc b/src/transform/vertex_pulling_test.cc index 1e6ff9ed00..04e5f6a8ec 100644 --- a/src/transform/vertex_pulling_test.cc +++ b/src/transform/vertex_pulling_test.cc @@ -121,7 +121,7 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : TintVertexData; [[stage(vertex)]] fn main([[builtin(vertex_index)]] tint_pulling_vertex_index : u32) -> [[builtin(position)]] vec4 { @@ -161,7 +161,7 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : TintVertexData; [[stage(vertex)]] fn main([[builtin(instance_index)]] tint_pulling_instance_index : u32) -> [[builtin(position)]] vec4 { @@ -201,7 +201,7 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(5)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; +[[binding(0), group(5)]] var tint_pulling_vertex_buffer_0 : TintVertexData; [[stage(vertex)]] fn main([[builtin(vertex_index)]] tint_pulling_vertex_index : u32) -> [[builtin(position)]] vec4 { @@ -246,7 +246,7 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : TintVertexData; struct Inputs { [[location(0)]] @@ -296,9 +296,9 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : TintVertexData; -[[binding(1), group(4)]] var tint_pulling_vertex_buffer_1 : [[access(read)]] TintVertexData; +[[binding(1), group(4)]] var tint_pulling_vertex_buffer_1 : TintVertexData; [[stage(vertex)]] fn main([[builtin(vertex_index)]] custom_vertex_index : u32, [[builtin(instance_index)]] custom_instance_index : u32) -> [[builtin(position)]] vec4 { @@ -358,9 +358,9 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : TintVertexData; -[[binding(1), group(4)]] var tint_pulling_vertex_buffer_1 : [[access(read)]] TintVertexData; +[[binding(1), group(4)]] var tint_pulling_vertex_buffer_1 : TintVertexData; struct tint_symbol { [[builtin(vertex_index)]] @@ -442,9 +442,9 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : TintVertexData; -[[binding(1), group(4)]] var tint_pulling_vertex_buffer_1 : [[access(read)]] TintVertexData; +[[binding(1), group(4)]] var tint_pulling_vertex_buffer_1 : TintVertexData; struct Inputs { [[location(0)]] @@ -511,7 +511,7 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : TintVertexData; [[stage(vertex)]] fn main([[builtin(vertex_index)]] tint_pulling_vertex_index : u32) -> [[builtin(position)]] vec4 { @@ -559,11 +559,11 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : TintVertexData; -[[binding(1), group(4)]] var tint_pulling_vertex_buffer_1 : [[access(read)]] TintVertexData; +[[binding(1), group(4)]] var tint_pulling_vertex_buffer_1 : TintVertexData; -[[binding(2), group(4)]] var tint_pulling_vertex_buffer_2 : [[access(read)]] TintVertexData; +[[binding(2), group(4)]] var tint_pulling_vertex_buffer_2 : TintVertexData; [[stage(vertex)]] fn main([[builtin(vertex_index)]] tint_pulling_vertex_index : u32) -> [[builtin(position)]] vec4 { @@ -617,7 +617,7 @@ struct TintVertexData { tint_vertex_data_1 : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0_1 : [[access(read)]] TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0_1 : TintVertexData; [[stage(vertex)]] fn main([[builtin(vertex_index)]] tint_pulling_vertex_index_1 : u32) -> [[builtin(position)]] vec4 { @@ -671,7 +671,7 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(5)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; +[[binding(0), group(5)]] var tint_pulling_vertex_buffer_0 : TintVertexData; var var_a : f32; @@ -720,9 +720,9 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : TintVertexData; -[[binding(1), group(4)]] var tint_pulling_vertex_buffer_1 : [[access(read)]] TintVertexData; +[[binding(1), group(4)]] var tint_pulling_vertex_buffer_1 : TintVertexData; var var_a : f32; @@ -787,7 +787,7 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : TintVertexData; var var_a : f32; diff --git a/src/writer/hlsl/generator_impl.cc b/src/writer/hlsl/generator_impl.cc index d25dc88cad..394017dbae 100644 --- a/src/writer/hlsl/generator_impl.cc +++ b/src/writer/hlsl/generator_impl.cc @@ -248,8 +248,8 @@ bool GeneratorImpl::EmitBitcast(std::ostream& pre, } out << "as"; - if (!EmitType(out, type, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) { + if (!EmitType(out, type, ast::StorageClass::kNone, ast::Access::kReadWrite, + "")) { return false; } out << "("; @@ -1303,8 +1303,8 @@ bool GeneratorImpl::EmitTypeConstructor(std::ostream& pre, if (brackets) { out << "{"; } else { - if (!EmitType(out, type, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) { + if (!EmitType(out, type, ast::StorageClass::kNone, ast::Access::kReadWrite, + "")) { return false; } out << "("; @@ -1566,7 +1566,7 @@ bool GeneratorImpl::EmitFunctionInternal(std::ostream& out, auto* func = builder_.Sem().Get(func_ast); if (!EmitType(out, func->ReturnType(), ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) { + ast::Access::kReadWrite, "")) { return false; } @@ -1633,7 +1633,7 @@ bool GeneratorImpl::EmitFunctionInternal(std::ostream& out, // buffers. These functions have a storage buffer parameter with // StorageClass::kStorage. This is required to correctly translate the // parameter to [RW]ByteAddressBuffer. - if (!EmitType(out, type, v->StorageClass(), v->AccessControl(), + if (!EmitType(out, type, v->StorageClass(), v->Access(), builder_.Symbols().NameFor(v->Declaration()->symbol()))) { return false; } @@ -1720,7 +1720,7 @@ bool GeneratorImpl::EmitEntryPointData( increment_indent(); make_indent(out); - if (!EmitType(out, type, var->StorageClass(), var->AccessControl(), "")) { + if (!EmitType(out, type, var->StorageClass(), var->Access(), "")) { return false; } out << " " << builder_.Symbols().NameFor(decl->symbol()) << ";" @@ -1746,15 +1746,13 @@ bool GeneratorImpl::EmitEntryPointData( } auto* type = var->Type()->UnwrapRef(); - if (!EmitType(out, type, ast::StorageClass::kStorage, var->AccessControl(), - "")) { + if (!EmitType(out, type, ast::StorageClass::kStorage, var->Access(), "")) { return false; } out << " " << builder_.Symbols().NameFor(decl->symbol()) - << RegisterAndSpace( - var->AccessControl() == ast::AccessControl::kRead ? 't' : 'u', - binding_point) + << RegisterAndSpace(var->Access() == ast::Access::kRead ? 't' : 'u', + binding_point) << ";" << std::endl; emitted_storagebuffer = true; } @@ -1781,7 +1779,7 @@ bool GeneratorImpl::EmitEntryPointData( auto* type = sem->Type()->UnwrapRef(); make_indent(out); - if (!EmitType(out, type, sem->StorageClass(), sem->AccessControl(), + if (!EmitType(out, type, sem->StorageClass(), sem->Access(), builder_.Symbols().NameFor(var->symbol()))) { return false; } @@ -1832,7 +1830,7 @@ bool GeneratorImpl::EmitEntryPointData( auto* type = sem->Type()->UnwrapRef(); make_indent(out); - if (!EmitType(out, type, sem->StorageClass(), sem->AccessControl(), + if (!EmitType(out, type, sem->StorageClass(), sem->Access(), builder_.Symbols().NameFor(var->symbol()))) { return false; } @@ -1903,8 +1901,7 @@ bool GeneratorImpl::EmitEntryPointData( auto name = builder_.Symbols().NameFor(decl->symbol()); auto* type = var->Type()->UnwrapRef(); - if (!EmitType(out, type, var->StorageClass(), var->AccessControl(), - name)) { + if (!EmitType(out, type, var->StorageClass(), var->Access(), name)) { return false; } if (!type->Is()) { @@ -1916,7 +1913,7 @@ bool GeneratorImpl::EmitEntryPointData( if (unwrapped_type->Is()) { register_space = "t"; if (auto* storage_tex = unwrapped_type->As()) { - if (storage_tex->access_control() != ast::AccessControl::kRead) { + if (storage_tex->access() != ast::Access::kRead) { register_space = "u"; } } @@ -2043,7 +2040,7 @@ bool GeneratorImpl::EmitEntryPointFunction(std::ostream& out, } first = false; - if (!EmitType(out, type, sem->StorageClass(), sem->AccessControl(), "")) { + if (!EmitType(out, type, sem->StorageClass(), sem->Access(), "")) { return false; } @@ -2111,8 +2108,8 @@ bool GeneratorImpl::EmitZeroValue(std::ostream& out, const sem::Type* type) { } else if (type->Is()) { out << "0u"; } else if (auto* vec = type->As()) { - if (!EmitType(out, type, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) { + if (!EmitType(out, type, ast::StorageClass::kNone, ast::Access::kReadWrite, + "")) { return false; } ScopedParen sp(out); @@ -2125,8 +2122,8 @@ bool GeneratorImpl::EmitZeroValue(std::ostream& out, const sem::Type* type) { } } } else if (auto* mat = type->As()) { - if (!EmitType(out, type, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) { + if (!EmitType(out, type, ast::StorageClass::kNone, ast::Access::kReadWrite, + "")) { return false; } ScopedParen sp(out); @@ -2326,10 +2323,10 @@ bool GeneratorImpl::EmitSwitch(std::ostream& out, ast::SwitchStatement* stmt) { bool GeneratorImpl::EmitType(std::ostream& out, const sem::Type* type, ast::StorageClass storage_class, - ast::AccessControl::Access access_control, + ast::Access access, const std::string& name) { if (storage_class == ast::StorageClass::kStorage) { - if (access_control != ast::AccessControl::kRead) { + if (access != ast::Access::kRead) { out << "RW"; } out << "ByteAddressBuffer"; @@ -2349,7 +2346,7 @@ bool GeneratorImpl::EmitType(std::ostream& out, sizes.push_back(arr->Count()); base_type = arr->ElemType(); } - if (!EmitType(out, base_type, storage_class, access_control, "")) { + if (!EmitType(out, base_type, storage_class, access, "")) { return false; } if (!name.empty()) { @@ -2365,7 +2362,7 @@ bool GeneratorImpl::EmitType(std::ostream& out, } else if (type->Is()) { out << "int"; } else if (auto* mat = type->As()) { - if (!EmitType(out, mat->type(), storage_class, access_control, "")) { + if (!EmitType(out, mat->type(), storage_class, access, "")) { return false; } // Note: HLSL's matrices are declared as NxM, where N is the number of @@ -2394,10 +2391,8 @@ bool GeneratorImpl::EmitType(std::ostream& out, auto* multism = tex->As(); auto* sampled = tex->As(); - if (storage) { - if (access_control != ast::AccessControl::kRead) { - out << "RW"; - } + if (storage && storage->access() != ast::Access::kRead) { + out << "RW"; } out << "Texture"; @@ -2461,7 +2456,7 @@ bool GeneratorImpl::EmitType(std::ostream& out, out << "uint" << size; } else { out << "vector<"; - if (!EmitType(out, vec->type(), storage_class, access_control, "")) { + if (!EmitType(out, vec->type(), storage_class, access, "")) { return false; } out << ", " << size << ">"; @@ -2498,7 +2493,7 @@ bool GeneratorImpl::EmitStructType(std::ostream& out, auto mem_name = builder_.Symbols().NameFor(mem->Declaration()->symbol()); if (!EmitType(out, mem->Type(), ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, mem_name)) { + ast::Access::kReadWrite, mem_name)) { return false; } // Array member name will be output with the type @@ -2602,7 +2597,7 @@ bool GeneratorImpl::EmitVariable(std::ostream& out, ast::Variable* var) { if (var->is_const()) { out << "const "; } - if (!EmitType(out, type, sem->StorageClass(), sem->AccessControl(), + if (!EmitType(out, type, sem->StorageClass(), sem->Access(), builder_.Symbols().NameFor(var->symbol()))) { return false; } @@ -2655,7 +2650,7 @@ bool GeneratorImpl::EmitProgramConstVariable(std::ostream& out, } out << "#endif" << std::endl; out << "static const "; - if (!EmitType(out, type, sem->StorageClass(), sem->AccessControl(), + if (!EmitType(out, type, sem->StorageClass(), sem->Access(), builder_.Symbols().NameFor(var->symbol()))) { return false; } @@ -2663,7 +2658,7 @@ bool GeneratorImpl::EmitProgramConstVariable(std::ostream& out, << kSpecConstantPrefix << const_id << ";" << std::endl; } else { out << "static const "; - if (!EmitType(out, type, sem->StorageClass(), sem->AccessControl(), + if (!EmitType(out, type, sem->StorageClass(), sem->Access(), builder_.Symbols().NameFor(var->symbol()))) { return false; } diff --git a/src/writer/hlsl/generator_impl.h b/src/writer/hlsl/generator_impl.h index 9fee7845d8..1b62c769a8 100644 --- a/src/writer/hlsl/generator_impl.h +++ b/src/writer/hlsl/generator_impl.h @@ -38,9 +38,6 @@ namespace tint { // Forward declarations namespace sem { -class AccessControl; -} // namespace sem -namespace sem { class Call; class Intrinsic; } // namespace sem @@ -288,13 +285,13 @@ class GeneratorImpl : public TextGenerator { /// @param out the output stream /// @param type the type to generate /// @param storage_class the storage class of the variable - /// @param access_control the access control type of the variable + /// @param access the access control type of the variable /// @param name the name of the variable, only used for array emission /// @returns true if the type is emitted bool EmitType(std::ostream& out, const sem::Type* type, ast::StorageClass storage_class, - ast::AccessControl::Access access_control, + ast::Access access, const std::string& name); /// Handles generating a structure declaration /// @param out the output stream diff --git a/src/writer/hlsl/generator_impl_function_test.cc b/src/writer/hlsl/generator_impl_function_test.cc index b828607d3b..e3b3d377ab 100644 --- a/src/writer/hlsl/generator_impl_function_test.cc +++ b/src/writer/hlsl/generator_impl_function_test.cc @@ -428,9 +428,7 @@ TEST_F(HlslGeneratorImplTest_Function, }, {create()}); - auto* ac = ty.access(ast::AccessControl::kReadWrite, s); - - Global("coord", ac, ast::StorageClass::kStorage, + Global("coord", s, ast::StorageClass::kStorage, ast::Access::kReadWrite, ast::DecorationList{ create(0), create(1), @@ -474,9 +472,7 @@ TEST_F(HlslGeneratorImplTest_Function, }, {create()}); - auto* ac = ty.access(ast::AccessControl::kRead, s); - - Global("coord", ac, ast::StorageClass::kStorage, + Global("coord", s, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(1), @@ -520,9 +516,7 @@ TEST_F(HlslGeneratorImplTest_Function, }, {create()}); - auto* ac = ty.access(ast::AccessControl::kWrite, s); - - Global("coord", ac, ast::StorageClass::kStorage, + Global("coord", s, ast::StorageClass::kStorage, ast::Access::kWrite, ast::DecorationList{ create(0), create(1), @@ -563,9 +557,7 @@ TEST_F(HlslGeneratorImplTest_Function, }, {create()}); - auto* ac = ty.access(ast::AccessControl::kReadWrite, s); - - Global("coord", ac, ast::StorageClass::kStorage, + Global("coord", s, ast::StorageClass::kStorage, ast::Access::kReadWrite, ast::DecorationList{ create(0), create(1), @@ -814,8 +806,7 @@ TEST_F(HlslGeneratorImplTest_Function, Emit_Decoration_Called_By_EntryPoint_With_StorageBuffer) { auto* s = Structure("S", {Member("x", ty.f32())}, {create()}); - auto* ac = ty.access(ast::AccessControl::kReadWrite, s); - Global("coord", ac, ast::StorageClass::kStorage, + Global("coord", s, ast::StorageClass::kStorage, ast::Access::kReadWrite, ast::DecorationList{ create(0), create(1), @@ -1064,9 +1055,7 @@ TEST_F(HlslGeneratorImplTest_Function, auto* s = Structure("Data", {Member("d", ty.f32())}, {create()}); - auto* ac = ty.access(ast::AccessControl::kReadWrite, s); - - Global("data", ac, ast::StorageClass::kStorage, + Global("data", s, ast::StorageClass::kStorage, ast::Access::kReadWrite, ast::DecorationList{ create(0), create(0), diff --git a/src/writer/hlsl/generator_impl_member_accessor_test.cc b/src/writer/hlsl/generator_impl_member_accessor_test.cc index e155281428..db9d468c23 100644 --- a/src/writer/hlsl/generator_impl_member_accessor_test.cc +++ b/src/writer/hlsl/generator_impl_member_accessor_test.cc @@ -98,9 +98,7 @@ class HlslGeneratorImplTest_MemberAccessorBase : public BASE { auto* s = b.Structure("Data", members, {b.create()}); - auto* ac_ty = b.ty.access(ast::AccessControl::kReadWrite, s); - - b.Global("data", ac_ty, ast::StorageClass::kStorage, nullptr, + b.Global("data", s, ast::StorageClass::kStorage, ast::Access::kReadWrite, ast::DecorationList{ b.create(0), b.create(1), diff --git a/src/writer/hlsl/generator_impl_sanitizer_test.cc b/src/writer/hlsl/generator_impl_sanitizer_test.cc index 7e16d5bdc8..25a584aee3 100644 --- a/src/writer/hlsl/generator_impl_sanitizer_test.cc +++ b/src/writer/hlsl/generator_impl_sanitizer_test.cc @@ -33,9 +33,8 @@ TEST_F(HlslSanitizerTest, ArrayLength) { { create(), }); - auto* ac_ty = ty.access(ast::AccessControl::kRead, sb_ty); - Global("sb", ac_ty, ast::StorageClass::kStorage, + Global("sb", sb_ty, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(1), diff --git a/src/writer/hlsl/generator_impl_type_test.cc b/src/writer/hlsl/generator_impl_type_test.cc index 090e077aa2..94dd0d673f 100644 --- a/src/writer/hlsl/generator_impl_type_test.cc +++ b/src/writer/hlsl/generator_impl_type_test.cc @@ -38,7 +38,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitType_Array) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, program->TypeOf(arr), ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "ary")) + ast::Access::kReadWrite, "ary")) << gen.error(); EXPECT_EQ(result(), "bool ary[4]"); } @@ -50,7 +50,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitType_ArrayOfArray) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, program->TypeOf(arr), ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "ary")) + ast::Access::kReadWrite, "ary")) << gen.error(); EXPECT_EQ(result(), "bool ary[5][4]"); } @@ -64,7 +64,7 @@ TEST_F(HlslGeneratorImplTest_Type, GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, program->TypeOf(arr), ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "ary")) + ast::Access::kReadWrite, "ary")) << gen.error(); EXPECT_EQ(result(), "bool ary[5][4][1]"); } @@ -76,7 +76,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitType_ArrayOfArrayOfArray) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, program->TypeOf(arr), ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "ary")) + ast::Access::kReadWrite, "ary")) << gen.error(); EXPECT_EQ(result(), "bool ary[6][5][4]"); } @@ -88,7 +88,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitType_Array_WithoutName) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, program->TypeOf(arr), ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) + ast::Access::kReadWrite, "")) << gen.error(); EXPECT_EQ(result(), "bool[4]"); } @@ -100,7 +100,7 @@ TEST_F(HlslGeneratorImplTest_Type, DISABLED_EmitType_RuntimeArray) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, program->TypeOf(arr), ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "ary")) + ast::Access::kReadWrite, "ary")) << gen.error(); EXPECT_EQ(result(), "bool ary[]"); } @@ -111,7 +111,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitType_Bool) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, bool_, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) + ast::Access::kReadWrite, "")) << gen.error(); EXPECT_EQ(result(), "bool"); } @@ -122,7 +122,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitType_F32) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, f32, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) + ast::Access::kReadWrite, "")) << gen.error(); EXPECT_EQ(result(), "float"); } @@ -133,7 +133,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitType_I32) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, i32, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) + ast::Access::kReadWrite, "")) << gen.error(); EXPECT_EQ(result(), "int"); } @@ -146,7 +146,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitType_Matrix) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, mat2x3, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) + ast::Access::kReadWrite, "")) << gen.error(); EXPECT_EQ(result(), "float2x3"); } @@ -159,7 +159,7 @@ TEST_F(HlslGeneratorImplTest_Type, DISABLED_EmitType_Pointer) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, p, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) + ast::Access::kReadWrite, "")) << gen.error(); EXPECT_EQ(result(), "float*"); } @@ -189,8 +189,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitType_StructDecl_OmittedIfStorageBuffer) { Member("b", ty.f32()), }, {create()}); - Global("g", ty.access(ast::AccessControl::kReadWrite, s), - ast::StorageClass::kStorage, + Global("g", s, ast::StorageClass::kStorage, ast::Access::kReadWrite, ast::DecorationList{ create(0), create(0), @@ -214,7 +213,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitType_Struct) { auto* sem_s = program->TypeOf(s)->As(); ASSERT_TRUE(gen.EmitType(out, sem_s, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) + ast::Access::kReadWrite, "")) << gen.error(); EXPECT_EQ(result(), "S"); } @@ -234,7 +233,7 @@ TEST_F(HlslGeneratorImplTest_Type, DISABLED_EmitType_Struct_InjectPadding) { auto* sem_s = program->TypeOf(s)->As(); ASSERT_TRUE(gen.EmitType(out, sem_s, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) + ast::Access::kReadWrite, "")) << gen.error(); EXPECT_EQ(gen.result(), R"(struct S { int a; @@ -290,7 +289,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitType_U32) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, u32, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) + ast::Access::kReadWrite, "")) << gen.error(); EXPECT_EQ(result(), "uint"); } @@ -302,7 +301,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitType_Vector) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, vec3, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) + ast::Access::kReadWrite, "")) << gen.error(); EXPECT_EQ(result(), "float3"); } @@ -313,7 +312,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitType_Void) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, void_, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) + ast::Access::kReadWrite, "")) << gen.error(); EXPECT_EQ(result(), "void"); } @@ -324,7 +323,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitSampler) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, sampler, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) + ast::Access::kReadWrite, "")) << gen.error(); EXPECT_EQ(result(), "SamplerState"); } @@ -335,7 +334,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitSamplerComparison) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, sampler, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) + ast::Access::kReadWrite, "")) << gen.error(); EXPECT_EQ(result(), "SamplerComparisonState"); } @@ -354,7 +353,7 @@ TEST_P(HlslDepthTexturesTest, Emit) { auto* t = ty.depth_texture(params.dim); - Global("tex", t, ast::StorageClass::kNone, nullptr, + Global("tex", t, ast::DecorationList{ create(1), create(2), @@ -413,7 +412,7 @@ TEST_P(HlslSampledTexturesTest, Emit) { } auto* t = ty.sampled_texture(params.dim, datatype); - Global("tex", t, ast::StorageClass::kNone, nullptr, + Global("tex", t, ast::DecorationList{ create(1), create(2), @@ -532,7 +531,7 @@ TEST_F(HlslGeneratorImplTest_Type, EmitMultisampledTexture) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(out, s, ast::StorageClass::kNone, - ast::AccessControl::kReadWrite, "")) + ast::Access::kReadWrite, "")) << gen.error(); EXPECT_EQ(result(), "Texture2DMS"); } @@ -552,11 +551,11 @@ using HlslStorageTexturesTest = TestParamHelper; TEST_P(HlslStorageTexturesTest, Emit) { auto params = GetParam(); - auto* t = ty.storage_texture(params.dim, params.imgfmt); - auto* ac = ty.access( - params.ro ? ast::AccessControl::kRead : ast::AccessControl::kWrite, t); + auto* t = + ty.storage_texture(params.dim, params.imgfmt, + params.ro ? ast::Access::kRead : ast::Access::kWrite); - Global("tex", ac, ast::StorageClass::kNone, nullptr, + Global("tex", t, ast::DecorationList{ create(1), create(2), diff --git a/src/writer/msl/generator_impl.cc b/src/writer/msl/generator_impl.cc index 6eec4df053..f4d38fc74f 100644 --- a/src/writer/msl/generator_impl.cc +++ b/src/writer/msl/generator_impl.cc @@ -1326,7 +1326,7 @@ bool GeneratorImpl::EmitFunctionInternal(ast::Function* func, } first = false; - if (var->AccessControl() == ast::AccessControl::kRead) { + if (var->Access() == ast::Access::kRead) { out_ << "const "; } @@ -1544,7 +1544,7 @@ bool GeneratorImpl::EmitEntryPointFunction(ast::Function* func) { auto* binding = data.second.binding; // auto* set = data.second.set; - if (var->AccessControl() == ast::AccessControl::kRead) { + if (var->Access() == ast::Access::kRead) { out_ << "const "; } @@ -2037,9 +2037,9 @@ bool GeneratorImpl::EmitType(const sem::Type* type, const std::string& name) { } std::string access_str; - if (storage->access_control() == ast::AccessControl::kRead) { + if (storage->access() == ast::Access::kRead) { out_ << ", access::read"; - } else if (storage->access_control() == ast::AccessControl::kWrite) { + } else if (storage->access() == ast::Access::kWrite) { out_ << ", access::write"; } else { diagnostics_.add_error("Invalid access control for storage texture"); diff --git a/src/writer/msl/generator_impl_function_test.cc b/src/writer/msl/generator_impl_function_test.cc index 7c19271a0c..66df0a34aa 100644 --- a/src/writer/msl/generator_impl_function_test.cc +++ b/src/writer/msl/generator_impl_function_test.cc @@ -306,9 +306,7 @@ TEST_F(MslGeneratorImplTest, }, {create()}); - auto* ac = ty.access(ast::AccessControl::kReadWrite, s); - - Global("coord", ac, ast::StorageClass::kStorage, + Global("coord", s, ast::StorageClass::kStorage, ast::Access::kReadWrite, ast::DecorationList{ create(0), create(1), @@ -354,9 +352,7 @@ TEST_F(MslGeneratorImplTest, }, {create()}); - auto* ac = ty.access(ast::AccessControl::kRead, s); - - Global("coord", ac, ast::StorageClass::kStorage, + Global("coord", s, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(1), @@ -620,9 +616,7 @@ TEST_F(MslGeneratorImplTest, }, {create()}); - auto* ac = ty.access(ast::AccessControl::kReadWrite, s); - - Global("coord", ac, ast::StorageClass::kStorage, + Global("coord", s, ast::StorageClass::kStorage, ast::Access::kReadWrite, ast::DecorationList{ create(0), create(1), @@ -679,9 +673,7 @@ TEST_F(MslGeneratorImplTest, }, {create()}); - auto* ac = ty.access(ast::AccessControl::kRead, s); - - Global("coord", ac, ast::StorageClass::kStorage, + Global("coord", s, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(1), @@ -824,9 +816,7 @@ TEST_F(MslGeneratorImplTest, auto* s = Structure("Data", {Member("d", ty.f32())}, {create()}); - auto* ac = ty.access(ast::AccessControl::kReadWrite, s); - - Global("data", ac, ast::StorageClass::kStorage, + Global("data", s, ast::StorageClass::kStorage, ast::Access::kReadWrite, ast::DecorationList{ create(0), create(0), diff --git a/src/writer/msl/generator_impl_type_test.cc b/src/writer/msl/generator_impl_type_test.cc index 235fc267e9..d45ead6aae 100644 --- a/src/writer/msl/generator_impl_type_test.cc +++ b/src/writer/msl/generator_impl_type_test.cc @@ -232,8 +232,7 @@ TEST_F(MslGeneratorImplTest, EmitType_Struct_Layout_NonComposites) { }, {create()}); - Global("G", ty.access(ast::AccessControl::kRead, s), - ast::StorageClass::kStorage, + Global("G", s, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -342,8 +341,7 @@ TEST_F(MslGeneratorImplTest, EmitType_Struct_Layout_Structures) { }, {create()}); - Global("G", ty.access(ast::AccessControl::kRead, s), - ast::StorageClass::kStorage, + Global("G", s, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -437,8 +435,7 @@ TEST_F(MslGeneratorImplTest, EmitType_Struct_Layout_ArrayDefaultStride) { }, ast::DecorationList{create()}); - Global("G", ty.access(ast::AccessControl::kRead, s), - ast::StorageClass::kStorage, + Global("G", s, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -551,8 +548,7 @@ TEST_F(MslGeneratorImplTest, AttemptTintPadSymbolCollision) { }, {create()}); - Global("G", ty.access(ast::AccessControl::kRead, s), - ast::StorageClass::kStorage, + Global("G", s, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -617,8 +613,7 @@ TEST_F(MslGeneratorImplTest, DISABLED_EmitType_Struct_WithDecoration) { }, {create()}); - Global("G", ty.access(ast::AccessControl::kRead, s), - ast::StorageClass::kStorage, + Global("G", s, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -771,10 +766,10 @@ using MslStorageTexturesTest = TestParamHelper; TEST_P(MslStorageTexturesTest, Emit) { auto params = GetParam(); - auto* s = ty.storage_texture(params.dim, ast::ImageFormat::kR32Float); - auto* ac = ty.access( - params.ro ? ast::AccessControl::kRead : ast::AccessControl::kWrite, s); - Global("test_var", ac, + auto* s = + ty.storage_texture(params.dim, ast::ImageFormat::kR32Float, + params.ro ? ast::Access::kRead : ast::Access::kWrite); + Global("test_var", s, ast::DecorationList{ create(0), create(0), @@ -782,7 +777,7 @@ TEST_P(MslStorageTexturesTest, Emit) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(program->TypeOf(ac), "")) << gen.error(); + ASSERT_TRUE(gen.EmitType(program->TypeOf(s), "")) << gen.error(); EXPECT_EQ(gen.result(), params.result); } INSTANTIATE_TEST_SUITE_P( diff --git a/src/writer/spirv/builder.cc b/src/writer/spirv/builder.cc index a0763189f9..6ebafb91da 100644 --- a/src/writer/spirv/builder.cc +++ b/src/writer/spirv/builder.cc @@ -786,20 +786,23 @@ bool Builder::GenerateGlobalVariable(ast::Variable* var) { if (var->has_constructor()) { ops.push_back(Operand::Int(init_id)); } else { - if (type->Is() || type->Is()) { + auto* st = type->As(); + if (st || type->Is()) { // type is a sem::Struct or a sem::StorageTexture - switch (sem->AccessControl()) { - case ast::AccessControl::kWrite: + auto access = st ? st->access() : sem->Access(); + switch (access) { + case ast::Access::kWrite: push_annot( spv::Op::OpDecorate, {Operand::Int(var_id), Operand::Int(SpvDecorationNonReadable)}); break; - case ast::AccessControl::kRead: + case ast::Access::kRead: push_annot( spv::Op::OpDecorate, {Operand::Int(var_id), Operand::Int(SpvDecorationNonWritable)}); break; - case ast::AccessControl::kReadWrite: + case ast::Access::kUndefined: + case ast::Access::kReadWrite: break; } } @@ -3287,17 +3290,17 @@ uint32_t Builder::GenerateTypeIfNeeded(const sem::Type* type) { type_name_to_id_[builder_ .create( st->dim(), st->image_format(), - ast::AccessControl::kRead, st->type()) + ast::Access::kRead, st->type()) ->type_name()] = id; type_name_to_id_[builder_ .create( st->dim(), st->image_format(), - ast::AccessControl::kWrite, st->type()) + ast::Access::kWrite, st->type()) ->type_name()] = id; type_name_to_id_[builder_ .create( st->dim(), st->image_format(), - ast::AccessControl::kReadWrite, st->type()) + ast::Access::kReadWrite, st->type()) ->type_name()] = id; } diff --git a/src/writer/spirv/builder.h b/src/writer/spirv/builder.h index 6cdd12a0ed..aa051c4eb3 100644 --- a/src/writer/spirv/builder.h +++ b/src/writer/spirv/builder.h @@ -263,9 +263,9 @@ class Builder { /// @param type the type to generate for /// @param struct_id the struct id /// @param member_idx the member index - void GenerateMemberAccessControlIfNeeded(const sem::Type* type, - uint32_t struct_id, - uint32_t member_idx); + void GenerateMemberAccessIfNeeded(const sem::Type* type, + uint32_t struct_id, + uint32_t member_idx); /// Generates a function variable /// @param var the variable /// @returns true if the variable was generated diff --git a/src/writer/spirv/builder_function_test.cc b/src/writer/spirv/builder_function_test.cc index a3efcf79e6..d4ed7fb68e 100644 --- a/src/writer/spirv/builder_function_test.cc +++ b/src/writer/spirv/builder_function_test.cc @@ -204,9 +204,7 @@ TEST_F(BuilderTest, Emit_Multiple_EntryPoint_With_Same_ModuleVar) { auto* s = Structure("Data", {Member("d", ty.f32())}, {create()}); - auto* ac = ty.access(ast::AccessControl::kReadWrite, s); - - Global("data", ac, ast::StorageClass::kStorage, nullptr, + Global("data", s, ast::StorageClass::kStorage, ast::Access::kReadWrite, ast::DecorationList{ create(0), create(0), diff --git a/src/writer/spirv/builder_global_variable_test.cc b/src/writer/spirv/builder_global_variable_test.cc index 622e7df37e..6cc49f9d6e 100644 --- a/src/writer/spirv/builder_global_variable_test.cc +++ b/src/writer/spirv/builder_global_variable_test.cc @@ -394,7 +394,7 @@ TEST_F(BuilderTest, GlobalVar_DeclReadOnly) { // struct A { // a : i32; // }; - // var b : [[access(read)]] A + // var b : A auto* A = Structure("A", { @@ -402,9 +402,8 @@ TEST_F(BuilderTest, GlobalVar_DeclReadOnly) { Member("b", ty.i32()), }, {create()}); - auto* ac = ty.access(ast::AccessControl::kRead, A); - auto* var = Global("b", ac, ast::StorageClass::kStorage, + auto* var = Global("b", A, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -438,14 +437,13 @@ TEST_F(BuilderTest, GlobalVar_TypeAliasDeclReadOnly) { // a : i32; // }; // type B = A; - // var b : [[access(read)]] B + // var b : B auto* A = Structure("A", {Member("a", ty.i32())}, {create()}); auto* B = ty.alias("B", A); AST().AddConstructedType(B); - auto* ac = ty.access(ast::AccessControl::kRead, B); - auto* var = Global("b", ac, ast::StorageClass::kStorage, + auto* var = Global("b", B, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -476,15 +474,14 @@ TEST_F(BuilderTest, GlobalVar_TypeAliasAssignReadOnly) { // struct A { // a : i32; // }; - // type B = [[access(read)]] A; - // var b : B + // type B = A; + // var b : B auto* A = Structure("A", {Member("a", ty.i32())}, {create()}); - auto* ac = ty.access(ast::AccessControl::kRead, A); - auto* B = ty.alias("B", ac); + auto* B = ty.alias("B", A); AST().AddConstructedType(B); - auto* var = Global("b", B, ast::StorageClass::kStorage, + auto* var = Global("b", B, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -515,24 +512,22 @@ TEST_F(BuilderTest, GlobalVar_TwoVarDeclReadOnly) { // struct A { // a : i32; // }; - // var b : [[access(read)]] A - // var c : [[access(read_write)]] A + // var b : A + // var c : A auto* A = Structure("A", {Member("a", ty.i32())}, {create()}); - auto* read = ty.access(ast::AccessControl::kRead, A); - auto* rw = ty.access(ast::AccessControl::kReadWrite, A); - - auto* var_b = Global("b", read, ast::StorageClass::kStorage, + auto* var_b = Global("b", A, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(0), }); - auto* var_c = Global("c", rw, ast::StorageClass::kStorage, - ast::DecorationList{ - create(1), - create(0), - }); + auto* var_c = + Global("c", A, ast::StorageClass::kStorage, ast::Access::kReadWrite, + ast::DecorationList{ + create(1), + create(0), + }); spirv::Builder& b = Build(); @@ -562,14 +557,13 @@ OpName %5 "c" } TEST_F(BuilderTest, GlobalVar_TextureStorageReadOnly) { - // var a : [[access(read)]] texture_storage_2d; + // var a : texture_storage_2d; - auto* type = ty.storage_texture(ast::TextureDimension::k2d, - ast::ImageFormat::kR32Uint); + auto* type = + ty.storage_texture(ast::TextureDimension::k2d, ast::ImageFormat::kR32Uint, + ast::Access::kRead); - auto* ac = ty.access(ast::AccessControl::kRead, type); - - auto* var_a = Global("a", ac, ast::StorageClass::kNone, + auto* var_a = Global("a", type, ast::DecorationList{ create(0), create(0), @@ -591,14 +585,13 @@ OpDecorate %1 DescriptorSet 0 } TEST_F(BuilderTest, GlobalVar_TextureStorageWriteOnly) { - // var a : [[access(write)]] texture_storage_2d; + // var a : texture_storage_2d; - auto* type = ty.storage_texture(ast::TextureDimension::k2d, - ast::ImageFormat::kR32Uint); + auto* type = + ty.storage_texture(ast::TextureDimension::k2d, ast::ImageFormat::kR32Uint, + ast::Access::kWrite); - auto* ac = ty.access(ast::AccessControl::kWrite, type); - - auto* var_a = Global("a", ac, ast::StorageClass::kNone, + auto* var_a = Global("a", type, ast::DecorationList{ create(0), create(0), @@ -622,21 +615,21 @@ OpDecorate %1 DescriptorSet 0 // Check that multiple texture_storage types with different access modifiers // only produces a single OpTypeImage. TEST_F(BuilderTest, GlobalVar_TextureStorageWithDifferentAccess) { - // var a : [[access(read)]] texture_storage_2d; - // var b : [[access(write)]] texture_storage_2d; + // var a : texture_storage_2d; + // var b : texture_storage_2d; - auto* type_a = ty.access(ast::AccessControl::kRead, - ty.storage_texture(ast::TextureDimension::k2d, - ast::ImageFormat::kR32Uint)); + auto* type_a = + ty.storage_texture(ast::TextureDimension::k2d, ast::ImageFormat::kR32Uint, + ast::Access::kRead); auto* var_a = Global("a", type_a, ast::StorageClass::kNone, ast::DecorationList{ create(0), create(0), }); - auto* type_b = ty.access(ast::AccessControl::kWrite, - ty.storage_texture(ast::TextureDimension::k2d, - ast::ImageFormat::kR32Uint)); + auto* type_b = + ty.storage_texture(ast::TextureDimension::k2d, ast::ImageFormat::kR32Uint, + ast::Access::kWrite); auto* var_b = Global("b", type_b, ast::StorageClass::kNone, ast::DecorationList{ create(1), diff --git a/src/writer/spirv/builder_intrinsic_test.cc b/src/writer/spirv/builder_intrinsic_test.cc index 6a09d5c23a..ebc1de3531 100644 --- a/src/writer/spirv/builder_intrinsic_test.cc +++ b/src/writer/spirv/builder_intrinsic_test.cc @@ -1537,8 +1537,7 @@ OpFunctionEnd TEST_F(IntrinsicBuilderTest, Call_ArrayLength) { auto* s = Structure("my_struct", {Member(0, "a", ty.array(4))}, {create()}); - auto* ac = ty.access(ast::AccessControl::kRead, s); - Global("b", ac, ast::StorageClass::kStorage, nullptr, + Global("b", s, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(1), create(2), @@ -1587,8 +1586,7 @@ TEST_F(IntrinsicBuilderTest, Call_ArrayLength_OtherMembersInStruct) { Member(4, "a", ty.array(4)), }, {create()}); - auto* ac = ty.access(ast::AccessControl::kRead, s); - Global("b", ac, ast::StorageClass::kStorage, nullptr, + Global("b", s, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(1), create(2), diff --git a/src/writer/spirv/builder_type_test.cc b/src/writer/spirv/builder_type_test.cc index 83168ca188..2200436e5e 100644 --- a/src/writer/spirv/builder_type_test.cc +++ b/src/writer/spirv/builder_type_test.cc @@ -30,8 +30,7 @@ TEST_F(BuilderTest_Type, GenerateRuntimeArray) { auto* ary = ty.array(ty.i32(), 0); auto* str = Structure("S", {Member("x", ary)}, {create()}); - auto* ac = ty.access(ast::AccessControl::kRead, str); - Global("a", ac, ast::StorageClass::kStorage, + Global("a", str, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -52,8 +51,7 @@ TEST_F(BuilderTest_Type, ReturnsGeneratedRuntimeArray) { auto* ary = ty.array(ty.i32(), 0); auto* str = Structure("S", {Member("x", ary)}, {create()}); - auto* ac = ty.access(ast::AccessControl::kRead, str); - Global("a", ac, ast::StorageClass::kStorage, + Global("a", str, ast::StorageClass::kStorage, ast::Access::kRead, ast::DecorationList{ create(0), create(0), @@ -831,10 +829,9 @@ TEST_F(BuilderTest_Type, SampledTexture_Generate_CubeArray) { TEST_F(BuilderTest_Type, StorageTexture_Generate_1d) { auto* s = ty.storage_texture(ast::TextureDimension::k1d, - ast::ImageFormat::kR32Float); - auto* ac = ty.access(ast::AccessControl::kRead, s); + ast::ImageFormat::kR32Float, ast::Access::kRead); - Global("test_var", ac, + Global("test_var", s, ast::DecorationList{ create(0), create(0), @@ -851,10 +848,9 @@ TEST_F(BuilderTest_Type, StorageTexture_Generate_1d) { TEST_F(BuilderTest_Type, StorageTexture_Generate_2d) { auto* s = ty.storage_texture(ast::TextureDimension::k2d, - ast::ImageFormat::kR32Float); - auto* ac = ty.access(ast::AccessControl::kRead, s); + ast::ImageFormat::kR32Float, ast::Access::kRead); - Global("test_var", ac, + Global("test_var", s, ast::DecorationList{ create(0), create(0), @@ -871,10 +867,9 @@ TEST_F(BuilderTest_Type, StorageTexture_Generate_2d) { TEST_F(BuilderTest_Type, StorageTexture_Generate_2dArray) { auto* s = ty.storage_texture(ast::TextureDimension::k2dArray, - ast::ImageFormat::kR32Float); - auto* ac = ty.access(ast::AccessControl::kRead, s); + ast::ImageFormat::kR32Float, ast::Access::kRead); - Global("test_var", ac, + Global("test_var", s, ast::DecorationList{ create(0), create(0), @@ -891,10 +886,9 @@ TEST_F(BuilderTest_Type, StorageTexture_Generate_2dArray) { TEST_F(BuilderTest_Type, StorageTexture_Generate_3d) { auto* s = ty.storage_texture(ast::TextureDimension::k3d, - ast::ImageFormat::kR32Float); - auto* ac = ty.access(ast::AccessControl::kRead, s); + ast::ImageFormat::kR32Float, ast::Access::kRead); - Global("test_var", ac, + Global("test_var", s, ast::DecorationList{ create(0), create(0), @@ -912,10 +906,9 @@ TEST_F(BuilderTest_Type, StorageTexture_Generate_3d) { TEST_F(BuilderTest_Type, StorageTexture_Generate_SampledTypeFloat_Format_r32float) { auto* s = ty.storage_texture(ast::TextureDimension::k2d, - ast::ImageFormat::kR32Float); - auto* ac = ty.access(ast::AccessControl::kRead, s); + ast::ImageFormat::kR32Float, ast::Access::kRead); - Global("test_var", ac, + Global("test_var", s, ast::DecorationList{ create(0), create(0), @@ -933,10 +926,9 @@ TEST_F(BuilderTest_Type, TEST_F(BuilderTest_Type, StorageTexture_Generate_SampledTypeSint_Format_r32sint) { auto* s = ty.storage_texture(ast::TextureDimension::k2d, - ast::ImageFormat::kR32Sint); - auto* ac = ty.access(ast::AccessControl::kRead, s); + ast::ImageFormat::kR32Sint, ast::Access::kRead); - Global("test_var", ac, + Global("test_var", s, ast::DecorationList{ create(0), create(0), @@ -954,10 +946,9 @@ TEST_F(BuilderTest_Type, TEST_F(BuilderTest_Type, StorageTexture_Generate_SampledTypeUint_Format_r32uint) { auto* s = ty.storage_texture(ast::TextureDimension::k2d, - ast::ImageFormat::kR32Uint); - auto* ac = ty.access(ast::AccessControl::kRead, s); + ast::ImageFormat::kR32Uint, ast::Access::kRead); - Global("test_var", ac, + Global("test_var", s, ast::DecorationList{ create(0), create(0), diff --git a/src/writer/wgsl/generator_impl.cc b/src/writer/wgsl/generator_impl.cc index 8bba93a6c3..789bb51f67 100644 --- a/src/writer/wgsl/generator_impl.cc +++ b/src/writer/wgsl/generator_impl.cc @@ -17,7 +17,7 @@ #include #include -#include "src/ast/access_control.h" +#include "src/ast/access.h" #include "src/ast/alias.h" #include "src/ast/array.h" #include "src/ast/bool.h" @@ -355,25 +355,26 @@ bool GeneratorImpl::EmitImageFormat(const ast::ImageFormat fmt) { return true; } -bool GeneratorImpl::EmitType(const ast::Type* ty) { - if (auto* ac = ty->As()) { - out_ << "[[access("; - if (ac->IsReadOnly()) { +bool GeneratorImpl::EmitAccess(const ast::Access access) { + switch (access) { + case ast::Access::kRead: out_ << "read"; - } else if (ac->IsWriteOnly()) { + return true; + case ast::Access::kWrite: out_ << "write"; - } else if (ac->IsReadWrite()) { + return true; + case ast::Access::kReadWrite: out_ << "read_write"; - } else { - diagnostics_.add_error("invalid access control"); - return false; - } - out_ << ")]] "; - if (!EmitType(ac->type())) { - return false; - } - return true; - } else if (auto* alias = ty->As()) { + return true; + default: + break; + } + diagnostics_.add_error("unknown access"); + return false; +} + +bool GeneratorImpl::EmitType(const ast::Type* ty) { + if (auto* alias = ty->As()) { out_ << program_->Symbols().NameFor(alias->symbol()); } else if (auto* ary = ty->As()) { for (auto* deco : ary->decorations()) { @@ -477,6 +478,10 @@ bool GeneratorImpl::EmitType(const ast::Type* ty) { if (!EmitImageFormat(storage->image_format())) { return false; } + out_ << ", "; + if (!EmitAccess(storage->access())) { + return false; + } out_ << ">"; } @@ -580,8 +585,16 @@ bool GeneratorImpl::EmitVariable(ast::Variable* var) { } else { out_ << "var"; auto sc = var->declared_storage_class(); - if (sc != ast::StorageClass::kNone) { - out_ << "<" << sc << ">"; + auto ac = var->declared_access(); + if (sc != ast::StorageClass::kNone || ac != ast::Access::kUndefined) { + out_ << "<" << sc; + if (ac != ast::Access::kUndefined) { + out_ << ", "; + if (!EmitAccess(ac)) { + return false; + } + } + out_ << ">"; } } diff --git a/src/writer/wgsl/generator_impl.h b/src/writer/wgsl/generator_impl.h index ecb17a5be3..1017bae022 100644 --- a/src/writer/wgsl/generator_impl.h +++ b/src/writer/wgsl/generator_impl.h @@ -174,6 +174,10 @@ class GeneratorImpl : public TextGenerator { /// @param fmt the format to generate /// @returns true if the format is emitted bool EmitImageFormat(const ast::ImageFormat fmt); + /// Handles emitting an access control + /// @param access the access to generate + /// @returns true if the access is emitted + bool EmitAccess(const ast::Access access); /// Handles emitting a type constructor /// @param expr the type constructor expression /// @returns true if the constructor is emitted diff --git a/src/writer/wgsl/generator_impl_function_test.cc b/src/writer/wgsl/generator_impl_function_test.cc index 97bf435f7d..5bb305a201 100644 --- a/src/writer/wgsl/generator_impl_function_test.cc +++ b/src/writer/wgsl/generator_impl_function_test.cc @@ -175,9 +175,7 @@ TEST_F(WgslGeneratorImplTest, auto* s = Structure("Data", {Member("d", ty.f32())}, {create()}); - auto* ac = ty.access(ast::AccessControl::kReadWrite, s); - - Global("data", ac, ast::StorageClass::kStorage, nullptr, + Global("data", s, ast::StorageClass::kStorage, ast::Access::kReadWrite, ast::DecorationList{ create(0), create(0), @@ -219,7 +217,7 @@ struct Data { d : f32; }; -[[binding(0), group(0)]] var data : [[access(read_write)]] Data; +[[binding(0), group(0)]] var data : Data; [[stage(compute)]] fn a() { diff --git a/src/writer/wgsl/generator_impl_global_decl_test.cc b/src/writer/wgsl/generator_impl_global_decl_test.cc index 45bb89f6fa..5954621c50 100644 --- a/src/writer/wgsl/generator_impl_global_decl_test.cc +++ b/src/writer/wgsl/generator_impl_global_decl_test.cc @@ -116,7 +116,7 @@ TEST_F(WgslGeneratorImplTest, Emit_Global_Sampler) { TEST_F(WgslGeneratorImplTest, Emit_Global_Texture) { auto* st = ty.sampled_texture(ast::TextureDimension::k1d, ty.f32()); - Global("t", ty.access(ast::AccessControl::kRead, st), + Global("t", st, ast::DecorationList{ create(0), create(0), @@ -127,9 +127,8 @@ TEST_F(WgslGeneratorImplTest, Emit_Global_Texture) { gen.increment_indent(); ASSERT_TRUE(gen.Generate()) << gen.error(); - EXPECT_EQ( - gen.result(), - " [[group(0), binding(0)]] var t : [[access(read)]] texture_1d;\n"); + EXPECT_EQ(gen.result(), + " [[group(0), binding(0)]] var t : texture_1d;\n"); } TEST_F(WgslGeneratorImplTest, Emit_OverridableConstants) { diff --git a/src/writer/wgsl/generator_impl_type_test.cc b/src/writer/wgsl/generator_impl_type_test.cc index d217bfb764..5bb5abd17f 100644 --- a/src/writer/wgsl/generator_impl_type_test.cc +++ b/src/writer/wgsl/generator_impl_type_test.cc @@ -45,32 +45,6 @@ TEST_F(WgslGeneratorImplTest, EmitType_Array) { EXPECT_EQ(gen.result(), "array"); } -TEST_F(WgslGeneratorImplTest, EmitType_AccessControl_Read) { - auto* s = Structure("S", {Member("a", ty.i32())}, - {create()}); - - auto* a = ty.access(ast::AccessControl::kRead, s); - AST().AddConstructedType(ty.alias("make_type_reachable", a)); - - GeneratorImpl& gen = Build(); - - ASSERT_TRUE(gen.EmitType(a)) << gen.error(); - EXPECT_EQ(gen.result(), "[[access(read)]] S"); -} - -TEST_F(WgslGeneratorImplTest, EmitType_AccessControl_ReadWrite) { - auto* s = Structure("S", {Member("a", ty.i32())}, - {create()}); - - auto* a = ty.access(ast::AccessControl::kReadWrite, s); - AST().AddConstructedType(ty.alias("make_type_reachable", a)); - - GeneratorImpl& gen = Build(); - - ASSERT_TRUE(gen.EmitType(a)) << gen.error(); - EXPECT_EQ(gen.result(), "[[access(read_write)]] S"); -} - TEST_F(WgslGeneratorImplTest, EmitType_Array_Decoration) { auto* a = ty.array(ty.bool_(), 4, 16u); AST().AddConstructedType(ty.alias("make_type_reachable", a)); @@ -416,7 +390,7 @@ INSTANTIATE_TEST_SUITE_P(WgslGeneratorImplTest, struct StorageTextureData { ast::ImageFormat fmt; ast::TextureDimension dim; - ast::AccessControl::Access access; + ast::Access access; const char* name; }; inline std::ostream& operator<<(std::ostream& out, StorageTextureData data) { @@ -427,12 +401,11 @@ using WgslGenerator_StorageTextureTest = TestParamHelper; TEST_P(WgslGenerator_StorageTextureTest, EmitType_StorageTexture) { auto param = GetParam(); - auto* t = ty.storage_texture(param.dim, param.fmt); - auto* ac = ty.access(param.access, t); + auto* t = ty.storage_texture(param.dim, param.fmt, param.access); GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(ac)) << gen.error(); + ASSERT_TRUE(gen.EmitType(t)) << gen.error(); EXPECT_EQ(gen.result(), param.name); } INSTANTIATE_TEST_SUITE_P( @@ -440,37 +413,29 @@ INSTANTIATE_TEST_SUITE_P( WgslGenerator_StorageTextureTest, testing::Values( StorageTextureData{ast::ImageFormat::kR8Unorm, - ast::TextureDimension::k1d, - ast::AccessControl::kRead, - "[[access(read)]] texture_storage_1d"}, + ast::TextureDimension::k1d, ast::Access::kRead, + "texture_storage_1d"}, StorageTextureData{ast::ImageFormat::kR8Unorm, - ast::TextureDimension::k2d, - ast::AccessControl::kRead, - "[[access(read)]] texture_storage_2d"}, - StorageTextureData{ - ast::ImageFormat::kR8Unorm, ast::TextureDimension::k2dArray, - ast::AccessControl::kRead, - "[[access(read)]] texture_storage_2d_array"}, + ast::TextureDimension::k2d, ast::Access::kRead, + "texture_storage_2d"}, StorageTextureData{ast::ImageFormat::kR8Unorm, - ast::TextureDimension::k3d, - ast::AccessControl::kRead, - "[[access(read)]] texture_storage_3d"}, + ast::TextureDimension::k2dArray, ast::Access::kRead, + "texture_storage_2d_array"}, StorageTextureData{ast::ImageFormat::kR8Unorm, - ast::TextureDimension::k1d, - ast::AccessControl::kWrite, - "[[access(write)]] texture_storage_1d"}, + ast::TextureDimension::k3d, ast::Access::kRead, + "texture_storage_3d"}, StorageTextureData{ast::ImageFormat::kR8Unorm, - ast::TextureDimension::k2d, - ast::AccessControl::kWrite, - "[[access(write)]] texture_storage_2d"}, - StorageTextureData{ - ast::ImageFormat::kR8Unorm, ast::TextureDimension::k2dArray, - ast::AccessControl::kWrite, - "[[access(write)]] texture_storage_2d_array"}, + ast::TextureDimension::k1d, ast::Access::kWrite, + "texture_storage_1d"}, StorageTextureData{ast::ImageFormat::kR8Unorm, - ast::TextureDimension::k3d, - ast::AccessControl::kWrite, - "[[access(write)]] texture_storage_3d"})); + ast::TextureDimension::k2d, ast::Access::kWrite, + "texture_storage_2d"}, + StorageTextureData{ast::ImageFormat::kR8Unorm, + ast::TextureDimension::k2dArray, ast::Access::kWrite, + "texture_storage_2d_array"}, + StorageTextureData{ast::ImageFormat::kR8Unorm, + ast::TextureDimension::k3d, ast::Access::kWrite, + "texture_storage_3d"})); struct ImageFormatData { ast::ImageFormat fmt; diff --git a/src/writer/wgsl/generator_impl_variable_test.cc b/src/writer/wgsl/generator_impl_variable_test.cc index 0605aac418..8b51c3a188 100644 --- a/src/writer/wgsl/generator_impl_variable_test.cc +++ b/src/writer/wgsl/generator_impl_variable_test.cc @@ -13,6 +13,7 @@ // limitations under the License. #include "src/ast/override_decoration.h" +#include "src/ast/struct_block_decoration.h" #include "src/writer/wgsl/test_helper.h" namespace tint { @@ -42,6 +43,54 @@ TEST_F(WgslGeneratorImplTest, EmitVariable_StorageClass) { )"); } +TEST_F(WgslGeneratorImplTest, EmitVariable_Access_Read) { + auto* s = Structure("S", {Member("a", ty.i32())}, + {create()}); + auto* v = Global("a", s, ast::StorageClass::kStorage, ast::Access::kRead, + ast::DecorationList{ + create(0), + create(0), + }); + + GeneratorImpl& gen = Build(); + + ASSERT_TRUE(gen.EmitVariable(v)) << gen.error(); + EXPECT_EQ(gen.result(), R"([[binding(0), group(0)]] var a : S; +)"); +} + +TEST_F(WgslGeneratorImplTest, EmitVariable_Access_Write) { + auto* s = Structure("S", {Member("a", ty.i32())}, + {create()}); + auto* v = Global("a", s, ast::StorageClass::kStorage, ast::Access::kWrite, + ast::DecorationList{ + create(0), + create(0), + }); + + GeneratorImpl& gen = Build(); + + ASSERT_TRUE(gen.EmitVariable(v)) << gen.error(); + EXPECT_EQ(gen.result(), R"([[binding(0), group(0)]] var a : S; +)"); +} + +TEST_F(WgslGeneratorImplTest, EmitVariable_Access_ReadWrite) { + auto* s = Structure("S", {Member("a", ty.i32())}, + {create()}); + auto* v = Global("a", s, ast::StorageClass::kStorage, ast::Access::kReadWrite, + ast::DecorationList{ + create(0), + create(0), + }); + + GeneratorImpl& gen = Build(); + + ASSERT_TRUE(gen.EmitVariable(v)) << gen.error(); + EXPECT_EQ(gen.result(), + R"([[binding(0), group(0)]] var a : S; +)"); +} TEST_F(WgslGeneratorImplTest, EmitVariable_Decorated) { auto* v = Global("a", ty.f32(), ast::StorageClass::kPrivate, nullptr, ast::DecorationList{ @@ -65,9 +114,8 @@ TEST_F(WgslGeneratorImplTest, EmitVariable_Decorated_Multiple) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitVariable(v)) << gen.error(); - EXPECT_EQ( - gen.result(), - R"([[builtin(position), location(2)]] var a : f32; + EXPECT_EQ(gen.result(), + R"([[builtin(position), location(2)]] var a : f32; )"); } diff --git a/test/BUILD.gn b/test/BUILD.gn index ac376f8ca9..dd982644f6 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -146,7 +146,6 @@ tint_unittests_source_set("tint_unittests_core_sem_src") { tint_unittests_source_set("tint_unittests_core_src") { sources = [ - "../src/ast/access_control_test.cc", "../src/ast/access_decoration_test.cc", "../src/ast/alias_test.cc", "../src/ast/array_accessor_expression_test.cc", @@ -467,7 +466,7 @@ tint_unittests_source_set("tint_unittests_wgsl_reader_src") { "../src/reader/wgsl/parser_impl_variable_decoration_test.cc", "../src/reader/wgsl/parser_impl_variable_ident_decl_test.cc", "../src/reader/wgsl/parser_impl_variable_stmt_test.cc", - "../src/reader/wgsl/parser_impl_variable_storage_decoration_test.cc", + "../src/reader/wgsl/parser_impl_variable_qualifier_test.cc", "../src/reader/wgsl/parser_test.cc", "../src/reader/wgsl/token_test.cc", ] diff --git a/test/array/assign_to_function_var.wgsl b/test/array/assign_to_function_var.wgsl index 043fb8c082..aba7c60b09 100644 --- a/test/array/assign_to_function_var.wgsl +++ b/test/array/assign_to_function_var.wgsl @@ -8,7 +8,7 @@ struct S { var src_private : ArrayType; var src_workgroup : ArrayType; [[group(0), binding(0)]] var src_uniform : S; -[[group(0), binding(1)]] var src_storage : [[access(read_write)]] S; +[[group(0), binding(1)]] var src_storage : S; fn ret_arr() -> ArrayType { return ArrayType(); diff --git a/test/array/assign_to_function_var.wgsl.expected.wgsl b/test/array/assign_to_function_var.wgsl.expected.wgsl index 7b23ed67c2..0ab9c0f119 100644 --- a/test/array/assign_to_function_var.wgsl.expected.wgsl +++ b/test/array/assign_to_function_var.wgsl.expected.wgsl @@ -11,7 +11,7 @@ var src_workgroup : ArrayType; [[group(0), binding(0)]] var src_uniform : S; -[[group(0), binding(1)]] var src_storage : [[access(read_write)]] S; +[[group(0), binding(1)]] var src_storage : S; fn ret_arr() -> ArrayType { return ArrayType(); diff --git a/test/array/assign_to_private_var.wgsl b/test/array/assign_to_private_var.wgsl index 1c32ee3afc..194c041824 100644 --- a/test/array/assign_to_private_var.wgsl +++ b/test/array/assign_to_private_var.wgsl @@ -8,7 +8,7 @@ struct S { var src_private : ArrayType; var src_workgroup : ArrayType; [[group(0), binding(0)]] var src_uniform : S; -[[group(0), binding(1)]] var src_storage : [[access(read_write)]] S; +[[group(0), binding(1)]] var src_storage : S; var dst : ArrayType; var dst_nested : array, 3>, 4>; diff --git a/test/array/assign_to_private_var.wgsl.expected.wgsl b/test/array/assign_to_private_var.wgsl.expected.wgsl index af9c38ee8d..ab6e8c7aa7 100644 --- a/test/array/assign_to_private_var.wgsl.expected.wgsl +++ b/test/array/assign_to_private_var.wgsl.expected.wgsl @@ -11,7 +11,7 @@ var src_workgroup : ArrayType; [[group(0), binding(0)]] var src_uniform : S; -[[group(0), binding(1)]] var src_storage : [[access(read_write)]] S; +[[group(0), binding(1)]] var src_storage : S; var dst : ArrayType; diff --git a/test/array/assign_to_storage_var.wgsl b/test/array/assign_to_storage_var.wgsl index 5754a2226c..b50f0dd25c 100644 --- a/test/array/assign_to_storage_var.wgsl +++ b/test/array/assign_to_storage_var.wgsl @@ -13,10 +13,10 @@ struct S_nested { var src_private : ArrayType; var src_workgroup : ArrayType; [[group(0), binding(0)]] var src_uniform : S; -[[group(0), binding(1)]] var src_storage : [[access(read_write)]] S; +[[group(0), binding(1)]] var src_storage : S; -[[group(0), binding(2)]] var dst : [[access(read_write)]] S; -[[group(0), binding(3)]] var dst_nested : [[access(read_write)]] S_nested; +[[group(0), binding(2)]] var dst : S; +[[group(0), binding(3)]] var dst_nested : S_nested; fn ret_arr() -> ArrayType { return ArrayType(); diff --git a/test/array/assign_to_storage_var.wgsl.expected.wgsl b/test/array/assign_to_storage_var.wgsl.expected.wgsl index 65085954ae..4c2228dc72 100644 --- a/test/array/assign_to_storage_var.wgsl.expected.wgsl +++ b/test/array/assign_to_storage_var.wgsl.expected.wgsl @@ -16,11 +16,11 @@ var src_workgroup : ArrayType; [[group(0), binding(0)]] var src_uniform : S; -[[group(0), binding(1)]] var src_storage : [[access(read_write)]] S; +[[group(0), binding(1)]] var src_storage : S; -[[group(0), binding(2)]] var dst : [[access(read_write)]] S; +[[group(0), binding(2)]] var dst : S; -[[group(0), binding(3)]] var dst_nested : [[access(read_write)]] S_nested; +[[group(0), binding(3)]] var dst_nested : S_nested; fn ret_arr() -> ArrayType { return ArrayType(); diff --git a/test/array/assign_to_workgroup_var.wgsl b/test/array/assign_to_workgroup_var.wgsl index 675daf6ab7..f2b237c153 100644 --- a/test/array/assign_to_workgroup_var.wgsl +++ b/test/array/assign_to_workgroup_var.wgsl @@ -8,7 +8,7 @@ struct S { var src_private : ArrayType; var src_workgroup : ArrayType; [[group(0), binding(0)]] var src_uniform : S; -[[group(0), binding(1)]] var src_storage : [[access(read_write)]] S; +[[group(0), binding(1)]] var src_storage : S; var dst : ArrayType; var dst_nested : array, 3>, 4>; diff --git a/test/array/assign_to_workgroup_var.wgsl.expected.wgsl b/test/array/assign_to_workgroup_var.wgsl.expected.wgsl index 8816948ba9..c19bd6f655 100644 --- a/test/array/assign_to_workgroup_var.wgsl.expected.wgsl +++ b/test/array/assign_to_workgroup_var.wgsl.expected.wgsl @@ -11,7 +11,7 @@ var src_workgroup : ArrayType; [[group(0), binding(0)]] var src_uniform : S; -[[group(0), binding(1)]] var src_storage : [[access(read_write)]] S; +[[group(0), binding(1)]] var src_storage : S; var dst : ArrayType; diff --git a/test/bug/tint/221.wgsl b/test/bug/tint/221.wgsl index f764d712b4..5e2c9ff537 100644 --- a/test/bug/tint/221.wgsl +++ b/test/bug/tint/221.wgsl @@ -6,7 +6,7 @@ struct Buf{ data : Arr; }; -[[group(0), binding (0)]] var b : [[access(read_write)]] Buf; +[[group(0), binding (0)]] var b : Buf; [[stage(compute)]] fn main() { diff --git a/test/bug/tint/221.wgsl.expected.wgsl b/test/bug/tint/221.wgsl.expected.wgsl index d7130c82a4..205d2958ab 100644 --- a/test/bug/tint/221.wgsl.expected.wgsl +++ b/test/bug/tint/221.wgsl.expected.wgsl @@ -6,7 +6,7 @@ struct Buf { data : Arr; }; -[[group(0), binding(0)]] var b : [[access(read_write)]] Buf; +[[group(0), binding(0)]] var b : Buf; [[stage(compute)]] fn main() { diff --git a/test/bug/tint/492.wgsl b/test/bug/tint/492.wgsl index 453796bf18..997a367669 100644 --- a/test/bug/tint/492.wgsl +++ b/test/bug/tint/492.wgsl @@ -1,5 +1,5 @@ [[block]] struct S { a : i32; }; -[[group(0), binding(0)]] var buf : [[access(read_write)]] S; +[[group(0), binding(0)]] var buf : S; [[stage(compute)]] fn main() { let p : ptr = &buf.a; diff --git a/test/bug/tint/492.wgsl.expected.wgsl b/test/bug/tint/492.wgsl.expected.wgsl index 821566a6e6..024d4079fb 100644 --- a/test/bug/tint/492.wgsl.expected.wgsl +++ b/test/bug/tint/492.wgsl.expected.wgsl @@ -3,7 +3,7 @@ struct S { a : i32; }; -[[group(0), binding(0)]] var buf : [[access(read_write)]] S; +[[group(0), binding(0)]] var buf : S; [[stage(compute)]] fn main() { diff --git a/test/bug/tint/744.wgsl b/test/bug/tint/744.wgsl index 8950ed5d27..72db750d2b 100644 --- a/test/bug/tint/744.wgsl +++ b/test/bug/tint/744.wgsl @@ -7,9 +7,9 @@ numbers: array; }; -[[group(0), binding(0)]] var firstMatrix : [[access(read)]] Matrix; -[[group(0), binding(1)]] var secondMatrix : [[access(read)]] Matrix; -[[group(0), binding(2)]] var resultMatrix : [[access(write)]] Matrix; +[[group(0), binding(0)]] var firstMatrix : Matrix; +[[group(0), binding(1)]] var secondMatrix : Matrix; +[[group(0), binding(2)]] var resultMatrix : Matrix; [[group(0), binding(3)]] var uniforms : Uniforms; [[stage(compute), workgroup_size(2,2,1)]] diff --git a/test/bug/tint/744.wgsl.expected.wgsl b/test/bug/tint/744.wgsl.expected.wgsl index cc4accafe2..d96d5100e4 100644 --- a/test/bug/tint/744.wgsl.expected.wgsl +++ b/test/bug/tint/744.wgsl.expected.wgsl @@ -10,11 +10,11 @@ struct Matrix { numbers : array; }; -[[group(0), binding(0)]] var firstMatrix : [[access(read)]] Matrix; +[[group(0), binding(0)]] var firstMatrix : Matrix; -[[group(0), binding(1)]] var secondMatrix : [[access(read)]] Matrix; +[[group(0), binding(1)]] var secondMatrix : Matrix; -[[group(0), binding(2)]] var resultMatrix : [[access(write)]] Matrix; +[[group(0), binding(2)]] var resultMatrix : Matrix; [[group(0), binding(3)]] var uniforms : Uniforms; diff --git a/test/deprecated/access_deco/storage_buffer.wgsl b/test/deprecated/access_deco/storage_buffer.wgsl new file mode 100644 index 0000000000..3948107f18 --- /dev/null +++ b/test/deprecated/access_deco/storage_buffer.wgsl @@ -0,0 +1,12 @@ + +[[block]] +struct SB { + a : f32; +}; + +[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; + +[[stage(compute)]] +fn main() { + var x : f32 = sb.a; +} diff --git a/test/deprecated/access_deco/storage_buffer.wgsl.expected.hlsl b/test/deprecated/access_deco/storage_buffer.wgsl.expected.hlsl new file mode 100644 index 0000000000..b68812700d --- /dev/null +++ b/test/deprecated/access_deco/storage_buffer.wgsl.expected.hlsl @@ -0,0 +1,13 @@ +deprecated/access_deco/storage_buffer.wgsl:7:26 warning: use of deprecated language feature: declare access with var instead of using [[access]] decoration +[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; + ^^^ + + +RWByteAddressBuffer sb : register(u0, space0); + +[numthreads(1, 1, 1)] +void main() { + float x = asfloat(sb.Load(0u)); + return; +} + diff --git a/test/deprecated/access_deco/storage_buffer.wgsl.expected.msl b/test/deprecated/access_deco/storage_buffer.wgsl.expected.msl new file mode 100644 index 0000000000..666ca66e23 --- /dev/null +++ b/test/deprecated/access_deco/storage_buffer.wgsl.expected.msl @@ -0,0 +1,16 @@ +deprecated/access_deco/storage_buffer.wgsl:7:26 warning: use of deprecated language feature: declare access with var instead of using [[access]] decoration +[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; + ^^^ + +#include + +using namespace metal; +struct SB { + /* 0x0000 */ float a; +}; + +kernel void tint_symbol(device SB& sb [[buffer(0)]]) { + float x = sb.a; + return; +} + diff --git a/test/deprecated/access_deco/storage_buffer.wgsl.expected.spvasm b/test/deprecated/access_deco/storage_buffer.wgsl.expected.spvasm new file mode 100644 index 0000000000..0736052215 --- /dev/null +++ b/test/deprecated/access_deco/storage_buffer.wgsl.expected.spvasm @@ -0,0 +1,41 @@ +deprecated/access_deco/storage_buffer.wgsl:7:26 warning: use of deprecated language feature: declare access with var instead of using [[access]] decoration +[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; + ^^^ + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" + OpExecutionMode %main LocalSize 1 1 1 + OpName %SB "SB" + OpMemberName %SB 0 "a" + OpName %sb "sb" + OpName %main "main" + OpName %x "x" + OpDecorate %SB Block + OpMemberDecorate %SB 0 Offset 0 + OpDecorate %sb DescriptorSet 0 + OpDecorate %sb Binding 0 + %float = OpTypeFloat 32 + %SB = OpTypeStruct %float +%_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB + %sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float +%_ptr_Function_float = OpTypePointer Function %float + %16 = OpConstantNull %float + %main = OpFunction %void None %5 + %8 = OpLabel + %x = OpVariable %_ptr_Function_float Function %16 + %12 = OpAccessChain %_ptr_StorageBuffer_float %sb %uint_0 + %13 = OpLoad %float %12 + OpStore %x %13 + OpReturn + OpFunctionEnd diff --git a/test/deprecated/access_deco/storage_buffer.wgsl.expected.wgsl b/test/deprecated/access_deco/storage_buffer.wgsl.expected.wgsl new file mode 100644 index 0000000000..4e23308e9f --- /dev/null +++ b/test/deprecated/access_deco/storage_buffer.wgsl.expected.wgsl @@ -0,0 +1,15 @@ +deprecated/access_deco/storage_buffer.wgsl:7:26 warning: use of deprecated language feature: declare access with var instead of using [[access]] decoration +[[group(0), binding(0)]] var sb : [[access(read_write)]] SB; + ^^^ + +[[block]] +struct SB { + a : f32; +}; + +[[group(0), binding(0)]] var sb : SB; + +[[stage(compute)]] +fn main() { + var x : f32 = sb.a; +} diff --git a/test/deprecated/access_deco/storage_texture.wgsl b/test/deprecated/access_deco/storage_texture.wgsl new file mode 100644 index 0000000000..17cd7fd277 --- /dev/null +++ b/test/deprecated/access_deco/storage_texture.wgsl @@ -0,0 +1,6 @@ +[[group(0), binding(0)]] var tex : [[access(write)]] texture_storage_2d; + +[[stage(compute)]] +fn main() { + var x : vec2 = textureDimensions(tex); +} diff --git a/test/deprecated/access_deco/storage_texture.wgsl.expected.hlsl b/test/deprecated/access_deco/storage_texture.wgsl.expected.hlsl new file mode 100644 index 0000000000..59a6564523 --- /dev/null +++ b/test/deprecated/access_deco/storage_texture.wgsl.expected.hlsl @@ -0,0 +1,14 @@ +deprecated/access_deco/storage_texture.wgsl:1:84 warning: use of deprecated language feature: access control is expected as last parameter of storage textures +[[group(0), binding(0)]] var tex : [[access(write)]] texture_storage_2d; + ^ + +RWTexture2D tex : register(u0, space0); + +[numthreads(1, 1, 1)] +void main() { + int2 tint_tmp; + tex.GetDimensions(tint_tmp.x, tint_tmp.y); + int2 x = tint_tmp; + return; +} + diff --git a/test/deprecated/access_deco/storage_texture.wgsl.expected.msl b/test/deprecated/access_deco/storage_texture.wgsl.expected.msl new file mode 100644 index 0000000000..44a2faff1b --- /dev/null +++ b/test/deprecated/access_deco/storage_texture.wgsl.expected.msl @@ -0,0 +1,12 @@ +deprecated/access_deco/storage_texture.wgsl:1:84 warning: use of deprecated language feature: access control is expected as last parameter of storage textures +[[group(0), binding(0)]] var tex : [[access(write)]] texture_storage_2d; + ^ + +#include + +using namespace metal; +kernel void tint_symbol() { + int2 x = int2(tex.get_width(), tex.get_height()); + return; +} + diff --git a/test/deprecated/access_deco/storage_texture.wgsl.expected.spvasm b/test/deprecated/access_deco/storage_texture.wgsl.expected.spvasm new file mode 100644 index 0000000000..03c770ec34 --- /dev/null +++ b/test/deprecated/access_deco/storage_texture.wgsl.expected.spvasm @@ -0,0 +1,38 @@ +deprecated/access_deco/storage_texture.wgsl:1:84 warning: use of deprecated language feature: access control is expected as last parameter of storage textures +[[group(0), binding(0)]] var tex : [[access(write)]] texture_storage_2d; + ^ + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 16 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" + OpExecutionMode %main LocalSize 1 1 1 + OpName %tex "tex" + OpName %main "main" + OpName %x "x" + OpDecorate %tex NonReadable + OpDecorate %tex DescriptorSet 0 + OpDecorate %tex Binding 0 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 0 0 0 2 Rgba32f +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %tex = OpVariable %_ptr_UniformConstant_3 UniformConstant + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 +%_ptr_Function_v2int = OpTypePointer Function %v2int + %15 = OpConstantNull %v2int + %main = OpFunction %void None %5 + %8 = OpLabel + %x = OpVariable %_ptr_Function_v2int Function %15 + %12 = OpLoad %3 %tex + %9 = OpImageQuerySize %v2int %12 + OpStore %x %9 + OpReturn + OpFunctionEnd diff --git a/test/deprecated/access_deco/storage_texture.wgsl.expected.wgsl b/test/deprecated/access_deco/storage_texture.wgsl.expected.wgsl new file mode 100644 index 0000000000..b7a6aec2d6 --- /dev/null +++ b/test/deprecated/access_deco/storage_texture.wgsl.expected.wgsl @@ -0,0 +1,10 @@ +deprecated/access_deco/storage_texture.wgsl:1:84 warning: use of deprecated language feature: access control is expected as last parameter of storage textures +[[group(0), binding(0)]] var tex : [[access(write)]] texture_storage_2d; + ^ + +[[group(0), binding(0)]] var tex : texture_storage_2d; + +[[stage(compute)]] +fn main() { + var x : vec2 = textureDimensions(tex); +} diff --git a/test/intrinsics/arrayLength.wgsl b/test/intrinsics/arrayLength.wgsl index 6ee682871d..ef179fc4a6 100644 --- a/test/intrinsics/arrayLength.wgsl +++ b/test/intrinsics/arrayLength.wgsl @@ -3,7 +3,7 @@ struct S { a : array; }; -[[group(0), binding(0)]] var G : [[access(read)]] S; +[[group(0), binding(0)]] var G : S; [[stage(compute)]] fn main() { diff --git a/test/intrinsics/arrayLength.wgsl.expected.wgsl b/test/intrinsics/arrayLength.wgsl.expected.wgsl index 5f75515a74..bcbd967f76 100644 --- a/test/intrinsics/arrayLength.wgsl.expected.wgsl +++ b/test/intrinsics/arrayLength.wgsl.expected.wgsl @@ -3,7 +3,7 @@ struct S { a : array; }; -[[group(0), binding(0)]] var G : [[access(read)]] S; +[[group(0), binding(0)]] var G : S; [[stage(compute)]] fn main() { diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl b/test/intrinsics/gen/arrayLength/647a40.wgsl index 3fa6e381b5..30519af86e 100644 --- a/test/intrinsics/gen/arrayLength/647a40.wgsl +++ b/test/intrinsics/gen/arrayLength/647a40.wgsl @@ -26,7 +26,7 @@ struct SB { arg_0: array; }; -[[group(0), binding(0)]] var sb : [[access(read)]] SB; +[[group(0), binding(0)]] var sb : SB; fn arrayLength_647a40() { var res: u32 = arrayLength(sb.arg_0); } diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl index 271971637c..c6b65fa28b 100644 --- a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl +++ b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl @@ -3,7 +3,7 @@ struct SB { arg_0 : array; }; -[[group(0), binding(0)]] var sb : [[access(read)]] SB; +[[group(0), binding(0)]] var sb : SB; fn arrayLength_647a40() { var res : u32 = arrayLength(sb.arg_0); diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl b/test/intrinsics/gen/arrayLength/721c9d.wgsl index 1bf15a8d90..dca5bee3f6 100644 --- a/test/intrinsics/gen/arrayLength/721c9d.wgsl +++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl @@ -26,7 +26,7 @@ struct SB { arg_0: array; }; -[[group(0), binding(0)]] var sb : [[access(read)]] SB; +[[group(0), binding(0)]] var sb : SB; fn arrayLength_721c9d() { var res: u32 = arrayLength(sb.arg_0); } diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl index 963e865e7a..3bf1a0b91f 100644 --- a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl @@ -3,7 +3,7 @@ struct SB { arg_0 : array; }; -[[group(0), binding(0)]] var sb : [[access(read)]] SB; +[[group(0), binding(0)]] var sb : SB; fn arrayLength_721c9d() { var res : u32 = arrayLength(sb.arg_0); diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl b/test/intrinsics/gen/arrayLength/b083be.wgsl index a48b181ef7..40fc5e667a 100644 --- a/test/intrinsics/gen/arrayLength/b083be.wgsl +++ b/test/intrinsics/gen/arrayLength/b083be.wgsl @@ -26,7 +26,7 @@ struct SB { arg_0: array; }; -[[group(0), binding(0)]] var sb : [[access(read)]] SB; +[[group(0), binding(0)]] var sb : SB; fn arrayLength_b083be() { var res: u32 = arrayLength(sb.arg_0); } diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl index 07011895e8..3b55b34c1e 100644 --- a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl +++ b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl @@ -3,7 +3,7 @@ struct SB { arg_0 : array; }; -[[group(0), binding(0)]] var sb : [[access(read)]] SB; +[[group(0), binding(0)]] var sb : SB; fn arrayLength_b083be() { var res : u32 = arrayLength(sb.arg_0); diff --git a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.wgsl index 8aa6f10e79..ac539f1010 100644 --- a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_012b82() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.wgsl index 0c068977e0..11e00f3f2d 100644 --- a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_08753d() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.wgsl index 6b9d4ebfbf..cd7a984696 100644 --- a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_08a62e() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.wgsl index 8025f25486..a59c9ab92b 100644 --- a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_0a5fcf() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.wgsl index 2a1cdc2d66..07c383208d 100644 --- a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_0bab57() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.wgsl index 1b29dc5b73..1116b91690 100644 --- a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_0c4772() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.wgsl index e1b42278e3..1f2e360904 100644 --- a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_0cce40() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.wgsl index 0dcd6ab7d3..eacaabe534 100644 --- a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_0cf2ff() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.wgsl index a7568176c4..56bfe0842f 100644 --- a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_0d8b7e() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.wgsl index d22f78ef85..e61c4e2443 100644 --- a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_0e32ee() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.wgsl index 46318cefd7..5b3b8fcc4a 100644 --- a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_1147d6() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.wgsl index f5192034bb..7b49a48a09 100644 --- a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_147998() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.wgsl index 6b679ac258..d9fba5cf97 100644 --- a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_16036c() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.wgsl index b66918a053..9dcbc77643 100644 --- a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_168fcc() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.wgsl index 6eb56a5b19..42ee0d44eb 100644 --- a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_18bd57() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.wgsl index b484dbe047..1b97b6344b 100644 --- a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_19bffc() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.wgsl index d8ec0223b8..9df4e177ef 100644 --- a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_1a58e7() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.wgsl index 07dcdb5a46..45e601f800 100644 --- a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_1aa199() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.wgsl index d2d1fde840..80dec55e54 100644 --- a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_1b71f0() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.wgsl index 7ab9a3780b..552452e252 100644 --- a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_1d6c26() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.wgsl index 4e8b5f6747..65b30fcba0 100644 --- a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_1e189c() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.wgsl index 7cd094b870..e2a609bb81 100644 --- a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_1e9e39() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.wgsl index b88578623f..95b156e172 100644 --- a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_214b7b() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.wgsl index 760b456248..1cab05993a 100644 --- a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_214dd4() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.wgsl index 83295f3108..e1327eb37a 100644 --- a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_26ef6c() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.wgsl index c9e1f1698e..ed74a86567 100644 --- a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_2ad087() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.wgsl index 8ad08a8a44..40df1b3f89 100644 --- a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_2d32ae() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.wgsl index 6ce2d7643c..0b5b5c1763 100644 --- a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_2e0662() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.wgsl index 64ae07464f..4a6cf0c3d8 100644 --- a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_2f289f() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.wgsl index 1c8d987670..3c2f7aaa32 100644 --- a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_318ecc() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.wgsl index b2d0826ffc..6a907d4465 100644 --- a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_340d06() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.wgsl index 5d0bac4f7f..66454eff4b 100644 --- a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_398e30() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.wgsl index ea6c5b2291..c6dc285afd 100644 --- a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_39a600() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.wgsl index f369f54666..22a6bbf014 100644 --- a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_3a94ea() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.wgsl index fbb8bf812e..fe6cee3415 100644 --- a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_3aca08() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.wgsl index 5f25817e67..78f31e9e79 100644 --- a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_3c5ad8() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.wgsl index 981b928f2e..a30d14419f 100644 --- a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_3d5817() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.wgsl index 22ba5eee79..8ddd8be01e 100644 --- a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_40bc10() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.wgsl index f548fe486c..f05b399f85 100644 --- a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_4267ee() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.wgsl index d218c7b233..38c83b0a8d 100644 --- a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_42d4e6() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.wgsl index 19693a983c..723d588282 100644 --- a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_441392() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.wgsl index 5fc20b1277..e41ddd8a5b 100644 --- a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_48cb89() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.wgsl index c9875415c9..906e9e2523 100644 --- a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_48cbb2() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.wgsl index 25c40cd041..6be9bc9abd 100644 --- a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_48f360() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.wgsl index 2308b26025..dd209413ec 100644 --- a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_49d274() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.wgsl index f29f9ac1a7..ba16c042e6 100644 --- a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_4df9a8() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.wgsl index fecc1a3b46..ae54442811 100644 --- a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_55b23e() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.wgsl index 4523c91761..97dc80761b 100644 --- a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_56ccfa() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.wgsl index 485e888267..aa29db6e65 100644 --- a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_57da0b() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.wgsl index ef8e7a850c..32ff0d96ed 100644 --- a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_57e7b3() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.wgsl index 238dcbac66..296fe97522 100644 --- a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_58a515() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.wgsl index f8e2f8b2cc..18d8afc467 100644 --- a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_5985f3() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.wgsl index 23e4b3601d..454b4fb5e8 100644 --- a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_5caa5e() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.wgsl index a5193f0e1d..f55c312fa3 100644 --- a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_5e295d() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.wgsl index 54326c9bd7..2fc63f0b73 100644 --- a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_60bf54() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.wgsl index c77564fb18..aa0a7f83ba 100644 --- a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_63f3cf() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.wgsl index 8d5e3b57aa..e2e6ef479e 100644 --- a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_66dc4e() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.wgsl index 3f6a780f39..bb886d09e6 100644 --- a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_670d90() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.wgsl index dba95a2a36..af6586e372 100644 --- a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_68105c() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.wgsl index 2cf5d09108..c72dafc3f8 100644 --- a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_6adac6() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.wgsl index 739dd84aef..961b7233a3 100644 --- a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_6c08ab() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.wgsl index 10b273b490..ac32f1eba3 100644 --- a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_6e2d12() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.wgsl index 624277c0b0..84bc7ec375 100644 --- a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_6f0d79() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.wgsl index c303a34112..d8cd581696 100644 --- a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_702c53() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.wgsl index 975437ab7b..6114a9d39e 100644 --- a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_70e26a() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.wgsl index 3380b0ee24..60146b847b 100644 --- a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_71e8f7() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.wgsl index b8ac441c39..d56bd69345 100644 --- a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_770103() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.wgsl index 6fedeb1103..f2f90891d0 100644 --- a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_7f5c2e() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.wgsl index a8552beb6e..c1d4f5309a 100644 --- a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_8028f3() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.wgsl index 3912edc0eb..7c2a044c8c 100644 --- a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_811679() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.wgsl index 3372df2f1c..c0c9e05ae5 100644 --- a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_820596() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.wgsl index 7b8a30989f..8c1011397e 100644 --- a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_82138e() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.wgsl index b87625cb05..f3b53fc855 100644 --- a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_8347ab() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.wgsl index ac6d1245a4..5cbb82b7a5 100644 --- a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_83ee5a() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.wgsl index 82f35a8790..3197f4ee77 100644 --- a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_8799ee() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.wgsl index b8e4b8c846..e4d6d51fc8 100644 --- a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_89a864() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.wgsl index 5869ada308..200e8e3bef 100644 --- a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_8b4fff() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.wgsl index 4e4b06ff0e..b4d874b1b2 100644 --- a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_8d89f8() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.wgsl index bb7611f66d..edbd3a48f4 100644 --- a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_8fca0f() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.wgsl index e508ed0ad3..f448823c68 100644 --- a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_9042ab() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.wgsl index 0126b0ef57..c6d5ab71d2 100644 --- a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_924742() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.wgsl index bb455ff211..c7c1b7d5c6 100644 --- a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_92ad20() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.wgsl index 96d00a5074..e5211ab522 100644 --- a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_9572e5() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.wgsl index ab83144d23..af6f26c2bb 100644 --- a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_998f6b() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.wgsl index eaf4cb70f0..76f4921d3c 100644 --- a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_9abfe5() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.wgsl index a1c58b11db..c120a9829e 100644 --- a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_9da9e2() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.wgsl index 6e481c452f..a97a20eac8 100644 --- a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_9eb8d8() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.wgsl index 2ea0a437e5..ee2c2c1e45 100644 --- a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_a0aad1() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.wgsl index 71446b5709..eeaf9a6847 100644 --- a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_a0e4ec() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.wgsl index 28907fe00a..0bc4d60bd5 100644 --- a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_a863f2() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.wgsl index bc281cd77d..922d19d283 100644 --- a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_ae457f() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.wgsl index 73263d7371..6aebe9ecc8 100644 --- a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_b91240() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.wgsl index ef3d759332..e620f4ad22 100644 --- a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_ba6e15() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.wgsl index 364b3b2c43..4766a5f4ce 100644 --- a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_bb3dde() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.wgsl index e2a273650d..5d839324bd 100644 --- a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_c2215f() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.wgsl index aa7601854f..30ae07124f 100644 --- a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_c30e75() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.wgsl index d0234350b6..5d93e280f3 100644 --- a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_c60b66() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.wgsl index 8acd040c6b..bee736c049 100644 --- a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_c74533() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.wgsl index a78b4f4566..a2ae851f94 100644 --- a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_c7943d() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.wgsl index 1e79cdbe6e..a201571e0e 100644 --- a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_caaabb() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.wgsl index 94d868a8e0..1245f54ac7 100644 --- a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_cc5478() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.wgsl index 0535708d9a..247fc375c2 100644 --- a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_cc968c() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.wgsl index 84b8ce7bb2..1a523633fd 100644 --- a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_cccc8f() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.wgsl index 808c1ae439..97e08ce91a 100644 --- a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_cd76a7() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.wgsl index 2f6b64c55c..5857cc82b5 100644 --- a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_cdaff9() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.wgsl index f25baa9a77..74e840443f 100644 --- a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_cdf473() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.wgsl index 4a3610d6be..94919bda5c 100644 --- a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_cf1d42() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.wgsl index db7d5887bd..ff42b8bd42 100644 --- a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_cf7e43() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.wgsl index a3480eebd3..3de5d350e0 100644 --- a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_d40b9e() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.wgsl index 3dd74734fb..8a56652de9 100644 --- a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_d4106f() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.wgsl index b807203be4..8664a89165 100644 --- a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_d8f951() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.wgsl index 738261e913..4c533e25a2 100644 --- a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_da3099() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.wgsl index e8ad8b5401..01ff304bf4 100644 --- a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_dba47c() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.wgsl index cbfe2d925e..93c08fb4f0 100644 --- a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_dc2dd0() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.wgsl index cea3ee548e..8e8fa05a23 100644 --- a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_e10157() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.wgsl index 57ba70605e..dbda02c008 100644 --- a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureDimensions_e93464() { var res : i32 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.wgsl index f159ee130b..820cdccd5f 100644 --- a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_e9628c() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.wgsl index 80b69f69a7..2c05b97077 100644 --- a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_e9e96c() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.wgsl index c5a4c06a80..ded00bd2a6 100644 --- a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_e9fe54() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.wgsl index f6d3e7eeac..7f3065938a 100644 --- a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_e9fe58() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.wgsl index 7b8c55cd0a..64adcb15a2 100644 --- a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_f1b72b() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.wgsl index 2fa399fcba..1fe82729ba 100644 --- a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_f7aa9e() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.wgsl index 0b0ef269d9..10cbcbf792 100644 --- a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_f7e436() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.wgsl index 0d82fc1de4..a3aad84e8c 100644 --- a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_f931c7() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.wgsl index e7a2306723..9dd338d29d 100644 --- a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureDimensions_fa90e1() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.wgsl index 9e57cf6a8b..901c479fcc 100644 --- a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureDimensions_fb5670() { var res : vec2 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.wgsl index 724fec4150..18fc3b03f1 100644 --- a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_fbbe4d() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.wgsl index a5ca00a08b..fbbabf70b3 100644 --- a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureDimensions_fcac78() { var res : vec3 = textureDimensions(arg_0); diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl index e02cdf028a..53f59fb5f6 100644 --- a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_050c33() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl index be1af70c6c..ecaffe95e2 100644 --- a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_072e26() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl index f2f0460a61..66edac12dc 100644 --- a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_078bc4() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl index aed5d39d35..68418264be 100644 --- a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_127e12() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl index 4aa8b44eea..bd1d310877 100644 --- a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_1561a7() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl index 7c6460a1d7..279eb74536 100644 --- a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_1a062f() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl index 61bda65f4d..625f24f760 100644 --- a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_1a8452() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl index 1f5f4cf9d2..83e4525b2f 100644 --- a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_20fa2f() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl index 03d832b43c..11ea8677aa 100644 --- a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_276a2c() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl index 1e7da98796..ea3a147a3c 100644 --- a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_2887d7() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl index 94ee8c4514..f255805103 100644 --- a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_2ae485() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl index ead2ebf42f..42777c1cbc 100644 --- a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_2d6cf7() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl index 90a425b818..09103fabcb 100644 --- a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_3c0d9e() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl index c0e77d0831..8bcb521714 100644 --- a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_3c9587() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl index 47f2b47ecd..173de566e2 100644 --- a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_3d001b() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl index 51108201ce..e9ae4f8d59 100644 --- a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_3d9c90() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl index 4e4c98561e..39ceaad5ab 100644 --- a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_505aa2() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl index aa8b4a4cbe..ae7d2849a9 100644 --- a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_519ab5() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl index d06470068f..a8c1054daa 100644 --- a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_53378a() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl index e464c72111..23386cde82 100644 --- a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_560573() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl index 07a18afd72..9a6f7d766c 100644 --- a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_582015() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl index 28eb64c18b..21de3a6a5c 100644 --- a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_5bb7fb() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl index 281d549860..17a102cff1 100644 --- a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_5d0a2f() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl index a0f70c0464..3676aeefef 100644 --- a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_62d125() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl index 3eede21498..17aa2785c5 100644 --- a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_6678b6() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl index aae3e6c22a..f1e922911b 100644 --- a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_67edca() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl index 40aa2c4b92..30ce4a8c8f 100644 --- a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_749704() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl index 747041dfa2..baa2499bf7 100644 --- a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_83cea4() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl index eda9388842..03b14af205 100644 --- a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_8e5032() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl index 750c3efec0..e697b1a35e 100644 --- a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_936952() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl index 355df010b8..9da0be5d02 100644 --- a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_9a7c90() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl index 35f6a52015..5aa4f8d048 100644 --- a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_9c2a14() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl index 4ad2dcdb46..976dec1e6b 100644 --- a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_a6a85a() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl index daf68a42c4..d4c44c8b12 100644 --- a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_a6b61d() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl index fdd365212d..d6f697459f 100644 --- a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_a7a3c3() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl index 92d14f4e21..570f9cefb8 100644 --- a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_b1bf79() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl index f6bc2f413b..d3ea3c84c0 100644 --- a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_b58c6d() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl index 4bf85458f0..1f4817e6d0 100644 --- a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_b6c458() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl index 0acf1d8dec..b838f9e9e7 100644 --- a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_bfd154() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl index 855caf6fbb..bd1e6cc9a9 100644 --- a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_c02b74() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl index 39db3518dc..da23603cf2 100644 --- a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_c07013() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl index 43965d8ca9..c30538fb0c 100644 --- a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_c40dcb() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl index a85b4e0d79..79f85f6248 100644 --- a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_c456bc() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl index 4b772126ce..3af835bf6a 100644 --- a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_c7cbed() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl index 73ec9deb7f..fbd652133e 100644 --- a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_c9cc40() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl index d795c88a4e..1c5665ffb0 100644 --- a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_d5c48d() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl index c0148386d8..77b6b330bc 100644 --- a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_d81c57() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl index 892d0257be..b4f96da151 100644 --- a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_d8617f() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl index 3cbc34f8d2..37d79eb54a 100644 --- a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_dbd554() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl index c5757d2562..64e2e1f3a7 100644 --- a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_ddeed3() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl index c21dfb702c..733a7a5d2c 100644 --- a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_dee8e7() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl index 33db37a742..e2e525d23b 100644 --- a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_e65916() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl index 48373a584e..dd32ccc034 100644 --- a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_e893d7() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl index 11af36ee94..b0d25ec452 100644 --- a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_eb573b() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl index 3e5e549b1d..07de2504a6 100644 --- a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureLoad_ecc823() { var res : vec4 = textureLoad(arg_0, vec2()); diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl index 68c90ba66c..44064ddb90 100644 --- a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_ef5405() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl index c20a1cd153..0feefabe48 100644 --- a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_f06b69() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl index a5546237ea..55d846fc5a 100644 --- a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_f379e2() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl index 394ca11fdf..8066af7ca3 100644 --- a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_f56e6f() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl index 5402217970..ac62fc10e5 100644 --- a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_f74bd8() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl index 6ab0bc3942..6b50dcf186 100644 --- a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_fc6d36() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl index 1e9118c268..a64885eba7 100644 --- a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureLoad_fdebd0() { var res : vec4 = textureLoad(arg_0, vec2(), 1); diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl index 5f27e75206..11fdd1fd0b 100644 --- a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureLoad_fe222a() { var res : vec4 = textureLoad(arg_0, 1); diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl index cb8f4b6007..25865d470a 100644 --- a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureLoad_feab99() { var res : vec4 = textureLoad(arg_0, vec3()); diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl index 1a2a38d34f..77783aa03e 100644 --- a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_058cc3() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl index 5235e46b9d..05314d0c0f 100644 --- a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_09d05d() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl index 783081fa35..393a7a0245 100644 --- a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_13b4ce() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl index 4932ed6efb..676195eae6 100644 --- a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_22e53b() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl index 105f35fc33..c3ae3e2440 100644 --- a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_2f6bb3() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl index 6cf6c73457..61a7bb0d05 100644 --- a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_315298() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl index 42d36f29ce..8ab4d01b3e 100644 --- a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_3615e3() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl index 1d83dcc0a2..4e6b9840c2 100644 --- a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_390fd5() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl index 756cf9fdd4..89e8b48fdc 100644 --- a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_45155d() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl index f3c2619851..ad275dbe7d 100644 --- a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_4bf67b() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl index c2c48bd90e..f61c9a3953 100644 --- a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_562013() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl index b7f2f1805e..58808a43be 100644 --- a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_57092f() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl index 606e2b04fa..51ccf5c30c 100644 --- a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_68a65b() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl index 4378023779..e80248e5ef 100644 --- a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_7f1937() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl index b898ee9edc..acac86b061 100644 --- a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_938763() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl index 09a5873523..b384e59cf1 100644 --- a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_9700fb() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl index 595c790cee..fa9fd0fe6c 100644 --- a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_a216d2() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl index 37ada319b7..b0678df383 100644 --- a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_aa08a7() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl index 86e0e6a370..f8d69bdc8e 100644 --- a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_ab0c9b() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl index e06a165421..5bc1e44337 100644 --- a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_b8cd76() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl index 6e4fd3a6e6..a35ecdbb2c 100644 --- a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_be1d70() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl index d986afd5ec..3f561f7ba3 100644 --- a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_be3acb() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl index d57c7069f5..55b06233c8 100644 --- a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_c09917() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl index 781b87844d..70719ee9e6 100644 --- a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_c7c7f2() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl index b90de11503..2b9c43d6d9 100644 --- a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_cd5dc8() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl index 5aab279d61..f27c252a2c 100644 --- a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_d5b228() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl index 2545c669f8..5a38d3fd32 100644 --- a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_e15642() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl index bf169dd0b6..54491f9231 100644 --- a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_e31be1() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl index 2ba778e472..77cfc30c97 100644 --- a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_ee942f() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl index 2141b9cb81..1630230fda 100644 --- a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_f33005() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl index d4c9e256f0..79cf26cc61 100644 --- a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_fcec98() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl index a5ddef8cb6..5498c71f83 100644 --- a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureNumLayers_ff5e89() { var res : i32 = textureNumLayers(arg_0); diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl index f31db20d61..b8dbde15cd 100644 --- a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_05ce15() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl index 46247d551c..7b0887c9dc 100644 --- a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_064c7f() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl index dbb407b086..5e28e982e8 100644 --- a/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_068641() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl index 6a1e8ddf14..b51a2f24ed 100644 --- a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_0af6b5() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl index 96e508b7a9..8abee33f42 100644 --- a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_0c3dff() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl index 78bc05dfbb..6e9b31ef7b 100644 --- a/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_102722() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl index d265bc0449..ced67609aa 100644 --- a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_1bbd08() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl index 17368d27ac..4646962b22 100644 --- a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_1c02e7() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl index cb9bde4993..8536604ecc 100644 --- a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_22d955() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl index a2bb93d1db..ab7beef97f 100644 --- a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_26bf70() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl index f541a87ffb..9ae12bf2c4 100644 --- a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_2796b4() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl index 6dd1a80eb3..ed127f012c 100644 --- a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_2ac6c7() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl index c1d63b6f00..2038c935a7 100644 --- a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_2eb2a4() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl index adb55f630a..5d611eb4b6 100644 --- a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_2ed2a3() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl index 0349879561..d08889a683 100644 --- a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_31745b() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl index c7addc8076..3099b25351 100644 --- a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_32f368() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl index 3d47b3886f..638ac346fb 100644 --- a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_331aee() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl index f87ee3ef54..a3528d8e73 100644 --- a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_38e8d7() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl index 2eadd38bc2..77717b87ae 100644 --- a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_3a52ac() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl index 3171defa7a..2380bdff93 100644 --- a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_3bb7a1() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl index be5532ba4b..e554d6125b 100644 --- a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_3bec15() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl index 6b61a49212..9dc38a050a 100644 --- a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_441ba8() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl index 4c0fd68f6a..8c8e1e84d6 100644 --- a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_4fc057() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl index adeefea649..bec35c50a7 100644 --- a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_5a2f8f() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl index 23913666c5..92f1984eb8 100644 --- a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_60975f() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl index 7dcc695abd..335ab1c71b 100644 --- a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_682fd6() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl index 6ed15c6f6d..83b679a9cf 100644 --- a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_6b75c3() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl index 6e06e4f7ca..1453f09821 100644 --- a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_6b80d2() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl index 900cfeab24..db87b5be0c 100644 --- a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_6cff2e() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl index eec8577504..bf9b952d12 100644 --- a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_6da692() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl index 3dc131cefd..f9238c276b 100644 --- a/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_731349() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl index 8f5dfb6b69..dd1a7e3005 100644 --- a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_752da6() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl index 434cae54df..d18f6bb882 100644 --- a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_77c0ae() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl index 420fd1ce37..1afb9462b2 100644 --- a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_7cec8d() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl index d0bd9f33e6..5eb44e1f2a 100644 --- a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_7f7fae() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl index 3306d47308..a1a469e683 100644 --- a/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_804942() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl index 2e0e003f52..e9277388f1 100644 --- a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_805dae() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl index 76596001d1..a5afd2603d 100644 --- a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_83bcc1() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl index 084d473c2d..e0a431ff0c 100644 --- a/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_872747() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl index f390e47f5e..7af6f1df1b 100644 --- a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_8e0479() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl index a6df58a912..b6bb528357 100644 --- a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_8f71a1() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl index bda2165e82..617bebe50c 100644 --- a/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_969534() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl index 1b3385b013..e6b2ae3d44 100644 --- a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_9a3ecc() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl index ca7531519b..29c626f8b1 100644 --- a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_9d9cd5() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl index 97220bf605..8ae880d7a7 100644 --- a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_9e3ec5() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl index f649c8b2d4..18380d5f8d 100644 --- a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_ac67aa() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl index d5a48e50ce..cbfd6213dc 100644 --- a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_b706b1() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl index 4c83b975f0..91d52f9c96 100644 --- a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_bbcb7f() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl index cf60e0d30e..c2a01b1986 100644 --- a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d; fn textureStore_be6e30() { textureStore(arg_0, vec2(), vec4()); diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl index 08ff4cb160..be55c998f0 100644 --- a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_bf775c() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl index 671eef02fa..c7237ea151 100644 --- a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_c5af1e() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl index f5d4ab38a6..5b7c3fb865 100644 --- a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_c863be() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl index 13b319031f..c2373a0e3b 100644 --- a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_d73b5c() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl index 487e0548c9..2e971b4265 100644 --- a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_dd7d81() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl index ed94049c2f..e07f74addd 100644 --- a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_dde364() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl index 53888d3775..6e19428442 100644 --- a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_e885e8() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl index 5cf2b135b8..0e0e7e535c 100644 --- a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_eb702f() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl index 31287b919e..520ce226f4 100644 --- a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_eb78b9() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl index c68cc918f6..dd420dbdea 100644 --- a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_ee6acc() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl index e8bf5e08f3..271825ad5f 100644 --- a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_ef9f2f() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl index 8f23e0ccdc..a23c85dcff 100644 --- a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; +[[group(1), binding(0)]] var arg_0 : texture_storage_3d; fn textureStore_f8dead() { textureStore(arg_0, vec3(), vec4()); diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl index efbe0fe9b0..7986787c59 100644 --- a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_f9be83() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl index 78ac35d220..c2488ecabf 100644 --- a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; +[[group(1), binding(0)]] var arg_0 : texture_storage_1d; fn textureStore_fb9a8f() { textureStore(arg_0, 1, vec4()); diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl index 18f047138a..fad0343e8e 100644 --- a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl @@ -1,4 +1,4 @@ -[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; +[[group(1), binding(0)]] var arg_0 : texture_storage_2d_array; fn textureStore_fbf53f() { textureStore(arg_0, vec2(), 1, vec4()); diff --git a/test/intrinsics/intrinsics.wgsl.tmpl b/test/intrinsics/intrinsics.wgsl.tmpl index e0ca593102..95d29b4200 100644 --- a/test/intrinsics/intrinsics.wgsl.tmpl +++ b/test/intrinsics/intrinsics.wgsl.tmpl @@ -43,7 +43,7 @@ struct SB { {{- end -}} {{- end -}} }; -[[group(0), binding(0)]] var sb : [[access(read)]] SB; +[[group(0), binding(0)]] var sb : SB; {{ end -}} {{- /* Generate module-scoped resource variables (textures, samplers, etc) */ -}} diff --git a/test/ptr_ref/load/local/ptr_storage.wgsl b/test/ptr_ref/load/local/ptr_storage.wgsl index d334f3420c..d8f764f8ae 100644 --- a/test/ptr_ref/load/local/ptr_storage.wgsl +++ b/test/ptr_ref/load/local/ptr_storage.wgsl @@ -4,7 +4,7 @@ struct S { }; [[group(0), binding(0)]] -var v : [[access(read_write)]] S; +var v : S; [[stage(compute)]] fn main() { diff --git a/test/ptr_ref/load/local/ptr_storage.wgsl.expected.wgsl b/test/ptr_ref/load/local/ptr_storage.wgsl.expected.wgsl index 0c88535dda..c8c24d2192 100644 --- a/test/ptr_ref/load/local/ptr_storage.wgsl.expected.wgsl +++ b/test/ptr_ref/load/local/ptr_storage.wgsl.expected.wgsl @@ -3,7 +3,7 @@ struct S { a : i32; }; -[[group(0), binding(0)]] var v : [[access(read_write)]] S; +[[group(0), binding(0)]] var v : S; [[stage(compute)]] fn main() { diff --git a/test/samples/compute_boids.wgsl b/test/samples/compute_boids.wgsl index 7570102ee6..e0a12065c3 100644 --- a/test/samples/compute_boids.wgsl +++ b/test/samples/compute_boids.wgsl @@ -54,8 +54,8 @@ struct Particle { }; [[binding(0), group(0)]] var params : SimParams; -[[binding(1), group(0)]] var particlesA : [[access(read_write)]] Particles; -[[binding(2), group(0)]] var particlesB : [[access(read_write)]] Particles; +[[binding(1), group(0)]] var particlesA : Particles; +[[binding(2), group(0)]] var particlesB : Particles; // https://github.com/austinEng/Project6-Vulkan-Flocking/blob/master/data/shaders/computeparticles/particle.comp [[stage(compute)]] diff --git a/test/samples/compute_boids.wgsl.expected.wgsl b/test/samples/compute_boids.wgsl.expected.wgsl index 882e2630c6..f1b9ee4d96 100644 --- a/test/samples/compute_boids.wgsl.expected.wgsl +++ b/test/samples/compute_boids.wgsl.expected.wgsl @@ -33,9 +33,9 @@ struct Particles { [[binding(0), group(0)]] var params : SimParams; -[[binding(1), group(0)]] var particlesA : [[access(read_write)]] Particles; +[[binding(1), group(0)]] var particlesA : Particles; -[[binding(2), group(0)]] var particlesB : [[access(read_write)]] Particles; +[[binding(2), group(0)]] var particlesB : Particles; [[stage(compute)]] fn comp_main([[builtin(global_invocation_id)]] gl_GlobalInvocationID : vec3) { diff --git a/test/shader_io/shared_struct_storage_buffer.wgsl b/test/shader_io/shared_struct_storage_buffer.wgsl index 56f983c936..5e2fabb37f 100644 --- a/test/shader_io/shared_struct_storage_buffer.wgsl +++ b/test/shader_io/shared_struct_storage_buffer.wgsl @@ -6,7 +6,7 @@ struct S { }; [[group(0), binding(0)]] -var output : [[access(write)]] S; +var output : S; [[stage(fragment)]] fn frag_main(input : S) { diff --git a/test/shader_io/shared_struct_storage_buffer.wgsl.expected.wgsl b/test/shader_io/shared_struct_storage_buffer.wgsl.expected.wgsl index db8682f78f..12065e672a 100644 --- a/test/shader_io/shared_struct_storage_buffer.wgsl.expected.wgsl +++ b/test/shader_io/shared_struct_storage_buffer.wgsl.expected.wgsl @@ -8,7 +8,7 @@ struct S { v : vec4; }; -[[group(0), binding(0)]] var output : [[access(write)]] S; +[[group(0), binding(0)]] var output : S; [[stage(fragment)]] fn frag_main(input : S) { diff --git a/tools/src/cmd/fix-tests/main.go b/tools/src/cmd/fix-tests/main.go index 886527065a..86cb459e31 100644 --- a/tools/src/cmd/fix-tests/main.go +++ b/tools/src/cmd/fix-tests/main.go @@ -77,7 +77,11 @@ func run() error { testResultsPath := filepath.Join(tmpDir, "test-results.json") // Run the tests - switch err := exec.Command(exe, "--gtest_output=json:"+testResultsPath).Run().(type) { + testArgs := []string{"--gtest_output=json:" + testResultsPath} + if len(args) > 1 { + testArgs = append(testArgs, args[1:]...) + } + switch err := exec.Command(exe, testArgs...).Run().(type) { default: return err case nil: