Mesa (master): freedreno/a3xx: make vs-set point size work

Ilia Mirkin imirkin at kemper.freedesktop.org
Sat Mar 28 19:16:46 UTC 2015


Module: Mesa
Branch: master
Commit: 995f55a6cedfd47a2aed75178a1b0caed7059f20
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=995f55a6cedfd47a2aed75178a1b0caed7059f20

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Tue Mar 17 01:02:32 2015 -0400

freedreno/a3xx: make vs-set point size work

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 at alum.mit.edu>

---

 src/gallium/drivers/freedreno/a2xx/fd2_draw.c  |    3 ++-
 src/gallium/drivers/freedreno/a3xx/fd3_draw.c  |    6 ++++++
 src/gallium/drivers/freedreno/freedreno_draw.h |    3 ++-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_draw.c b/src/gallium/drivers/freedreno/a2xx/fd2_draw.c
index dfc7202..f2efd5f 100644
--- a/src/gallium/drivers/freedreno/a2xx/fd2_draw.c
+++ b/src/gallium/drivers/freedreno/a2xx/fd2_draw.c
@@ -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));
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_draw.c b/src/gallium/drivers/freedreno/a3xx/fd3_draw.c
index 179bf9c..48dd8da 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_draw.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_draw.c
@@ -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);
 }
diff --git a/src/gallium/drivers/freedreno/freedreno_draw.h b/src/gallium/drivers/freedreno/freedreno_draw.h
index 25e102f..3224fb1 100644
--- a/src/gallium/drivers/freedreno/freedreno_draw.h
+++ b/src/gallium/drivers/freedreno/freedreno_draw.h
@@ -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);
 }




More information about the mesa-commit mailing list