[Mesa-dev] [PATCH] i965: Use sample barycentric coordinates with per sample shading

Anuj Phogat anuj.phogat at gmail.com
Fri Jan 10 17:25:55 PST 2014


On Thu, Jan 9, 2014 at 4:34 PM, Chris Forbes <chrisf at ijw.co.nz> wrote:
> Hi Anuj,
>
> There's one fiddly interaction that I don't think this handles quite
> right, although I think it does conform.
>
> Suppose we have this fragment shader:
>
>    #version 330
>    #extension ARB_gpu_shader5: require
>
>    sample in vec4 a;
>    in vec4 b;
>
>    ...
>
> Then `b` is being evaluated at the sample position as well. This is
> allowed by my reading of the spec, but probably not what the author
> expected.
Good catch.
>
> From the ARB_gpu_shader5 spec, emphasis mine:
>
>     (11) Should we support per-sample interpolation of attributes?  If so,
>          how?
>
>       RESOLVED.  Yes.  When multisample rasterization is enabled, qualifying
>       one or more fragment shader inputs with "sample" will force per-sample
>       interpolation of those attributes.  If the same shader includes other
>       fragment inputs not qualified with sample, those attributes _may_ be
>       interpolated per-pixel (i.e., all samples get the same values, likely
>       evaluated at the pixel center).
>
> What do you think?
I agree with your interpretation. Spec seems to be flexible about it. I'll check
what NVIDIA does in this case. This should be easy to fix if we need to.
>
> -- Chris


More information about the mesa-dev mailing list