removed tfxMipMapLevel's used and translate fields, initial teximage clean-up
This commit is contained in:
parent
de5c19d139
commit
ba3d9d0ce9
|
@ -50,6 +50,9 @@
|
||||||
#if defined(FX)
|
#if defined(FX)
|
||||||
|
|
||||||
#include "fxdrv.h"
|
#include "fxdrv.h"
|
||||||
|
#include "image.h"
|
||||||
|
#include "texutil.h"
|
||||||
|
|
||||||
|
|
||||||
void fxPrintTextureData(tfxTexInfo *ti)
|
void fxPrintTextureData(tfxTexInfo *ti)
|
||||||
{
|
{
|
||||||
|
@ -129,7 +132,6 @@ static tfxTexInfo *fxAllocTexObjData(fxMesaContext fxMesa)
|
||||||
ti->LODblend=FXFALSE;
|
ti->LODblend=FXFALSE;
|
||||||
|
|
||||||
for(i=0;i<MAX_TEXTURE_LEVELS;i++) {
|
for(i=0;i<MAX_TEXTURE_LEVELS;i++) {
|
||||||
ti->mipmapLevel[i].used=GL_FALSE;
|
|
||||||
ti->mipmapLevel[i].data=NULL;
|
ti->mipmapLevel[i].data=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -775,12 +777,14 @@ void fxTexGetFormat(GLenum glformat, GrTextureFormat_t *tfmt, GLint *ifmt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fxIsTexSupported(GLenum target, GLint internalFormat,
|
static GLboolean fxIsTexSupported(GLenum target, GLint internalFormat,
|
||||||
const struct gl_texture_image *image)
|
const struct gl_texture_image *image)
|
||||||
{
|
{
|
||||||
if(target!=GL_TEXTURE_2D)
|
if(target!=GL_TEXTURE_2D)
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* mesa will have already checked this */
|
||||||
switch(internalFormat) {
|
switch(internalFormat) {
|
||||||
case GL_INTENSITY:
|
case GL_INTENSITY:
|
||||||
case GL_INTENSITY4:
|
case GL_INTENSITY4:
|
||||||
|
@ -841,6 +845,7 @@ static int fxIsTexSupported(GLenum target, GLint internalFormat,
|
||||||
|
|
||||||
if(image->Height>256)
|
if(image->Height>256)
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!fxTexGetInfo(image->Width,image->Height,NULL,NULL,NULL,NULL,NULL,NULL,
|
if(!fxTexGetInfo(image->Width,image->Height,NULL,NULL,NULL,NULL,NULL,NULL,
|
||||||
NULL,NULL))
|
NULL,NULL))
|
||||||
|
@ -850,36 +855,43 @@ static int fxIsTexSupported(GLenum target, GLint internalFormat,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fxTexBuildImageMap(const struct gl_texture_image *image,
|
static void fxTexBuildImageMap(const struct gl_texture_image *image,
|
||||||
GLint internalFormat, unsigned short **dest,
|
GLint internalFormat, unsigned short **dest)
|
||||||
GLboolean *istranslate)
|
|
||||||
{
|
{
|
||||||
unsigned short *src;
|
int w, h, wscale, hscale;
|
||||||
unsigned char *data;
|
int texelSize; /* in bytes */
|
||||||
int x,y,w,h,wscale,hscale,idx;
|
MesaIntTexFormat intFormat;
|
||||||
|
|
||||||
fxTexGetInfo(image->Width,image->Height,NULL,NULL,NULL,NULL,NULL,NULL,
|
fxTexGetInfo(image->Width,image->Height,NULL,NULL,NULL,NULL,NULL,NULL,
|
||||||
&wscale,&hscale);
|
&wscale,&hscale);
|
||||||
w = image->Width * wscale;
|
w = image->Width * wscale;
|
||||||
h = image->Height * hscale;
|
h = image->Height * hscale;
|
||||||
|
|
||||||
data=image->Data;
|
|
||||||
switch (internalFormat) {
|
switch (internalFormat) {
|
||||||
case GL_INTENSITY:
|
case GL_INTENSITY:
|
||||||
case GL_INTENSITY4:
|
case GL_INTENSITY4:
|
||||||
case GL_INTENSITY8:
|
case GL_INTENSITY8:
|
||||||
case GL_INTENSITY12:
|
case GL_INTENSITY12:
|
||||||
case GL_INTENSITY16:
|
case GL_INTENSITY16:
|
||||||
|
texelSize = 1;
|
||||||
|
intFormat = MESA_I8;
|
||||||
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
case GL_LUMINANCE:
|
case GL_LUMINANCE:
|
||||||
case GL_LUMINANCE4:
|
case GL_LUMINANCE4:
|
||||||
case GL_LUMINANCE8:
|
case GL_LUMINANCE8:
|
||||||
case GL_LUMINANCE12:
|
case GL_LUMINANCE12:
|
||||||
case GL_LUMINANCE16:
|
case GL_LUMINANCE16:
|
||||||
|
texelSize = 1;
|
||||||
|
intFormat = MESA_L8;
|
||||||
|
break;
|
||||||
case GL_ALPHA:
|
case GL_ALPHA:
|
||||||
case GL_ALPHA4:
|
case GL_ALPHA4:
|
||||||
case GL_ALPHA8:
|
case GL_ALPHA8:
|
||||||
case GL_ALPHA12:
|
case GL_ALPHA12:
|
||||||
case GL_ALPHA16:
|
case GL_ALPHA16:
|
||||||
|
texelSize = 1;
|
||||||
|
intFormat = MESA_A8;
|
||||||
|
break;
|
||||||
case GL_COLOR_INDEX:
|
case GL_COLOR_INDEX:
|
||||||
case GL_COLOR_INDEX1_EXT:
|
case GL_COLOR_INDEX1_EXT:
|
||||||
case GL_COLOR_INDEX2_EXT:
|
case GL_COLOR_INDEX2_EXT:
|
||||||
|
@ -887,34 +899,8 @@ static void fxTexBuildImageMap(const struct gl_texture_image *image,
|
||||||
case GL_COLOR_INDEX8_EXT:
|
case GL_COLOR_INDEX8_EXT:
|
||||||
case GL_COLOR_INDEX12_EXT:
|
case GL_COLOR_INDEX12_EXT:
|
||||||
case GL_COLOR_INDEX16_EXT:
|
case GL_COLOR_INDEX16_EXT:
|
||||||
/* Optimized for GLQuake */
|
texelSize = 1;
|
||||||
|
intFormat = MESA_C8;
|
||||||
if(wscale==hscale==1) {
|
|
||||||
(*istranslate)=GL_FALSE;
|
|
||||||
|
|
||||||
(*dest)=(unsigned short *)data;
|
|
||||||
} else {
|
|
||||||
unsigned char *srcb;
|
|
||||||
|
|
||||||
(*istranslate)=GL_TRUE;
|
|
||||||
|
|
||||||
if(!(*dest)) {
|
|
||||||
if(!((*dest)=src=(unsigned short *)MALLOC(sizeof(unsigned char)*w*h))) {
|
|
||||||
fprintf(stderr,"fx Driver: out of memory !\n");
|
|
||||||
fxCloseHardware();
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
src=(*dest);
|
|
||||||
|
|
||||||
srcb=(unsigned char *)src;
|
|
||||||
|
|
||||||
for(y=0;y<h;y++)
|
|
||||||
for(x=0;x<w;x++) {
|
|
||||||
idx=(x/wscale+(y/hscale)*(w/wscale));
|
|
||||||
srcb[x+y*w]=data[idx];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
case GL_LUMINANCE_ALPHA:
|
case GL_LUMINANCE_ALPHA:
|
||||||
|
@ -924,40 +910,8 @@ static void fxTexBuildImageMap(const struct gl_texture_image *image,
|
||||||
case GL_LUMINANCE12_ALPHA4:
|
case GL_LUMINANCE12_ALPHA4:
|
||||||
case GL_LUMINANCE12_ALPHA12:
|
case GL_LUMINANCE12_ALPHA12:
|
||||||
case GL_LUMINANCE16_ALPHA16:
|
case GL_LUMINANCE16_ALPHA16:
|
||||||
(*istranslate)=GL_TRUE;
|
texelSize = 2;
|
||||||
|
intFormat = MESA_L8_A8;
|
||||||
if(!(*dest)) {
|
|
||||||
if(!((*dest)=src=(unsigned short *)MALLOC(sizeof(unsigned short)*w*h))) {
|
|
||||||
fprintf(stderr,"fx Driver: out of memory !\n");
|
|
||||||
fxCloseHardware();
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
src=(*dest);
|
|
||||||
|
|
||||||
if(wscale==hscale==1) {
|
|
||||||
int i=0;
|
|
||||||
int lenght=h*w;
|
|
||||||
unsigned short a,l;
|
|
||||||
|
|
||||||
while(i++<lenght) {
|
|
||||||
l=*data++;
|
|
||||||
a=*data++;
|
|
||||||
|
|
||||||
*src++=(a << 8) | l;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
unsigned short a,l;
|
|
||||||
|
|
||||||
for(y=0;y<h;y++)
|
|
||||||
for(x=0;x<w;x++) {
|
|
||||||
idx=(x/wscale+(y/hscale)*(w/wscale))*2;
|
|
||||||
l=data[idx];
|
|
||||||
a=data[idx+1];
|
|
||||||
|
|
||||||
src[x+y*w]=(a << 8) | l;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
case GL_RGB:
|
case GL_RGB:
|
||||||
|
@ -968,46 +922,8 @@ static void fxTexBuildImageMap(const struct gl_texture_image *image,
|
||||||
case GL_RGB10:
|
case GL_RGB10:
|
||||||
case GL_RGB12:
|
case GL_RGB12:
|
||||||
case GL_RGB16:
|
case GL_RGB16:
|
||||||
(*istranslate)=GL_TRUE;
|
texelSize = 2;
|
||||||
|
intFormat = MESA_R5_G6_B5;
|
||||||
if(!(*dest)) {
|
|
||||||
if(!((*dest)=src=(unsigned short *)MALLOC(sizeof(unsigned short)*w*h))) {
|
|
||||||
fprintf(stderr,"fx Driver: out of memory !\n");
|
|
||||||
fxCloseHardware();
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
src=(*dest);
|
|
||||||
|
|
||||||
if(wscale==hscale==1) {
|
|
||||||
int i=0;
|
|
||||||
int lenght=h*w;
|
|
||||||
unsigned int r,g,b;
|
|
||||||
|
|
||||||
while(i++<lenght) {
|
|
||||||
r=*data++;
|
|
||||||
g=*data++;
|
|
||||||
b=*data++;
|
|
||||||
|
|
||||||
*src++=((0xf8 & r) << (11-3)) |
|
|
||||||
((0xfc & g) << (5-3+1)) |
|
|
||||||
((0xf8 & b) >> 3);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
unsigned int r,g,b;
|
|
||||||
|
|
||||||
for(y=0;y<h;y++)
|
|
||||||
for(x=0;x<w;x++) {
|
|
||||||
idx=(x/wscale+(y/hscale)*(w/wscale))*3;
|
|
||||||
r=data[idx];
|
|
||||||
g=data[idx+1];
|
|
||||||
b=data[idx+2];
|
|
||||||
|
|
||||||
src[x+y*w]=((0xf8 & r) << (11-3)) |
|
|
||||||
((0xfc & g) << (5-3+1)) |
|
|
||||||
((0xf8 & b) >> 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
case GL_RGBA:
|
case GL_RGBA:
|
||||||
|
@ -1017,106 +933,38 @@ static void fxTexBuildImageMap(const struct gl_texture_image *image,
|
||||||
case GL_RGB10_A2:
|
case GL_RGB10_A2:
|
||||||
case GL_RGBA12:
|
case GL_RGBA12:
|
||||||
case GL_RGBA16:
|
case GL_RGBA16:
|
||||||
(*istranslate)=GL_TRUE;
|
texelSize = 2;
|
||||||
|
intFormat = MESA_A4_R4_G4_B4;
|
||||||
if(!(*dest)) {
|
|
||||||
if(!((*dest)=src=(unsigned short *)MALLOC(sizeof(unsigned short)*w*h))) {
|
|
||||||
fprintf(stderr,"fx Driver: out of memory !\n");
|
|
||||||
fxCloseHardware();
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
src=(*dest);
|
|
||||||
|
|
||||||
if(wscale==hscale==1) {
|
|
||||||
int i=0;
|
|
||||||
int lenght=h*w;
|
|
||||||
unsigned int r,g,b,a;
|
|
||||||
|
|
||||||
while(i++<lenght) {
|
|
||||||
r=*data++;
|
|
||||||
g=*data++;
|
|
||||||
b=*data++;
|
|
||||||
a=*data++;
|
|
||||||
|
|
||||||
*src++=((0xf0 & a) << 8) |
|
|
||||||
((0xf0 & r) << 4) |
|
|
||||||
(0xf0 & g) |
|
|
||||||
((0xf0 & b) >> 4);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
unsigned int r,g,b,a;
|
|
||||||
|
|
||||||
for(y=0;y<h;y++)
|
|
||||||
for(x=0;x<w;x++) {
|
|
||||||
idx=(x/wscale+(y/hscale)*(w/wscale))*4;
|
|
||||||
r=data[idx];
|
|
||||||
g=data[idx+1];
|
|
||||||
b=data[idx+2];
|
|
||||||
a=data[idx+3];
|
|
||||||
|
|
||||||
src[x+y*w]=((0xf0 & a) << 8) |
|
|
||||||
((0xf0 & r) << 4) |
|
|
||||||
(0xf0 & g) |
|
|
||||||
((0xf0 & b) >> 4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case GL_RGB5_A1:
|
case GL_RGB5_A1:
|
||||||
(*istranslate)=GL_TRUE;
|
texelSize = 2;
|
||||||
|
intFormat = MESA_A1_R5_G5_B5;
|
||||||
if(!(*dest)) {
|
|
||||||
if(!((*dest)=src=(unsigned short *)malloc(sizeof(unsigned short)*w*h))) {
|
|
||||||
fprintf(stderr,"fx Driver: out of memory !\n");
|
|
||||||
fxCloseHardware();
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
src=(*dest);
|
|
||||||
|
|
||||||
if(wscale==hscale==1) {
|
|
||||||
int i=0;
|
|
||||||
int lenght=h*w;
|
|
||||||
unsigned r,g,b,a;
|
|
||||||
|
|
||||||
while(i++<lenght) {
|
|
||||||
r=*data++;
|
|
||||||
g=*data++;
|
|
||||||
b=*data++;
|
|
||||||
a=*data++;
|
|
||||||
*src++=((0x80 & a) << 8) |
|
|
||||||
((0xf8 & r) << 7) |
|
|
||||||
((0xf8 & g) << 2) |
|
|
||||||
((0xf8 & b) >> 3);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
unsigned r,g,b,a;
|
|
||||||
|
|
||||||
for(y=0;y<h;y++)
|
|
||||||
for(x=0;x<w;x++) {
|
|
||||||
idx=(x/wscale+(y/hscale)*(w/wscale))*4;
|
|
||||||
r=data[idx];
|
|
||||||
g=data[idx+1];
|
|
||||||
b=data[idx+2];
|
|
||||||
a=data[idx+3];
|
|
||||||
|
|
||||||
src[x+y*w]=((0x80 & a) << 8) |
|
|
||||||
((0xf8 & r) << 7) |
|
|
||||||
((0xf8 & g) << 2) |
|
|
||||||
((0xf8 & b) >> 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr,"fx Driver: wrong internalFormat in texbuildimagemap()\n");
|
fprintf(stderr,"tdfx driver: texbuildimagemap() bad format\n");
|
||||||
fxCloseHardware();
|
return;
|
||||||
exit(-1);
|
}
|
||||||
break;
|
|
||||||
|
/* alloc teximage memory */
|
||||||
|
if (!(*dest)) {
|
||||||
|
*dest = (GLushort *) MALLOC(w * h * texelSize);
|
||||||
|
if (!(*dest)) {
|
||||||
|
return; /* out of memory */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* convert image to internal format */
|
||||||
|
_mesa_convert_teximage(intFormat, w, h, *dest,
|
||||||
|
image->Width, image->Height,
|
||||||
|
image->Format, GL_UNSIGNED_BYTE,
|
||||||
|
image->Data, &_mesa_native_packing);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void fxDDTexImg(GLcontext *ctx, GLenum target,
|
void fxDDTexImg(GLcontext *ctx, GLenum target,
|
||||||
struct gl_texture_object *tObj, GLint level, GLint internalFormat,
|
struct gl_texture_object *tObj, GLint level,
|
||||||
|
GLint internalFormat,
|
||||||
const struct gl_texture_image *image)
|
const struct gl_texture_image *image)
|
||||||
{
|
{
|
||||||
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
|
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
|
||||||
|
@ -1143,45 +991,41 @@ void fxDDTexImg(GLcontext *ctx, GLenum target,
|
||||||
|
|
||||||
fxTexGetFormat(internalFormat, &gldformat, NULL);
|
fxTexGetFormat(internalFormat, &gldformat, NULL);
|
||||||
|
|
||||||
if(mml->used) {
|
|
||||||
if ((mml->glideFormat == gldformat) &&
|
if ((mml->glideFormat == gldformat) &&
|
||||||
(mml->width == image->Width) &&
|
(mml->width == image->Width) &&
|
||||||
(mml->height == image->Height)) {
|
(mml->height == image->Height)) {
|
||||||
fxTexBuildImageMap(image,internalFormat,&(mml->data),
|
/* overwrite existing texture image of same size and format */
|
||||||
&(mml->translated));
|
fxTexBuildImageMap(image, internalFormat, &(mml->data));
|
||||||
|
|
||||||
if(ti->validated && ti->isInTM)
|
if(ti->validated && ti->isInTM)
|
||||||
fxTMReloadMipMapLevel(fxMesa, tObj, level);
|
fxTMReloadMipMapLevel(fxMesa, tObj, level);
|
||||||
else
|
else
|
||||||
fxTexInvalidate(ctx,tObj);
|
fxTexInvalidate(ctx,tObj);
|
||||||
|
}
|
||||||
return;
|
else {
|
||||||
} else {
|
/* deallocate existing texture image, if any */
|
||||||
if(mml->translated)
|
if (mml->data) {
|
||||||
FREE(mml->data);
|
FREE(mml->data);
|
||||||
mml->data = NULL;
|
mml->data = NULL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
mml->glideFormat = gldformat;
|
mml->glideFormat = gldformat;
|
||||||
mml->width = image->Width;
|
mml->width = image->Width;
|
||||||
mml->height = image->Height;
|
mml->height = image->Height;
|
||||||
mml->used=GL_TRUE;
|
|
||||||
|
|
||||||
fxTexBuildImageMap(image,internalFormat,&(mml->data),
|
|
||||||
&(mml->translated));
|
|
||||||
|
|
||||||
|
/* make new texture image */
|
||||||
|
fxTexBuildImageMap(image, internalFormat, &(mml->data));
|
||||||
fxTexInvalidate(ctx, tObj);
|
fxTexInvalidate(ctx, tObj);
|
||||||
}
|
}
|
||||||
#ifndef FX_SILENT
|
}
|
||||||
else
|
else {
|
||||||
fprintf(stderr,"fx Driver: unsupported texture in fxDDTexImg()\n");
|
gl_problem(NULL, "fx Driver: unsupported texture in fxDDTexImg()\n");
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fxTexBuildSubImageMap(const struct gl_texture_image *image,
|
static void fxTexBuildSubImageMap(const struct gl_texture_image *image,
|
||||||
GLint internalFormat,
|
GLint internalFormat,
|
||||||
GLint xoffset, GLint yoffset, GLint width, GLint height,
|
GLint xoffset, GLint yoffset,
|
||||||
|
GLint width, GLint height,
|
||||||
unsigned short *destimg)
|
unsigned short *destimg)
|
||||||
{
|
{
|
||||||
fxTexGetInfo(image->Width,image->Height,NULL,NULL,NULL,NULL,NULL,NULL,
|
fxTexGetInfo(image->Width,image->Height,NULL,NULL,NULL,NULL,NULL,NULL,
|
||||||
|
@ -1212,9 +1056,9 @@ static void fxTexBuildSubImageMap(const struct gl_texture_image *image,
|
||||||
case GL_COLOR_INDEX12_EXT:
|
case GL_COLOR_INDEX12_EXT:
|
||||||
case GL_COLOR_INDEX16_EXT:
|
case GL_COLOR_INDEX16_EXT:
|
||||||
{
|
{
|
||||||
|
|
||||||
int y;
|
int y;
|
||||||
unsigned char *bsrc,*bdst;
|
unsigned char *bdst;
|
||||||
|
const unsigned char *bsrc;
|
||||||
|
|
||||||
bsrc=(unsigned char *)(image->Data+(yoffset*image->Width+xoffset));
|
bsrc=(unsigned char *)(image->Data+(yoffset*image->Width+xoffset));
|
||||||
bdst=((unsigned char *)destimg)+(yoffset*image->Width+xoffset);
|
bdst=((unsigned char *)destimg)+(yoffset*image->Width+xoffset);
|
||||||
|
@ -1359,9 +1203,7 @@ static void fxTexBuildSubImageMap(const struct gl_texture_image *image,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr,"fx Driver: wrong internalFormat in fxTexBuildSubImageMap()\n");
|
fprintf(stderr,"tdfx driver: fxTexBuildSubImageMap() bad format\n");
|
||||||
fxCloseHardware();
|
|
||||||
exit(-1);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1398,10 +1240,9 @@ void fxDDTexSubImg(GLcontext *ctx, GLenum target,
|
||||||
|
|
||||||
if (mml->glideFormat != gldformat) {
|
if (mml->glideFormat != gldformat) {
|
||||||
if (MESA_VERBOSE&VERBOSE_DRIVER) {
|
if (MESA_VERBOSE&VERBOSE_DRIVER) {
|
||||||
fprintf(stderr,"fxmesa: ti->info.format!=format in fxDDTexSubImg()\n");
|
gl_problem(NULL, "glide texture format mismatch in fxDDTexSubImg");
|
||||||
}
|
}
|
||||||
fxDDTexImg(ctx,target,tObj,level,internalFormat,image);
|
fxDDTexImg(ctx,target,tObj,level,internalFormat,image);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1416,7 +1257,7 @@ void fxDDTexSubImg(GLcontext *ctx, GLenum target,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mml->translated)
|
assert(mml->data); /* must have an existing texture image! */
|
||||||
fxTexBuildSubImageMap(image,internalFormat,xoffset,yoffset,
|
fxTexBuildSubImageMap(image,internalFormat,xoffset,yoffset,
|
||||||
width,height,mml->data);
|
width,height,mml->data);
|
||||||
|
|
||||||
|
|
|
@ -275,8 +275,6 @@ typedef struct {
|
||||||
GLsizei width, height; /* image size */
|
GLsizei width, height; /* image size */
|
||||||
GrTextureFormat_t glideFormat; /* Glide image format */
|
GrTextureFormat_t glideFormat; /* Glide image format */
|
||||||
unsigned short *data; /* Glide-formated texture image */
|
unsigned short *data; /* Glide-formated texture image */
|
||||||
GLboolean translated; /* True if data points to a reformated image */
|
|
||||||
GLboolean used; /* True if we've given the image to Glide */
|
|
||||||
} tfxMipMapLevel;
|
} tfxMipMapLevel;
|
||||||
|
|
||||||
typedef struct tfxTexInfo_t {
|
typedef struct tfxTexInfo_t {
|
||||||
|
|
|
@ -652,11 +652,10 @@ void fxTMFreeTexture(fxMesaContext fxMesa, struct gl_texture_object *tObj)
|
||||||
fxTMMoveOutTM(fxMesa, tObj);
|
fxTMMoveOutTM(fxMesa, tObj);
|
||||||
|
|
||||||
for (i=0; i<MAX_TEXTURE_LEVELS; i++) {
|
for (i=0; i<MAX_TEXTURE_LEVELS; i++) {
|
||||||
if (ti->mipmapLevel[i].used &&
|
if (ti->mipmapLevel[i].data) {
|
||||||
ti->mipmapLevel[i].translated)
|
|
||||||
FREE(ti->mipmapLevel[i].data);
|
FREE(ti->mipmapLevel[i].data);
|
||||||
|
ti->mipmapLevel[i].data = NULL;
|
||||||
(void)ti->mipmapLevel[i].data;
|
}
|
||||||
}
|
}
|
||||||
switch (ti->whichTMU) {
|
switch (ti->whichTMU) {
|
||||||
case FX_TMU0:
|
case FX_TMU0:
|
||||||
|
|
Loading…
Reference in New Issue