Skip to content
Snippets Groups Projects
Commit 1f1ceb2e authored by Neil Roberts's avatar Neil Roberts Committed by Eric Engestrom
Browse files

v3d/compiler: Fix sorting the gs and fs inputs


ntq_setup_fs_inputs and ntq_setup_gs_inputs sort the inputs according to
the driver location. This input array is then used to calculate the VPM
offset for the outputs in the previous stage. However, it wasn’t taking
into account variables that are packed into a single varying slot. In
that case they would have the same driver_location and are
distinguished by location_frac.

This patch makes it additionally sort by location_frac when the driver
locations are equal. This can happen when the compiler packs varyings
that are sized less than vec4. Without this fix, when the VPM is used to
transmit data free-form between the stages (such as VS->GS) then it
would end up writing to inconsistent locations.

Fixes dEQP tests such as:
dEQP-GLES31.functional.primitive_bounding_box.lines.global_state.
vertex_geometry_fragment.default_framebuffer_bbox_equal

Fixes: 5d578c27 ("v3d: add initial compiler plumbing for geometry shaders")

Reviewed-by: default avatarIago Toral Quiroga <itoral@igalia.com>
Reviewed-by: default avatarJose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <!5787>
(cherry picked from commit deefebc5)
parent 41fb8c1f
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment