[Mesa-dev] Shader Interface Matching

Timothy Arceri timothy.arceri at collabora.com
Wed Dec 2 19:58:42 PST 2015


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?

Tim


[1] http://cgit.freedesktop.org/piglit/commit/?id=f1e416b8e65ad95c6ce9e
04a80d83e7f9e1e9239
[2]
http://cgit.freedesktop.org/piglit/commit/?id=2b2bb62ce03ffa065e9b591cd
05e12c623ed4759


More information about the mesa-dev mailing list