ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

texcompress_s3tc.c
Go to the documentation of this file.
00001 /*
00002  * Mesa 3-D graphics library
00003  * Version:  6.5.3
00004  *
00005  * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
00006  *
00007  * Permission is hereby granted, free of charge, to any person obtaining a
00008  * copy of this software and associated documentation files (the "Software"),
00009  * to deal in the Software without restriction, including without limitation
00010  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00011  * and/or sell copies of the Software, and to permit persons to whom the
00012  * Software is furnished to do so, subject to the following conditions:
00013  *
00014  * The above copyright notice and this permission notice shall be included
00015  * in all copies or substantial portions of the Software.
00016  *
00017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00018  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00020  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00021  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00022  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00023  */
00024 
00025 
00031 #ifndef USE_EXTERNAL_DXTN_LIB
00032 #define USE_EXTERNAL_DXTN_LIB 1
00033 #endif
00034 
00035 #include "glheader.h"
00036 #include "imports.h"
00037 #include "colormac.h"
00038 #include "context.h"
00039 #include "convolve.h"
00040 #include "dlopen.h"
00041 #include "image.h"
00042 #include "texcompress.h"
00043 #include "texformat.h"
00044 #include "texstore.h"
00045 
00046 #ifdef __MINGW32__
00047 #define DXTN_LIBNAME "dxtn.dll"
00048 #define RTLD_LAZY 0
00049 #define RTLD_GLOBAL 0
00050 #elif defined(__DJGPP__)
00051 #define DXTN_LIBNAME "dxtn.dxe"
00052 #else
00053 #define DXTN_LIBNAME "libtxc_dxtn.so"
00054 #endif
00055 
00056 
00057 typedef void (*dxtFetchTexelFuncExt)( GLint srcRowstride, GLubyte *pixdata, GLint col, GLint row, GLvoid *texelOut );
00058 
00059 dxtFetchTexelFuncExt fetch_ext_rgb_dxt1 = NULL;
00060 dxtFetchTexelFuncExt fetch_ext_rgba_dxt1 = NULL;
00061 dxtFetchTexelFuncExt fetch_ext_rgba_dxt3 = NULL;
00062 dxtFetchTexelFuncExt fetch_ext_rgba_dxt5 = NULL;
00063 
00064 typedef void (*dxtCompressTexFuncExt)(GLint srccomps, GLint width,
00065                                       GLint height, const GLchan *srcPixData,
00066                                       GLenum destformat, GLubyte *dest,
00067                                       GLint dstRowStride);
00068 
00069 static dxtCompressTexFuncExt ext_tx_compress_dxtn = NULL;
00070 
00071 static void *dxtlibhandle = NULL;
00072 
00073 
00074 void
00075 _mesa_init_texture_s3tc( GLcontext *ctx )
00076 {
00077    /* called during context initialization */
00078    ctx->Mesa_DXTn = GL_FALSE;
00079 #if USE_EXTERNAL_DXTN_LIB
00080    if (!dxtlibhandle) {
00081       dxtlibhandle = _mesa_dlopen(DXTN_LIBNAME, 0);
00082       if (!dxtlibhandle) {
00083      _mesa_warning(ctx, "couldn't open " DXTN_LIBNAME ", software DXTn "
00084         "compression/decompression unavailable");
00085       }
00086       else {
00087          /* the fetch functions are not per context! Might be problematic... */
00088          fetch_ext_rgb_dxt1 = (dxtFetchTexelFuncExt)
00089             _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgb_dxt1");
00090          fetch_ext_rgba_dxt1 = (dxtFetchTexelFuncExt)
00091             _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgba_dxt1");
00092          fetch_ext_rgba_dxt3 = (dxtFetchTexelFuncExt)
00093             _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgba_dxt3");
00094          fetch_ext_rgba_dxt5 = (dxtFetchTexelFuncExt)
00095             _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgba_dxt5");
00096          ext_tx_compress_dxtn = (dxtCompressTexFuncExt)
00097             _mesa_dlsym(dxtlibhandle, "tx_compress_dxtn");
00098 
00099          if (!fetch_ext_rgb_dxt1 ||
00100              !fetch_ext_rgba_dxt1 ||
00101              !fetch_ext_rgba_dxt3 ||
00102              !fetch_ext_rgba_dxt5 ||
00103              !ext_tx_compress_dxtn) {
00104         _mesa_warning(ctx, "couldn't reference all symbols in "
00105            DXTN_LIBNAME ", software DXTn compression/decompression "
00106            "unavailable");
00107             fetch_ext_rgb_dxt1 = NULL;
00108             fetch_ext_rgba_dxt1 = NULL;
00109             fetch_ext_rgba_dxt3 = NULL;
00110             fetch_ext_rgba_dxt5 = NULL;
00111             ext_tx_compress_dxtn = NULL;
00112             _mesa_dlclose(dxtlibhandle);
00113             dxtlibhandle = NULL;
00114          }
00115       }
00116    }
00117    if (dxtlibhandle) {
00118       ctx->Mesa_DXTn = GL_TRUE;
00119       _mesa_warning(ctx, "software DXTn compression/decompression available");
00120    }
00121 #else
00122    (void) ctx;
00123 #endif
00124 }
00125 
00129 static GLboolean
00130 texstore_rgb_dxt1(TEXSTORE_PARAMS)
00131 {
00132    const GLchan *pixels;
00133    GLint srcRowStride;
00134    GLubyte *dst;
00135    const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */
00136    const GLchan *tempImage = NULL;
00137 
00138    ASSERT(dstFormat == &_mesa_texformat_rgb_dxt1);
00139    ASSERT(dstXoffset % 4 == 0);
00140    ASSERT(dstYoffset % 4 == 0);
00141    ASSERT(dstZoffset % 4 == 0);
00142    (void) dstZoffset;
00143    (void) dstImageOffsets;
00144 
00145    if (srcFormat != GL_RGB ||
00146        srcType != CHAN_TYPE ||
00147        ctx->_ImageTransferState ||
00148        srcPacking->SwapBytes) {
00149       /* convert image to RGB/GLchan */
00150       tempImage = _mesa_make_temp_chan_image(ctx, dims,
00151                                              baseInternalFormat,
00152                                              dstFormat->BaseFormat,
00153                                              srcWidth, srcHeight, srcDepth,
00154                                              srcFormat, srcType, srcAddr,
00155                                              srcPacking);
00156       if (!tempImage)
00157          return GL_FALSE; /* out of memory */
00158       _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight);
00159       pixels = tempImage;
00160       srcRowStride = 3 * srcWidth;
00161       srcFormat = GL_RGB;
00162    }
00163    else {
00164       pixels = (const GLchan *) srcAddr;
00165       srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat,
00166                                             srcType) / sizeof(GLchan);
00167    }
00168 
00169    dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
00170                                         dstFormat->MesaFormat,
00171                                         texWidth, (GLubyte *) dstAddr);
00172 
00173    if (ext_tx_compress_dxtn) {
00174       (*ext_tx_compress_dxtn)(3, srcWidth, srcHeight, pixels,
00175                               GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
00176                               dst, dstRowStride);
00177    }
00178    else {
00179       _mesa_warning(ctx, "external dxt library not available");
00180    }
00181 
00182    if (tempImage)
00183       _mesa_free((void *) tempImage);
00184 
00185    return GL_TRUE;
00186 }
00187 
00188 
00192 static GLboolean
00193 texstore_rgba_dxt1(TEXSTORE_PARAMS)
00194 {
00195    const GLchan *pixels;
00196    GLint srcRowStride;
00197    GLubyte *dst;
00198    const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */
00199    const GLchan *tempImage = NULL;
00200 
00201    ASSERT(dstFormat == &_mesa_texformat_rgba_dxt1);
00202    ASSERT(dstXoffset % 4 == 0);
00203    ASSERT(dstYoffset % 4 == 0);
00204    ASSERT(dstZoffset % 4 == 0);
00205    (void) dstZoffset;
00206    (void) dstImageOffsets;
00207 
00208    if (srcFormat != GL_RGBA ||
00209        srcType != CHAN_TYPE ||
00210        ctx->_ImageTransferState ||
00211        srcPacking->SwapBytes) {
00212       /* convert image to RGBA/GLchan */
00213       tempImage = _mesa_make_temp_chan_image(ctx, dims,
00214                                              baseInternalFormat,
00215                                              dstFormat->BaseFormat,
00216                                              srcWidth, srcHeight, srcDepth,
00217                                              srcFormat, srcType, srcAddr,
00218                                              srcPacking);
00219       if (!tempImage)
00220          return GL_FALSE; /* out of memory */
00221       _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight);
00222       pixels = tempImage;
00223       srcRowStride = 4 * srcWidth;
00224       srcFormat = GL_RGBA;
00225    }
00226    else {
00227       pixels = (const GLchan *) srcAddr;
00228       srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat,
00229                                             srcType) / sizeof(GLchan);
00230    }
00231 
00232    dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
00233                                         dstFormat->MesaFormat,
00234                                         texWidth, (GLubyte *) dstAddr);
00235    if (ext_tx_compress_dxtn) {
00236       (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels,
00237                               GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
00238                               dst, dstRowStride);
00239    }
00240    else {
00241       _mesa_warning(ctx, "external dxt library not available");
00242    }
00243 
00244    if (tempImage)
00245       _mesa_free((void*) tempImage);
00246 
00247    return GL_TRUE;
00248 }
00249 
00250 
00254 static GLboolean
00255 texstore_rgba_dxt3(TEXSTORE_PARAMS)
00256 {
00257    const GLchan *pixels;
00258    GLint srcRowStride;
00259    GLubyte *dst;
00260    const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */
00261    const GLchan *tempImage = NULL;
00262 
00263    ASSERT(dstFormat == &_mesa_texformat_rgba_dxt3);
00264    ASSERT(dstXoffset % 4 == 0);
00265    ASSERT(dstYoffset % 4 == 0);
00266    ASSERT(dstZoffset % 4 == 0);
00267    (void) dstZoffset;
00268    (void) dstImageOffsets;
00269 
00270    if (srcFormat != GL_RGBA ||
00271        srcType != CHAN_TYPE ||
00272        ctx->_ImageTransferState ||
00273        srcPacking->SwapBytes) {
00274       /* convert image to RGBA/GLchan */
00275       tempImage = _mesa_make_temp_chan_image(ctx, dims,
00276                                              baseInternalFormat,
00277                                              dstFormat->BaseFormat,
00278                                              srcWidth, srcHeight, srcDepth,
00279                                              srcFormat, srcType, srcAddr,
00280                                              srcPacking);
00281       if (!tempImage)
00282          return GL_FALSE; /* out of memory */
00283       _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight);
00284       pixels = tempImage;
00285       srcRowStride = 4 * srcWidth;
00286    }
00287    else {
00288       pixels = (const GLchan *) srcAddr;
00289       srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat,
00290                                             srcType) / sizeof(GLchan);
00291    }
00292 
00293    dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
00294                                         dstFormat->MesaFormat,
00295                                         texWidth, (GLubyte *) dstAddr);
00296    if (ext_tx_compress_dxtn) {
00297       (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels,
00298                               GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,
00299                               dst, dstRowStride);
00300    }
00301    else {
00302       _mesa_warning(ctx, "external dxt library not available");
00303    }
00304 
00305    if (tempImage)
00306       _mesa_free((void *) tempImage);
00307 
00308    return GL_TRUE;
00309 }
00310 
00311 
00315 static GLboolean
00316 texstore_rgba_dxt5(TEXSTORE_PARAMS)
00317 {
00318    const GLchan *pixels;
00319    GLint srcRowStride;
00320    GLubyte *dst;
00321    const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */
00322    const GLchan *tempImage = NULL;
00323 
00324    ASSERT(dstFormat == &_mesa_texformat_rgba_dxt5);
00325    ASSERT(dstXoffset % 4 == 0);
00326    ASSERT(dstYoffset % 4 == 0);
00327    ASSERT(dstZoffset % 4 == 0);
00328    (void) dstZoffset;
00329    (void) dstImageOffsets;
00330 
00331    if (srcFormat != GL_RGBA ||
00332        srcType != CHAN_TYPE ||
00333        ctx->_ImageTransferState ||
00334        srcPacking->SwapBytes) {
00335       /* convert image to RGBA/GLchan */
00336       tempImage = _mesa_make_temp_chan_image(ctx, dims,
00337                                              baseInternalFormat,
00338                                              dstFormat->BaseFormat,
00339                                              srcWidth, srcHeight, srcDepth,
00340                                              srcFormat, srcType, srcAddr,
00341                                              srcPacking);
00342       if (!tempImage)
00343          return GL_FALSE; /* out of memory */
00344       _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight);
00345       pixels = tempImage;
00346       srcRowStride = 4 * srcWidth;
00347    }
00348    else {
00349       pixels = (const GLchan *) srcAddr;
00350       srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat,
00351                                             srcType) / sizeof(GLchan);
00352    }
00353 
00354    dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
00355                                         dstFormat->MesaFormat,
00356                                         texWidth, (GLubyte *) dstAddr);
00357    if (ext_tx_compress_dxtn) {
00358       (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels,
00359                               GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,
00360                               dst, dstRowStride);
00361    }
00362    else {
00363       _mesa_warning(ctx, "external dxt library not available");
00364    }
00365 
00366    if (tempImage)
00367       _mesa_free((void *) tempImage);
00368 
00369    return GL_TRUE;
00370 }
00371 
00372 
00373 static void
00374 fetch_texel_2d_rgb_dxt1( const struct gl_texture_image *texImage,
00375                          GLint i, GLint j, GLint k, GLchan *texel )
00376 {
00377    (void) k;
00378    if (fetch_ext_rgb_dxt1) {
00379       ASSERT (sizeof(GLchan) == sizeof(GLubyte));
00380       fetch_ext_rgb_dxt1(texImage->RowStride,
00381                          (GLubyte *)(texImage)->Data, i, j, texel);
00382    }
00383    else
00384       _mesa_debug(NULL, "attempted to decode s3tc texture without library available\n");
00385 }
00386 
00387 
00388 static void
00389 fetch_texel_2d_f_rgb_dxt1( const struct gl_texture_image *texImage,
00390                             GLint i, GLint j, GLint k, GLfloat *texel )
00391 {
00392    /* just sample as GLchan and convert to float here */
00393    GLchan rgba[4];
00394    fetch_texel_2d_rgb_dxt1(texImage, i, j, k, rgba);
00395    texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
00396    texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
00397    texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
00398    texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
00399 }
00400 
00401 
00402 static void
00403 fetch_texel_2d_rgba_dxt1( const struct gl_texture_image *texImage,
00404                           GLint i, GLint j, GLint k, GLchan *texel )
00405 {
00406    (void) k;
00407    if (fetch_ext_rgba_dxt1) {
00408       fetch_ext_rgba_dxt1(texImage->RowStride,
00409                           (GLubyte *)(texImage)->Data, i, j, texel);
00410    }
00411    else
00412       _mesa_debug(NULL, "attempted to decode s3tc texture without library available\n");
00413 }
00414 
00415 
00416 static void
00417 fetch_texel_2d_f_rgba_dxt1( const struct gl_texture_image *texImage,
00418                             GLint i, GLint j, GLint k, GLfloat *texel )
00419 {
00420    /* just sample as GLchan and convert to float here */
00421    GLchan rgba[4];
00422    fetch_texel_2d_rgba_dxt1(texImage, i, j, k, rgba);
00423    texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
00424    texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
00425    texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
00426    texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
00427 }
00428 
00429 
00430 static void
00431 fetch_texel_2d_rgba_dxt3( const struct gl_texture_image *texImage,
00432                           GLint i, GLint j, GLint k, GLchan *texel )
00433 {
00434    (void) k;
00435    if (fetch_ext_rgba_dxt3) {
00436       ASSERT (sizeof(GLchan) == sizeof(GLubyte));
00437       fetch_ext_rgba_dxt3(texImage->RowStride, (GLubyte *)(texImage)->Data,
00438                           i, j, texel);
00439    }
00440    else
00441       _mesa_debug(NULL, "attempted to decode s3tc texture without library available\n");
00442 }
00443 
00444 
00445 static void
00446 fetch_texel_2d_f_rgba_dxt3( const struct gl_texture_image *texImage,
00447                             GLint i, GLint j, GLint k, GLfloat *texel )
00448 {
00449    /* just sample as GLchan and convert to float here */
00450    GLchan rgba[4];
00451    fetch_texel_2d_rgba_dxt3(texImage, i, j, k, rgba);
00452    texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
00453    texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
00454    texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
00455    texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
00456 }
00457 
00458 
00459 static void
00460 fetch_texel_2d_rgba_dxt5( const struct gl_texture_image *texImage,
00461                           GLint i, GLint j, GLint k, GLchan *texel )
00462 {
00463    (void) k;
00464    if (fetch_ext_rgba_dxt5) {
00465       fetch_ext_rgba_dxt5(texImage->RowStride, (GLubyte *)(texImage)->Data,
00466                           i, j, texel);
00467    }
00468    else
00469       _mesa_debug(NULL, "attempted to decode s3tc texture without library available\n");
00470 }
00471 
00472 
00473 static void
00474 fetch_texel_2d_f_rgba_dxt5( const struct gl_texture_image *texImage,
00475                             GLint i, GLint j, GLint k, GLfloat *texel )
00476 {
00477    /* just sample as GLchan and convert to float here */
00478    GLchan rgba[4];
00479    fetch_texel_2d_rgba_dxt5(texImage, i, j, k, rgba);
00480    texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
00481    texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
00482    texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
00483    texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
00484 }
00485 
00486 
00487 const struct gl_texture_format _mesa_texformat_rgb_dxt1 = {
00488    MESA_FORMAT_RGB_DXT1,        /* MesaFormat */
00489    GL_RGB,              /* BaseFormat */
00490    GL_UNSIGNED_NORMALIZED_ARB,      /* DataType */
00491    4, /*approx*/            /* RedBits */
00492    4, /*approx*/            /* GreenBits */
00493    4, /*approx*/            /* BlueBits */
00494    0,                   /* AlphaBits */
00495    0,                   /* LuminanceBits */
00496    0,                   /* IntensityBits */
00497    0,                   /* IndexBits */
00498    0,                   /* DepthBits */
00499    0,                   /* StencilBits */
00500    0,                   /* TexelBytes */
00501    texstore_rgb_dxt1,           /* StoreTexImageFunc */
00502    NULL, /*impossible*/         /* FetchTexel1D */
00503    fetch_texel_2d_rgb_dxt1,         /* FetchTexel2D */
00504    NULL, /*impossible*/         /* FetchTexel3D */
00505    NULL, /*impossible*/         /* FetchTexel1Df */
00506    fetch_texel_2d_f_rgb_dxt1,       /* FetchTexel2Df */
00507    NULL, /*impossible*/         /* FetchTexel3Df */
00508    NULL                 /* StoreTexel */
00509 };
00510 
00511 #if FEATURE_EXT_texture_sRGB
00512 const struct gl_texture_format _mesa_texformat_srgb_dxt1 = {
00513    MESA_FORMAT_SRGB_DXT1,       /* MesaFormat */
00514    GL_RGB,              /* BaseFormat */
00515    GL_UNSIGNED_NORMALIZED_ARB,      /* DataType */
00516    4, /*approx*/            /* RedBits */
00517    4, /*approx*/            /* GreenBits */
00518    4, /*approx*/            /* BlueBits */
00519    0,                   /* AlphaBits */
00520    0,                   /* LuminanceBits */
00521    0,                   /* IntensityBits */
00522    0,                   /* IndexBits */
00523    0,                   /* DepthBits */
00524    0,                   /* StencilBits */
00525    0,                   /* TexelBytes */
00526    texstore_rgb_dxt1,           /* StoreTexImageFunc */
00527    NULL, /*impossible*/         /* FetchTexel1D */
00528    fetch_texel_2d_rgb_dxt1,         /* FetchTexel2D */
00529    NULL, /*impossible*/         /* FetchTexel3D */
00530    NULL, /*impossible*/         /* FetchTexel1Df */
00531    fetch_texel_2d_f_rgb_dxt1,       /* FetchTexel2Df */
00532    NULL, /*impossible*/         /* FetchTexel3Df */
00533    NULL                 /* StoreTexel */
00534 };
00535 #endif
00536 
00537 const struct gl_texture_format _mesa_texformat_rgba_dxt1 = {
00538    MESA_FORMAT_RGBA_DXT1,       /* MesaFormat */
00539    GL_RGBA,             /* BaseFormat */
00540    GL_UNSIGNED_NORMALIZED_ARB,      /* DataType */
00541    4, /*approx*/            /* RedBits */
00542    4, /*approx*/            /* GreenBits */
00543    4, /*approx*/            /* BlueBits */
00544    1, /*approx*/            /* AlphaBits */
00545    0,                   /* LuminanceBits */
00546    0,                   /* IntensityBits */
00547    0,                   /* IndexBits */
00548    0,                   /* DepthBits */
00549    0,                   /* StencilBits */
00550    0,                   /* TexelBytes */
00551    texstore_rgba_dxt1,          /* StoreTexImageFunc */
00552    NULL, /*impossible*/         /* FetchTexel1D */
00553    fetch_texel_2d_rgba_dxt1,        /* FetchTexel2D */
00554    NULL, /*impossible*/         /* FetchTexel3D */
00555    NULL, /*impossible*/         /* FetchTexel1Df */
00556    fetch_texel_2d_f_rgba_dxt1,      /* FetchTexel2Df */
00557    NULL, /*impossible*/         /* FetchTexel3Df */
00558    NULL                 /* StoreTexel */
00559 };
00560 
00561 const struct gl_texture_format _mesa_texformat_rgba_dxt3 = {
00562    MESA_FORMAT_RGBA_DXT3,       /* MesaFormat */
00563    GL_RGBA,             /* BaseFormat */
00564    GL_UNSIGNED_NORMALIZED_ARB,      /* DataType */
00565    4, /*approx*/            /* RedBits */
00566    4, /*approx*/            /* GreenBits */
00567    4, /*approx*/            /* BlueBits */
00568    4, /*approx*/            /* AlphaBits */
00569    0,                   /* LuminanceBits */
00570    0,                   /* IntensityBits */
00571    0,                   /* IndexBits */
00572    0,                   /* DepthBits */
00573    0,                   /* StencilBits */
00574    0,                   /* TexelBytes */
00575    texstore_rgba_dxt3,          /* StoreTexImageFunc */
00576    NULL, /*impossible*/         /* FetchTexel1D */
00577    fetch_texel_2d_rgba_dxt3,        /* FetchTexel2D */
00578    NULL, /*impossible*/         /* FetchTexel3D */
00579    NULL, /*impossible*/         /* FetchTexel1Df */
00580    fetch_texel_2d_f_rgba_dxt3,      /* FetchTexel2Df */
00581    NULL, /*impossible*/         /* FetchTexel3Df */
00582    NULL                 /* StoreTexel */
00583 };
00584 
00585 const struct gl_texture_format _mesa_texformat_rgba_dxt5 = {
00586    MESA_FORMAT_RGBA_DXT5,       /* MesaFormat */
00587    GL_RGBA,             /* BaseFormat */
00588    GL_UNSIGNED_NORMALIZED_ARB,      /* DataType */
00589    4,/*approx*/             /* RedBits */
00590    4,/*approx*/             /* GreenBits */
00591    4,/*approx*/             /* BlueBits */
00592    4,/*approx*/             /* AlphaBits */
00593    0,                   /* LuminanceBits */
00594    0,                   /* IntensityBits */
00595    0,                   /* IndexBits */
00596    0,                   /* DepthBits */
00597    0,                   /* StencilBits */
00598    0,                   /* TexelBytes */
00599    texstore_rgba_dxt5,          /* StoreTexImageFunc */
00600    NULL, /*impossible*/         /* FetchTexel1D */
00601    fetch_texel_2d_rgba_dxt5,        /* FetchTexel2D */
00602    NULL, /*impossible*/         /* FetchTexel3D */
00603    NULL, /*impossible*/         /* FetchTexel1Df */
00604    fetch_texel_2d_f_rgba_dxt5,      /* FetchTexel2Df */
00605    NULL, /*impossible*/         /* FetchTexel3Df */
00606    NULL                 /* StoreTexel */
00607 };

Generated on Sun May 27 2012 04:20:29 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.