Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Mesa 3-D graphics library |
Brian Paul | a9bcf75 | 2006-04-06 04:23:58 +0000 | [diff] [blame^] | 3 | * Version: 6.5.1 |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 4 | * |
Brian Paul | a9bcf75 | 2006-04-06 04:23:58 +0000 | [diff] [blame^] | 5 | * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 6 | * |
| 7 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 8 | * copy of this software and associated documentation files (the "Software"), |
| 9 | * to deal in the Software without restriction, including without limitation |
| 10 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 11 | * and/or sell copies of the Software, and to permit persons to whom the |
| 12 | * Software is furnished to do so, subject to the following conditions: |
| 13 | * |
| 14 | * The above copyright notice and this permission notice shall be included |
| 15 | * in all copies or substantial portions of the Software. |
| 16 | * |
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 20 | * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
| 21 | * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 23 | */ |
| 24 | |
Keith Whitwell | 6dc8557 | 2003-07-17 13:43:59 +0000 | [diff] [blame] | 25 | |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 26 | /** |
| 27 | * \file texformat.c |
| 28 | * Texture formats. |
| 29 | * |
| 30 | * \author Gareth Hughes |
| 31 | */ |
| 32 | |
| 33 | |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 34 | #include "colormac.h" |
| 35 | #include "context.h" |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 36 | #include "texformat.h" |
Brian Paul | 3623733 | 2004-04-22 00:54:53 +0000 | [diff] [blame] | 37 | #include "texstore.h" |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 38 | |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 39 | |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 40 | |
Keith Whitwell | 6dc8557 | 2003-07-17 13:43:59 +0000 | [diff] [blame] | 41 | /* Texel fetch routines for all supported formats |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 42 | */ |
| 43 | #define DIM 1 |
| 44 | #include "texformat_tmp.h" |
| 45 | |
| 46 | #define DIM 2 |
| 47 | #include "texformat_tmp.h" |
| 48 | |
| 49 | #define DIM 3 |
| 50 | #include "texformat_tmp.h" |
| 51 | |
Keith Whitwell | 6dc8557 | 2003-07-17 13:43:59 +0000 | [diff] [blame] | 52 | /** |
| 53 | * Null texel fetch function. |
| 54 | * |
| 55 | * Have to have this so the FetchTexel function pointer is never NULL. |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 56 | */ |
| 57 | static void fetch_null_texel( const struct gl_texture_image *texImage, |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 58 | GLint i, GLint j, GLint k, GLchan *texel ) |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 59 | { |
Brian Paul | a6c423d | 2004-08-25 15:59:48 +0000 | [diff] [blame] | 60 | (void) texImage; (void) i; (void) j; (void) k; |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 61 | texel[RCOMP] = 0; |
| 62 | texel[GCOMP] = 0; |
| 63 | texel[BCOMP] = 0; |
| 64 | texel[ACOMP] = 0; |
| 65 | _mesa_warning(NULL, "fetch_null_texel() called!"); |
| 66 | } |
| 67 | |
| 68 | static void fetch_null_texelf( const struct gl_texture_image *texImage, |
| 69 | GLint i, GLint j, GLint k, GLfloat *texel ) |
| 70 | { |
Brian Paul | a6c423d | 2004-08-25 15:59:48 +0000 | [diff] [blame] | 71 | (void) texImage; (void) i; (void) j; (void) k; |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 72 | texel[RCOMP] = 0.0; |
| 73 | texel[GCOMP] = 0.0; |
| 74 | texel[BCOMP] = 0.0; |
| 75 | texel[ACOMP] = 0.0; |
| 76 | _mesa_warning(NULL, "fetch_null_texelf() called!"); |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 77 | } |
| 78 | |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 79 | static void store_null_texel(struct gl_texture_image *texImage, |
| 80 | GLint i, GLint j, GLint k, const void *texel) |
| 81 | { |
Brian Paul | a9bcf75 | 2006-04-06 04:23:58 +0000 | [diff] [blame^] | 82 | (void) texImage; |
| 83 | (void) i; |
| 84 | (void) j; |
| 85 | (void) k; |
| 86 | (void) texel; |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 87 | /* no-op */ |
| 88 | } |
| 89 | |
| 90 | |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 91 | /** |
| 92 | * Notes about the predefined gl_texture_formats: |
| 93 | * |
| 94 | * 1. There are 1D, 2D and 3D functions for fetching texels from texture |
| 95 | * images, returning both GLchan values and GLfloat values. (six |
| 96 | * functions in total) |
| 97 | * You don't have to provide both the GLchan and GLfloat functions; |
| 98 | * just one or the other is OK. Mesa will use an "adaptor" to convert |
| 99 | * between GLchan/GLfloat when needed. |
| 100 | * Since the adaptors have small performance penalty, we provide both |
| 101 | * GLchan and GLfloat functions for some common formats like RGB, RGBA. |
| 102 | */ |
| 103 | |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 104 | |
Keith Whitwell | 6dc8557 | 2003-07-17 13:43:59 +0000 | [diff] [blame] | 105 | /***************************************************************/ |
| 106 | /** \name Default GLchan-based formats */ |
| 107 | /*@{*/ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 108 | |
| 109 | const struct gl_texture_format _mesa_texformat_rgba = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 110 | MESA_FORMAT_RGBA, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 111 | GL_RGBA, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 112 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 113 | CHAN_BITS, /* RedBits */ |
| 114 | CHAN_BITS, /* GreenBits */ |
| 115 | CHAN_BITS, /* BlueBits */ |
| 116 | CHAN_BITS, /* AlphaBits */ |
| 117 | 0, /* LuminanceBits */ |
| 118 | 0, /* IntensityBits */ |
| 119 | 0, /* IndexBits */ |
| 120 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 121 | 0, /* StencilBits */ |
Brian Paul | 6e16715 | 2004-04-22 23:51:15 +0000 | [diff] [blame] | 122 | 4 * sizeof(GLchan), /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 123 | _mesa_texstore_rgba, /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 124 | fetch_texel_1d_rgba, /* FetchTexel1D */ |
| 125 | fetch_texel_2d_rgba, /* FetchTexel2D */ |
| 126 | fetch_texel_3d_rgba, /* FetchTexel3D */ |
| 127 | fetch_texel_1d_f_rgba, /* FetchTexel1Df */ |
| 128 | fetch_texel_2d_f_rgba, /* FetchTexel2Df */ |
| 129 | fetch_texel_3d_f_rgba, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 130 | store_texel_rgba /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 131 | }; |
| 132 | |
| 133 | const struct gl_texture_format _mesa_texformat_rgb = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 134 | MESA_FORMAT_RGB, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 135 | GL_RGB, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 136 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 137 | CHAN_BITS, /* RedBits */ |
| 138 | CHAN_BITS, /* GreenBits */ |
| 139 | CHAN_BITS, /* BlueBits */ |
| 140 | 0, /* AlphaBits */ |
| 141 | 0, /* LuminanceBits */ |
| 142 | 0, /* IntensityBits */ |
| 143 | 0, /* IndexBits */ |
| 144 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 145 | 0, /* StencilBits */ |
Brian Paul | 6e16715 | 2004-04-22 23:51:15 +0000 | [diff] [blame] | 146 | 3 * sizeof(GLchan), /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 147 | _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 148 | fetch_texel_1d_rgb, /* FetchTexel1D */ |
| 149 | fetch_texel_2d_rgb, /* FetchTexel2D */ |
| 150 | fetch_texel_3d_rgb, /* FetchTexel3D */ |
| 151 | fetch_texel_1d_f_rgb, /* FetchTexel1Df */ |
| 152 | fetch_texel_2d_f_rgb, /* FetchTexel2Df */ |
| 153 | fetch_texel_3d_f_rgb, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 154 | store_texel_rgb /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 155 | }; |
| 156 | |
| 157 | const struct gl_texture_format _mesa_texformat_alpha = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 158 | MESA_FORMAT_ALPHA, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 159 | GL_ALPHA, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 160 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 161 | 0, /* RedBits */ |
| 162 | 0, /* GreenBits */ |
| 163 | 0, /* BlueBits */ |
| 164 | CHAN_BITS, /* AlphaBits */ |
| 165 | 0, /* LuminanceBits */ |
| 166 | 0, /* IntensityBits */ |
| 167 | 0, /* IndexBits */ |
| 168 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 169 | 0, /* StencilBits */ |
Brian Paul | 6e16715 | 2004-04-22 23:51:15 +0000 | [diff] [blame] | 170 | sizeof(GLchan), /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 171 | _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 172 | fetch_texel_1d_alpha, /* FetchTexel1D */ |
| 173 | fetch_texel_2d_alpha, /* FetchTexel2D */ |
| 174 | fetch_texel_3d_alpha, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 175 | NULL, /* FetchTexel1Df */ |
| 176 | NULL, /* FetchTexel2Df */ |
| 177 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 178 | store_texel_alpha /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 179 | }; |
| 180 | |
| 181 | const struct gl_texture_format _mesa_texformat_luminance = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 182 | MESA_FORMAT_LUMINANCE, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 183 | GL_LUMINANCE, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 184 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 185 | 0, /* RedBits */ |
| 186 | 0, /* GreenBits */ |
| 187 | 0, /* BlueBits */ |
| 188 | 0, /* AlphaBits */ |
| 189 | CHAN_BITS, /* LuminanceBits */ |
| 190 | 0, /* IntensityBits */ |
| 191 | 0, /* IndexBits */ |
| 192 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 193 | 0, /* StencilBits */ |
Brian Paul | 6e16715 | 2004-04-22 23:51:15 +0000 | [diff] [blame] | 194 | sizeof(GLchan), /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 195 | _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 196 | fetch_texel_1d_luminance, /* FetchTexel1D */ |
| 197 | fetch_texel_2d_luminance, /* FetchTexel2D */ |
| 198 | fetch_texel_3d_luminance, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 199 | NULL, /* FetchTexel1Df */ |
| 200 | NULL, /* FetchTexel2Df */ |
| 201 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 202 | store_texel_luminance /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 203 | }; |
| 204 | |
| 205 | const struct gl_texture_format _mesa_texformat_luminance_alpha = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 206 | MESA_FORMAT_LUMINANCE_ALPHA, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 207 | GL_LUMINANCE_ALPHA, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 208 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 209 | 0, /* RedBits */ |
| 210 | 0, /* GreenBits */ |
| 211 | 0, /* BlueBits */ |
| 212 | CHAN_BITS, /* AlphaBits */ |
| 213 | CHAN_BITS, /* LuminanceBits */ |
| 214 | 0, /* IntensityBits */ |
| 215 | 0, /* IndexBits */ |
| 216 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 217 | 0, /* StencilBits */ |
Brian Paul | 6e16715 | 2004-04-22 23:51:15 +0000 | [diff] [blame] | 218 | 2 * sizeof(GLchan), /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 219 | _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 220 | fetch_texel_1d_luminance_alpha, /* FetchTexel1D */ |
| 221 | fetch_texel_2d_luminance_alpha, /* FetchTexel2D */ |
| 222 | fetch_texel_3d_luminance_alpha, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 223 | NULL, /* FetchTexel1Df */ |
| 224 | NULL, /* FetchTexel2Df */ |
| 225 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 226 | store_texel_luminance_alpha /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 227 | }; |
| 228 | |
| 229 | const struct gl_texture_format _mesa_texformat_intensity = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 230 | MESA_FORMAT_INTENSITY, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 231 | GL_INTENSITY, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 232 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 233 | 0, /* RedBits */ |
| 234 | 0, /* GreenBits */ |
| 235 | 0, /* BlueBits */ |
| 236 | 0, /* AlphaBits */ |
| 237 | 0, /* LuminanceBits */ |
| 238 | CHAN_BITS, /* IntensityBits */ |
| 239 | 0, /* IndexBits */ |
| 240 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 241 | 0, /* StencilBits */ |
Brian Paul | 6e16715 | 2004-04-22 23:51:15 +0000 | [diff] [blame] | 242 | sizeof(GLchan), /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 243 | _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 244 | fetch_texel_1d_intensity, /* FetchTexel1D */ |
| 245 | fetch_texel_2d_intensity, /* FetchTexel2D */ |
| 246 | fetch_texel_3d_intensity, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 247 | NULL, /* FetchTexel1Df */ |
| 248 | NULL, /* FetchTexel2Df */ |
| 249 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 250 | store_texel_intensity /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 251 | }; |
| 252 | |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 253 | |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 254 | const struct gl_texture_format _mesa_texformat_rgba_float32 = { |
| 255 | MESA_FORMAT_RGBA_FLOAT32, /* MesaFormat */ |
| 256 | GL_RGBA, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 257 | GL_FLOAT, /* DataType */ |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 258 | 8 * sizeof(GLfloat), /* RedBits */ |
| 259 | 8 * sizeof(GLfloat), /* GreenBits */ |
| 260 | 8 * sizeof(GLfloat), /* BlueBits */ |
| 261 | 8 * sizeof(GLfloat), /* AlphaBits */ |
| 262 | 0, /* LuminanceBits */ |
| 263 | 0, /* IntensityBits */ |
| 264 | 0, /* IndexBits */ |
| 265 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 266 | 0, /* StencilBits */ |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 267 | 4 * sizeof(GLfloat), /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 268 | _mesa_texstore_rgba_float32, /* StoreTexImageFunc */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 269 | NULL, /* FetchTexel1D */ |
| 270 | NULL, /* FetchTexel1D */ |
| 271 | NULL, /* FetchTexel1D */ |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 272 | fetch_texel_1d_f_rgba_f32, /* FetchTexel1Df */ |
| 273 | fetch_texel_2d_f_rgba_f32, /* FetchTexel2Df */ |
| 274 | fetch_texel_3d_f_rgba_f32, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 275 | store_texel_rgba_f32 /* StoreTexel */ |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 276 | }; |
| 277 | |
| 278 | const struct gl_texture_format _mesa_texformat_rgba_float16 = { |
| 279 | MESA_FORMAT_RGBA_FLOAT16, /* MesaFormat */ |
| 280 | GL_RGBA, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 281 | GL_FLOAT, /* DataType */ |
| 282 | 8 * sizeof(GLhalfARB), /* RedBits */ |
| 283 | 8 * sizeof(GLhalfARB), /* GreenBits */ |
| 284 | 8 * sizeof(GLhalfARB), /* BlueBits */ |
| 285 | 8 * sizeof(GLhalfARB), /* AlphaBits */ |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 286 | 0, /* LuminanceBits */ |
| 287 | 0, /* IntensityBits */ |
| 288 | 0, /* IndexBits */ |
| 289 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 290 | 0, /* StencilBits */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 291 | 4 * sizeof(GLhalfARB), /* TexelBytes */ |
| 292 | _mesa_texstore_rgba_float16, /* StoreTexImageFunc */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 293 | NULL, /* FetchTexel1D */ |
| 294 | NULL, /* FetchTexel1D */ |
| 295 | NULL, /* FetchTexel1D */ |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 296 | fetch_texel_1d_f_rgba_f16, /* FetchTexel1Df */ |
| 297 | fetch_texel_2d_f_rgba_f16, /* FetchTexel2Df */ |
| 298 | fetch_texel_3d_f_rgba_f16, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 299 | store_texel_rgba_f16 /* StoreTexel */ |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 300 | }; |
| 301 | |
| 302 | const struct gl_texture_format _mesa_texformat_rgb_float32 = { |
| 303 | MESA_FORMAT_RGB_FLOAT32, /* MesaFormat */ |
| 304 | GL_RGB, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 305 | GL_FLOAT, /* DataType */ |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 306 | 8 * sizeof(GLfloat), /* RedBits */ |
| 307 | 8 * sizeof(GLfloat), /* GreenBits */ |
| 308 | 8 * sizeof(GLfloat), /* BlueBits */ |
| 309 | 0, /* AlphaBits */ |
| 310 | 0, /* LuminanceBits */ |
| 311 | 0, /* IntensityBits */ |
| 312 | 0, /* IndexBits */ |
| 313 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 314 | 0, /* StencilBits */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 315 | 3 * sizeof(GLfloat), /* TexelBytes */ |
| 316 | _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 317 | NULL, /* FetchTexel1D */ |
| 318 | NULL, /* FetchTexel1D */ |
| 319 | NULL, /* FetchTexel1D */ |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 320 | fetch_texel_1d_f_rgb_f32, /* FetchTexel1Df */ |
| 321 | fetch_texel_2d_f_rgb_f32, /* FetchTexel2Df */ |
| 322 | fetch_texel_3d_f_rgb_f32, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 323 | store_texel_rgb_f32 /* StoreTexel */ |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 324 | }; |
| 325 | |
| 326 | const struct gl_texture_format _mesa_texformat_rgb_float16 = { |
| 327 | MESA_FORMAT_RGB_FLOAT16, /* MesaFormat */ |
| 328 | GL_RGB, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 329 | GL_FLOAT, /* DataType */ |
| 330 | 8 * sizeof(GLhalfARB), /* RedBits */ |
| 331 | 8 * sizeof(GLhalfARB), /* GreenBits */ |
| 332 | 8 * sizeof(GLhalfARB), /* BlueBits */ |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 333 | 0, /* AlphaBits */ |
| 334 | 0, /* LuminanceBits */ |
| 335 | 0, /* IntensityBits */ |
| 336 | 0, /* IndexBits */ |
| 337 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 338 | 0, /* StencilBits */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 339 | 3 * sizeof(GLhalfARB), /* TexelBytes */ |
| 340 | _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 341 | NULL, /* FetchTexel1D */ |
| 342 | NULL, /* FetchTexel1D */ |
| 343 | NULL, /* FetchTexel1D */ |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 344 | fetch_texel_1d_f_rgb_f16, /* FetchTexel1Df */ |
| 345 | fetch_texel_2d_f_rgb_f16, /* FetchTexel2Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 346 | fetch_texel_3d_f_rgb_f16, /* FetchTexel3Df */ |
| 347 | store_texel_rgb_f16 /* StoreTexel */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 348 | }; |
| 349 | |
| 350 | const struct gl_texture_format _mesa_texformat_alpha_float32 = { |
| 351 | MESA_FORMAT_ALPHA_FLOAT32, /* MesaFormat */ |
| 352 | GL_ALPHA, /* BaseFormat */ |
| 353 | GL_FLOAT, /* DataType */ |
| 354 | 0, /* RedBits */ |
| 355 | 0, /* GreenBits */ |
| 356 | 0, /* BlueBits */ |
| 357 | 8 * sizeof(GLfloat), /* AlphaBits */ |
| 358 | 0, /* LuminanceBits */ |
| 359 | 0, /* IntensityBits */ |
| 360 | 0, /* IndexBits */ |
| 361 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 362 | 0, /* StencilBits */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 363 | 1 * sizeof(GLfloat), /* TexelBytes */ |
| 364 | _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 365 | NULL, /* FetchTexel1D */ |
| 366 | NULL, /* FetchTexel1D */ |
| 367 | NULL, /* FetchTexel1D */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 368 | fetch_texel_1d_f_alpha_f32, /* FetchTexel1Df */ |
| 369 | fetch_texel_2d_f_alpha_f32, /* FetchTexel2Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 370 | fetch_texel_3d_f_alpha_f32, /* FetchTexel3Df */ |
| 371 | store_texel_alpha_f32 /* StoreTexel */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 372 | }; |
| 373 | |
| 374 | const struct gl_texture_format _mesa_texformat_alpha_float16 = { |
| 375 | MESA_FORMAT_ALPHA_FLOAT16, /* MesaFormat */ |
| 376 | GL_ALPHA, /* BaseFormat */ |
| 377 | GL_FLOAT, /* DataType */ |
| 378 | 0, /* RedBits */ |
| 379 | 0, /* GreenBits */ |
| 380 | 0, /* BlueBits */ |
| 381 | 8 * sizeof(GLhalfARB), /* AlphaBits */ |
| 382 | 0, /* LuminanceBits */ |
| 383 | 0, /* IntensityBits */ |
| 384 | 0, /* IndexBits */ |
| 385 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 386 | 0, /* StencilBits */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 387 | 1 * sizeof(GLhalfARB), /* TexelBytes */ |
| 388 | _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 389 | NULL, /* FetchTexel1D */ |
| 390 | NULL, /* FetchTexel1D */ |
| 391 | NULL, /* FetchTexel1D */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 392 | fetch_texel_1d_f_alpha_f16, /* FetchTexel1Df */ |
| 393 | fetch_texel_2d_f_alpha_f16, /* FetchTexel2Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 394 | fetch_texel_3d_f_alpha_f16, /* FetchTexel3Df */ |
| 395 | store_texel_alpha_f16 /* StoreTexel */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 396 | }; |
| 397 | |
| 398 | const struct gl_texture_format _mesa_texformat_luminance_float32 = { |
| 399 | MESA_FORMAT_LUMINANCE_FLOAT32, /* MesaFormat */ |
| 400 | GL_LUMINANCE, /* BaseFormat */ |
| 401 | GL_FLOAT, /* DataType */ |
| 402 | 0, /* RedBits */ |
| 403 | 0, /* GreenBits */ |
| 404 | 0, /* BlueBits */ |
| 405 | 0, /* AlphaBits */ |
| 406 | 8 * sizeof(GLfloat), /* LuminanceBits */ |
| 407 | 0, /* IntensityBits */ |
| 408 | 0, /* IndexBits */ |
| 409 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 410 | 0, /* StencilBits */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 411 | 1 * sizeof(GLfloat), /* TexelBytes */ |
| 412 | _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 413 | NULL, /* FetchTexel1D */ |
| 414 | NULL, /* FetchTexel2D */ |
| 415 | NULL, /* FetchTexel3D */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 416 | fetch_texel_1d_f_luminance_f32, /* FetchTexel1Df */ |
| 417 | fetch_texel_2d_f_luminance_f32, /* FetchTexel2Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 418 | fetch_texel_3d_f_luminance_f32, /* FetchTexel3Df */ |
| 419 | store_texel_luminance_f32 /* StoreTexel */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 420 | }; |
| 421 | |
| 422 | const struct gl_texture_format _mesa_texformat_luminance_float16 = { |
| 423 | MESA_FORMAT_LUMINANCE_FLOAT16, /* MesaFormat */ |
| 424 | GL_LUMINANCE, /* BaseFormat */ |
| 425 | GL_FLOAT, /* DataType */ |
| 426 | 0, /* RedBits */ |
| 427 | 0, /* GreenBits */ |
| 428 | 0, /* BlueBits */ |
| 429 | 0, /* AlphaBits */ |
| 430 | 8 * sizeof(GLhalfARB), /* LuminanceBits */ |
| 431 | 0, /* IntensityBits */ |
| 432 | 0, /* IndexBits */ |
| 433 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 434 | 0, /* StencilBits */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 435 | 1 * sizeof(GLhalfARB), /* TexelBytes */ |
| 436 | _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 437 | NULL, /* FetchTexel1D */ |
| 438 | NULL, /* FetchTexel2D */ |
| 439 | NULL, /* FetchTexel3D */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 440 | fetch_texel_1d_f_luminance_f16, /* FetchTexel1Df */ |
| 441 | fetch_texel_2d_f_luminance_f16, /* FetchTexel2Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 442 | fetch_texel_3d_f_luminance_f16, /* FetchTexel3Df */ |
| 443 | store_texel_luminance_f16 /* StoreTexel */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 444 | }; |
| 445 | |
| 446 | const struct gl_texture_format _mesa_texformat_luminance_alpha_float32 = { |
| 447 | MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, /* MesaFormat */ |
| 448 | GL_LUMINANCE_ALPHA, /* BaseFormat */ |
| 449 | GL_FLOAT, /* DataType */ |
| 450 | 0, /* RedBits */ |
| 451 | 0, /* GreenBits */ |
| 452 | 0, /* BlueBits */ |
| 453 | 8 * sizeof(GLfloat), /* AlphaBits */ |
| 454 | 8 * sizeof(GLfloat), /* LuminanceBits */ |
| 455 | 0, /* IntensityBits */ |
| 456 | 0, /* IndexBits */ |
| 457 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 458 | 0, /* StencilBits */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 459 | 2 * sizeof(GLfloat), /* TexelBytes */ |
| 460 | _mesa_texstore_rgba_float32, /* StoreTexImageFunc */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 461 | NULL, /* FetchTexel1D */ |
| 462 | NULL, /* FetchTexel2D */ |
| 463 | NULL, /* FetchTexel3D */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 464 | fetch_texel_1d_f_luminance_alpha_f32,/* FetchTexel1Df */ |
| 465 | fetch_texel_2d_f_luminance_alpha_f32,/* FetchTexel2Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 466 | fetch_texel_3d_f_luminance_alpha_f32,/* FetchTexel3Df */ |
| 467 | store_texel_luminance_alpha_f32 /* StoreTexel */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 468 | }; |
| 469 | |
| 470 | const struct gl_texture_format _mesa_texformat_luminance_alpha_float16 = { |
| 471 | MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, /* MesaFormat */ |
| 472 | GL_LUMINANCE_ALPHA, /* BaseFormat */ |
| 473 | GL_FLOAT, /* DataType */ |
| 474 | 0, /* RedBits */ |
| 475 | 0, /* GreenBits */ |
| 476 | 0, /* BlueBits */ |
| 477 | 8 * sizeof(GLhalfARB), /* AlphaBits */ |
| 478 | 8 * sizeof(GLhalfARB), /* LuminanceBits */ |
| 479 | 0, /* IntensityBits */ |
| 480 | 0, /* IndexBits */ |
| 481 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 482 | 0, /* StencilBits */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 483 | 2 * sizeof(GLhalfARB), /* TexelBytes */ |
| 484 | _mesa_texstore_rgba_float16, /* StoreTexImageFunc */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 485 | NULL, /* FetchTexel1D */ |
| 486 | NULL, /* FetchTexel2D */ |
| 487 | NULL, /* FetchTexel3D */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 488 | fetch_texel_1d_f_luminance_alpha_f16,/* FetchTexel1Df */ |
| 489 | fetch_texel_2d_f_luminance_alpha_f16,/* FetchTexel2Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 490 | fetch_texel_3d_f_luminance_alpha_f16,/* FetchTexel3Df */ |
| 491 | store_texel_luminance_alpha_f16 /* StoreTexel */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 492 | }; |
| 493 | |
| 494 | const struct gl_texture_format _mesa_texformat_intensity_float32 = { |
| 495 | MESA_FORMAT_INTENSITY_FLOAT32, /* MesaFormat */ |
| 496 | GL_INTENSITY, /* BaseFormat */ |
| 497 | GL_FLOAT, /* DataType */ |
| 498 | 0, /* RedBits */ |
| 499 | 0, /* GreenBits */ |
| 500 | 0, /* BlueBits */ |
| 501 | 0, /* AlphaBits */ |
| 502 | 0, /* LuminanceBits */ |
| 503 | 8 * sizeof(GLfloat), /* IntensityBits */ |
| 504 | 0, /* IndexBits */ |
| 505 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 506 | 0, /* StencilBits */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 507 | 1 * sizeof(GLfloat), /* TexelBytes */ |
| 508 | _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 509 | NULL, /* FetchTexel1D */ |
| 510 | NULL, /* FetchTexel2D */ |
| 511 | NULL, /* FetchTexel3D */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 512 | fetch_texel_1d_f_intensity_f32, /* FetchTexel1Df */ |
| 513 | fetch_texel_2d_f_intensity_f32, /* FetchTexel2Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 514 | fetch_texel_3d_f_intensity_f32, /* FetchTexel3Df */ |
| 515 | store_texel_intensity_f32 /* StoreTexel */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 516 | }; |
| 517 | |
| 518 | const struct gl_texture_format _mesa_texformat_intensity_float16 = { |
| 519 | MESA_FORMAT_INTENSITY_FLOAT16, /* MesaFormat */ |
| 520 | GL_INTENSITY, /* BaseFormat */ |
| 521 | GL_FLOAT, /* DataType */ |
| 522 | 0, /* RedBits */ |
| 523 | 0, /* GreenBits */ |
| 524 | 0, /* BlueBits */ |
| 525 | 0, /* AlphaBits */ |
| 526 | 0, /* LuminanceBits */ |
| 527 | 8 * sizeof(GLhalfARB), /* IntensityBits */ |
| 528 | 0, /* IndexBits */ |
| 529 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 530 | 0, /* StencilBits */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 531 | 1 * sizeof(GLhalfARB), /* TexelBytes */ |
| 532 | _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 533 | NULL, /* FetchTexel1D */ |
| 534 | NULL, /* FetchTexel2D */ |
| 535 | NULL, /* FetchTexel3D */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 536 | fetch_texel_1d_f_intensity_f16, /* FetchTexel1Df */ |
| 537 | fetch_texel_2d_f_intensity_f16, /* FetchTexel2Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 538 | fetch_texel_3d_f_intensity_f16, /* FetchTexel3Df */ |
| 539 | store_texel_intensity_f16 /* StoreTexel */ |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 540 | }; |
| 541 | |
| 542 | |
Keith Whitwell | 6dc8557 | 2003-07-17 13:43:59 +0000 | [diff] [blame] | 543 | /*@}*/ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 544 | |
Keith Whitwell | 6dc8557 | 2003-07-17 13:43:59 +0000 | [diff] [blame] | 545 | |
| 546 | /***************************************************************/ |
| 547 | /** \name Hardware formats */ |
| 548 | /*@{*/ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 549 | |
| 550 | const struct gl_texture_format _mesa_texformat_rgba8888 = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 551 | MESA_FORMAT_RGBA8888, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 552 | GL_RGBA, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 553 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 554 | 8, /* RedBits */ |
| 555 | 8, /* GreenBits */ |
| 556 | 8, /* BlueBits */ |
| 557 | 8, /* AlphaBits */ |
| 558 | 0, /* LuminanceBits */ |
| 559 | 0, /* IntensityBits */ |
| 560 | 0, /* IndexBits */ |
| 561 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 562 | 0, /* StencilBits */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 563 | 4, /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 564 | _mesa_texstore_rgba8888, /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 565 | fetch_texel_1d_rgba8888, /* FetchTexel1D */ |
| 566 | fetch_texel_2d_rgba8888, /* FetchTexel2D */ |
| 567 | fetch_texel_3d_rgba8888, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 568 | NULL, /* FetchTexel1Df */ |
| 569 | NULL, /* FetchTexel2Df */ |
| 570 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 571 | store_texel_rgba8888 /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 572 | }; |
| 573 | |
Brian Paul | defb035 | 2004-05-13 15:26:51 +0000 | [diff] [blame] | 574 | const struct gl_texture_format _mesa_texformat_rgba8888_rev = { |
| 575 | MESA_FORMAT_RGBA8888_REV, /* MesaFormat */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 576 | GL_RGBA, /* BaseFormat */ |
| 577 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
| 578 | 8, /* RedBits */ |
| 579 | 8, /* GreenBits */ |
| 580 | 8, /* BlueBits */ |
| 581 | 8, /* AlphaBits */ |
| 582 | 0, /* LuminanceBits */ |
| 583 | 0, /* IntensityBits */ |
| 584 | 0, /* IndexBits */ |
| 585 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 586 | 0, /* StencilBits */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 587 | 4, /* TexelBytes */ |
Brian Paul | defb035 | 2004-05-13 15:26:51 +0000 | [diff] [blame] | 588 | _mesa_texstore_rgba8888, /* StoreTexImageFunc */ |
| 589 | fetch_texel_1d_rgba8888_rev, /* FetchTexel1D */ |
| 590 | fetch_texel_2d_rgba8888_rev, /* FetchTexel2D */ |
| 591 | fetch_texel_3d_rgba8888_rev, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 592 | NULL, /* FetchTexel1Df */ |
| 593 | NULL, /* FetchTexel2Df */ |
| 594 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 595 | store_texel_rgba8888_rev /* StoreTexel */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 596 | }; |
| 597 | |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 598 | const struct gl_texture_format _mesa_texformat_argb8888 = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 599 | MESA_FORMAT_ARGB8888, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 600 | GL_RGBA, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 601 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 602 | 8, /* RedBits */ |
| 603 | 8, /* GreenBits */ |
| 604 | 8, /* BlueBits */ |
| 605 | 8, /* AlphaBits */ |
| 606 | 0, /* LuminanceBits */ |
| 607 | 0, /* IntensityBits */ |
| 608 | 0, /* IndexBits */ |
| 609 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 610 | 0, /* StencilBits */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 611 | 4, /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 612 | _mesa_texstore_argb8888, /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 613 | fetch_texel_1d_argb8888, /* FetchTexel1D */ |
| 614 | fetch_texel_2d_argb8888, /* FetchTexel2D */ |
| 615 | fetch_texel_3d_argb8888, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 616 | NULL, /* FetchTexel1Df */ |
| 617 | NULL, /* FetchTexel2Df */ |
| 618 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 619 | store_texel_argb8888 /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 620 | }; |
| 621 | |
Brian Paul | defb035 | 2004-05-13 15:26:51 +0000 | [diff] [blame] | 622 | const struct gl_texture_format _mesa_texformat_argb8888_rev = { |
| 623 | MESA_FORMAT_ARGB8888_REV, /* MesaFormat */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 624 | GL_RGBA, /* BaseFormat */ |
| 625 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
| 626 | 8, /* RedBits */ |
| 627 | 8, /* GreenBits */ |
| 628 | 8, /* BlueBits */ |
| 629 | 8, /* AlphaBits */ |
| 630 | 0, /* LuminanceBits */ |
| 631 | 0, /* IntensityBits */ |
| 632 | 0, /* IndexBits */ |
| 633 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 634 | 0, /* StencilBits */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 635 | 4, /* TexelBytes */ |
Brian Paul | defb035 | 2004-05-13 15:26:51 +0000 | [diff] [blame] | 636 | _mesa_texstore_argb8888, /* StoreTexImageFunc */ |
| 637 | fetch_texel_1d_argb8888_rev, /* FetchTexel1D */ |
| 638 | fetch_texel_2d_argb8888_rev, /* FetchTexel2D */ |
| 639 | fetch_texel_3d_argb8888_rev, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 640 | NULL, /* FetchTexel1Df */ |
| 641 | NULL, /* FetchTexel2Df */ |
| 642 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 643 | store_texel_argb8888_rev /* StoreTexel */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 644 | }; |
| 645 | |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 646 | const struct gl_texture_format _mesa_texformat_rgb888 = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 647 | MESA_FORMAT_RGB888, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 648 | GL_RGB, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 649 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 650 | 8, /* RedBits */ |
| 651 | 8, /* GreenBits */ |
| 652 | 8, /* BlueBits */ |
| 653 | 0, /* AlphaBits */ |
| 654 | 0, /* LuminanceBits */ |
| 655 | 0, /* IntensityBits */ |
| 656 | 0, /* IndexBits */ |
| 657 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 658 | 0, /* StencilBits */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 659 | 3, /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 660 | _mesa_texstore_rgb888, /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 661 | fetch_texel_1d_rgb888, /* FetchTexel1D */ |
| 662 | fetch_texel_2d_rgb888, /* FetchTexel2D */ |
| 663 | fetch_texel_3d_rgb888, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 664 | NULL, /* FetchTexel1Df */ |
| 665 | NULL, /* FetchTexel2Df */ |
| 666 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 667 | store_texel_rgb888 /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 668 | }; |
| 669 | |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 670 | const struct gl_texture_format _mesa_texformat_bgr888 = { |
| 671 | MESA_FORMAT_BGR888, /* MesaFormat */ |
| 672 | GL_RGB, /* BaseFormat */ |
| 673 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
| 674 | 8, /* RedBits */ |
| 675 | 8, /* GreenBits */ |
| 676 | 8, /* BlueBits */ |
| 677 | 0, /* AlphaBits */ |
| 678 | 0, /* LuminanceBits */ |
| 679 | 0, /* IntensityBits */ |
| 680 | 0, /* IndexBits */ |
| 681 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 682 | 0, /* StencilBits */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 683 | 3, /* TexelBytes */ |
| 684 | _mesa_texstore_bgr888, /* StoreTexImageFunc */ |
| 685 | fetch_texel_1d_bgr888, /* FetchTexel1D */ |
| 686 | fetch_texel_2d_bgr888, /* FetchTexel2D */ |
| 687 | fetch_texel_3d_bgr888, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 688 | NULL, /* FetchTexel1Df */ |
| 689 | NULL, /* FetchTexel2Df */ |
| 690 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 691 | store_texel_bgr888 /* StoreTexel */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 692 | }; |
| 693 | |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 694 | const struct gl_texture_format _mesa_texformat_rgb565 = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 695 | MESA_FORMAT_RGB565, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 696 | GL_RGB, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 697 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 698 | 5, /* RedBits */ |
| 699 | 6, /* GreenBits */ |
| 700 | 5, /* BlueBits */ |
| 701 | 0, /* AlphaBits */ |
| 702 | 0, /* LuminanceBits */ |
| 703 | 0, /* IntensityBits */ |
| 704 | 0, /* IndexBits */ |
| 705 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 706 | 0, /* StencilBits */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 707 | 2, /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 708 | _mesa_texstore_rgb565, /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 709 | fetch_texel_1d_rgb565, /* FetchTexel1D */ |
| 710 | fetch_texel_2d_rgb565, /* FetchTexel2D */ |
| 711 | fetch_texel_3d_rgb565, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 712 | NULL, /* FetchTexel1Df */ |
| 713 | NULL, /* FetchTexel2Df */ |
| 714 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 715 | store_texel_rgb565 /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 716 | }; |
| 717 | |
Brian Paul | defb035 | 2004-05-13 15:26:51 +0000 | [diff] [blame] | 718 | const struct gl_texture_format _mesa_texformat_rgb565_rev = { |
| 719 | MESA_FORMAT_RGB565_REV, /* MesaFormat */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 720 | GL_RGB, /* BaseFormat */ |
| 721 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
| 722 | 5, /* RedBits */ |
| 723 | 6, /* GreenBits */ |
| 724 | 5, /* BlueBits */ |
| 725 | 0, /* AlphaBits */ |
| 726 | 0, /* LuminanceBits */ |
| 727 | 0, /* IntensityBits */ |
| 728 | 0, /* IndexBits */ |
| 729 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 730 | 0, /* StencilBits */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 731 | 2, /* TexelBytes */ |
Brian Paul | defb035 | 2004-05-13 15:26:51 +0000 | [diff] [blame] | 732 | _mesa_texstore_rgb565, /* StoreTexImageFunc */ |
| 733 | fetch_texel_1d_rgb565_rev, /* FetchTexel1D */ |
| 734 | fetch_texel_2d_rgb565_rev, /* FetchTexel2D */ |
| 735 | fetch_texel_3d_rgb565_rev, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 736 | NULL, /* FetchTexel1Df */ |
| 737 | NULL, /* FetchTexel2Df */ |
| 738 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 739 | store_texel_rgb565_rev /* StoreTexel */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 740 | }; |
| 741 | |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 742 | const struct gl_texture_format _mesa_texformat_argb4444 = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 743 | MESA_FORMAT_ARGB4444, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 744 | GL_RGBA, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 745 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 746 | 4, /* RedBits */ |
| 747 | 4, /* GreenBits */ |
| 748 | 4, /* BlueBits */ |
| 749 | 4, /* AlphaBits */ |
| 750 | 0, /* LuminanceBits */ |
| 751 | 0, /* IntensityBits */ |
| 752 | 0, /* IndexBits */ |
| 753 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 754 | 0, /* StencilBits */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 755 | 2, /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 756 | _mesa_texstore_argb4444, /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 757 | fetch_texel_1d_argb4444, /* FetchTexel1D */ |
| 758 | fetch_texel_2d_argb4444, /* FetchTexel2D */ |
| 759 | fetch_texel_3d_argb4444, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 760 | NULL, /* FetchTexel1Df */ |
| 761 | NULL, /* FetchTexel2Df */ |
| 762 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 763 | store_texel_argb4444 /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 764 | }; |
| 765 | |
Brian Paul | defb035 | 2004-05-13 15:26:51 +0000 | [diff] [blame] | 766 | const struct gl_texture_format _mesa_texformat_argb4444_rev = { |
| 767 | MESA_FORMAT_ARGB4444_REV, /* MesaFormat */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 768 | GL_RGBA, /* BaseFormat */ |
| 769 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
| 770 | 4, /* RedBits */ |
| 771 | 4, /* GreenBits */ |
| 772 | 4, /* BlueBits */ |
| 773 | 4, /* AlphaBits */ |
| 774 | 0, /* LuminanceBits */ |
| 775 | 0, /* IntensityBits */ |
| 776 | 0, /* IndexBits */ |
| 777 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 778 | 0, /* StencilBits */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 779 | 2, /* TexelBytes */ |
Brian Paul | defb035 | 2004-05-13 15:26:51 +0000 | [diff] [blame] | 780 | _mesa_texstore_argb4444, /* StoreTexImageFunc */ |
| 781 | fetch_texel_1d_argb4444_rev, /* FetchTexel1D */ |
| 782 | fetch_texel_2d_argb4444_rev, /* FetchTexel2D */ |
| 783 | fetch_texel_3d_argb4444_rev, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 784 | NULL, /* FetchTexel1Df */ |
| 785 | NULL, /* FetchTexel2Df */ |
| 786 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 787 | store_texel_argb4444_rev /* StoreTexel */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 788 | }; |
| 789 | |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 790 | const struct gl_texture_format _mesa_texformat_argb1555 = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 791 | MESA_FORMAT_ARGB1555, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 792 | GL_RGBA, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 793 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 794 | 5, /* RedBits */ |
| 795 | 5, /* GreenBits */ |
| 796 | 5, /* BlueBits */ |
| 797 | 1, /* AlphaBits */ |
| 798 | 0, /* LuminanceBits */ |
| 799 | 0, /* IntensityBits */ |
| 800 | 0, /* IndexBits */ |
| 801 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 802 | 0, /* StencilBits */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 803 | 2, /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 804 | _mesa_texstore_argb1555, /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 805 | fetch_texel_1d_argb1555, /* FetchTexel1D */ |
| 806 | fetch_texel_2d_argb1555, /* FetchTexel2D */ |
| 807 | fetch_texel_3d_argb1555, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 808 | NULL, /* FetchTexel1Df */ |
| 809 | NULL, /* FetchTexel2Df */ |
| 810 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 811 | store_texel_argb1555 /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 812 | }; |
| 813 | |
Brian Paul | defb035 | 2004-05-13 15:26:51 +0000 | [diff] [blame] | 814 | const struct gl_texture_format _mesa_texformat_argb1555_rev = { |
| 815 | MESA_FORMAT_ARGB1555_REV, /* MesaFormat */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 816 | GL_RGBA, /* BaseFormat */ |
| 817 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
| 818 | 5, /* RedBits */ |
| 819 | 5, /* GreenBits */ |
| 820 | 5, /* BlueBits */ |
| 821 | 1, /* AlphaBits */ |
| 822 | 0, /* LuminanceBits */ |
| 823 | 0, /* IntensityBits */ |
| 824 | 0, /* IndexBits */ |
| 825 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 826 | 0, /* StencilBits */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 827 | 2, /* TexelBytes */ |
Brian Paul | defb035 | 2004-05-13 15:26:51 +0000 | [diff] [blame] | 828 | _mesa_texstore_argb1555, /* StoreTexImageFunc */ |
| 829 | fetch_texel_1d_argb1555_rev, /* FetchTexel1D */ |
| 830 | fetch_texel_2d_argb1555_rev, /* FetchTexel2D */ |
| 831 | fetch_texel_3d_argb1555_rev, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 832 | NULL, /* FetchTexel1Df */ |
| 833 | NULL, /* FetchTexel2Df */ |
| 834 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 835 | store_texel_argb1555_rev /* StoreTexel */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 836 | }; |
| 837 | |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 838 | const struct gl_texture_format _mesa_texformat_al88 = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 839 | MESA_FORMAT_AL88, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 840 | GL_LUMINANCE_ALPHA, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 841 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 842 | 0, /* RedBits */ |
| 843 | 0, /* GreenBits */ |
| 844 | 0, /* BlueBits */ |
| 845 | 8, /* AlphaBits */ |
| 846 | 8, /* LuminanceBits */ |
| 847 | 0, /* IntensityBits */ |
| 848 | 0, /* IndexBits */ |
| 849 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 850 | 0, /* StencilBits */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 851 | 2, /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 852 | _mesa_texstore_al88, /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 853 | fetch_texel_1d_al88, /* FetchTexel1D */ |
| 854 | fetch_texel_2d_al88, /* FetchTexel2D */ |
| 855 | fetch_texel_3d_al88, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 856 | NULL, /* FetchTexel1Df */ |
| 857 | NULL, /* FetchTexel2Df */ |
| 858 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 859 | store_texel_al88 /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 860 | }; |
| 861 | |
Brian Paul | defb035 | 2004-05-13 15:26:51 +0000 | [diff] [blame] | 862 | const struct gl_texture_format _mesa_texformat_al88_rev = { |
| 863 | MESA_FORMAT_AL88_REV, /* MesaFormat */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 864 | GL_LUMINANCE_ALPHA, /* BaseFormat */ |
| 865 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
| 866 | 0, /* RedBits */ |
| 867 | 0, /* GreenBits */ |
| 868 | 0, /* BlueBits */ |
| 869 | 8, /* AlphaBits */ |
| 870 | 8, /* LuminanceBits */ |
| 871 | 0, /* IntensityBits */ |
| 872 | 0, /* IndexBits */ |
| 873 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 874 | 0, /* StencilBits */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 875 | 2, /* TexelBytes */ |
Brian Paul | defb035 | 2004-05-13 15:26:51 +0000 | [diff] [blame] | 876 | _mesa_texstore_al88, /* StoreTexImageFunc */ |
| 877 | fetch_texel_1d_al88_rev, /* FetchTexel1D */ |
| 878 | fetch_texel_2d_al88_rev, /* FetchTexel2D */ |
| 879 | fetch_texel_3d_al88_rev, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 880 | NULL, /* FetchTexel1Df */ |
| 881 | NULL, /* FetchTexel2Df */ |
| 882 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 883 | store_texel_al88_rev /* StoreTexel */ |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 884 | }; |
| 885 | |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 886 | const struct gl_texture_format _mesa_texformat_rgb332 = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 887 | MESA_FORMAT_RGB332, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 888 | GL_RGB, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 889 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 890 | 3, /* RedBits */ |
| 891 | 3, /* GreenBits */ |
| 892 | 2, /* BlueBits */ |
| 893 | 0, /* AlphaBits */ |
| 894 | 0, /* LuminanceBits */ |
| 895 | 0, /* IntensityBits */ |
| 896 | 0, /* IndexBits */ |
| 897 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 898 | 0, /* StencilBits */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 899 | 1, /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 900 | _mesa_texstore_rgb332, /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 901 | fetch_texel_1d_rgb332, /* FetchTexel1D */ |
| 902 | fetch_texel_2d_rgb332, /* FetchTexel2D */ |
| 903 | fetch_texel_3d_rgb332, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 904 | NULL, /* FetchTexel1Df */ |
| 905 | NULL, /* FetchTexel2Df */ |
| 906 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 907 | store_texel_rgb332 /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 908 | }; |
| 909 | |
| 910 | const struct gl_texture_format _mesa_texformat_a8 = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 911 | MESA_FORMAT_A8, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 912 | GL_ALPHA, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 913 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 914 | 0, /* RedBits */ |
| 915 | 0, /* GreenBits */ |
| 916 | 0, /* BlueBits */ |
| 917 | 8, /* AlphaBits */ |
| 918 | 0, /* LuminanceBits */ |
| 919 | 0, /* IntensityBits */ |
| 920 | 0, /* IndexBits */ |
| 921 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 922 | 0, /* StencilBits */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 923 | 1, /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 924 | _mesa_texstore_a8, /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 925 | fetch_texel_1d_a8, /* FetchTexel1D */ |
| 926 | fetch_texel_2d_a8, /* FetchTexel2D */ |
| 927 | fetch_texel_3d_a8, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 928 | NULL, /* FetchTexel1Df */ |
| 929 | NULL, /* FetchTexel2Df */ |
| 930 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 931 | store_texel_a8 /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 932 | }; |
| 933 | |
| 934 | const struct gl_texture_format _mesa_texformat_l8 = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 935 | MESA_FORMAT_L8, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 936 | GL_LUMINANCE, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 937 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 938 | 0, /* RedBits */ |
| 939 | 0, /* GreenBits */ |
| 940 | 0, /* BlueBits */ |
| 941 | 0, /* AlphaBits */ |
| 942 | 8, /* LuminanceBits */ |
| 943 | 0, /* IntensityBits */ |
| 944 | 0, /* IndexBits */ |
| 945 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 946 | 0, /* StencilBits */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 947 | 1, /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 948 | _mesa_texstore_a8,/*yes*/ /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 949 | fetch_texel_1d_l8, /* FetchTexel1D */ |
| 950 | fetch_texel_2d_l8, /* FetchTexel2D */ |
| 951 | fetch_texel_3d_l8, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 952 | NULL, /* FetchTexel1Df */ |
| 953 | NULL, /* FetchTexel2Df */ |
| 954 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 955 | store_texel_l8 /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 956 | }; |
| 957 | |
| 958 | const struct gl_texture_format _mesa_texformat_i8 = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 959 | MESA_FORMAT_I8, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 960 | GL_INTENSITY, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 961 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 962 | 0, /* RedBits */ |
| 963 | 0, /* GreenBits */ |
| 964 | 0, /* BlueBits */ |
| 965 | 0, /* AlphaBits */ |
| 966 | 0, /* LuminanceBits */ |
| 967 | 8, /* IntensityBits */ |
| 968 | 0, /* IndexBits */ |
| 969 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 970 | 0, /* StencilBits */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 971 | 1, /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 972 | _mesa_texstore_a8,/*yes*/ /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 973 | fetch_texel_1d_i8, /* FetchTexel1D */ |
| 974 | fetch_texel_2d_i8, /* FetchTexel2D */ |
| 975 | fetch_texel_3d_i8, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 976 | NULL, /* FetchTexel1Df */ |
| 977 | NULL, /* FetchTexel2Df */ |
| 978 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 979 | store_texel_i8 /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 980 | }; |
| 981 | |
| 982 | const struct gl_texture_format _mesa_texformat_ci8 = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 983 | MESA_FORMAT_CI8, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 984 | GL_COLOR_INDEX, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 985 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 986 | 0, /* RedBits */ |
| 987 | 0, /* GreenBits */ |
| 988 | 0, /* BlueBits */ |
| 989 | 0, /* AlphaBits */ |
| 990 | 0, /* LuminanceBits */ |
| 991 | 0, /* IntensityBits */ |
| 992 | 8, /* IndexBits */ |
| 993 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 994 | 0, /* StencilBits */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 995 | 1, /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 996 | _mesa_texstore_ci8, /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 997 | fetch_texel_1d_ci8, /* FetchTexel1D */ |
| 998 | fetch_texel_2d_ci8, /* FetchTexel2D */ |
| 999 | fetch_texel_3d_ci8, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 1000 | NULL, /* FetchTexel1Df */ |
| 1001 | NULL, /* FetchTexel2Df */ |
| 1002 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 1003 | store_texel_ci8 /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1004 | }; |
| 1005 | |
Brian Paul | c5b9950 | 2002-09-21 16:51:25 +0000 | [diff] [blame] | 1006 | const struct gl_texture_format _mesa_texformat_ycbcr = { |
| 1007 | MESA_FORMAT_YCBCR, /* MesaFormat */ |
| 1008 | GL_YCBCR_MESA, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1009 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Brian Paul | c5b9950 | 2002-09-21 16:51:25 +0000 | [diff] [blame] | 1010 | 0, /* RedBits */ |
| 1011 | 0, /* GreenBits */ |
| 1012 | 0, /* BlueBits */ |
| 1013 | 0, /* AlphaBits */ |
| 1014 | 0, /* LuminanceBits */ |
| 1015 | 0, /* IntensityBits */ |
| 1016 | 0, /* IndexBits */ |
| 1017 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 1018 | 0, /* StencilBits */ |
Brian Paul | c5b9950 | 2002-09-21 16:51:25 +0000 | [diff] [blame] | 1019 | 2, /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1020 | _mesa_texstore_ycbcr, /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 1021 | fetch_texel_1d_ycbcr, /* FetchTexel1D */ |
| 1022 | fetch_texel_2d_ycbcr, /* FetchTexel2D */ |
| 1023 | fetch_texel_3d_ycbcr, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 1024 | NULL, /* FetchTexel1Df */ |
| 1025 | NULL, /* FetchTexel2Df */ |
| 1026 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 1027 | store_texel_ycbcr /* StoreTexel */ |
Brian Paul | c5b9950 | 2002-09-21 16:51:25 +0000 | [diff] [blame] | 1028 | }; |
| 1029 | |
Brian Paul | c5b9950 | 2002-09-21 16:51:25 +0000 | [diff] [blame] | 1030 | const struct gl_texture_format _mesa_texformat_ycbcr_rev = { |
| 1031 | MESA_FORMAT_YCBCR_REV, /* MesaFormat */ |
| 1032 | GL_YCBCR_MESA, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1033 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
Brian Paul | c5b9950 | 2002-09-21 16:51:25 +0000 | [diff] [blame] | 1034 | 0, /* RedBits */ |
| 1035 | 0, /* GreenBits */ |
| 1036 | 0, /* BlueBits */ |
| 1037 | 0, /* AlphaBits */ |
| 1038 | 0, /* LuminanceBits */ |
| 1039 | 0, /* IntensityBits */ |
| 1040 | 0, /* IndexBits */ |
| 1041 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 1042 | 0, /* StencilBits */ |
Brian Paul | c5b9950 | 2002-09-21 16:51:25 +0000 | [diff] [blame] | 1043 | 2, /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1044 | _mesa_texstore_ycbcr, /* StoreTexImageFunc */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 1045 | fetch_texel_1d_ycbcr_rev, /* FetchTexel1D */ |
| 1046 | fetch_texel_2d_ycbcr_rev, /* FetchTexel2D */ |
| 1047 | fetch_texel_3d_ycbcr_rev, /* FetchTexel3D */ |
Brian Paul | 63b5b8e | 2005-09-15 01:55:40 +0000 | [diff] [blame] | 1048 | NULL, /* FetchTexel1Df */ |
| 1049 | NULL, /* FetchTexel2Df */ |
| 1050 | NULL, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 1051 | store_texel_ycbcr_rev /* StoreTexel */ |
Brian Paul | c5b9950 | 2002-09-21 16:51:25 +0000 | [diff] [blame] | 1052 | }; |
| 1053 | |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 1054 | const struct gl_texture_format _mesa_texformat_z24_s8 = { |
| 1055 | MESA_FORMAT_Z24_S8, /* MesaFormat */ |
| 1056 | GL_DEPTH_STENCIL_EXT, /* BaseFormat */ |
| 1057 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
| 1058 | 0, /* RedBits */ |
| 1059 | 0, /* GreenBits */ |
| 1060 | 0, /* BlueBits */ |
| 1061 | 0, /* AlphaBits */ |
| 1062 | 0, /* LuminanceBits */ |
| 1063 | 0, /* IntensityBits */ |
| 1064 | 0, /* IndexBits */ |
| 1065 | 24, /* DepthBits */ |
| 1066 | 8, /* StencilBits */ |
| 1067 | 4, /* TexelBytes */ |
Brian Paul | 2794507 | 2005-10-01 16:09:26 +0000 | [diff] [blame] | 1068 | _mesa_texstore_z24_s8, /* StoreTexImageFunc */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 1069 | NULL, /* FetchTexel1D */ |
| 1070 | NULL, /* FetchTexel2D */ |
| 1071 | NULL, /* FetchTexel3D */ |
| 1072 | fetch_texel_1d_f_z24_s8, /* FetchTexel1Df */ |
| 1073 | fetch_texel_2d_f_z24_s8, /* FetchTexel2Df */ |
| 1074 | fetch_texel_3d_f_z24_s8, /* FetchTexel3Df */ |
| 1075 | store_texel_z24_s8 /* StoreTexel */ |
| 1076 | }; |
| 1077 | |
Brian Paul | a9bcf75 | 2006-04-06 04:23:58 +0000 | [diff] [blame^] | 1078 | const struct gl_texture_format _mesa_texformat_z16 = { |
| 1079 | MESA_FORMAT_Z16, /* MesaFormat */ |
| 1080 | GL_DEPTH_COMPONENT, /* BaseFormat */ |
| 1081 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
| 1082 | 0, /* RedBits */ |
| 1083 | 0, /* GreenBits */ |
| 1084 | 0, /* BlueBits */ |
| 1085 | 0, /* AlphaBits */ |
| 1086 | 0, /* LuminanceBits */ |
| 1087 | 0, /* IntensityBits */ |
| 1088 | 0, /* IndexBits */ |
| 1089 | sizeof(GLushort) * 8, /* DepthBits */ |
| 1090 | 0, /* StencilBits */ |
| 1091 | sizeof(GLushort), /* TexelBytes */ |
| 1092 | _mesa_texstore_z16, /* StoreTexImageFunc */ |
| 1093 | NULL, /* FetchTexel1D */ |
| 1094 | NULL, /* FetchTexel1D */ |
| 1095 | NULL, /* FetchTexel1D */ |
| 1096 | fetch_texel_1d_f_z16, /* FetchTexel1Df */ |
| 1097 | fetch_texel_2d_f_z16, /* FetchTexel2Df */ |
| 1098 | fetch_texel_3d_f_z16, /* FetchTexel3Df */ |
| 1099 | store_texel_z16 /* StoreTexel */ |
| 1100 | }; |
| 1101 | |
| 1102 | const struct gl_texture_format _mesa_texformat_z32 = { |
| 1103 | MESA_FORMAT_Z32, /* MesaFormat */ |
| 1104 | GL_DEPTH_COMPONENT, /* BaseFormat */ |
| 1105 | GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ |
| 1106 | 0, /* RedBits */ |
| 1107 | 0, /* GreenBits */ |
| 1108 | 0, /* BlueBits */ |
| 1109 | 0, /* AlphaBits */ |
| 1110 | 0, /* LuminanceBits */ |
| 1111 | 0, /* IntensityBits */ |
| 1112 | 0, /* IndexBits */ |
| 1113 | sizeof(GLuint) * 8, /* DepthBits */ |
| 1114 | 0, /* StencilBits */ |
| 1115 | sizeof(GLuint), /* TexelBytes */ |
| 1116 | _mesa_texstore_z32, /* StoreTexImageFunc */ |
| 1117 | NULL, /* FetchTexel1D */ |
| 1118 | NULL, /* FetchTexel1D */ |
| 1119 | NULL, /* FetchTexel1D */ |
| 1120 | fetch_texel_1d_f_z32, /* FetchTexel1Df */ |
| 1121 | fetch_texel_2d_f_z32, /* FetchTexel2Df */ |
| 1122 | fetch_texel_3d_f_z32, /* FetchTexel3Df */ |
| 1123 | store_texel_z32 /* StoreTexel */ |
| 1124 | }; |
| 1125 | |
Keith Whitwell | 6dc8557 | 2003-07-17 13:43:59 +0000 | [diff] [blame] | 1126 | /*@}*/ |
| 1127 | |
| 1128 | |
| 1129 | /***************************************************************/ |
| 1130 | /** \name Null format (useful for proxy textures) */ |
| 1131 | /*@{*/ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1132 | |
| 1133 | const struct gl_texture_format _mesa_null_texformat = { |
Gareth Hughes | 38f2866 | 2001-03-28 20:40:51 +0000 | [diff] [blame] | 1134 | -1, /* MesaFormat */ |
Brian Paul | 1c85aa3 | 2001-04-20 16:46:04 +0000 | [diff] [blame] | 1135 | 0, /* BaseFormat */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1136 | GL_NONE, /* DataType */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1137 | 0, /* RedBits */ |
| 1138 | 0, /* GreenBits */ |
| 1139 | 0, /* BlueBits */ |
| 1140 | 0, /* AlphaBits */ |
| 1141 | 0, /* LuminanceBits */ |
| 1142 | 0, /* IntensityBits */ |
| 1143 | 0, /* IndexBits */ |
| 1144 | 0, /* DepthBits */ |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 1145 | 0, /* StencilBits */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1146 | 0, /* TexelBytes */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1147 | NULL, /* StoreTexImageFunc */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1148 | fetch_null_texel, /* FetchTexel1D */ |
| 1149 | fetch_null_texel, /* FetchTexel2D */ |
| 1150 | fetch_null_texel, /* FetchTexel3D */ |
Brian Paul | 4f295ce | 2004-01-23 01:59:54 +0000 | [diff] [blame] | 1151 | fetch_null_texelf, /* FetchTexel1Df */ |
| 1152 | fetch_null_texelf, /* FetchTexel2Df */ |
| 1153 | fetch_null_texelf, /* FetchTexel3Df */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 1154 | store_null_texel /* StoreTexel */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1155 | }; |
| 1156 | |
Keith Whitwell | 6dc8557 | 2003-07-17 13:43:59 +0000 | [diff] [blame] | 1157 | /*@}*/ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1158 | |
Keith Whitwell | 6dc8557 | 2003-07-17 13:43:59 +0000 | [diff] [blame] | 1159 | |
Keith Whitwell | 6dc8557 | 2003-07-17 13:43:59 +0000 | [diff] [blame] | 1160 | /** |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 1161 | * Choose an appropriate texture format given the format, type and |
| 1162 | * internalFormat parameters passed to glTexImage(). |
Keith Whitwell | 6dc8557 | 2003-07-17 13:43:59 +0000 | [diff] [blame] | 1163 | * |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 1164 | * \param ctx the GL context. |
| 1165 | * \param internalFormat user's prefered internal texture format. |
| 1166 | * \param format incoming image pixel format. |
| 1167 | * \param type incoming image data type. |
Keith Whitwell | 6dc8557 | 2003-07-17 13:43:59 +0000 | [diff] [blame] | 1168 | * |
Brian Paul | fe03108 | 2004-01-24 17:02:19 +0000 | [diff] [blame] | 1169 | * \return a pointer to a gl_texture_format object which describes the |
| 1170 | * choosen texture format, or NULL on failure. |
Keith Whitwell | 6dc8557 | 2003-07-17 13:43:59 +0000 | [diff] [blame] | 1171 | * |
| 1172 | * This is called via dd_function_table::ChooseTextureFormat. Hardware drivers |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1173 | * will typically override this function with a specialized version. |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1174 | */ |
Brian Paul | 7d58f44 | 2001-04-04 21:54:20 +0000 | [diff] [blame] | 1175 | const struct gl_texture_format * |
| 1176 | _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, |
| 1177 | GLenum format, GLenum type ) |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1178 | { |
Brian Paul | 7d58f44 | 2001-04-04 21:54:20 +0000 | [diff] [blame] | 1179 | (void) format; |
| 1180 | (void) type; |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1181 | |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1182 | switch (internalFormat) { |
| 1183 | /* RGBA formats */ |
| 1184 | case 4: |
| 1185 | case GL_RGBA: |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1186 | case GL_RGB10_A2: |
| 1187 | case GL_RGBA12: |
| 1188 | case GL_RGBA16: |
| 1189 | return &_mesa_texformat_rgba; |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 1190 | case GL_RGBA8: |
| 1191 | return &_mesa_texformat_rgba8888; |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1192 | case GL_RGB5_A1: |
| 1193 | return &_mesa_texformat_argb1555; |
| 1194 | case GL_RGBA2: |
Brian Paul | defb035 | 2004-05-13 15:26:51 +0000 | [diff] [blame] | 1195 | return &_mesa_texformat_argb4444_rev; /* just to test another format*/ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1196 | case GL_RGBA4: |
| 1197 | return &_mesa_texformat_argb4444; |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1198 | |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1199 | /* RGB formats */ |
| 1200 | case 3: |
| 1201 | case GL_RGB: |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1202 | case GL_RGB10: |
| 1203 | case GL_RGB12: |
| 1204 | case GL_RGB16: |
| 1205 | return &_mesa_texformat_rgb; |
Brian Paul | defb035 | 2004-05-13 15:26:51 +0000 | [diff] [blame] | 1206 | case GL_RGB8: |
| 1207 | return &_mesa_texformat_rgb888; |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1208 | case GL_R3_G3_B2: |
| 1209 | return &_mesa_texformat_rgb332; |
| 1210 | case GL_RGB4: |
Brian Paul | defb035 | 2004-05-13 15:26:51 +0000 | [diff] [blame] | 1211 | return &_mesa_texformat_rgb565_rev; /* just to test another format */ |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1212 | case GL_RGB5: |
| 1213 | return &_mesa_texformat_rgb565; |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1214 | |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1215 | /* Alpha formats */ |
| 1216 | case GL_ALPHA: |
| 1217 | case GL_ALPHA4: |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1218 | case GL_ALPHA12: |
| 1219 | case GL_ALPHA16: |
| 1220 | return &_mesa_texformat_alpha; |
Brian Paul | a156b49 | 2004-05-12 01:50:30 +0000 | [diff] [blame] | 1221 | case GL_ALPHA8: |
| 1222 | return &_mesa_texformat_a8; |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1223 | |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1224 | /* Luminance formats */ |
| 1225 | case 1: |
| 1226 | case GL_LUMINANCE: |
| 1227 | case GL_LUMINANCE4: |
| 1228 | case GL_LUMINANCE12: |
| 1229 | case GL_LUMINANCE16: |
| 1230 | return &_mesa_texformat_luminance; |
| 1231 | case GL_LUMINANCE8: |
| 1232 | return &_mesa_texformat_l8; |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1233 | |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1234 | /* Luminance/Alpha formats */ |
| 1235 | case 2: |
| 1236 | case GL_LUMINANCE_ALPHA: |
| 1237 | case GL_LUMINANCE4_ALPHA4: |
| 1238 | case GL_LUMINANCE6_ALPHA2: |
| 1239 | case GL_LUMINANCE12_ALPHA4: |
| 1240 | case GL_LUMINANCE12_ALPHA12: |
| 1241 | case GL_LUMINANCE16_ALPHA16: |
| 1242 | return &_mesa_texformat_luminance_alpha; |
| 1243 | case GL_LUMINANCE8_ALPHA8: |
| 1244 | return &_mesa_texformat_al88; |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1245 | |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1246 | case GL_INTENSITY: |
| 1247 | case GL_INTENSITY4: |
| 1248 | case GL_INTENSITY12: |
| 1249 | case GL_INTENSITY16: |
| 1250 | return &_mesa_texformat_intensity; |
| 1251 | case GL_INTENSITY8: |
| 1252 | return &_mesa_texformat_i8; |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1253 | |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1254 | case GL_COLOR_INDEX: |
| 1255 | case GL_COLOR_INDEX1_EXT: |
| 1256 | case GL_COLOR_INDEX2_EXT: |
| 1257 | case GL_COLOR_INDEX4_EXT: |
| 1258 | case GL_COLOR_INDEX12_EXT: |
| 1259 | case GL_COLOR_INDEX16_EXT: |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1260 | case GL_COLOR_INDEX8_EXT: |
| 1261 | return &_mesa_texformat_ci8; |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1262 | |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1263 | default: |
| 1264 | ; /* fallthrough */ |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1265 | } |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1266 | |
Brian Paul | 4618a9b | 2005-09-08 15:28:45 +0000 | [diff] [blame] | 1267 | if (ctx->Extensions.SGIX_depth_texture || |
| 1268 | ctx->Extensions.ARB_depth_texture) { |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1269 | switch (internalFormat) { |
| 1270 | case GL_DEPTH_COMPONENT: |
| 1271 | case GL_DEPTH_COMPONENT24_SGIX: |
| 1272 | case GL_DEPTH_COMPONENT32_SGIX: |
Brian Paul | a9bcf75 | 2006-04-06 04:23:58 +0000 | [diff] [blame^] | 1273 | return &_mesa_texformat_z32; |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1274 | case GL_DEPTH_COMPONENT16_SGIX: |
Brian Paul | a9bcf75 | 2006-04-06 04:23:58 +0000 | [diff] [blame^] | 1275 | return &_mesa_texformat_z16; |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1276 | default: |
| 1277 | ; /* fallthrough */ |
| 1278 | } |
| 1279 | } |
| 1280 | |
| 1281 | if (ctx->Extensions.ARB_texture_compression) { |
| 1282 | switch (internalFormat) { |
| 1283 | case GL_COMPRESSED_ALPHA_ARB: |
| 1284 | return &_mesa_texformat_alpha; |
| 1285 | case GL_COMPRESSED_LUMINANCE_ARB: |
| 1286 | return &_mesa_texformat_luminance; |
| 1287 | case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: |
| 1288 | return &_mesa_texformat_luminance_alpha; |
| 1289 | case GL_COMPRESSED_INTENSITY_ARB: |
| 1290 | return &_mesa_texformat_intensity; |
| 1291 | case GL_COMPRESSED_RGB_ARB: |
| 1292 | if (ctx->Extensions.TDFX_texture_compression_FXT1) |
| 1293 | return &_mesa_texformat_rgb_fxt1; |
| 1294 | else if (ctx->Extensions.EXT_texture_compression_s3tc || |
| 1295 | ctx->Extensions.S3_s3tc) |
| 1296 | return &_mesa_texformat_rgb_dxt1; |
| 1297 | else |
| 1298 | return &_mesa_texformat_rgb; |
| 1299 | case GL_COMPRESSED_RGBA_ARB: |
| 1300 | if (ctx->Extensions.TDFX_texture_compression_FXT1) |
| 1301 | return &_mesa_texformat_rgba_fxt1; |
| 1302 | else if (ctx->Extensions.EXT_texture_compression_s3tc || |
| 1303 | ctx->Extensions.S3_s3tc) |
| 1304 | return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1, see spec */ |
| 1305 | else |
| 1306 | return &_mesa_texformat_rgba; |
| 1307 | default: |
| 1308 | ; /* fallthrough */ |
| 1309 | } |
| 1310 | } |
| 1311 | |
| 1312 | if (ctx->Extensions.MESA_ycbcr_texture) { |
| 1313 | if (internalFormat == GL_YCBCR_MESA) { |
| 1314 | if (type == GL_UNSIGNED_SHORT_8_8_MESA) |
| 1315 | return &_mesa_texformat_ycbcr; |
| 1316 | else |
| 1317 | return &_mesa_texformat_ycbcr_rev; |
| 1318 | } |
| 1319 | } |
| 1320 | |
| 1321 | if (ctx->Extensions.TDFX_texture_compression_FXT1) { |
| 1322 | switch (internalFormat) { |
| 1323 | case GL_COMPRESSED_RGB_FXT1_3DFX: |
| 1324 | return &_mesa_texformat_rgb_fxt1; |
| 1325 | case GL_COMPRESSED_RGBA_FXT1_3DFX: |
| 1326 | return &_mesa_texformat_rgba_fxt1; |
| 1327 | default: |
| 1328 | ; /* fallthrough */ |
| 1329 | } |
| 1330 | } |
| 1331 | |
| 1332 | if (ctx->Extensions.EXT_texture_compression_s3tc) { |
| 1333 | switch (internalFormat) { |
| 1334 | case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: |
| 1335 | return &_mesa_texformat_rgb_dxt1; |
| 1336 | case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: |
| 1337 | return &_mesa_texformat_rgba_dxt1; |
| 1338 | case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: |
| 1339 | return &_mesa_texformat_rgba_dxt3; |
| 1340 | case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: |
| 1341 | return &_mesa_texformat_rgba_dxt5; |
| 1342 | default: |
| 1343 | ; /* fallthrough */ |
| 1344 | } |
| 1345 | } |
| 1346 | |
| 1347 | if (ctx->Extensions.S3_s3tc) { |
| 1348 | switch (internalFormat) { |
| 1349 | case GL_RGB_S3TC: |
| 1350 | case GL_RGB4_S3TC: |
| 1351 | return &_mesa_texformat_rgb_dxt1; |
| 1352 | case GL_RGBA_S3TC: |
| 1353 | case GL_RGBA4_S3TC: |
| 1354 | return &_mesa_texformat_rgba_dxt3; |
| 1355 | default: |
| 1356 | ; /* fallthrough */ |
| 1357 | } |
| 1358 | } |
| 1359 | |
| 1360 | if (ctx->Extensions.ARB_texture_float) { |
| 1361 | switch (internalFormat) { |
| 1362 | case GL_ALPHA16F_ARB: |
| 1363 | return &_mesa_texformat_alpha_float16; |
| 1364 | case GL_ALPHA32F_ARB: |
| 1365 | return &_mesa_texformat_alpha_float32; |
| 1366 | case GL_LUMINANCE16F_ARB: |
| 1367 | return &_mesa_texformat_luminance_float16; |
| 1368 | case GL_LUMINANCE32F_ARB: |
| 1369 | return &_mesa_texformat_luminance_float32; |
| 1370 | case GL_LUMINANCE_ALPHA16F_ARB: |
| 1371 | return &_mesa_texformat_luminance_alpha_float16; |
| 1372 | case GL_LUMINANCE_ALPHA32F_ARB: |
| 1373 | return &_mesa_texformat_luminance_alpha_float32; |
| 1374 | case GL_INTENSITY16F_ARB: |
| 1375 | return &_mesa_texformat_intensity_float16; |
| 1376 | case GL_INTENSITY32F_ARB: |
| 1377 | return &_mesa_texformat_intensity_float32; |
| 1378 | case GL_RGB16F_ARB: |
| 1379 | return &_mesa_texformat_rgb_float16; |
| 1380 | case GL_RGB32F_ARB: |
| 1381 | return &_mesa_texformat_rgb_float32; |
| 1382 | case GL_RGBA16F_ARB: |
| 1383 | return &_mesa_texformat_rgba_float16; |
| 1384 | case GL_RGBA32F_ARB: |
| 1385 | return &_mesa_texformat_rgba_float32; |
| 1386 | default: |
| 1387 | ; /* fallthrough */ |
| 1388 | } |
| 1389 | } |
| 1390 | |
Brian Paul | 1ad7b99 | 2005-09-28 02:29:50 +0000 | [diff] [blame] | 1391 | if (ctx->Extensions.EXT_packed_depth_stencil) { |
| 1392 | switch (internalFormat) { |
| 1393 | case GL_DEPTH_STENCIL_EXT: |
| 1394 | case GL_DEPTH24_STENCIL8_EXT: |
| 1395 | return &_mesa_texformat_z24_s8; |
| 1396 | default: |
| 1397 | ; /* fallthrough */ |
| 1398 | } |
| 1399 | } |
| 1400 | |
Brian Paul | f959f6e | 2004-04-22 00:27:31 +0000 | [diff] [blame] | 1401 | _mesa_problem(ctx, "unexpected format in _mesa_choose_tex_format()"); |
| 1402 | return NULL; |
Gareth Hughes | 2c3d34c | 2001-03-18 08:53:49 +0000 | [diff] [blame] | 1403 | } |