r600g: emit streamout from dma copy shader
authorDave Airlie <airlied@redhat.com>
Thu, 19 Dec 2013 05:17:00 +0000 (05:17 +0000)
committerDave Airlie <airlied@redhat.com>
Wed, 5 Feb 2014 00:49:39 +0000 (10:49 +1000)
This enables streamout with GS in the mix, from the
VS dma shader.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/r600/r600_shader.c
src/gallium/drivers/r600/r600_state_common.c

index 07b343bd5feda6d5ae71fd834e33c7f072ed9024..e24b64d17811ec5fb56cd9ea365a498fe80f8f33 100644 (file)
@@ -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;
@@ -1179,6 +1180,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 ? */
@@ -1961,7 +1963,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;
        }
 
index 3221a8e24e84ef0f5f69804e9d001b4e1da26203..6cc6ef048bae7bb1d8fd532be1fa3f3e262c5e79 100644 (file)
@@ -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,