FShade icon indicating copy to clipboard operation
FShade copied to clipboard

Multiple Interpolation Qualifiers

Open luithefirst opened this issue 3 years ago • 0 comments

It is not possible to define varyings with multiple interpolation qualifiers, e.g. "noperspective" and "sample". The Interpolation attribute can only be defined once and does not allow multiple arguments.

This is valid for certain combinations: https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.4.40.pdf

Page 49: "The auxiliary storage qualifiers centroid and sample can also be applied, as well as the interpolation qualifiers flat, noperspective, and smooth."

Example: "noperspective centroid in vec2 myTexCoord;"

We already discussed this and changing the InterpolationMode to a flag enum would make this possible with a reasonable effort of changes. It should be acceptable that the user is responsible for only building valid combinations. The code would then look like this:

type VertexUV = {
    [<TexCoord; Interpolation(InterpolationMode.NoPerspective ||| InterpolationMode.Sample)>] tc : V2d
}

luithefirst avatar Feb 03 '22 15:02 luithefirst