[Mesa-dev] [PATCH 4/9] draw: Consider the geometry shader when choosing the vertex size.
jfonseca at vmware.com
jfonseca at vmware.com
Tue Dec 4 06:13:47 PST 2012
From: José Fonseca <jfonseca at vmware.com>
A single vertex size is chosen for the whole pipeline. So the number of
geometry shader outputs must also be taken in consideration.
---
.../auxiliary/draw/draw_pt_fetch_shade_pipeline.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
index 27420f0..053ea7d 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
@@ -59,12 +59,11 @@ static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle,
struct fetch_pipeline_middle_end *fpme = (struct fetch_pipeline_middle_end *)middle;
struct draw_context *draw = fpme->draw;
struct draw_vertex_shader *vs = draw->vs.vertex_shader;
+ struct draw_geometry_shader *gs = draw->gs.geometry_shader;
unsigned i;
unsigned instance_id_index = ~0;
- unsigned gs_out_prim = (draw->gs.geometry_shader ?
- draw->gs.geometry_shader->output_primitive :
- prim);
+ unsigned gs_out_prim = (gs ? gs->output_primitive : prim);
/* Add one to num_outputs because the pipeline occasionally tags on
* an additional texcoord, eg for AA lines.
@@ -72,6 +71,10 @@ static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle,
unsigned nr = MAX2( vs->info.num_inputs,
vs->info.num_outputs + 1 );
+ if (gs) {
+ nr = MAX2(nr, gs->info.num_outputs + 1);
+ }
+
/* Scan for instanceID system value.
*/
for (i = 0; i < vs->info.num_inputs; i++) {
--
1.7.9.5
More information about the mesa-dev
mailing list