freedreno/a3xx: make vs-set point size work
authorIlia Mirkin <imirkin@alum.mit.edu>
Tue, 17 Mar 2015 05:02:32 +0000 (01:02 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 28 Mar 2015 18:54:41 +0000 (14:54 -0400)
This appears to need the A2XX version of the point list, so select it at
draw time if necessary.

Experimentally, always using the A2XX version causes hangs when PSIZE
isn't actually emitted.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/freedreno/a2xx/fd2_draw.c
src/gallium/drivers/freedreno/a3xx/fd3_draw.c
src/gallium/drivers/freedreno/freedreno_draw.h

index dfc7202c446688288d7ee6747b6b0a9fc02d94c4..f2efd5f2eb0ad22a57d6ecab568569804ad8db9f 100644 (file)
@@ -107,7 +107,8 @@ fd2_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info)
        OUT_RING(ring, info->max_index);        /* VGT_MAX_VTX_INDX */
        OUT_RING(ring, info->min_index);        /* VGT_MIN_VTX_INDX */
 
-       fd_draw_emit(ctx, ring, IGNORE_VISIBILITY, info);
+       fd_draw_emit(ctx, ring, ctx->primtypes[info->mode],
+                                IGNORE_VISIBILITY, info);
 
        OUT_PKT3(ring, CP_SET_CONSTANT, 2);
        OUT_RING(ring, CP_REG(REG_A2XX_UNKNOWN_2010));
index 179bf9ce92def01e37594a0229e208855e071775..48dd8da782a1460d08752362a823b170c8b0d590 100644 (file)
@@ -58,6 +58,7 @@ draw_impl(struct fd_context *ctx, struct fd_ringbuffer *ring,
                struct fd3_emit *emit)
 {
        const struct pipe_draw_info *info = emit->info;
+       enum pc_di_primtype primtype = ctx->primtypes[info->mode];
 
        fd3_emit_state(ctx, ring, emit);
 
@@ -77,7 +78,12 @@ draw_impl(struct fd_context *ctx, struct fd_ringbuffer *ring,
        OUT_RING(ring, info->primitive_restart ? /* PC_RESTART_INDEX */
                        info->restart_index : 0xffffffff);
 
+       if (ctx->rasterizer && ctx->rasterizer->point_size_per_vertex &&
+               info->mode == PIPE_PRIM_POINTS)
+               primtype = DI_PT_POINTLIST_A2XX;
+
        fd_draw_emit(ctx, ring,
+                       primtype,
                        emit->key.binning_pass ? IGNORE_VISIBILITY : USE_VISIBILITY,
                        info);
 }
index 25e102f5067c61d0b97a6275ea69d575b99a281f..3224fb14652336f5e34b2c00c74bcbeca0b10c89 100644 (file)
@@ -113,6 +113,7 @@ size2indextype(unsigned index_size)
 /* this is same for a2xx/a3xx, so split into helper: */
 static inline void
 fd_draw_emit(struct fd_context *ctx, struct fd_ringbuffer *ring,
+               enum pc_di_primtype primtype,
                enum pc_di_vis_cull_mode vismode,
                const struct pipe_draw_info *info)
 {
@@ -138,7 +139,7 @@ fd_draw_emit(struct fd_context *ctx, struct fd_ringbuffer *ring,
                src_sel = DI_SRC_SEL_AUTO_INDEX;
        }
 
-       fd_draw(ctx, ring, ctx->primtypes[info->mode], vismode, src_sel,
+       fd_draw(ctx, ring, primtype, vismode, src_sel,
                        info->count, info->instance_count - 1,
                        idx_type, idx_size, idx_offset, idx_bo);
 }