[Mesa-dev] [PATCH] draw: don't crash if GS doesn't emit anything
Jose Fonseca
jfonseca at vmware.com
Tue Apr 30 06:47:12 PDT 2013
----- Original Message -----
> On 04/27/2013 06:57 AM, Zack Rusin wrote:
> > Technically it's legal for geometry shader to not emit any
> > vertices. It's silly, but perfectly legal, so lets make draw
> > stop crashing if it happens.
> >
> > Signed-off-by: Zack Rusin<zackr at vmware.com>
> > ---
> > src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c | 9
> > +++++++++
> > .../auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c | 9
> > +++++++++
> > 2 files changed, 18 insertions(+)
> >
> > 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 7b871c2..8d66c88 100644
> > --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
> > +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
> > @@ -299,6 +299,15 @@ static void fetch_pipeline_generic( struct
> > draw_pt_middle_end *middle,
> > }
> > }
> > }
> > + if (prim_info->count == 0) {
> > + debug_printf("GS/IA didn't emit any vertices!\n");
>
> What is "IA"?
"Input Assembly", a D3D10 term that roughly matches pipe_vertex_elements / pipe_vertex_buffer state.
BTW, I think that Chris Forbes makes a good point -- a GS might choose to not emit any vertices (e.g., that does fancy culling) -- so maybe this debugging message should be silent by default.
Jose
More information about the mesa-dev
mailing list