[Mesa-dev] [PATCH] gallium: add PIPE_SHADER_CAP_MAX_VARYINGS

Ilia Mirkin imirkin at alum.mit.edu
Mon Aug 28 13:24:52 UTC 2017

On Mon, Aug 28, 2017 at 4:23 AM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> On 27.08.2017 12:59, Karol Herbst wrote:
>> this way Nouveau can report 128 inputs, but only 124 varyings.
>> Fixes: 'KHR-GL45.limits.max_fragment_input_components'
> Can you explain a bit more why this is necessary? The GL CTS test only
> exercises the core profile, where it should be possible for you to cleanly
> map GLSL I/O to whatever the hardware does.

On NVIDIA, a fragment shader may read up to 128 inputs. However some
of those inputs are e.g. "w" (used for perspective interp, i.e.
~always), or gl_FragCoord. Not sure how gl_Layer, gl_ViepowrtIndex,
gl_PrimitiveID, gl_SampleMaskIn fit into this accounting. So
effectively we can only support 31 vec4 varyings as far as the
GL_MAX_VARYINGS is concerned. However this type of accounting that
includes internal and system values is legal (apparently) for input
components, so we can report 128 for the max input components, per GL



More information about the mesa-dev mailing list