Commit graph

7 commits

Author SHA1 Message Date
Arman Uguray 0a6a6e2c21 [vello_shaders] Move vello_shaders to crates/shaders 2023-03-29 12:24:28 -07:00
Arman Uguray 7a99ae5a9e [vello_shaders] Add copyright headers 2023-03-29 11:20:38 -07:00
Arman Uguray 4f445c2e0a [vello_shaders] Provide workgroup shared memory allocation sizes
Naga traslates workgroup variable declarations to threadgroup
address-space entry-point parameters when generating MSL. Metal API
validation requires that the memory sizes for these parameters be set
explicitly by calling setThreadgroupMemoryLength:index on the
MTLComputeCommandEncoder.

The crate now calculates the required memory size for global workgroup
variables that are accessed by the entry point and provides them
alongside the binding list. This is abstracted separately from the
binding list.

While the current usage that we're aware of is limited to Metal, this
information is being provided as part of the generic ComputeShader type
instead of a MSL-specific type, as the information itself is computed
from the parsed WGSL IR and not specific to Metal.
2023-03-29 10:38:10 -07:00
Chad Brokaw 87803cc8a6 fmt 2023-03-29 10:38:10 -07:00
Chad Brokaw a532eacf7b Replace HashMap with sorted Vec so builds are deterministic 2023-03-29 10:38:10 -07:00
Chad Brokaw a5434569b6 fix build rerun path 2023-03-29 10:38:10 -07:00
Chad Brokaw 0db71153ad Playing with shader permutations and AOT compilation 2023-03-29 10:38:10 -07:00