mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
merge from 5.0.1 branch
This commit is contained in:
parent
ed1b6e98e2
commit
ff6068b217
1 changed files with 21 additions and 15 deletions
|
|
@ -27,7 +27,7 @@
|
|||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: texobj.c,v 1.62.4.1 2003/03/09 10:52:21 jrfonseca Exp $ */
|
||||
/* $Id: texobj.c,v 1.62.4.2 2003/03/10 14:10:46 brianp Exp $ */
|
||||
|
||||
#include "glheader.h"
|
||||
#include "colortab.h"
|
||||
|
|
@ -894,7 +894,7 @@ _mesa_AreTexturesResident(GLsizei n, const GLuint *texName,
|
|||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLboolean allResident = GL_TRUE;
|
||||
GLint i;
|
||||
GLint i, j;
|
||||
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
|
||||
|
||||
if (n < 0) {
|
||||
|
|
@ -908,26 +908,32 @@ _mesa_AreTexturesResident(GLsizei n, const GLuint *texName,
|
|||
for (i = 0; i < n; i++) {
|
||||
struct gl_texture_object *t;
|
||||
if (texName[i] == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident(textures)");
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident");
|
||||
return GL_FALSE;
|
||||
}
|
||||
t = (struct gl_texture_object *)
|
||||
_mesa_HashLookup(ctx->Shared->TexObjects, texName[i]);
|
||||
if (t) {
|
||||
if (ctx->Driver.IsTextureResident) {
|
||||
residences[i] = ctx->Driver.IsTextureResident(ctx, t);
|
||||
if (!residences[i])
|
||||
allResident = GL_FALSE;
|
||||
}
|
||||
else {
|
||||
residences[i] = GL_TRUE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident(textures)");
|
||||
if (!t) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident");
|
||||
return GL_FALSE;
|
||||
}
|
||||
if (!ctx->Driver.IsTextureResident ||
|
||||
ctx->Driver.IsTextureResident(ctx, t)) {
|
||||
/* The texture is resident */
|
||||
if (!allResident)
|
||||
residences[i] = GL_TRUE;
|
||||
}
|
||||
else {
|
||||
/* The texture is not resident */
|
||||
if (allResident) {
|
||||
allResident = GL_FALSE;
|
||||
for (j = 0; j < i; j++)
|
||||
residences[j] = GL_TRUE;
|
||||
}
|
||||
residences[i] = GL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return allResident;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue