|
Post by DJLinux on Dec 25, 2008 19:41:44 GMT -5
I know OpenGL version < 3.0 has no FreeMemory function as a workaround i tryed to build 256 MB displaylists on a card with only 64MB i was hoping to get an opengl error but the OS will allocate the 256 MB in virtual swapspace. how to hell can a game get the REAL size of free memory in hardware? Joshy function Alloc1MB(List) dim p,v#(2),Bytes glNewList(List,GL_COMPILE) if glGetError()=GL_OUT_OF_MEMORY then return 0 end if bytes=bytes+4 glBegin(GL_POINTS):bytes=bytes+4 for p =1 to 43690 glNormal3f(rnd(),rnd(),rnd()) if glGetError()<>GL_NO_ERROR then return Bytes end if bytes=bytes+12 glVertex3f(rnd(),rnd(),rnd()) if glGetError()<>GL_NO_ERROR then return Bytes end if bytes=bytes+12 next ' vertex glEnd() if glGetError()<>GL_NO_ERROR then return Bytes end if bytes=bytes+4 glEndList() if glGetError()<>GL_NO_ERROR then return Bytes end if bytes=bytes+4 return bytes end function ' ' ' dim vendor$ = glGetString(GL_VENDOR) 'dim renderer$ = glGetString(GL_RENDERER) dim version$ = glGetString(GL_VERSION) printr vendor$ + " " + version$ ' dim i,Lists,nBytes,mb ' ' ' Lists=glGenLists(256) if (Lists=0) or (glGetError()<>GL_NO_ERROR) then printr "error: cant generate 256 displaylists!" input$():end end if ' ' ' while (i<256) i=i+1 nBytes=Alloc1MB(Lists+i) if nBytes<>(1024*1024) then printr "error: alloc 1 MB!" i=256 else mb=mb+1 locate 0,2:printr "MB:" + mb end if wend glDeleteLists(Lists,256) end
|
|
|
Post by Darkjester on Dec 25, 2008 22:49:21 GMT -5
I ran the test on a 256mb ati x1050 and got this...
|
|
|
Post by DJLinux on Dec 25, 2008 23:53:37 GMT -5
try this
change: if (Lists=0) or (glGetError()<>GL_NO_ERROR) then
to: if Lists=0 then
|
|
|
Post by Darkjester on Dec 26, 2008 0:43:31 GMT -5
try this change: if (Lists=0) or (glGetError()<>GL_NO_ERROR) then to: if Lists=0 then Tried and got this result before my computer almost completely locked up(might have been a swapfile thing cause i lack an enormous amount of ram on this pc) or a mem leak not sure,
|
|