mesa: fix interface matching done in validate_io
authorTapani Pälli <tapani.palli@intel.com>
Wed, 16 Dec 2015 06:24:52 +0000 (08:24 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Tue, 22 Dec 2015 12:50:25 +0000 (14:50 +0200)
commitf2be5b8ba4b1fbbf1a5bb5f83d68a3240a287fa4
tree3b820f03d2892986476bb8f95c212678ff65547f
parent5f8bb6fbb11f488bb3aa22c8067028fc51b2b9f9
mesa: fix interface matching done in validate_io

Patch makes following changes for interface matching:

   - do not try to match builtin variables
   - handle swizzle in input name, as example 'a.z' should
     match with 'a'
   - add matching by location
   - check that amount of inputs and outputs matches

These changes make interface matching tests to work in:
   ES31-CTS.sepshaderobjs.StateInteraction

The test still does not pass completely due to errors in rendering
output. IMO this is unrelated to interface matching.

Note that type matching is not done due to varying packing which
changes type of variable, this can be added later on. Preferably
when we have quicker way to iterate resources and have a complete
list of all existed varyings (before packing) available.

v2: add spec reference, return true on desktop since we do not
    have failing cases for it, inputs and outputs amount do not
    need to match on desktop.

v3: add some more spec reference, remove desktop specifics since
    not used for now on desktop, add match by location qualifier,
    rename input_stage and output_stage as producer and consumer
    as suggested by Timothy.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
src/mesa/main/shader_query.cpp