summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
index 9f172418544..10fc548b77b 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
@@ -141,19 +141,11 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
struct draw_geometry_shader *gs = draw->gs.geometry_shader;
const unsigned out_prim = gs ? gs->output_primitive :
u_assembled_prim(in_prim);
- const unsigned nr = MAX2(vs->info.num_inputs,
- draw_total_vs_outputs(draw));
+ unsigned nr;
fpme->input_prim = in_prim;
fpme->opt = opt;
- /* Always leave room for the vertex header whether we need it or
- * not. It's hard to get rid of it in particular because of the
- * viewport code in draw_pt_post_vs.c.
- */
- fpme->vertex_size = sizeof(struct vertex_header) + nr * 4 * sizeof(float);
-
-
draw_pt_post_vs_prepare( fpme->post_vs,
draw->clip_xy,
draw->clip_z,
@@ -177,6 +169,30 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
*max_vertices = 4096;
}
+ /* Get the number of float[4] attributes per vertex.
+ * Note: this must be done after draw_pt_emit_prepare() since that
+ * can effect the vertex size.
+ */
+ nr = MAX2(vs->info.num_inputs, draw_total_vs_outputs(draw));
+
+ /* Always leave room for the vertex header whether we need it or
+ * not. It's hard to get rid of it in particular because of the
+ * viewport code in draw_pt_post_vs.c.
+ */
+ fpme->vertex_size = sizeof(struct vertex_header) + nr * 4 * sizeof(float);
+
+ /* Get the number of float[4] attributes per vertex.
+ * Note: this must be done after draw_pt_emit_prepare() since that
+ * can effect the vertex size.
+ */
+ nr = MAX2(vs->info.num_inputs, draw_total_vs_outputs(draw));
+
+ /* Always leave room for the vertex header whether we need it or
+ * not. It's hard to get rid of it in particular because of the
+ * viewport code in draw_pt_post_vs.c.
+ */
+ fpme->vertex_size = sizeof(struct vertex_header) + nr * 4 * sizeof(float);
+
/* return even number */
*max_vertices = *max_vertices & ~1;