freedreno/a4xx: add ARB_instanced_arrays support
authorRob Clark <robclark@freedesktop.org>
Sun, 21 Dec 2014 16:52:44 +0000 (11:52 -0500)
committerRob Clark <robclark@freedesktop.org>
Tue, 24 Feb 2015 19:23:38 +0000 (14:23 -0500)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a4xx/fd4_emit.c
src/gallium/drivers/freedreno/freedreno_screen.c

index c1d7c4083ea0f78b7abe43bdfdb29689adc8fa0b..6540e1d29f42b17bfe21099ff09ae49915d9d680 100644 (file)
@@ -322,10 +322,11 @@ fd4_emit_vertex_bufs(struct fd_ringbuffer *ring, struct fd4_emit *emit)
                        OUT_PKT0(ring, REG_A4XX_VFD_FETCH(j), 4);
                        OUT_RING(ring, A4XX_VFD_FETCH_INSTR_0_FETCHSIZE(fs - 1) |
                                        A4XX_VFD_FETCH_INSTR_0_BUFSTRIDE(vb->stride) |
+                                       COND(elem->instance_divisor, A4XX_VFD_FETCH_INSTR_0_INSTANCED) |
                                        COND(switchnext, A4XX_VFD_FETCH_INSTR_0_SWITCHNEXT));
                        OUT_RELOC(ring, rsc->bo, off, 0, 0);
                        OUT_RING(ring, A4XX_VFD_FETCH_INSTR_2_SIZE(size));
-                       OUT_RING(ring, 0x00000001);
+                       OUT_RING(ring, A4XX_VFD_FETCH_INSTR_3_STEPRATE(MAX2(1, elem->instance_divisor)));
 
                        OUT_PKT0(ring, REG_A4XX_VFD_DECODE_INSTR(j), 1);
                        OUT_RING(ring, A4XX_VFD_DECODE_INSTR_CONSTFILL |
@@ -351,7 +352,7 @@ fd4_emit_vertex_bufs(struct fd_ringbuffer *ring, struct fd4_emit *emit)
                        A4XX_VFD_CONTROL_1_REGID4VTX(vertex_regid) |
                        A4XX_VFD_CONTROL_1_REGID4INST(instance_regid));
        OUT_RING(ring, 0x00000000);   /* XXX VFD_CONTROL_2 */
-       OUT_RING(ring, 0x0000fc00);   /* XXX VFD_CONTROL_3 */
+       OUT_RING(ring, A4XX_VFD_CONTROL_3_REGID_VTXCNT(regid(63, 0)));
        OUT_RING(ring, 0x00000000);   /* XXX VFD_CONTROL_4 */
 
        /* cache invalidate, otherwise vertex fetch could see
index 97bab9dd242788668b41cf52b6661c755fc1e5c9..29734585c0a530605772b6679a5a338a57b3cdf2 100644 (file)
@@ -170,10 +170,8 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_SM3:
        case PIPE_CAP_PRIMITIVE_RESTART:
        case PIPE_CAP_TGSI_INSTANCEID:
-               return is_a3xx(screen) || is_a4xx(screen);
-
        case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
-               return is_a3xx(screen) && glsl130;
+               return is_a3xx(screen) || is_a4xx(screen);
 
        case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
                return 256;