summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_blitter.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-11-19 21:44:28 +0100
committerChristoph Bumiller <[email protected]>2011-12-15 18:51:48 +0100
commitb177e2c54c7dbec58c2547524abe89e52d458252 (patch)
tree2182326eddd22afed48588c5d7d7107db4255bd5 /src/gallium/auxiliary/util/u_blitter.c
parent1114b192af1a27c4d90d79145847464e27391fcc (diff)
u_blitter: restore stream output targets
Diffstat (limited to 'src/gallium/auxiliary/util/u_blitter.c')
-rw-r--r--src/gallium/auxiliary/util/u_blitter.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index f5cc5cb3b07..c0c477b6a18 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -109,6 +109,7 @@ struct blitter_context_priv
boolean has_geometry_shader;
boolean vertex_has_integers;
+ boolean has_stream_out;
};
static void blitter_draw_rectangle(struct blitter_context *blitter,
@@ -148,6 +149,7 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe)
ctx->base.saved_num_sampler_views = ~0;
ctx->base.saved_num_sampler_states = ~0;
ctx->base.saved_num_vertex_buffers = ~0;
+ ctx->base.saved_num_so_targets = ~0;
ctx->has_geometry_shader =
pipe->screen->get_shader_param(pipe->screen, PIPE_SHADER_GEOMETRY,
@@ -155,6 +157,9 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe)
ctx->vertex_has_integers =
pipe->screen->get_shader_param(pipe->screen, PIPE_SHADER_VERTEX,
PIPE_SHADER_CAP_INTEGERS);
+ ctx->has_stream_out =
+ pipe->screen->get_param(pipe->screen,
+ PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS) != 0;
/* blend state objects */
memset(&blend, 0, sizeof(blend));
@@ -319,6 +324,7 @@ static void blitter_check_saved_vertex_states(struct blitter_context_priv *ctx)
ctx->base.saved_velem_state != INVALID_PTR &&
ctx->base.saved_vs != INVALID_PTR &&
(!ctx->has_geometry_shader || ctx->base.saved_gs != INVALID_PTR) &&
+ (!ctx->has_stream_out || ctx->base.saved_num_so_targets != ~0) &&
ctx->base.saved_rs_state != INVALID_PTR);
}
@@ -354,6 +360,18 @@ static void blitter_restore_vertex_states(struct blitter_context_priv *ctx)
ctx->base.saved_gs = INVALID_PTR;
}
+ /* Stream outputs. */
+ if (ctx->has_stream_out) {
+ pipe->set_stream_output_targets(pipe,
+ ctx->base.saved_num_so_targets,
+ ctx->base.saved_so_targets, ~0);
+
+ for (i = 0; i < ctx->base.saved_num_so_targets; i++)
+ pipe_so_target_reference(&ctx->base.saved_so_targets[i], NULL);
+
+ ctx->base.saved_num_so_targets = ~0;
+ }
+
/* Rasterizer. */
pipe->bind_rasterizer_state(pipe, ctx->base.saved_rs_state);
ctx->base.saved_rs_state = INVALID_PTR;