freedreno/a6xx: Fix point coord
authorKristian H. Kristensen <hoegsberg@chromium.org>
Tue, 12 Feb 2019 18:17:55 +0000 (10:17 -0800)
committerKristian H. Kristensen <hoegsberg@chromium.org>
Wed, 13 Feb 2019 19:14:06 +0000 (11:14 -0800)
Use ir3_next_varying() for iterating through varyings and unset the
global point coord invert bit.

Fixes:

  dEQP-GLES3.functional.shaders.builtin_variable.pointcoord

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
src/gallium/drivers/freedreno/a6xx/fd6_emit.c
src/gallium/drivers/freedreno/a6xx/fd6_program.c
src/gallium/drivers/freedreno/a6xx/fd6_program.h

index fad3c09a733a5257ed3274b9234fff2943e18b6f..2956f4cde6e3ee4645ef2f803cc45051b980f869 100644 (file)
@@ -1070,7 +1070,8 @@ t7              opcode: CP_WAIT_FOR_IDLE (26) (1 dwords)
        WRITE(REG_A6XX_VPC_UNKNOWN_9101, 0xffff00);
        WRITE(REG_A6XX_VPC_UNKNOWN_9107, 0);
 
-       WRITE(REG_A6XX_VPC_UNKNOWN_9236, 1);
+       WRITE(REG_A6XX_VPC_UNKNOWN_9236,
+                 A6XX_VPC_UNKNOWN_9236_POINT_COORD_INVERT(0));
        WRITE(REG_A6XX_VPC_UNKNOWN_9300, 0);
 
        WRITE(REG_A6XX_VPC_SO_OVERRIDE, A6XX_VPC_SO_OVERRIDE_SO_DISABLE);
index 470bacfd5fe1fc8e35050f4d869a0ead3c74cb8a..634e521c59ae7216eee26ab417d2c23a7cd6213a 100644 (file)
@@ -651,8 +651,7 @@ fd6_program_emit(struct fd_ringbuffer *ring, struct fd6_emit *emit)
                memset(vinterp, 0, sizeof(vinterp));
                memset(vpsrepl, 0, sizeof(vpsrepl));
 
-               for (int i = 0; i < state->fs_inputs_count; i++) {
-                       int j = state->fs_inputs[i];
+               for (int j = -1; (j = ir3_next_varying(fs, j)) < (int)fs->inputs_count; ) {
 
                        /* NOTE: varyings are packed, so if compmask is 0xb
                         * then first, third, and fourth component occupy
@@ -666,7 +665,7 @@ fd6_program_emit(struct fd_ringbuffer *ring, struct fd6_emit *emit)
                                        (fs->inputs[j].rasterflat && emit->rasterflat)) {
                                uint32_t loc = inloc;
 
-                               for (i = 0; i < 4; i++) {
+                               for (int i = 0; i < 4; i++) {
                                        if (compmask & (1 << i)) {
                                                vinterp[loc / 16] |= 1 << ((loc % 16) * 2);
                                                loc++;
index 3ed5426b50ee4424b60c67713d0567303a9478f1..8bc95f5e940659aca951b2ad0df049aaf063af9f 100644 (file)
@@ -54,10 +54,6 @@ struct fd6_program_state {
        /* cached state about current emitted shader program (3d): */
        struct fd6_streamout_state tf;
 
-       /* index and # of varyings: */
-       uint8_t fs_inputs[16];
-       uint8_t fs_inputs_count;
-
        uint32_t vinterp[8];
 };