The idea is to implement #63 but in another way:
fn main()
{
const if (target(spirv))
{
// target is spirv
}
const if (target(glsl, 430))
{
// target is GLSL 4.3
const if (target_ext("GL_EXT_shader_samples_identical"))
{
// GL_EXT_shader_samples_identical is supported
}
}
}
now that feature is mostly useless without a way to inject GLSL/SPIR-V/WGSL/... directly, a bit like asm blocks in C. However I'm not sure about the syntax.
const if (target(glsl) && target_ext("GL_MESA_shader_integer_functions"))
{
// ?
}
I think the best way would be to have a special kind of function, maybe something like
[cond(target(glsl) && target_ext("GL_MESA_shader_integer_functions"))]
[asm(glsl)]
fn bitcount(value: i32) -> i32
{
// GLSL code, value being available to it
/// return bitCount(value);
}
The idea is to implement #63 but in another way:
now that feature is mostly useless without a way to inject GLSL/SPIR-V/WGSL/... directly, a bit like
asmblocks in C. However I'm not sure about the syntax.I think the best way would be to have a special kind of function, maybe something like