[Mesa-dev] [PATCH 14/25] r600g: emit streamout from dma copy shader

Dave Airlie airlied at gmail.com
Wed Jan 29 16:42:15 PST 2014


From: Dave Airlie <airlied at redhat.com>

This enables streamout with GS in the mix, from the
VS dma shader.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/gallium/drivers/r600/r600_shader.c       | 6 ++++--
 src/gallium/drivers/r600/r600_state_common.c | 4 ++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 93fe851..aa680d7 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -1095,7 +1095,8 @@ out_err:
 }
 
 static int generate_gs_copy_shader(struct r600_context *rctx,
-                                   struct r600_pipe_shader *gs)
+                                   struct r600_pipe_shader *gs,
+                                   struct pipe_stream_output_info *so)
 {
 	struct r600_shader_ctx ctx = {};
 	struct r600_shader *gs_shader = &gs->shader;
@@ -1180,6 +1181,7 @@ static int generate_gs_copy_shader(struct r600_context *rctx,
 
 	/* XXX handle clipvertex, streamout? */
 
+        emit_streamout(&ctx, so);
 	/* export vertex data */
 	/* XXX factor out common code with r600_shader_from_tgsi ? */
 	for (i = 0; i < ocnt; ++i) {
@@ -1963,7 +1965,7 @@ static int r600_shader_from_tgsi(struct r600_context *rctx,
 	}
 
 	if (ctx.type == TGSI_PROCESSOR_GEOMETRY) {
-		if ((r = generate_gs_copy_shader(rctx, pipeshader)))
+		if ((r = generate_gs_copy_shader(rctx, pipeshader, &so)))
 			return r;
 	}
 
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index c533e5d..d140136 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -826,6 +826,10 @@ static void r600_bind_gs_state(struct pipe_context *ctx, void *state)
 	struct r600_context *rctx = (struct r600_context *)ctx;
 
 	rctx->gs_shader = (struct r600_pipe_shader_selector *)state;
+
+	if (!state)
+		return;
+	rctx->b.streamout.stride_in_dw = rctx->gs_shader->so.stride;
 }
 
 static void r600_delete_shader_selector(struct pipe_context *ctx,
-- 
1.8.3.1



More information about the mesa-dev mailing list