diff options
author | Kristian H. Kristensen <[email protected]> | 2019-09-13 15:20:05 -0700 |
---|---|---|
committer | Kristian H. Kristensen <[email protected]> | 2019-09-18 16:59:10 -0700 |
commit | be38480064a78c4a4391f87e45f7dd78dc88edce (patch) | |
tree | 08324f0963a69dbe6272601711a294e59da078ef /src/gallium/drivers | |
parent | d38e0a6326310d8c92e8344a5feeda1e869760e8 (diff) |
freedreno/a6xx: Track location of gl_Position out as we link it
When using xfb and rasterizing, the fragment shader may have fewer
inputs than the vertex shader outputs. We can't rely on gl_Position to
be placed at fs->total_in, but have to instead remember where we add
it in the link map and use that location.
Fixes 100+ tesselation dEQPs under
dEQP-GLES31.functional.tessellation.primitive_discard.*
dEQP-GLES31.functional.tessellation.user_defined_io.*
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_program.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_program.c b/src/gallium/drivers/freedreno/a6xx/fd6_program.c index 8931d40a8e2..47ba86353b1 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_program.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_program.c @@ -275,7 +275,7 @@ setup_stateobj(struct fd_ringbuffer *ring, struct fd_screen *screen, uint32_t vertex_regid, instance_regid; uint32_t ij_pix_regid, ij_samp_regid, ij_cent_regid, ij_size_regid; enum a3xx_threadsize fssz; - uint8_t psize_loc = ~0; + uint8_t psize_loc = ~0, pos_loc = ~0; int i, j; static const struct ir3_shader_variant dummy_fs = {0}; @@ -393,8 +393,10 @@ setup_stateobj(struct fd_ringbuffer *ring, struct fd_screen *screen, OUT_RING(ring, ~varmask[3]); /* VPC_VAR[3].DISABLE */ /* a6xx appends pos/psize to end of the linkage map: */ - if (VALIDREG(pos_regid)) + if (VALIDREG(pos_regid)) { + pos_loc = l.max_loc; ir3_link_add(&l, pos_regid, 0xf, l.max_loc); + } if (VALIDREG(psize_regid)) { psize_loc = l.max_loc; @@ -551,7 +553,7 @@ setup_stateobj(struct fd_ringbuffer *ring, struct fd_screen *screen, } OUT_PKT4(ring, REG_A6XX_VPC_PACK, 1); - OUT_RING(ring, A6XX_VPC_PACK_NUMNONPOSVAR(fs->total_in) | + OUT_RING(ring, A6XX_VPC_PACK_POSITIONLOC(pos_loc) | A6XX_VPC_PACK_PSIZELOC(psize_loc) | A6XX_VPC_PACK_STRIDE_IN_VPC(l.max_loc)); |