Mesa (master): draw: Consider the geometry shader when choosing the vertex size.
Jose Fonseca
jrfonseca at kemper.freedesktop.org
Tue Dec 4 19:35:24 UTC 2012
Module: Mesa
Branch: master
Commit: 32e899ab8b3e0cc717c740e95e05f5e9d11e8224
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=32e899ab8b3e0cc717c740e95e05f5e9d11e8224
Author: José Fonseca <jfonseca at vmware.com>
Date: Thu Nov 15 20:35:20 2012 +0000
draw: Consider the geometry shader when choosing the vertex size.
A single vertex size is chosen for the whole pipeline. So the number of
geometry shader outputs must also be taken in consideration.
Reviewed-by: Brian Paul <brianp at vmware.com>
---
.../auxiliary/draw/draw_pt_fetch_shade_pipeline.c | 9 ++++++---
1 files 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++) {
More information about the mesa-commit
mailing list