return draw->rasterizer_no_cull[scissor][flatshade];
}
+/**
+ * Sets the mapped so targets.
+ *
+ * The append bitmask specifies which of the buffers are in
+ * the append mode. The append mode means that the buffer
+ * should be appended to, rather than written to from the start.
+ * i.e. the outputs should be written starting from the last
+ * location to which the previous
+ * pass of stream output wrote to in this buffer.
+ * If the buffer is not in an append mode (which is more common)
+ * the writing begins from the start of the buffer.
+ *
+ */
void
draw_set_mapped_so_targets(struct draw_context *draw,
int num_targets,
- struct draw_so_target *targets[PIPE_MAX_SO_BUFFERS])
+ struct draw_so_target *targets[PIPE_MAX_SO_BUFFERS],
+ unsigned append_bitmask)
{
int i;
- for (i = 0; i < num_targets; i++)
+ for (i = 0; i < num_targets; i++) {
draw->so.targets[i] = targets[i];
+ /* if we're not appending then lets reset the internal
+ data of our so target */
+ if (!(append_bitmask & (1 << i)) && draw->so.targets[i]) {
+ draw->so.targets[i]->internal_offset = 0;
+ draw->so.targets[i]->emitted_vertices = 0;
+ }
+ }
for (i = num_targets; i < PIPE_MAX_SO_BUFFERS; i++)
draw->so.targets[i] = NULL;
void
draw_set_mapped_so_targets(struct draw_context *draw,
int num_targets,
- struct draw_so_target *targets[PIPE_MAX_SO_BUFFERS]);
+ struct draw_so_target *targets[PIPE_MAX_SO_BUFFERS],
+ unsigned append_bitmask);
/***********************************************************************
struct draw_so_target *so_targets[PIPE_MAX_SO_BUFFERS];
int num_so_targets;
+ unsigned so_append_bitmask;
struct pipe_query_data_so_statistics so_stats;
unsigned num_primitives_generated;
}
}
draw_set_mapped_so_targets(draw, lp->num_so_targets,
- lp->so_targets);
+ lp->so_targets, lp->so_append_bitmask);
llvmpipe_prepare_vertex_sampling(lp,
lp->num_sampler_views[PIPE_SHADER_VERTEX],
if (mapped_indices) {
draw_set_indexes(draw, NULL, 0, 0);
}
- draw_set_mapped_so_targets(draw, 0, NULL);
+ draw_set_mapped_so_targets(draw, 0, NULL, 0);
if (lp->gs && !lp->gs->shader.tokens) {
/* we have attached stream output to the vs for rendering,
int i;
for (i = 0; i < num_targets; i++) {
pipe_so_target_reference((struct pipe_stream_output_target **)&llvmpipe->so_targets[i], targets[i]);
- /* if we're not appending then lets reset the internal
- data of our so target */
- if (!(append_bitmask & (1 << i)) && llvmpipe->so_targets[i]) {
- llvmpipe->so_targets[i]->internal_offset = 0;
- llvmpipe->so_targets[i]->emitted_vertices = 0;
- }
}
for (; i < llvmpipe->num_so_targets; i++) {
pipe_so_target_reference((struct pipe_stream_output_target **)&llvmpipe->so_targets[i], NULL);
}
+
+ llvmpipe->so_append_bitmask = append_bitmask;
llvmpipe->num_so_targets = num_targets;
}
struct draw_so_target *so_targets[PIPE_MAX_SO_BUFFERS];
unsigned num_so_targets;
+ unsigned so_append_bitmask;
struct pipe_query_data_so_statistics so_stats;
unsigned num_primitives_generated;
}
draw_set_mapped_so_targets(draw, sp->num_so_targets,
- sp->so_targets);
+ sp->so_targets, sp->so_append_bitmask);
if (sp->gs && !sp->gs->shader.tokens) {
/* we have an empty geometry shader with stream output, so
draw_set_indexes(draw, NULL, 0, 0);
}
- draw_set_mapped_so_targets(draw, 0, NULL);
+ draw_set_mapped_so_targets(draw, 0, NULL, 0);
/*
* TODO: Flush only when a user vertex/index buffer is present
}
softpipe->num_so_targets = num_targets;
+ softpipe->so_append_bitmask = append_bitmask;
}
void