mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-09 14:45:58 +00:00
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 <bclayton@google.com> Reviewed-by: James Price <jrprice@google.com> Reviewed-by: David Neto <dneto@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
39 lines
1.5 KiB
Plaintext
39 lines
1.5 KiB
Plaintext
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<rgba32float>;
|
|
^
|
|
|
|
; 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
|