[Mesa-dev] Shader Interface Matching
tapani.palli at intel.com
Wed Dec 2 23:15:00 PST 2015
On 12/03/2015 09:03 AM, Timothy Arceri wrote:
> On Thu, 2015-12-03 at 08:46 +0200, Tapani Pälli wrote:
>> On 12/03/2015 05:58 AM, Timothy Arceri wrote:
>>> Hi All,
>>> I recently pushed a couple of piglit tests  and  that test
>>> matching of blocks and structs based on location rather than name
>>> 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;
>>> -- the two variables are declared with the same location and
>>> component layout qualifiers and match in type and
>>> But then later it says:
>>> "The inputs and outputs on an interface between programs need not
>>> ex-actly when input and output location qualifiers (sections
>>> 4.4.1(“Input Layout Qual-ifiers”) and 4.4.2(“Output Layout
>>> of the OpenGL Shading LanguageSpecification) are used. When using
>>> location qualifiers, any input with an inputlocation qualifier will
>>> well-defined as long as the other program writes to amatching
>>> as described above. The names of variables need not match when
>>> by location."
>>> So my question is why bother to inforce name matching on blocks
>>> 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.
> Mesa also has a bigger problem in that it parses the location from
> structs and interface blocks but doesn't actually use it.
Right, I think it's there only for uniforms. Uniforms will get
sequential locations for structure items. Now I can't find test for this
but I remember writing the code for it.
>> I don't see
>> it being limited to SSO scope. How I understand is that this
>> belongs to generic scope of "Shader Interface Matching" section.
> But doesn't the end of the first line "between programs" mean its only
> talking about SSO. At the top when it talks about names being required
> to match for blocks and block members it talks about the interface
> between shaders rather than programs.
True, I missed this bit. I guess it would be good to make a search in
Khronos bugzilla if there is any discussion about this topic. I don't
see much reason to require name to match if location, type and other
required qualifiers match but it does seem to be required :/
>>> mesa-dev mailing list
>>> mesa-dev at lists.freedesktop.org
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
More information about the mesa-dev