300
/* try to find a format which will only need a memcopy */
301
static const struct gl_texture_format *r300Choose8888TexFormat( GLenum srcFormat,
305
const GLubyte littleEndian = *((const GLubyte *) &ui);
307
if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8) ||
308
(srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) ||
309
(srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
310
(srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && littleEndian)) {
311
return &_mesa_texformat_rgba8888;
313
else if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
314
(srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) ||
315
(srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8) ||
316
(srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && !littleEndian)) {
317
return &_mesa_texformat_rgba8888_rev;
319
else if (srcFormat == GL_BGRA &&
320
((srcType == GL_UNSIGNED_BYTE && !littleEndian) ||
321
srcType == GL_UNSIGNED_INT_8_8_8_8)) {
322
return &_mesa_texformat_argb8888_rev;
324
else if (srcFormat == GL_BGRA &&
325
((srcType == GL_UNSIGNED_BYTE && littleEndian) ||
326
srcType == GL_UNSIGNED_INT_8_8_8_8_REV)) {
327
return &_mesa_texformat_argb8888;
329
else return _dri_texformat_argb8888;
300
332
static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx,
335
367
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
336
368
return _dri_texformat_argb1555;
338
return do32bpt ? _dri_texformat_rgba8888 :
370
return do32bpt ? r300Choose8888TexFormat(format, type) :
339
371
_dri_texformat_argb4444;