View Full Version : Vertex Array Range with Linux?
Has anyone successfully use Vertex Array Range with Linux?
I don't seem to be able to use it under Linux, the problem is that glXAllocateMemoryNV always return NULL.
I tried the same code under Windows (and replace glXAllocateMemoryNV with wglAllocateMemoryNV), I can allocate video memory (not AGP memory though).
Anyone know how to set up your machine so that you can use AGP memory?
08-21-2002, 10:33 AM
The problem is
glXAllocateMemoryNV returns NULL
as long as the window of your current
opengl context is not mapped.
1. XMapWindow (display, window) ;
2. XFlush (display) ;
3. (wait until window send Expose event
=> window is mapped !!!)
4. glXAllocateMemoryNV returns != NULL
Why do you need to wait ?
The problem is that your window manager
intercepts the XMap request and reparents your top level window. During reparentingthe window is in not mapped state.
Therefore wait until first Expose event
or another possibility is to query for window attributes and check for map state:
1.XWindowAttributes attr ;
2.while ( XGetWindowAttributes
(display, window, &attr ))
if (attr.map_state == IsViewable) break;
I tried your suggestion, although not using exactly the functions you suggested. What I did was calling glXAllocateMemoryNV after I have rendered several frames (drawing a simple triangle). Then, I rendered my geometry using VAR. If the problem was the window has not been mapped, then by doing the above, it will fix it.
However, my test shows that glXAllocateMemoryNV still returning NULL.
Any more ideas?
08-21-2002, 02:32 PM
Hi, take a look at the extension spec at http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_array_range.txt
It basically says that it will return NULL if the memory cannot be allocated. It also says that if your implementation doesnt support this extension it will always return NULL. And it also says that if you use indirect rendering, it will always return NULL. Hope this was of help.
08-21-2002, 09:59 PM
The evaluation of my previous test I have made was not quite accurate. After retrying my tests I experienced the following:
Allocating has worked only the first time,
the second call always failed - waiting
for the window to be in mapped state is not necessary ! However freeing the memory and then reallocating a larger one works fine.
It seems to me you have found a driver bug ;-;
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.