Open mighdoll opened 1 week ago
Some of what I have seen (mostly glsl)
alias array${N}f = array<f32, ${N}>;
const my_feat: bool = ${MY_FEAT_ENABLED};
let my_const = ${3+2}
${DEBUG_BEGIN} ... some stuff ... ${DEBUG_END}
@bind(${i++})
#include
facility#define
and possibly function overloading, wished for features in WGSL#include
and #ifdef
preprocessoroverride
override
to inject e.g. SCAN_BLOCK_SIZE, WORKGROUP_SIZE [pixijs-filters]()
Community projects in WGSL (and other shader communities) typically rely on string interpolation to inject some host specific variation into shaders.
Let's enumerate the common string interpolation use cases in this issue (and make separate issues for the uncommon cases) and then document them on the spec site.
We originally planned to address these common cases by standardizing a string interpolation mechanism (see SimpleTemplating). I think the current discussions lean towards more precise language features than string insertion, but either way a clear understanding of the use cases will help validate our solutions. When we agree on spec features to address these community use cases, we can document them alongside.