That will be offered. This is good since the driver won't store backups in RAM.Originally Posted by Mark Shaxted
You can also tell it to keep a backup for people who want the old GL behavior.
That will be offered. This is good since the driver won't store backups in RAM.Originally Posted by Mark Shaxted
You can also tell it to keep a backup for people who want the old GL behavior.
------------------------------
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
V-man, what are you referring to ?Originally Posted by V-man
So that's not happening then. It was something alluded to by barthold in a thread many moons ago, when the summer days were longer and coke tasted nice.
To be honest, I wouldn't expect anything like that. The best you could hope for is keeping the priority mechanism.Currently, there is no way to "force" a texture or VBO in VRAM and let the application do its own memory management. Some will argue that this kind of low-level control should not be exposed, but in real-time application where avoiding glitches is a must, such a scheme would provide a way to garantee a glitch-free operation. Simply hoping that the driver makes the right decision as to which object to keep in VRAM is not an option.
Not to mention the simple fact that I can't imagine how an application could expect that to work. I mean, the GL spec can only enforce behavior, not performance. You could have a function that says, "put this into video memory," but there's no way to tell if the driver is lying to you if it says, "OK." After all, it's your only interface to video memory, so it can lie to you on query functions too. And you can never know if a hitch in the rendering is due to paging something in or some other issue without significant diagnostics tools.
It also doesn't make sense if the Operating System virtualizes video memory (like MacOS and Vista), as the graphics driver literally has no control over what is and isn't in video memory.
Actually, you don't know that. You're assuming that, possibly with some evidence, but it may be different in the next driver version.This is impossible since the texture is only sent to VRAM as a whole chunk when it is first used.
I'm pretty sure you can forget that one. Don't even dream about it; it ain't gonna happen.Ideally, a mechanism for casting a surface from says a 1MB RGBA texture to a 1MB DXT texture would be great since a bunch of them could be created during initialization and always reused.
The simple fact is this: OpenGL and D3D are abstractions, not memory managers. Their job is to actively prevent you from doing those things.
Yes drivers lying and optimizing to gain few fps in benchmarks is problem which the API can not directly solve. The only thing the API can do is provide strong mechanism for specifying the program intentions to the driver (e.g. This uniform is changed offten, do not optimize. Try to keep this shadowmap in the fastest memory at all costs even if I will not use it for some time.) so reasonable driver does not have to gues the intended behavior.Originally Posted by Korval
I think that the virtualization is always done with cooperation with the driver because only the driver knows what can be safely moved to different memory. So the driver should have at least some control about what is removed.It also doesn't make sense if the Operating System virtualizes video memory (like MacOS and Vista), as the graphics driver literally has no control over what is and isn't in video memory.
The reall memory size and other requirements put on the texture memory might change in unexpected (for external observer) ways between formats or texture sizes depending on what the hw requires. Even the DX10 which allows for accessing the resource using different formats is very strict and limited in what types are compatible for this purpose.Originally Posted by bertgp
I strongly disagree with this statement. Only the application, with its knowledge of how it will use resources can effectively make appropriate decisions as to what to prioritize. I do agree that there are cases where the driver, because of the underlying hardware implementation, will be more apt to choose the right behavior. However, this should not be an excuse to give absolutely no control to the application over memory usage because then the application cannot ever guarantee 100% glitch-free operation (think real-time app).Originally Posted by Komat
The current priority mechanism is either not really enforced or outright ignored by the driver. At the very least, can we please _enforce_ it in the spec (not just provide idiotic "hints" that the driver can ignore!!) so a higher priority texture is never kicked out of VRAM when a lower priority one is not currently used?
Originally Posted by Korval
Having had access to driver source from one major vendor (and one minor) and spending a few weeks investigating the other major vendor's driver, I can say with confidence that this is what happens. One way or the other, don't you agree that not being able to easily pinpoint the source of a glitch is unacceptable? Even worse, in the case of memory management, not being able to effectively remedy it? Worse still, having to redo all the investigation work from one driver version to the next?Originally Posted by Korval
You are right that a 1024x1024 texture does not have the same VRAM size depending on its format. Also, the hardware does some tiling to optimize the memory access pattern of textures which is not necessarily compatible across texture types. Straightforward "casting" of one texture surface type to another would probably not work. However, as you mentioned, some types can be safely casted into other types. This should be available.Originally Posted by Komat
Also, imagine a 1024x1024 texture is divided in 4 512x512 tiles and each of those is further divided down to some limit size. It would be nice to be able to take advantage of this and be able to create 4 512x512 textures from a 1024x1024 texture.
Currently, drivers keep a copy of the texture in RAM do they not?Originally Posted by Rob Barris
This is just in case Windows destroys your texture. The driver gets a notification from Windows, so it reuploads the texture when it gets needed.
GL3 was suppose to offer a feature where we can tell the driver to not keep copies in RAM.
Boring story ahead!
With one project of mine, I added the ability to not initialize GL because it was consuming a ridiculous amount of RAM (according to task manager). Memory usage came down to 24MB. With GL, it went above 100MB. My project was using textures, VBOs, FBOs. I did keep a copy of the textures in RAM when GL was initialized but memory usage should have been around 20MB. The extra 50MB, 60MB, 70MB was probably the GL driver.
------------------------------
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Oh yeah, it's like X-Mas now. Siggraph is less than a month away. Let the count down begin.
Basically, my requirements are for displaying thumbnails of photographs. I want to use the following strategy:-
vram: 8192 64x64 6:1 compressed thumbs (total 16mb forced into vram - ie a high priority)
vram: 256 thumbs of a given size converted into monitor colour profile (volatile)
system ram 1024 jpeg thumbs.
So, in an ideal world, I'd say if the high res thumb exists render with that. If that fails use the crappy low res version, and in the background decompress the jpg, then upload it.
However, as it stands now, all the compressed thumbs, and the hgh res version will exist in vram AND system ram. And for my type of app, memory is always a scarce commodity.
Surely, even with virtualised vram, the driver must know when a txture is about to be paged out. All I want is for the driver to say "no need, I'll just delete it", and return an error when you try to use it. Then *I* can deal with the consequences.