freedreno/a3xx: add ARB_instanced_arrays support
authorIlia Mirkin <imirkin@alum.mit.edu>
Tue, 2 Dec 2014 05:32:57 +0000 (00:32 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 19 Feb 2015 05:25:03 +0000 (00:25 -0500)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
docs/relnotes/10.6.0.html
src/gallium/drivers/freedreno/a3xx/fd3_emit.c
src/gallium/drivers/freedreno/freedreno_screen.c

index bedbd4bab9e997b4741fdb28bbc04b8c5d2fd0be..151ba1763468934b84b3ede277cc1c9b62afdb04 100644 (file)
@@ -46,6 +46,7 @@ Note: some of the new features are only available with certain drivers.
 <ul>
 <li>GL_AMD_pinned_memory on r600, radeonsi</li>
 <li>GL_ARB_draw_instanced on freedreno</li>
+<li>GL_ARB_instanced_arrays on freedreno</li>
 <li>GL_ARB_pipeline_statistics_query on i965, nvc0, r600, radeonsi, softpipe</li>
 </ul>
 
index ad5fcb35cf5063d7c8af799e1b44af0a58f9b087..f1a17ec1dfb4aea151a1cfcd52e637117e2d567c 100644 (file)
@@ -396,7 +396,8 @@ fd3_emit_vertex_bufs(struct fd_ringbuffer *ring, struct fd3_emit *emit)
                                        A3XX_VFD_FETCH_INSTR_0_BUFSTRIDE(vb->stride) |
                                        COND(switchnext, A3XX_VFD_FETCH_INSTR_0_SWITCHNEXT) |
                                        A3XX_VFD_FETCH_INSTR_0_INDEXCODE(j) |
-                                       A3XX_VFD_FETCH_INSTR_0_STEPRATE(1));
+                                       COND(elem->instance_divisor, A3XX_VFD_FETCH_INSTR_0_INSTANCED) |
+                                       A3XX_VFD_FETCH_INSTR_0_STEPRATE(MAX2(1, elem->instance_divisor)));
                        OUT_RELOC(ring, rsc->bo, vb->buffer_offset + elem->src_offset, 0, 0);
 
                        OUT_PKT0(ring, REG_A3XX_VFD_DECODE_INSTR(j), 1);
index 7952c04d35c4f19930df015c5c0e83cd10f7c894..b0bdfd9fb72e90cd10d37e1a09d704eb988138f9 100644 (file)
@@ -186,7 +186,6 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
        case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE:
        case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
-       case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
        case PIPE_CAP_START_INSTANCE:
        case PIPE_CAP_COMPUTE:
                return 0;
@@ -196,6 +195,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
                return is_a3xx(screen) || is_a4xx(screen);
 
        case PIPE_CAP_TGSI_INSTANCEID:
+       case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
                return is_a3xx(screen) && glsl130;
 
        case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT: