freedreno/a6xx: fix border-color offset
authorRob Clark <robdclark@gmail.com>
Thu, 21 Feb 2019 20:44:35 +0000 (15:44 -0500)
committerRob Clark <robdclark@gmail.com>
Fri, 22 Feb 2019 19:05:32 +0000 (14:05 -0500)
Fixes nearly all of dEQP-GLES31.functional.texture.border_clamp.* when
run after a test that binds textures used in vertex shader.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/freedreno/registers/a6xx.xml.h
src/gallium/drivers/freedreno/a6xx/fd6_emit.c

index 78869bf0469fc858b27236ac64f5478519fc7449..227a04aafbe47f100d0ed403591acd3900d21783 100644 (file)
@@ -5215,8 +5215,8 @@ static inline uint32_t A6XX_TEX_SAMP_1_MIN_LOD(float val)
 }
 
 #define REG_A6XX_TEX_SAMP_2                                    0x00000002
-#define A6XX_TEX_SAMP_2_BCOLOR_OFFSET__MASK                    0xfffffff0
-#define A6XX_TEX_SAMP_2_BCOLOR_OFFSET__SHIFT                   4
+#define A6XX_TEX_SAMP_2_BCOLOR_OFFSET__MASK                    0xffffffff
+#define A6XX_TEX_SAMP_2_BCOLOR_OFFSET__SHIFT                   0
 static inline uint32_t A6XX_TEX_SAMP_2_BCOLOR_OFFSET(uint32_t val)
 {
        return ((val) << A6XX_TEX_SAMP_2_BCOLOR_OFFSET__SHIFT) & A6XX_TEX_SAMP_2_BCOLOR_OFFSET__MASK;
index daa06d22c82c40c6932780aa53df6c428461255f..243d44335ac6c8590060023cf3b7fc166fd2b7b9 100644 (file)
@@ -370,7 +370,7 @@ fd6_emit_textures(struct fd_pipe *pipe, struct fd_ringbuffer *ring,
                        OUT_RING(state, sampler->texsamp0);
                        OUT_RING(state, sampler->texsamp1);
                        OUT_RING(state, sampler->texsamp2 |
-                               A6XX_TEX_SAMP_2_BCOLOR_OFFSET(bcolor_offset));
+                               A6XX_TEX_SAMP_2_BCOLOR_OFFSET((i + bcolor_offset) * sizeof(struct bcolor_entry)));
                        OUT_RING(state, sampler->texsamp3);
                        needs_border |= sampler->needs_border;
                }