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

Chris Forbes chrisf at ijw.co.nz
Thu Jan 9 16:34:23 PST 2014


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.

>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?

-- Chris


More information about the mesa-dev mailing list