-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ill-specified interaction of display lists and primitive restart #74
Comments
This would also affect GLX implementations of OpenGL 3.1+ compatibility profile due to the need for the client to dereference client-side arrays to send to the server. |
The interaction is not ill-specified. Since the dereferencing happened at the time of compilation, and at the time of the specification, primitive restarting was not set, the behavior is obvious: it accesses the index exactly as you specified it during compilation. Also, the function is |
Yes, You have chosen to interpret the spec one way. That interpretation is likely similar to the interpretation made by the vendor that crashes on array index 0x7fffffff. However, at least one other vendor does not interpret the spec that way, and that driver has very different behavior. At the point where two major vendors of desktop OpenGL drivers make dramatically different interpretations of the spec, the spec is, by definition, ill specified. The problem is that before we removed all of the deprecated functionality from OpenGL 3.1, the primitive restart index and primitive restart control was client state. Since client state was no longer a thing in OpenGL 3.1, the restart index and the restart enable had to change. In OpenGL 3.0 with
It also says:
Calls to Client state affects compilation of display lists, but server state affects execution of display lists. In general, server state is ignored during compilation. The commands are just stored in the list. Section 21.4 calls this out:
This prevents errors from being generated during compilation. This is why you can make a display list that just contains a bunch of called to In addition, even in the compatibility profile specs, there is no analog to To make matters worse, As far as I can tell from having done lots and lots of spec archaeology, changing primitive restart enable and primitive restart index to server state in compatibility profile effectively makes it impossible to both follow the letter of the spec and have primitive restart work in display lists. In my opinion, this violates the principle of least surprise. I also don't think it's what anyone intended. |
The existence of driver bugs is not a reasonable definition of "ill specified". "Ill specified" means that the standard does not say what ought to happen. That people might fail to implement it correctly is not de facto evidence of a defect in the standard. Your point about server state vs. client state is valid, but not the idea that driver bug == ill specified. |
I've been actively contributing to OpenGL specs for 20 years. This is the process. Please stop being a troll. |
A few bits of the OpenGL 3.1+ specification combine to generate an interaction that may be impossible to satisfy.
glPrimitiveRestartIndex
cannot be compiled into a display list.Based on that, what should the following code do?
The difficulty is that
glArrayIndex(0x7fffffff)
is supposed to dereference the vertex array at the time it is called. However, the state ofGL_PRIMITIVE_RESTART
and the primitive restart index aren't known untilglCallList
. It is impossible for the implementation to know if0x7fffffff
should start a new primitive or dereference a very large memory address.On at least one implementation, it crashes inside
glArrayIndex(0x7fffffff)
.The text was updated successfully, but these errors were encountered: