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:
parent
e89c27c648
commit
1dbda6f254
File diff suppressed because it is too large
Load Diff
|
@ -43,7 +43,7 @@ See:
|
||||||
{{- /* Generate RW storage buffer parameters */ -}}
|
{{- /* Generate RW storage buffer parameters */ -}}
|
||||||
{{- $sb_rw_fields := Eval "EmitBufferFields" "overload" $overload
|
{{- $sb_rw_fields := Eval "EmitBufferFields" "overload" $overload
|
||||||
"var_name" "sb_rw"
|
"var_name" "sb_rw"
|
||||||
"storage" "storage"
|
"address_space" "storage"
|
||||||
"access" "read_write"
|
"access" "read_write"
|
||||||
"args" $args -}}
|
"args" $args -}}
|
||||||
{{- if $sb_rw_fields -}}
|
{{- if $sb_rw_fields -}}
|
||||||
|
@ -56,7 +56,7 @@ struct SB_RW {
|
||||||
{{- /* Generate RO storage buffer parameters */ -}}
|
{{- /* Generate RO storage buffer parameters */ -}}
|
||||||
{{- $sb_ro_fields := Eval "EmitBufferFields" "overload" $overload
|
{{- $sb_ro_fields := Eval "EmitBufferFields" "overload" $overload
|
||||||
"var_name" "sb_ro"
|
"var_name" "sb_ro"
|
||||||
"storage" "storage"
|
"address_space" "storage"
|
||||||
"access" "read"
|
"access" "read"
|
||||||
"args" $args -}}
|
"args" $args -}}
|
||||||
{{- if $sb_ro_fields -}}
|
{{- if $sb_ro_fields -}}
|
||||||
|
@ -69,7 +69,7 @@ struct SB_RO {
|
||||||
{{- /* Generate uniform buffer parameters */ -}}
|
{{- /* Generate uniform buffer parameters */ -}}
|
||||||
{{- $ub_fields := Eval "EmitBufferFields" "overload" $overload
|
{{- $ub_fields := Eval "EmitBufferFields" "overload" $overload
|
||||||
"var_name" "ub"
|
"var_name" "ub"
|
||||||
"storage" "uniform"
|
"address_space" "uniform"
|
||||||
"access" "read"
|
"access" "read"
|
||||||
"args" $args -}}
|
"args" $args -}}
|
||||||
{{- if $ub_fields -}}
|
{{- if $ub_fields -}}
|
||||||
|
@ -198,19 +198,19 @@ enable f16;
|
||||||
{{- /* Argument is a map with the following expected keys: */ -}}
|
{{- /* Argument is a map with the following expected keys: */ -}}
|
||||||
{{- /* 'overload' - the current overload */ -}}
|
{{- /* 'overload' - the current overload */ -}}
|
||||||
{{- /* 'var_name' - name of the variable of the structure type */ -}}
|
{{- /* 'var_name' - name of the variable of the structure type */ -}}
|
||||||
{{- /* 'storage' - filtered address space */ -}}
|
{{- /* 'address_space' - filtered address space */ -}}
|
||||||
{{- /* 'access' - filtered access */ -}}
|
{{- /* 'access' - filtered access */ -}}
|
||||||
{{- /* 'args' - argument map that's populated with the fields */ -}}
|
{{- /* 'args' - argument map that's populated with the fields */ -}}
|
||||||
{{- /* ------------------------------------------------------------------ */ -}}
|
{{- /* ------------------------------------------------------------------ */ -}}
|
||||||
{{- $overload := .Get "overload" -}}
|
{{- $overload := .Get "overload" -}}
|
||||||
{{- $var_name := .Get "var_name" -}}
|
{{- $var_name := .Get "var_name" -}}
|
||||||
{{- $filter_storage := .Get "storage" -}}
|
{{- $filter_address_space := .Get "address_space" -}}
|
||||||
{{- $filter_access := .Get "access" -}}
|
{{- $filter_access := .Get "access" -}}
|
||||||
{{- $args := .Get "args" -}}
|
{{- $args := .Get "args" -}}
|
||||||
{{- range $i, $p := $overload.Parameters }}
|
{{- range $i, $p := $overload.Parameters }}
|
||||||
{{- $address_space := Eval "AddressSpace" $p.Type -}}
|
{{- $address_space := Eval "AddressSpace" $p.Type -}}
|
||||||
{{- $access := Eval "Access" $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 }}
|
{{- if eq "ptr" $p.Type.Target.Name }}
|
||||||
arg_{{$i}}: {{template "Type" (index $p.Type.TemplateArguments 1)}},
|
arg_{{$i}}: {{template "Type" (index $p.Type.TemplateArguments 1)}},
|
||||||
{{ $args.Put $i (printf "&%v.arg_%v" $var_name $i) -}}
|
{{ $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}}
|
{{- if eq $name "ptr" -}}{{(index .TemplateArguments 2).Target.Name}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- /* Emit the default for the address space */ -}}
|
{{- /* 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" . -}}
|
{{- $address_space := Eval "AddressSpace" . -}}
|
||||||
{{- if eq $address_space "function" -}}read_write
|
{{- if eq $address_space "function" -}}read_write
|
||||||
{{- else if eq $address_space "private" -}}read_write
|
{{- else if eq $address_space "private" -}}read_write
|
||||||
|
|
Loading…
Reference in New Issue