summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2013-08-09 10:11:31 -0400
committerZack Rusin <[email protected]>2013-08-14 18:23:35 -0400
commita3ae5dc7dd5c2f8893f86a920247e690e550ebd4 (patch)
tree0c8ab07edf93210be4d0f20e95886b206c927e52 /src/gallium
parent98d2498404ba69a3efc1c765b1a1885d151181ed (diff)
draw: make sure that the stages setup outputs
Calling the prepare outputs cleans up the slot assignments for outputs, unfortunately aapoint and aaline didn't have code to reset their slots after the initial setup, this was messing up our slot assignments. The unfilled stage was just missing the initial assignment of the face slot. This fixes all of the reported piglit failures. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/draw/draw_context.c2
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe.h5
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_aaline.c27
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_aapoint.c56
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_unfilled.c2
5 files changed, 62 insertions, 30 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index 2d4843ebe25..d1fac0c6c1d 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -564,6 +564,8 @@ draw_prepare_shader_outputs(struct draw_context *draw)
draw_remove_extra_vertex_attribs(draw);
draw_prim_assembler_prepare_outputs(draw->ia);
draw_unfilled_prepare_outputs(draw, draw->pipeline.unfilled);
+ draw_aapoint_prepare_outputs(draw, draw->pipeline.aapoint);
+ draw_aaline_prepare_outputs(draw, draw->pipeline.aaline);
}
/**
diff --git a/src/gallium/auxiliary/draw/draw_pipe.h b/src/gallium/auxiliary/draw/draw_pipe.h
index 7c9ed6c31d9..ad3165fd29b 100644
--- a/src/gallium/auxiliary/draw/draw_pipe.h
+++ b/src/gallium/auxiliary/draw/draw_pipe.h
@@ -101,7 +101,10 @@ void draw_pipe_passthrough_tri(struct draw_stage *stage, struct prim_header *hea
void draw_pipe_passthrough_line(struct draw_stage *stage, struct prim_header *header);
void draw_pipe_passthrough_point(struct draw_stage *stage, struct prim_header *header);
-
+void draw_aapoint_prepare_outputs(struct draw_context *context,
+ struct draw_stage *stage);
+void draw_aaline_prepare_outputs(struct draw_context *context,
+ struct draw_stage *stage);
void draw_unfilled_prepare_outputs(struct draw_context *context,
struct draw_stage *stage);
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
index aa884596b35..c44c236bc58 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
@@ -692,13 +692,7 @@ aaline_first_line(struct draw_stage *stage, struct prim_header *header)
return;
}
- /* update vertex attrib info */
- aaline->pos_slot = draw_current_shader_position_output(draw);;
-
- /* allocate the extra post-transformed vertex attribute */
- aaline->tex_slot = draw_alloc_extra_vertex_attrib(draw,
- TGSI_SEMANTIC_GENERIC,
- aaline->fs->generic_attrib);
+ draw_aaline_prepare_outputs(draw, draw->pipeline.aaline);
/* how many samplers? */
/* we'll use sampler/texture[pstip->sampler_unit] for the stipple */
@@ -953,6 +947,25 @@ aaline_set_sampler_views(struct pipe_context *pipe,
}
+void
+draw_aaline_prepare_outputs(struct draw_context *draw,
+ struct draw_stage *stage)
+{
+ struct aaline_stage *aaline = aaline_stage(stage);
+ const struct pipe_rasterizer_state *rast = draw->rasterizer;
+
+ /* update vertex attrib info */
+ aaline->pos_slot = draw_current_shader_position_output(draw);;
+
+ if (!rast->line_smooth)
+ return;
+
+ /* allocate the extra post-transformed vertex attribute */
+ aaline->tex_slot = draw_alloc_extra_vertex_attrib(draw,
+ TGSI_SEMANTIC_GENERIC,
+ aaline->fs->generic_attrib);
+}
+
/**
* Called by drivers that want to install this AA line prim stage
* into the draw module's pipeline. This will not be used if the
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
index 0d7b88ee7d1..7ae1ddd24ce 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
@@ -696,28 +696,7 @@ aapoint_first_point(struct draw_stage *stage, struct prim_header *header)
*/
bind_aapoint_fragment_shader(aapoint);
- /* update vertex attrib info */
- aapoint->pos_slot = draw_current_shader_position_output(draw);
-
- /* allocate the extra post-transformed vertex attribute */
- aapoint->tex_slot = draw_alloc_extra_vertex_attrib(draw,
- TGSI_SEMANTIC_GENERIC,
- aapoint->fs->generic_attrib);
- assert(aapoint->tex_slot > 0); /* output[0] is vertex pos */
-
- /* find psize slot in post-transform vertex */
- aapoint->psize_slot = -1;
- if (draw->rasterizer->point_size_per_vertex) {
- const struct tgsi_shader_info *info = draw_get_shader_info(draw);
- uint i;
- /* find PSIZ vertex output */
- for (i = 0; i < info->num_outputs; i++) {
- if (info->output_semantic_name[i] == TGSI_SEMANTIC_PSIZE) {
- aapoint->psize_slot = i;
- break;
- }
- }
- }
+ draw_aapoint_prepare_outputs(draw, draw->pipeline.aapoint);
draw->suspend_flushing = TRUE;
@@ -781,6 +760,39 @@ aapoint_destroy(struct draw_stage *stage)
FREE( stage );
}
+void
+draw_aapoint_prepare_outputs(struct draw_context *draw,
+ struct draw_stage *stage)
+{
+ struct aapoint_stage *aapoint = aapoint_stage(stage);
+ const struct pipe_rasterizer_state *rast = draw->rasterizer;
+
+ /* update vertex attrib info */
+ aapoint->pos_slot = draw_current_shader_position_output(draw);
+
+ if (!rast->point_smooth)
+ return;
+
+ /* allocate the extra post-transformed vertex attribute */
+ aapoint->tex_slot = draw_alloc_extra_vertex_attrib(draw,
+ TGSI_SEMANTIC_GENERIC,
+ aapoint->fs->generic_attrib);
+ assert(aapoint->tex_slot > 0); /* output[0] is vertex pos */
+
+ /* find psize slot in post-transform vertex */
+ aapoint->psize_slot = -1;
+ if (draw->rasterizer->point_size_per_vertex) {
+ const struct tgsi_shader_info *info = draw_get_shader_info(draw);
+ uint i;
+ /* find PSIZ vertex output */
+ for (i = 0; i < info->num_outputs; i++) {
+ if (info->output_semantic_name[i] == TGSI_SEMANTIC_PSIZE) {
+ aapoint->psize_slot = i;
+ break;
+ }
+ }
+ }
+}
static struct aapoint_stage *
draw_aapoint_stage(struct draw_context *draw)
diff --git a/src/gallium/auxiliary/draw/draw_pipe_unfilled.c b/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
index 68bab72265e..7a88ce0f6d7 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
@@ -268,6 +268,8 @@ struct draw_stage *draw_unfilled_stage( struct draw_context *draw )
unfilled->stage.reset_stipple_counter = unfilled_reset_stipple_counter;
unfilled->stage.destroy = unfilled_destroy;
+ unfilled->face_slot = -1;
+
if (!draw_alloc_temp_verts( &unfilled->stage, 0 ))
goto fail;