[Mesa-dev] Shader Interface Matching

Tapani Pälli tapani.palli at intel.com
Wed Dec 2 22:46:01 PST 2015



On 12/03/2015 05:58 AM, Timothy Arceri wrote:
> Hi All,
>
> I recently pushed a couple of piglit tests [1] and [2] that test for
> matching of blocks and structs based on location rather than name when
> an explicit location is given.
>
> The test pass on Nvidia but fail in current Mesa.
>
> However I just came across this in section 7.4.1 (Shader Interface
> Matching) the OpenGL 4.5 spec:
>
>     "- An output block is considered to match an input block in
>        the subsequent shader if the two blocks have the same block
>        name, and the members of the block match exactly in name,
>        type, qualification, and declaration order.
>      - An output variable is considered to match an input variable
>        in the subsequentshader if:
>        -- the two variables match in name, type, and qualification; or
>        -- the two variables are declared with the same location and
>           component layout qualifiers and match in type and
>           qualification."
>
> But then later it says:
>
> "The inputs and outputs on an interface between programs need not match
> ex-actly when input and output location qualifiers (sections
> 4.4.1(“Input Layout Qual-ifiers”) and 4.4.2(“Output Layout Qualifiers”)
> of the OpenGL Shading LanguageSpecification) are used. When using
> location qualifiers, any input with an inputlocation qualifier will be
> well-defined as long as the other program writes to amatching output,
> as described above. The names of variables need not match when matching
> by location."
>
> So my question is why bother to inforce name matching on blocks when
> not using SSO? Should I folow the spec or do what Nvidia does?

I was reading through these sections when looking at the tests. My 
understanding is that Mesa is too strict currently since matching by 
location is defined as above, this change came in 4.3 spec. I don't see 
it being limited to SSO scope. How I understand is that this paragraph 
belongs to generic scope of "Shader Interface Matching" section.


> Tim
>
>
> [1] http://cgit.freedesktop.org/piglit/commit/?id=f1e416b8e65ad95c6ce9e
> 04a80d83e7f9e1e9239
> [2]
> http://cgit.freedesktop.org/piglit/commit/?id=2b2bb62ce03ffa065e9b591cd
> 05e12c623ed4759
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>


More information about the mesa-dev mailing list