Not used by any hardware driver. ARGB4444 and ARGB4444_REV remain.
0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */
1, 1, 2 /* BlockWidth/Height,Bytes */
},
- {
- MESA_FORMAT_RGBA4444, /* Name */
- GL_RGBA, /* BaseFormat */
- GL_UNSIGNED_NORMALIZED, /* DataType */
- 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */
- 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */
- 1, 1, 2 /* BlockWidth/Height,Bytes */
- },
{
MESA_FORMAT_ARGB4444, /* Name */
GL_RGBA, /* BaseFormat */
MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */
MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */
MESA_FORMAT_RGB565_REV, /* GGGB BBBB RRRR RGGG */
- MESA_FORMAT_RGBA4444, /* RRRR GGGG BBBB AAAA */
MESA_FORMAT_ARGB4444, /* AAAA RRRR GGGG BBBB */
MESA_FORMAT_ARGB4444_REV, /* GGGG BBBB AAAA RRRR */
MESA_FORMAT_RGBA5551, /* RRRR RGGG GGBB BBBA */
fetch_texel_3d_f_rgb565_rev,
store_texel_rgb565_rev
},
- {
- MESA_FORMAT_RGBA4444,
- fetch_texel_1d_f_rgba4444,
- fetch_texel_2d_f_rgba4444,
- fetch_texel_3d_f_rgba4444,
- store_texel_rgba4444
- },
{
MESA_FORMAT_ARGB4444,
fetch_texel_1d_f_argb4444,
}
#endif
-/* MESA_FORMAT_RGBA4444 ******************************************************/
-
-/* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */
-static void FETCH(f_rgba4444)( const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- const GLushort s = *src;
- texel[RCOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F);
- texel[GCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F);
- texel[BCOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F);
- texel[ACOMP] = ((s ) & 0xf) * (1.0F / 15.0F);
-}
-
-#if DIM == 3
-static void store_texel_rgba4444(struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, const void *texel)
-{
- const GLubyte *rgba = (const GLubyte *) texel;
- GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = PACK_COLOR_4444(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]);
-}
-#endif
-
/* MESA_FORMAT_ARGB4444 ******************************************************/
return GL_TRUE;
}
-static GLboolean
-_mesa_texstore_rgba4444(TEXSTORE_PARAMS)
-{
- const GLuint texelBytes = _mesa_get_format_bytes(dstFormat);
- const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
-
- ASSERT(dstFormat == MESA_FORMAT_RGBA4444);
- ASSERT(texelBytes == 2);
-
- if (!ctx->_ImageTransferState &&
- !srcPacking->SwapBytes &&
- dstFormat == MESA_FORMAT_RGBA4444 &&
- baseInternalFormat == GL_RGBA &&
- srcFormat == GL_RGBA &&
- srcType == GL_UNSIGNED_SHORT_4_4_4_4){
- /* simple memcpy path */
- memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
- srcWidth, srcHeight, srcDepth, srcFormat, srcType,
- srcAddr, srcPacking);
- }
- else {
- /* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
- baseInternalFormat,
- baseFormat,
- srcWidth, srcHeight, srcDepth,
- srcFormat, srcType, srcAddr,
- srcPacking);
- const GLchan *src = tempImage;
- GLint img, row, col;
- if (!tempImage)
- return GL_FALSE;
- _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight);
- for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
- + dstYoffset * dstRowStride
- + dstXoffset * texelBytes;
- for (row = 0; row < srcHeight; row++) {
- GLushort *dstUS = (GLushort *) dstRow;
- for (col = 0; col < srcWidth; col++) {
- dstUS[col] = PACK_COLOR_4444( CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]),
- CHAN_TO_UBYTE(src[ACOMP]) );
- src += 4;
- }
- dstRow += dstRowStride;
- }
- }
- _mesa_free((void *) tempImage);
- }
- return GL_TRUE;
-}
static GLboolean
_mesa_texstore_argb4444(TEXSTORE_PARAMS)
{ MESA_FORMAT_BGR888, _mesa_texstore_bgr888 },
{ MESA_FORMAT_RGB565, _mesa_texstore_rgb565 },
{ MESA_FORMAT_RGB565_REV, _mesa_texstore_rgb565 },
- { MESA_FORMAT_RGBA4444, _mesa_texstore_rgba4444 },
{ MESA_FORMAT_ARGB4444, _mesa_texstore_argb4444 },
{ MESA_FORMAT_ARGB4444_REV, _mesa_texstore_argb4444 },
{ MESA_FORMAT_RGBA5551, _mesa_texstore_rgba5551 },