[Mesa-dev] [PATCH 02/12] radeonsi: don't use util_draw_arrays_instanced in si_draw_rectangle

Marek Olšák maraeo at gmail.com
Fri Oct 6 14:10:05 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/radeonsi/si_state_draw.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index 43ad97a..adebba6 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -22,21 +22,20 @@
  *
  * Authors:
  *      Christian König <christian.koenig at amd.com>
  */
 
 #include "si_pipe.h"
 #include "radeon/r600_cs.h"
 #include "sid.h"
 #include "gfx9d.h"
 
-#include "util/u_draw.h"
 #include "util/u_index_modify.h"
 #include "util/u_log.h"
 #include "util/u_upload_mgr.h"
 #include "util/u_prim.h"
 
 #include "ac_debug.h"
 
 static unsigned si_conv_pipe_prim(unsigned mode)
 {
         static const unsigned prim_conv[] = {
@@ -1558,22 +1557,27 @@ void si_draw_rectangle(struct blitter_context *blitter,
 	default:; /* Nothing to do. */
 	}
 
 	/* draw */
 	struct pipe_vertex_buffer vbuffer = {};
 	vbuffer.buffer.resource = buf;
 	vbuffer.stride = 2 * 4 * sizeof(float); /* vertex size */
 	vbuffer.buffer_offset = offset;
 
 	pipe->set_vertex_buffers(pipe, blitter->vb_slot, 1, &vbuffer);
-	util_draw_arrays_instanced(pipe, R600_PRIM_RECTANGLE_LIST, 0, 3,
-				   0, num_instances);
+
+	struct pipe_draw_info info = {};
+	info.mode = R600_PRIM_RECTANGLE_LIST;
+	info.count = 3;
+	info.instance_count = num_instances;
+
+	si_draw_vbo(pipe, &info);
 	pipe_resource_reference(&buf, NULL);
 }
 
 void si_trace_emit(struct si_context *sctx)
 {
 	struct radeon_winsys_cs *cs = sctx->b.gfx.cs;
 	uint64_t va = sctx->current_saved_cs->trace_buf->gpu_address;
 	uint32_t trace_id = ++sctx->current_saved_cs->trace_id;
 
 	radeon_emit(cs, PKT3(PKT3_WRITE_DATA, 3, 0));
-- 
2.7.4



More information about the mesa-dev mailing list