[Mesa-dev] [Bug 90130] gl_PrimitiveId seems to reset at 340

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Apr 22 08:42:31 PDT 2015


https://bugs.freedesktop.org/show_bug.cgi?id=90130

--- Comment #9 from Ken Martin <kennethmorrismartin at gmail.com> ---
(In reply to Roland Scheidegger from comment #5)
> Or even better, a piglit test :-).
> 
> I suspect there's an issue with the prim assembler in draw.
> Since from a quick look it seems like the prim assembler would always reset
> the prim_id it's going to inject whenever it's run, and that's going to
> happen per chunk (as we don't process all vertices in a draw call at once if
> there's too many). Probably would need to fix that somehow so it's only
> reset per instance.
> We possibly (?) handle this correctly if there's a gs.

(In reply to Roland Scheidegger from comment #5)
> Or even better, a piglit test :-).
> 
> I suspect there's an issue with the prim assembler in draw.
> Since from a quick look it seems like the prim assembler would always reset
> the prim_id it's going to inject whenever it's run, and that's going to
> happen per chunk (as we don't process all vertices in a draw call at once if
> there's too many). Probably would need to fix that somehow so it's only
> reset per instance.
> We possibly (?) handle this correctly if there's a gs.

Any suggestion on a piglit test to use as a starting point? It would need
OpenGL 3.2 and the basic test would be


draw say 10000 triangles each covering the entire window with this fragment
shader

#version 150
main
{
  // throw out the first 9999 triangles (0 to 9998)
  if (glPrimitiveID < 9999) { discard; }
  // for the last triangle create the color based on glPrimitiveId
  gl_FragColor = vec4(glPrimitiveId%256,glPrimitiveId/256,0.0,1.0);
}

Then test the color of a pixel to see if it is RGBA (15,39,0,255) or the equiv
in float.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150422/856f4021/attachment.html>


More information about the mesa-dev mailing list