https://bugs.freedesktop.org/show_bug.cgi?id=78951
Priority: medium Bug ID: 78951 Assignee: dri-devel@lists.freedesktop.org Summary: gl_PrimitiveID is zero if no geometry shader is present Severity: normal Classification: Unclassified OS: All Reporter: pavol@klacansky.com Hardware: Other Status: NEW Version: unspecified Component: Drivers/Gallium/r600 Product: Mesa
I case there is no geometry shader attached to program, gl_PrimitiveID is always zero.
https://bugs.freedesktop.org/show_bug.cgi?id=78951
pavol@klacansky.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |pavol@klacansky.com Version|unspecified |git
https://bugs.freedesktop.org/show_bug.cgi?id=78951
--- Comment #1 from Michel Dänzer michel@daenzer.net --- AFAICT the hardware doesn't provide any way to retrieve the primitive ID without a geometry shader, so we'd probably need to use a passthrough geometry shader for this. Any volunteers?
https://bugs.freedesktop.org/show_bug.cgi?id=78951
--- Comment #2 from pavol@klacansky.com --- Alright, I can create 3 geometry shaders for all primitives, but I am not sure if that is the right way for mesa. Thanks
https://bugs.freedesktop.org/show_bug.cgi?id=78951
--- Comment #3 from Michel Dänzer michel@daenzer.net --- Just to be clear, I'm talking about doing this transparently in the driver, not in the application.
https://bugs.freedesktop.org/show_bug.cgi?id=78951
pavol@klacansky.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Priority|medium |highest
--- Comment #4 from pavol@klacansky.com --- I do not have radeonsi supported device. How does Intel driver support this? I think this is really useful for picking algorithm.
https://bugs.freedesktop.org/show_bug.cgi?id=78951
--- Comment #5 from Ian Romanick idr@freedesktop.org --- (In reply to pavol from comment #4)
I do not have radeonsi supported device. How does Intel driver support this? I think this is really useful for picking algorithm.
The piglit test tests/spec/glsl-1.50/execution/primitive-id-no-gs.shader_test is for this very case. That test passes at least on my Ivybridge. I don't know what we do in the driver to make this work... or if the hardware just sorts it out.
https://bugs.freedesktop.org/show_bug.cgi?id=78951
--- Comment #6 from Marek Olšák maraeo@gmail.com --- The hw GS mode A should be able to do this, which is basically a VS which gets PrimitiveID on the input.
https://bugs.freedesktop.org/show_bug.cgi?id=78951
--- Comment #7 from Dave Airlie airlied@freedesktop.org --- FYI I've posted patches to mesa-dev to address this for evergreen and later.
https://bugs.freedesktop.org/show_bug.cgi?id=78951
--- Comment #8 from Dave Airlie airlied@freedesktop.org --- fix for this pushed to mesa master
https://bugs.freedesktop.org/show_bug.cgi?id=78951
pavol@klacansky.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #9 from pavol@klacansky.com --- Thank you, it works great.
dri-devel@lists.freedesktop.org