[Mesa-dev] [PATCH 4/8] draw/gs: fix segfault in glsl-1.50-gs-mismatch-prim-type triangles_adjacency

Zack Rusin zackr at vmware.com
Tue Jun 10 17:18:45 PDT 2014


> I'll revisit it today and see if I can spot something else wrong, it
> fails for triangle adj because there are 6 vertices per primitive and
> we have only malloced space for 4.

It has to be something else because that's impossible, in fact it's 2x impossible ;)

1) It's illegal and impossible for geometry shader to emit adjacency primitives. Only points, lines and triangles can be emitted from gs.

2) The output primitive is irrelevant for the size of the buffer. If a geometry shader claims that the max output vertices is four, then it can, at most, emit 4 points, 2 lines or 1 triangle (incomplete primitives are discarded from geometry shader so the extra 4th vertex will be discarded). If a geometry shader claims to max emit 4 vertices and you try to emit 100 points, you will still get only 4 points (96 will be counted as overflowed but they won't be emitted).

My advice would be to check what's in the output buffer with llvmpipe. If tgsi_exec doesn't match llvmpipe then there's a bug in tgsi_exec.

z


More information about the mesa-dev mailing list