Commit graph

8 commits

Author SHA1 Message Date
Arman Uguray eb1d4be36a [vello_shaders] Pin naga dependency 2023-03-29 11:20:15 -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
Arman Uguray b52ef32c90 [vello_shaders] Use thiserror::Error for the library Error type 2023-03-29 10:38:10 -07:00
Arman Uguray 14ab8d90ae [vello_shaders] Use the per_entry_point_map option for MSL 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