changes for single-copy textures

This commit is contained in:
Brian Paul
2000-03-29 18:13:59 +00:00
parent 8fd9fcbc2d
commit 4827179cc0
3 changed files with 26 additions and 12 deletions
+1 -1
View File
@@ -1,4 +1,3 @@
/* $Id: dd.h,v 1.23 2000/03/23 16:22:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -626,6 +625,7 @@ struct dd_function_table {
*/
GLvoid *(*GetTexImage)( GLcontext *ctx, GLenum target, GLint level,
const struct gl_texture_object *texObj,
GLenum *formatOut, GLenum *typeOut,
GLboolean *freeImageOut );
/* Called by glGetTexImage or by core Mesa when a texture image
+24 -1
View File
@@ -49,6 +49,29 @@
*/
#ifdef DEBUG
static void PrintTexture(int w, int h, int c, const GLubyte *data)
{
int i, j;
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
if (c==1)
printf("%02x ", data[0]);
else if (c==2)
printf("%02x %02x ", data[0], data[1]);
else if (c==3)
printf("%02x %02x %02x ", data[0], data[1], data[2]);
else if (c==4)
printf("%02x %02x %02x %02x ", data[0], data[1], data[2], data[3]);
data += c;
}
printf("\n");
}
}
#endif
/*
* Compute log base 2 of n.
* If n isn't an exact power of two return -1.
@@ -1377,7 +1400,7 @@ _mesa_get_teximage_from_driver( GLcontext *ctx, GLenum target, GLint level,
if (!ctx->Driver.GetTexImage)
return;
image = (*ctx->Driver.GetTexImage)( ctx, target, level,
image = (*ctx->Driver.GetTexImage)( ctx, target, level, texObj,
&imgFormat, &imgType, &freeImage);
if (!image)
return;
+1 -10
View File
@@ -1,4 +1,3 @@
/* $Id: texobj.c,v 1.16 2000/03/27 17:55:19 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -168,7 +167,7 @@ void gl_test_texture_object_completeness( const GLcontext *ctx, struct gl_textur
t->Complete = GL_TRUE; /* be optimistic */
/* Always need level zero image */
if (!t->Image[0] || !t->Image[0]->Data) {
if (!t->Image[0]) {
t->Complete = GL_FALSE;
return;
}
@@ -207,10 +206,6 @@ void gl_test_texture_object_completeness( const GLcontext *ctx, struct gl_textur
/* Test dimension-independent attributes */
for (i = minLevel; i <= maxLevel; i++) {
if (t->Image[i]) {
if (!t->Image[i]->Data) {
t->Complete = GL_FALSE;
return;
}
if (t->Image[i]->Format != t->Image[0]->Format) {
t->Complete = GL_FALSE;
return;
@@ -235,10 +230,6 @@ void gl_test_texture_object_completeness( const GLcontext *ctx, struct gl_textur
t->Complete = GL_FALSE;
return;
}
if (!t->Image[i]->Data) {
t->Complete = GL_FALSE;
return;
}
if (t->Image[i]->Width2 != width ) {
t->Complete = GL_FALSE;
return;