texturememory, read back pixels into main memory

Started by
1 comment, last by ghostd0g 16 years, 10 months ago
hi folks, two short questions: 1. is there a standardized way to get the current amount of used texture memory (in total or for one gl context)? 2. how can i actually really read back pixelvalues (for further processing on the CPU) from gfx-mem to main memory? or is this even possible? thx in advance
Advertisement
1. no, but it's possible to estimate if you calculate it yourself.
2. glGetTexImage
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);
@2 thanks man, how could i overlook that ...

@1 hmm, and is there a non standardized (just nvidia) way?
or how could i estimate it. do the drivers store the raw bytes + some overhead (how much?) or do they process (compress?) the uploaded images in some way (efficient mipmaps)?

[Edited by - ghostd0g on June 4, 2007 7:25:37 AM]

This topic is closed to new replies.

Advertisement