[Mesa-dev] [PATCH 4/8] draw/gs: fix segfault in glsl-1.50-gs-mismatch-prim-type triangles_adjacency
airlied at gmail.com
Tue Jun 10 17:27:36 PDT 2014
On 11 June 2014 10:18, Zack Rusin <zackr at vmware.com> wrote:
>> 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.
Okay I think I found the actual problem,
The input shader is naughty, and says max vertices 3, then emits 6,
because why not.
I've got another patch to limit things that doesn't seem to regress
any, I'll send it on now.
More information about the mesa-dev