Sometimes, a shader just need a few information from the vertex attributes. You then want to be able to authorize “gaps” in the semantics so that shaders can be used for several varieties of vertex formats.
But, for each attribute name in the semantics enum, a compilation warning appears (shader program warning: vertex attribute warning: inactive <name of attribute> vertex attribute) if the shader does not read that attribute. I tried adding unbound, by analogy to #[uniform(unbound)], but that did not silence the warning.
Are these warnings meant to be ignored, or should there be a way to suppress them? Or is the documentation incorrect, and Semantics should not be reused for shader programs needing different sets of information?
(In the case where this came up, both the vertex type and the shader agree on having a smaller set of attributes; I could easily define a second, narrower Semantics enum. But it seemed like using the same Semantics was meant to be possible.)
There should be only one Semantics for your whole application ideally. So yes, it should be possible to remove those warnings. I noticed them too lately. I’ll have a look asap.
The documentation for
Semantics
says:But, for each attribute name in the semantics enum, a compilation warning appears (
shader program warning: vertex attribute warning: inactive <name of attribute> vertex attribute
) if the shader does not read that attribute. I tried addingunbound
, by analogy to#[uniform(unbound)]
, but that did not silence the warning.Are these warnings meant to be ignored, or should there be a way to suppress them? Or is the documentation incorrect, and
Semantics
should not be reused for shader programs needing different sets of information?(In the case where this came up, both the vertex type and the shader agree on having a smaller set of attributes; I could easily define a second, narrower
Semantics
enum. But it seemed like using the sameSemantics
was meant to be possible.)