}
/* Unsupported texture/multitexture cases */
- if(fxMesa->emulateTwoTMUs) {
- if((ctx->_Enabled & (TEXTURE0_3D | TEXTURE1_3D)) ||
- /* Not very well written ... */
- ((ctx->_Enabled & (TEXTURE0_1D | TEXTURE1_1D)) &&
- ((ctx->_Enabled & (TEXTURE0_2D | TEXTURE1_2D))!=(TEXTURE0_2D | TEXTURE1_2D)))
- ) {
- return GL_FALSE;
- }
+ if (fxMesa->emulateTwoTMUs) {
+ if (ctx->Texture._ReallyEnabled & (TEXTURE0_3D | TEXTURE1_3D))
+ return GL_FALSE; /* can't do 3D textures */
+ if (ctx->Texture._ReallyEnabled & (TEXTURE0_1D | TEXTURE1_1D))
+ return GL_FALSE; /* can't do 1D textures */
if (ctx->Texture._ReallyEnabled & TEXTURE0_2D) {
if (ctx->Texture.Unit[0].EnvMode == GL_BLEND &&
break;
default:
fprintf(stderr,
- "fx Driver: unsupported internalFormat in fxTexGetFormat()\n");
+ "fx Driver: unsupported internalFormat (0x%x) in fxTexGetFormat()\n",
+ glformat);
fxCloseHardware();
exit(-1);
break;
rgba[GCOMP] = *texel;
rgba[BCOMP] = *texel;
rgba[ACOMP] = 255;
-
}
rgba[ACOMP] = texel[1];
}
+
static void
fetch_r5g6b5(GLcontext *ctx,
const struct gl_texture_object *texObj,
{
fxMesaContext fxMesa = (fxMesaContext)ctx->DriverCtx;
GrTextureFormat_t gldformat;
- tfxTexInfo *ti = fxTMGetTexInfo(texObj);
+ tfxTexInfo *ti;
tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
MesaIntTexFormat mesaFormat;
GLint texelSize;
if (!texObj->DriverData)
texObj->DriverData = fxAllocTexObjData(fxMesa);
+ ti = fxTMGetTexInfo(texObj);
if (!mml) {
texImage->DriverData = MALLOC(sizeof(tfxMipMapLevel));
fxTexGetInfo(width, height, NULL, NULL, NULL, NULL,
NULL, NULL, &mml->wScale, &mml->hScale);
- mml->width = texImage->Width * mml->wScale;
- mml->height = texImage->Height * mml->hScale;
+ mml->width = width * mml->wScale;
+ mml->height = height * mml->hScale;
switch (internalFormat) {
case GL_INTENSITY:
case GL_INTENSITY8:
case GL_INTENSITY12:
case GL_INTENSITY16:
+ texImage->Format = GL_INTENSITY;
texImage->FetchTexel = fetch_intensity8;
texelSize = 1;
mesaFormat = MESA_I8;
case GL_LUMINANCE8:
case GL_LUMINANCE12:
case GL_LUMINANCE16:
+ texImage->Format = GL_LUMINANCE;
texImage->FetchTexel = fetch_luminance8;
texelSize = 1;
mesaFormat = MESA_L8;
case GL_ALPHA8:
case GL_ALPHA12:
case GL_ALPHA16:
+ texImage->Format = GL_ALPHA;
texImage->FetchTexel = fetch_alpha8;
texelSize = 1;
mesaFormat = MESA_A8;
case GL_COLOR_INDEX8_EXT:
case GL_COLOR_INDEX12_EXT:
case GL_COLOR_INDEX16_EXT:
+ texImage->Format = GL_COLOR_INDEX;
texImage->FetchTexel = fetch_index8;
texelSize = 1;
mesaFormat = MESA_C8;
case GL_LUMINANCE12_ALPHA4:
case GL_LUMINANCE12_ALPHA12:
case GL_LUMINANCE16_ALPHA16:
+ texImage->Format = GL_LUMINANCE_ALPHA;
texImage->FetchTexel = fetch_luminance8_alpha8;
texelSize = 2;
mesaFormat = MESA_A8_L8;
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
+ texImage->Format = GL_RGB;
texImage->FetchTexel = fetch_r5g6b5;
texelSize = 2;
mesaFormat = MESA_R5_G6_B5;
case GL_RGB10_A2:
case GL_RGBA12:
case GL_RGBA16:
+ texImage->Format = GL_RGBA;
texImage->FetchTexel = fetch_r4g4b4a4;
texelSize = 2;
mesaFormat = MESA_A4_R4_G4_B4;
break;
case GL_RGB5_A1:
+ texImage->Format = GL_RGBA;
texImage->FetchTexel = fetch_r5g5b5a1;
texelSize = 2;
mesaFormat = MESA_A1_R5_G5_B5;
}
_mesa_set_teximage_component_sizes(mesaFormat, texImage);
+ texImage->Type = 0; /* indicates a driver-specific format */
- /* allocate new storage for texture image, if needed */
+ /* allocate storage for texture image */
texImage->Data = MALLOC(mml->width * mml->height * texelSize);
if (!texImage->Data)
return;