Skip to contentSkip to conversation

New: gl_PrimitiveID is zero if no geometry shader is present

Bug 78951 [email protected] 1 participant 11 messages May 20, 2014 – Jan 29, 2015

lore
Share & tools
lore
#0 lore raw

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

Priority: medium
Bug ID: 78951
Assignee: [email protected]
Summary: gl_PrimitiveID is zero if no geometry shader is
present
Severity: normal
Classification: Unclassified
OS: All
Reporter: [email protected]
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.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

[Bug 78951] gl_PrimitiveID is zero if no geometry shader is present

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

[email protected] changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |[email protected]
            Version|unspecified                 |git
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

[Bug 78951] gl_PrimitiveID is zero if no geometry shader is present

In reply to [email protected]

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

--- Comment #1 from Michel Dänzer <[email protected]> ---
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?

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

[Bug 78951] gl_PrimitiveID is zero if no geometry shader is present

In reply to [email protected]

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

--- Comment #2 from [email protected] ---
Alright, I can create 3 geometry shaders for all primitives, but I am not sure if that is the right way for mesa. Thanks

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw

[Bug 78951] gl_PrimitiveID is zero if no geometry shader is present

In reply to [email protected]

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

--- Comment #3 from Michel Dänzer <[email protected]> ---
Just to be clear, I'm talking about doing this transparently in the driver, not in the application.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

[Bug 78951] gl_PrimitiveID is zero if no geometry shader is present

In reply to [email protected]

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

[email protected] changed:

What |Removed |Added
----------------------------------------------------------------------------
Priority|medium |highest

--- Comment #4 from [email protected] ---
I do not have radeonsi supported device. How does Intel driver support this? I think this is really useful for picking algorithm.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

[Bug 78951] gl_PrimitiveID is zero if no geometry shader is present

In reply to [email protected]

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

--- Comment #5 from Ian Romanick <[email protected]> --- (In reply to pavol from comment #4)

Quoted 2 lines

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.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw

[Bug 78951] gl_PrimitiveID is zero if no geometry shader is present

In reply to [email protected]

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

--- Comment #6 from Marek Olšák <[email protected]> ---
The hw GS mode A should be able to do this, which is basically a VS which gets PrimitiveID on the input.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw

[Bug 78951] gl_PrimitiveID is zero if no geometry shader is present

In reply to [email protected]

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

--- Comment #7 from Dave Airlie <[email protected]> --- FYI I've posted patches to mesa-dev to address this for evergreen and later.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw

[Bug 78951] gl_PrimitiveID is zero if no geometry shader is present

In reply to [email protected]

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

--- Comment #8 from Dave Airlie <[email protected]> --- fix for this pushed to mesa master

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw

[Bug 78951] gl_PrimitiveID is zero if no geometry shader is present

In reply to [email protected]

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

[email protected] changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from [email protected] ---
Thank you, it works great.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel