KhronosGroup / KhronosGroup/OpenGL-API
Interactions between GL_NV_primitive_restart and OpenGL 3.1+ are undefined
- Dominant language
- No language data
- Stars
- 42
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
In [GL_NV_primitive_restart](https://www.khronos.org/registry/OpenGL/extensions/NV/NV_primitive_restart.txt), the enable and the restart index are client state. In unextended OpenGL 3.1 or OpenGL 3.2+ Core Profile, there is, effectively, no client vertex state. As a result, the enable and the restart index are server state. In unextended OpenGL 3.1 or OpenGL 3.2+ Core Profile, it is not possible to expose the extension, so there is no problem.
In extended OpenGL 3.1 or OpenGL 3.2+ Compatibility Profile, it is possible to expose GL_NV_primitve_restart in addition to the core feature. However, the extension spec was never updated with any interactions. What happens in the following code?
```
glEnable(GL_PRIMITIVE_RESTART);
glClientEnable(GL_PRIMITIVE_RESTART_NV);
glPrimitiveRestartIndex(1);
glPrimitiveRestartIndexNV(2);
glDrawElements(...); /* 1 */
glDisable(GL_PRIMITIVE_RESTART);
glDrawElements(...); /* 2 */
glEnable(GL_PRIMITIVE_RESTART);
glClientDisable(GL_PRIMITIVE_RESTART_NV);
glDrawElements(...); /* 3 */
```
In draw 1, what is the primitive restart index? In draws 2 and 3, is primitive restart enabled or not?
Thinking about how this could work with GLX protocol, my _guess_ would be that when both `GL_PRIMITVE_RESTART` and `GL_PRIMITVE_RESTART_NV` are enabled, the state for `GL_PRIMITVE_RESTART_NV` is used. If only of `GL_PRIMITVE_RESTART` or `GL_PRIMITVE_RESTART_NV` is enabled, the enabled state is used.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the linked GL_NV_primitive_restart extension specification and the OpenGL 3.1 and 3.2+ Compatibility Profile primitive-restart definitions. Analyze the three draw cases and document the interaction between the core and NV state, including the selected restart index and enabled state.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100