glsl: disable varying packing when its not safe

Graphics / Mesa 3D Graphics Library / Mesa - Timothy Arceri [collabora.com] - 17 March 2016 18:26 UTC

In GL 4.4+ there is no guarantee that interpolation qualifiers will match between stages so we cannot safely pack varyings using the current packing pass in Mesa.

We also disable packing on outerward facing interfaces for SSO because in ES we need to retain the unpacked varying information for draw time validation. For desktop GL we could allow packing for SSO in versions < 4.4 but its just safer not to do so.

We do however enable packing on individual arrays, structs, and matrices as these are required by the transform feedback code and it is still safe to do so.

Finally we also enable packing when a varying is only used for transform feedback and its not a SSO.

This fixes all remaining rendering issues with the dEQP SSO tests, the only issues remaining with thoses tests are to do with validation.

Note: There is still one remaining SSO bug that this patch doesn't fix. Their is a chance that VS -> TCS will have mismatching interfaces because we pack VS output in case its used by transform feedback but don't pack TCS input for performance reasons. This patch will make the situation better but doesn't fix it.

V4: fix out of order function params after rebase, make sure packing still disabled in tess stages. Update comments as to why we disable packing on SSO.

V3: ES 3.1 *does* require interpolation to match so don't disable packing there. Rebased on master rather than on enhanced layouts component packing series.

V2: Make is_varying_packing_safe() a function in the varying_matches class, fix spelling (Matt) and make sure to remove the outer array when dealing with Geom and Tess shaders where appropriate. Lastly fix piglit regression in new piglit test and document the undefined behaviour it depends on: arb_separate_shader_objects/execution/vs-gs-linking.shader_test

d6b9202 glsl: disable varying packing when its not safe
src/compiler/glsl/ir.h | 7 +
src/compiler/glsl/ir_optimization.h | 2 +-
src/compiler/glsl/link_varyings.cpp | 196 +++++++++++++++++++++------
src/compiler/glsl/lower_packed_varyings.cpp | 28 +++-
4 files changed, 180 insertions(+), 53 deletions(-)

Upstream: cgit.freedesktop.org


  • Share