Reputation: 2254
While I seeing OpenGL specification, I noticed something weird.
Here are prototypes for glMapBufferRange() and glMapNamedBufferRange():
void *glMapBufferRange( GLenum target,
GLintptr offset,
GLsizeiptr length,
GLbitfield access);
void *glMapNamedBufferRange( GLuint buffer,
GLintptr offset,
GLsizei length,
GLbitfield access);
For length parameter, glMapNamedBufferRange() uses GLsizei type which is 32bit integer while glMapBufferRange() uses GLsizeiptr whose size is >= sizeof(void*).
From the specification, it's not possible to map a very long range of buffer using glMapNamedBufferRange() because GLsizei is only 32bit integer.
On the other hand glMapbufferRange() can map all range of addresses in 64bit platform.
Why does only glMapNamedBufferRange() have such limitation even though its purpose is very similar with glNamedBufferRange()?
edit:
I found similar cases. In fact, lots of named buffer counter parts uses GLsizei when non named version uses GLsizeptr.
Why do named version buffer functions have such limitations?
Upvotes: 1
Views: 504
Reputation: 473547
What version of the specification are you looking at? The OpenGL specification version 4.6 (pdf) (and the associated gl.xml
file) clearly says that glMapNamedBufferRange
takes a GLsizeiptr
.
You're probably looking at the man pages, which can sometimes have errors like this. Always check the actual specification first if you see something odd like this.
Upvotes: 4