tgsi_to_nir: only update TGSI properties of the current shader stage
authorJose Maria Casanova Crespo <jmcasanova@igalia.com>
Mon, 19 Aug 2019 13:05:25 +0000 (15:05 +0200)
committerJosé Casanova Crespo <jmcasanova@igalia.com>
Tue, 20 Aug 2019 10:30:21 +0000 (10:30 +0000)
commit7c56a68c8bd45208ef7c7e6e61bfeb6147ded4b6
treeec0f7bc16a2eb2fc672f20a6f5a75e8e555ff89e
parent83a63a5b12323b733cf4ebf5b9892cd7c8718578
tgsi_to_nir: only update TGSI properties of the current shader stage

The implementation introduced in "tgsi_to_nir: be careful about not
losing any TGSI properties silently (v2)" updates all the TGSI properties,
but it didn't take into account that the shader_info structure uses a union
to store the different attributes for each shader stage.

Now we only update the attributes if they affect current shader stage,
avoiding to overwrite members of the union that should be overwritten.
This has created hundreds of regressions in v3d.

For example the TGSI_PROPERTY_VS_BLIT_SGPRS_AMD was overwritting the
same position used by TGSI_PROPERY_CS_FIXED_BLOCK_DEPTH.

Fixes: e3003651978 ("tgsi_to_nir: be careful about not losing any TGSI properties silently (v2)")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/nir/tgsi_to_nir.c