Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 10 of 10

Thread: Vertex Array Range (nvidia) Problem!!

  1. #1
    Intern Contributor
    Join Date
    May 2001
    Location
    Hamburg, Germany
    Posts
    75

    Vertex Array Range (nvidia) Problem!!

    Hi!
    I have troubles getting VAR working!
    I try to allocate some memory, but i always get a nullpointer...
    Hereīs my code:
    Code :
    		unsigned char *AGPMemory; 
     
    		if(VARSupported)
    		{
    			// This call allocates Memory in AGP-Memory!!
    			AGPMemory = (unsigned char*)wglAllocateMemoryNV(1024*sizeof(float), 0.2f, 0.2f, 0.5f);
     
    			if (!AGPMemory)
    			{
    				//No AGP Memory available
    				VARSupported = false;
    			}
    			else
    			{
    				//Everything worked fine and the memory could be allocated...
     
    				//...Proceed with memcopy etc.
     
    			}
     
    		}
    But actually itīs always !AGPMemory .... so wahtīs wrong with that
    BTW: The NVIDIA demos workes perfectly, so it canīt be my machine....

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Jun 2001
    Location
    Denmark
    Posts
    748

    Re: Vertex Array Range (nvidia) Problem!!

    Hi Mr.Blob , try these values for wglAllocateMemoryNV( 1024*sizeof(float), 0, 0.1f, 0.75f ).

  3. #3
    Intern Contributor
    Join Date
    May 2001
    Location
    Hamburg, Germany
    Posts
    75

    Re: Vertex Array Range (nvidia) Problem!!

    Well, I tried those values, but it sill doesnīt work...
    Or my check-code is not correct?? I dunno...
    Please help me!

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Aug 2000
    Location
    Portsmouth, Hampshire, England
    Posts
    1,063

    Re: Vertex Array Range (nvidia) Problem!!

    Are you sure you have a valid OpenGL rendering context, when you do this? I assume you do, or you wouldn't have been able to get the address of the allocate function. But thats all I can think of.

    Nutty

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,704

    Re: Vertex Array Range (nvidia) Problem!!

    That. Or your machine doesn't have the right AGP drivers installed (common on VIA chipset machines, I hear). Or your card is actually a PCI card, so there is no AGP memory. Or you are out of AGP memory. Or one of a million other things.

    It's perfectly fine for AllocateMemory() to return NULL; the fallback case is to use malloc() for your memory. You can still call VertexArrayRange() on malloc()-ed memory, and it will still make vertex arrays draw faster when they're in that memory.

    Code :
    bool inMalloc = false;
    void * varMemory = 0;
     
    void init()
    {
      inMalloc = false;
      if( !(varMemory = wglAllocateMemory(...)) ) {
        varMemory = malloc(...);
        inMalloc = true;
      }
      glVertexArrayRangeNV(varMemory,...);
      glEnable(GL_VERTEX_ARRAY_RANGE_NV);
    }
     
    void terminate()
    {
      glDisable(GL_VERTEX_ARRAY_RANGE_NV);
      if( inMalloc ) {
        free(varMemory);
      }
      else {
        wglFreeMemory(...,varMemory);
      }
    }
    [This message has been edited by jwatte (edited 06-09-2002).]
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

  6. #6
    Member Regular Contributor
    Join Date
    Feb 2002
    Location
    Hamburg, Germany
    Posts
    415

    Re: Vertex Array Range (nvidia) Problem!!

    i had this problem too... does you driver support AGP ?
    check out the renderer string.
    if you have a pci-version only (this can be true even on agp machines) then try to allocate videomem with: glAllocateMemoryNV(size,0,0,1);

  7. #7
    Senior Member OpenGL Pro
    Join Date
    Aug 2000
    Location
    Portsmouth, Hampshire, England
    Posts
    1,063

    Re: Vertex Array Range (nvidia) Problem!!

    Although he said the nvidia demos work fine, I suppose he should verify that they are allocating AGP memory. Perhaps they're just falling back to video memory, or sys memory.

  8. #8
    Member Regular Contributor
    Join Date
    Feb 2002
    Location
    Hamburg, Germany
    Posts
    415

    Re: Vertex Array Range (nvidia) Problem!!

    nutty, you are right. the nvidia demos check for AGP mem first, and when they can't allocate it, they allocate pure videomem.

  9. #9
    Senior Member OpenGL Pro
    Join Date
    Feb 2001
    Location
    Switzerland
    Posts
    1,840

    Re: Vertex Array Range (nvidia) Problem!!

    http://tyrannen.starcraft3d.net/PerPixelLighting

    try this app, it reports from where the mem is allocated..
    http://davepermen.net - if i could stay true to my heart, i would feel totally free

  10. #10
    Intern Contributor
    Join Date
    May 2001
    Location
    Hamburg, Germany
    Posts
    75

    Re: Vertex Array Range (nvidia) Problem!!

    Ok, I treid the app and I found out that itīs allocating the memory in GeForce RAM i.e video-mem. I have a GeForce1, but actually i thought the GeForce would provide AGP Memory...the problem is, that i wnat to allocate about 1024*1024*11 bytes *g*! Thatīs a little bit too much for VideoMem!
    But I Canīt help it...thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •