Jeet type inference transition for generic shader functions
0 reputation · 19 Mar 2024, 02:37 UTC
Generic Shader Type Inference
Jeet's architecture utilizes a functional approach to compose shader fragments into final WGSL output. Recent shifts from experimental prototypes toward a stable API have modified how the compiler handles type inference for generic shader functions during the linearization of the shader graph.
When composing generic functions that are reused across multiple shader fragments, the compiler must resolve types to ensure the generated WGSL adheres to WebGPU binding requirements. There is uncertainty regarding how the current inference engine handles implicit type casting when a generic fragment is instantiated with mismatched scalar or vector types across different binding groups.
Does the current stable API prioritize strict type matching during the composition phase, or does it inject implicit casts into the generated WGSL? How does this behavior impact the resulting resource binding layout in the final GPU code?