#include "glheader.h"
#include "mtypes.h"
#include "imports.h"
+#include "macros.h"
#include "simple_list.h"
#include "enums.h"
#include "image.h"
{
intelContextPtr intel = INTEL_CONTEXT( ctx );
const GLboolean do32bpt = ( intel->intelScreen->cpp == 4 &&
- intel->intelScreen->textureSize > 4*1024*1024);
+ intel->intelScreen->tex.size > 4*1024*1024);
switch ( internalFormat ) {
case 4:
case GL_ALPHA12:
case GL_ALPHA16:
case GL_COMPRESSED_ALPHA:
-/* if (1 || intel->intelScreen->deviceID == PCI_CHIP_I915_G) */
- return &_mesa_texformat_a8;
-/* else */
-/* return &_mesa_texformat_al88; */
+ return &_mesa_texformat_a8;
case 1:
case GL_LUMINANCE:
case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
return &_mesa_texformat_rgba_dxt5;
+ case GL_DEPTH_COMPONENT:
+ case GL_DEPTH_COMPONENT16:
+ case GL_DEPTH_COMPONENT24:
+ case GL_DEPTH_COMPONENT32:
+ return &_mesa_texformat_depth_component16;
+
default:
- fprintf(stderr, "unexpected texture format in %s\n", __FUNCTION__);
+ fprintf(stderr, "unexpected texture format %s in %s\n",
+ _mesa_lookup_enum_by_nr(internalFormat),
+ __FUNCTION__);
return NULL;
}
image->Width, image->Height, image->Depth, offset,
row_len, t->Pitch, t->depth_pitch);
- switch(image->IntFormat)
- {
+ switch (image->InternalFormat) {
case GL_COMPRESSED_RGB_FXT1_3DFX:
case GL_COMPRESSED_RGBA_FXT1_3DFX:
case GL_RGB_S3TC:
}
break;
default:
- fprintf(stderr,"Internal Compressed format not supported %d\n", image->IntFormat);
+ fprintf(stderr,"Internal Compressed format not supported %d\n", image->InternalFormat);
break;
- }
+ }
}
else {
GLuint row_len = image->Width * image->TexFormat->TexelBytes;
/* Set the base offset of the texture image */
t->BufAddr = intel->intelScreen->tex.map + t->base.memBlock->ofs;
- t->TextureOffset = intel->intelScreen->textureOffset + t->base.memBlock->ofs;
+ t->TextureOffset = intel->intelScreen->tex.offset + t->base.memBlock->ofs;
t->dirty = ~0;
}