[Mesa-dev] [RFC PATCH 0/5] ARB_gpu_shader5 interpolateAt* GLSL plumbing

Marek Olšák maraeo at gmail.com
Sun Nov 10 02:43:17 PST 2013


On Sun, Nov 10, 2013 at 9:51 AM, Chris Forbes <chrisf at ijw.co.nz> wrote:
> Here is the driver-independent part of ARB_gpu_shader5's
> interpolateAtCentroid, interpolateAtOffset builtins.
>
> Before I go further with this approach, I'd like feedback on the following:
>
> 1) I've (ab)used ir_var_shader_in variable mode in function signatures to
> enforce the strange restrictions interpolateAt* have. Is this crazy/awful?
>
> 2) I intend to implement interpolateAtSample() by:
>
> - Adding a new builtin uniform (perhaps "gl_SamplePositionsMESA"); which
>    will be an array of vec2, containing the full palette of current sample
>    positions. This could be formally exposed by another extension at a later
>    point.
>
> - Compiling interpolateAtSample(x, sample_num) as if the shader author wrote:
>    interpolateAtOffset(x, gl_SamplePositionsMESA[sample_num] - vec2(0.5))

I think our Evergreen-Cayman hardware implements interpolateAtSample
with interpolateAtOffset, so this looks good. Not sure about the newer
chips.

Marek


More information about the mesa-dev mailing list