-
Notifications
You must be signed in to change notification settings - Fork 162
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
GLsizeiptr and GLintptr defined incorrectly? #246
Comments
The header is generated from <type requires="khrplatform">typedef khronos_intptr_t <name>GLintptr</name>;</type>
<type requires="khrplatform">typedef khronos_ssize_t <name>GLsizeiptr</name>;</type> but, sadly, not every system provides a I guess it should be possible to change those definitions depending on the platform. |
Since we're generating stub types from khrplatform.h because we can't include it reliably, we'll have to deal with some of the fallout of the Win64 types. Fixes: #246
Could you try #247 and see if it fixes the problem? I don't have a Windows 64 bit build I can test on, at the moment. |
Thanks for the quick response! At the moment I don't have a Windows
system handy either. Actually trying to come up with a simple and
definitive test case is a little tricky as well... for one thing, it
seems that Mesa/Gallium has problems if you try to create a single
buffer larger than 4 GiB.
One simple test that does work with Mesa is to try running:
GLint buffer;
glGenBuffers(1, &buffer);
glBindBuffer(GL_ARRAY_BUFFER, buffer);
glBufferData(GL_ARRAY_BUFFER, -1, NULL, GL_STATIC_DRAW);
which, according to the man page, ought to produce a GL_INVALID_VALUE
error.
- on X11 Mesa (32-bit or 64-bit), it generates an error;
- on 64-bit Wine, when applying the patch from #247, it generates an
error;
- on 64-bit Wine, without that patch, it doesn't generate an error (and
instead allocates a buffer of size 2^32-1.)
But of course that's Wine and corner cases like these might not be
completely accurate with respect to the behavior on Windows.
|
According to the GL specs, the types GLsizeiptr and GLintptr should be the size of a pointer (as the 'ptr' suffix would suggest.)
This is supported by the <GL/glext.h> supplied by the MinGW-w64 cross compiler (mingw-w64-common 6.0.0-3 on Debian):
libepoxy 1.5.3 agrees:
However, libepoxy 1.5.5 disagrees:
Which is correct? What does the implementation of, say, glBindBuffersRange() expect, on 64-bit Windows?
The text was updated successfully, but these errors were encountered: