shader: correct swizzles from TGSI_SEMANTIC_SAMPLEPOS
TGSI defines TGSI_SEMANTIC_SAMPLEPOS as a 4-component vector with Z and W set to 0. However, if we ever try to reach thez and w compoents, we run into trouble because this is implemented as a swizzle on gl_SamplePosition instead. And gl_SamplePosition only has x and y.
It seems that recent versions of mesa does just this, causing shader-compilation errors during dEQP tests.
This fixes regressions in the following tests:
- dEQP-GLES31.functional.shaders.sample_variables.sample_pos.correctness.singlesample_texture
- dEQP-GLES31.functional.shaders.sample_variables.sample_pos.correctness.multisample_texture_1
- dEQP-GLES31.functional.shaders.sample_variables.sample_pos.correctness.multisample_texture_2
- dEQP-GLES31.functional.shaders.sample_variables.sample_pos.correctness.multisample_texture_4
- dEQP-GLES31.functional.shaders.sample_variables.sample_pos.correctness.multisample_texture_8
- dEQP-GLES31.functional.shaders.sample_variables.sample_pos.correctness.singlesample_rbo
- dEQP-GLES31.functional.shaders.sample_variables.sample_pos.correctness.multisample_rbo_1
- dEQP-GLES31.functional.shaders.sample_variables.sample_pos.correctness.multisample_rbo_2
- dEQP-GLES31.functional.shaders.sample_variables.sample_pos.correctness.multisample_rbo_4
- dEQP-GLES31.functional.shaders.sample_variables.sample_pos.correctness.multisample_rbo_8
- dEQP-GLES31.functional.shaders.sample_variables.sample_pos.distribution.multisample_texture_1
- dEQP-GLES31.functional.shaders.sample_variables.sample_pos.distribution.multisample_texture_2
- dEQP-GLES31.functional.shaders.sample_variables.sample_pos.distribution.multisample_texture_4
- dEQP-GLES31.functional.shaders.sample_variables.sample_pos.distribution.multisample_texture_8
- dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_offset.at_sample_position.default_framebuffer
Signed-off-by: Erik Faye-Lund erik.faye-lund@collabora.com
Edited by Erik Faye-Lund