summaryrefslogtreecommitdiff
path: root/src/mesa/main/texstore.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-09-27 18:09:23 -0600
committerBrian Paul <brianp@vmware.com>2009-09-27 18:09:23 -0600
commitda5722bea6e2f613933d3e3da214da8cd0047d2e (patch)
tree103d2d4d57ae83458fcbf2ae2d996f86d6faf198 /src/mesa/main/texstore.c
parent7116ae857c6ef3809c712e96b28bd69d92b3cd33 (diff)
mesa: use new look-up table to get texel fetch/store funcs
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r--src/mesa/main/texstore.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index f4df71d769..33edf8a56a 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -62,6 +62,8 @@
#include "mipmap.h"
#include "imports.h"
#include "texcompress.h"
+#include "texcompress_fxt1.h"
+#include "texcompress_s3tc.h"
#include "texformat.h"
#include "teximage.h"
#include "texstore.h"
@@ -3227,6 +3229,8 @@ texstore_funcs[MESA_FORMAT_COUNT] =
{ MESA_FORMAT_CI8, _mesa_texstore_ci8 },
{ MESA_FORMAT_YCBCR, _mesa_texstore_ycbcr },
{ MESA_FORMAT_YCBCR_REV, _mesa_texstore_ycbcr },
+ { MESA_FORMAT_RGB_FXT1, _mesa_texstore_rgb_fxt1 },
+ { MESA_FORMAT_RGBA_FXT1, _mesa_texstore_rgba_fxt1 },
{ MESA_FORMAT_Z24_S8, _mesa_texstore_z24_s8 },
{ MESA_FORMAT_S8_Z24, _mesa_texstore_s8_z24 },
{ MESA_FORMAT_Z16, _mesa_texstore_z16 },
@@ -3399,22 +3403,8 @@ _mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims)
ASSERT(dims == 1 || dims == 2 || dims == 3);
ASSERT(texImage->TexFormat);
- switch (dims) {
- case 1:
- texImage->FetchTexelc = texImage->TexFormat->FetchTexel1D;
- texImage->FetchTexelf = texImage->TexFormat->FetchTexel1Df;
- break;
- case 2:
- texImage->FetchTexelc = texImage->TexFormat->FetchTexel2D;
- texImage->FetchTexelf = texImage->TexFormat->FetchTexel2Df;
- break;
- case 3:
- texImage->FetchTexelc = texImage->TexFormat->FetchTexel3D;
- texImage->FetchTexelf = texImage->TexFormat->FetchTexel3Df;
- break;
- default:
- ;
- }
+ texImage->FetchTexelf =
+ _mesa_get_texel_fetch_func(texImage->TexFormat->MesaFormat, dims);
/* now check if we need to use a float/chan adaptor */
if (!texImage->FetchTexelc) {