Update variables in address space template.

This CL updates the address space template to remove some usages of
`stoarge`.

Bug: tint:1404
Change-Id: I4c10f62886d2be4b03bce85dac9d58e3547ca60b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104423
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
dan sinclair 2022-10-04 19:44:48 +00:00 committed by Dawn LUCI CQ
parent e89c27c648
commit 1dbda6f254
2 changed files with 4086 additions and 4086 deletions

File diff suppressed because it is too large Load Diff

View File

@ -43,7 +43,7 @@ See:
{{- /* Generate RW storage buffer parameters */ -}}
{{- $sb_rw_fields := Eval "EmitBufferFields" "overload" $overload
"var_name" "sb_rw"
"storage" "storage"
"address_space" "storage"
"access" "read_write"
"args" $args -}}
{{- if $sb_rw_fields -}}
@ -56,7 +56,7 @@ struct SB_RW {
{{- /* Generate RO storage buffer parameters */ -}}
{{- $sb_ro_fields := Eval "EmitBufferFields" "overload" $overload
"var_name" "sb_ro"
"storage" "storage"
"address_space" "storage"
"access" "read"
"args" $args -}}
{{- if $sb_ro_fields -}}
@ -69,7 +69,7 @@ struct SB_RO {
{{- /* Generate uniform buffer parameters */ -}}
{{- $ub_fields := Eval "EmitBufferFields" "overload" $overload
"var_name" "ub"
"storage" "uniform"
"address_space" "uniform"
"access" "read"
"args" $args -}}
{{- if $ub_fields -}}
@ -198,19 +198,19 @@ enable f16;
{{- /* Argument is a map with the following expected keys: */ -}}
{{- /* 'overload' - the current overload */ -}}
{{- /* 'var_name' - name of the variable of the structure type */ -}}
{{- /* 'storage' - filtered address space */ -}}
{{- /* 'address_space' - filtered address space */ -}}
{{- /* 'access' - filtered access */ -}}
{{- /* 'args' - argument map that's populated with the fields */ -}}
{{- /* ------------------------------------------------------------------ */ -}}
{{- $overload := .Get "overload" -}}
{{- $var_name := .Get "var_name" -}}
{{- $filter_storage := .Get "storage" -}}
{{- $filter_address_space := .Get "address_space" -}}
{{- $filter_access := .Get "access" -}}
{{- $args := .Get "args" -}}
{{- range $i, $p := $overload.Parameters }}
{{- $address_space := Eval "AddressSpace" $p.Type -}}
{{- $access := Eval "Access" $p.Type -}}
{{- if and (eq $filter_storage $address_space) (eq $filter_access $access) }}
{{- if and (eq $filter_address_space $address_space) (eq $filter_access $access) }}
{{- if eq "ptr" $p.Type.Target.Name }}
arg_{{$i}}: {{template "Type" (index $p.Type.TemplateArguments 1)}},
{{ $args.Put $i (printf "&%v.arg_%v" $var_name $i) -}}
@ -245,7 +245,7 @@ enable f16;
{{- if eq $name "ptr" -}}{{(index .TemplateArguments 2).Target.Name}}
{{- else -}}
{{- /* Emit the default for the address space */ -}}
{{- /* https://gpuweb.github.io/gpuweb/wgsl/#storage-class */ -}}
{{- /* https://gpuweb.github.io/gpuweb/wgsl/#address-space */ -}}
{{- $address_space := Eval "AddressSpace" . -}}
{{- if eq $address_space "function" -}}read_write
{{- else if eq $address_space "private" -}}read_write