2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
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:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
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.
30 * \author Gareth Hughes
36 #include "texformat.h"
41 /* Texel fetch routines for all supported formats
44 #include "texformat_tmp.h"
47 #include "texformat_tmp.h"
50 #include "texformat_tmp.h"
53 * Null texel fetch function.
55 * Have to have this so the FetchTexel function pointer is never NULL.
57 static void fetch_null_texel( const struct gl_texture_image
*texImage
,
58 GLint i
, GLint j
, GLint k
, GLchan
*texel
)
60 (void) texImage
; (void) i
; (void) j
; (void) k
;
65 _mesa_warning(NULL
, "fetch_null_texel() called!");
68 static void fetch_null_texelf( const struct gl_texture_image
*texImage
,
69 GLint i
, GLint j
, GLint k
, GLfloat
*texel
)
71 (void) texImage
; (void) i
; (void) j
; (void) k
;
76 _mesa_warning(NULL
, "fetch_null_texelf() called!");
79 static void store_null_texel(struct gl_texture_image
*texImage
,
80 GLint i
, GLint j
, GLint k
, const void *texel
)
87 * Notes about the predefined gl_texture_formats:
89 * 1. There are 1D, 2D and 3D functions for fetching texels from texture
90 * images, returning both GLchan values and GLfloat values. (six
92 * You don't have to provide both the GLchan and GLfloat functions;
93 * just one or the other is OK. Mesa will use an "adaptor" to convert
94 * between GLchan/GLfloat when needed.
95 * Since the adaptors have small performance penalty, we provide both
96 * GLchan and GLfloat functions for some common formats like RGB, RGBA.
100 /***************************************************************/
101 /** \name Default GLchan-based formats */
104 const struct gl_texture_format _mesa_texformat_rgba
= {
105 MESA_FORMAT_RGBA
, /* MesaFormat */
106 GL_RGBA
, /* BaseFormat */
107 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
108 CHAN_BITS
, /* RedBits */
109 CHAN_BITS
, /* GreenBits */
110 CHAN_BITS
, /* BlueBits */
111 CHAN_BITS
, /* AlphaBits */
112 0, /* LuminanceBits */
113 0, /* IntensityBits */
116 4 * sizeof(GLchan
), /* TexelBytes */
117 _mesa_texstore_rgba
, /* StoreTexImageFunc */
118 fetch_texel_1d_rgba
, /* FetchTexel1D */
119 fetch_texel_2d_rgba
, /* FetchTexel2D */
120 fetch_texel_3d_rgba
, /* FetchTexel3D */
121 fetch_texel_1d_f_rgba
, /* FetchTexel1Df */
122 fetch_texel_2d_f_rgba
, /* FetchTexel2Df */
123 fetch_texel_3d_f_rgba
, /* FetchTexel3Df */
124 store_texel_rgba
/* StoreTexel */
127 const struct gl_texture_format _mesa_texformat_rgb
= {
128 MESA_FORMAT_RGB
, /* MesaFormat */
129 GL_RGB
, /* BaseFormat */
130 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
131 CHAN_BITS
, /* RedBits */
132 CHAN_BITS
, /* GreenBits */
133 CHAN_BITS
, /* BlueBits */
135 0, /* LuminanceBits */
136 0, /* IntensityBits */
139 3 * sizeof(GLchan
), /* TexelBytes */
140 _mesa_texstore_rgba
,/*yes*/ /* StoreTexImageFunc */
141 fetch_texel_1d_rgb
, /* FetchTexel1D */
142 fetch_texel_2d_rgb
, /* FetchTexel2D */
143 fetch_texel_3d_rgb
, /* FetchTexel3D */
144 fetch_texel_1d_f_rgb
, /* FetchTexel1Df */
145 fetch_texel_2d_f_rgb
, /* FetchTexel2Df */
146 fetch_texel_3d_f_rgb
, /* FetchTexel3Df */
147 store_texel_rgb
/* StoreTexel */
150 const struct gl_texture_format _mesa_texformat_alpha
= {
151 MESA_FORMAT_ALPHA
, /* MesaFormat */
152 GL_ALPHA
, /* BaseFormat */
153 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
157 CHAN_BITS
, /* AlphaBits */
158 0, /* LuminanceBits */
159 0, /* IntensityBits */
162 sizeof(GLchan
), /* TexelBytes */
163 _mesa_texstore_rgba
,/*yes*/ /* StoreTexImageFunc */
164 fetch_texel_1d_alpha
, /* FetchTexel1D */
165 fetch_texel_2d_alpha
, /* FetchTexel2D */
166 fetch_texel_3d_alpha
, /* FetchTexel3D */
167 NULL
, /* FetchTexel1Df */
168 NULL
, /* FetchTexel2Df */
169 NULL
, /* FetchTexel3Df */
170 store_texel_alpha
/* StoreTexel */
173 const struct gl_texture_format _mesa_texformat_luminance
= {
174 MESA_FORMAT_LUMINANCE
, /* MesaFormat */
175 GL_LUMINANCE
, /* BaseFormat */
176 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
181 CHAN_BITS
, /* LuminanceBits */
182 0, /* IntensityBits */
185 sizeof(GLchan
), /* TexelBytes */
186 _mesa_texstore_rgba
,/*yes*/ /* StoreTexImageFunc */
187 fetch_texel_1d_luminance
, /* FetchTexel1D */
188 fetch_texel_2d_luminance
, /* FetchTexel2D */
189 fetch_texel_3d_luminance
, /* FetchTexel3D */
190 NULL
, /* FetchTexel1Df */
191 NULL
, /* FetchTexel2Df */
192 NULL
, /* FetchTexel3Df */
193 store_texel_luminance
/* StoreTexel */
196 const struct gl_texture_format _mesa_texformat_luminance_alpha
= {
197 MESA_FORMAT_LUMINANCE_ALPHA
, /* MesaFormat */
198 GL_LUMINANCE_ALPHA
, /* BaseFormat */
199 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
203 CHAN_BITS
, /* AlphaBits */
204 CHAN_BITS
, /* LuminanceBits */
205 0, /* IntensityBits */
208 2 * sizeof(GLchan
), /* TexelBytes */
209 _mesa_texstore_rgba
,/*yes*/ /* StoreTexImageFunc */
210 fetch_texel_1d_luminance_alpha
, /* FetchTexel1D */
211 fetch_texel_2d_luminance_alpha
, /* FetchTexel2D */
212 fetch_texel_3d_luminance_alpha
, /* FetchTexel3D */
213 NULL
, /* FetchTexel1Df */
214 NULL
, /* FetchTexel2Df */
215 NULL
, /* FetchTexel3Df */
216 store_texel_luminance_alpha
/* StoreTexel */
219 const struct gl_texture_format _mesa_texformat_intensity
= {
220 MESA_FORMAT_INTENSITY
, /* MesaFormat */
221 GL_INTENSITY
, /* BaseFormat */
222 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
227 0, /* LuminanceBits */
228 CHAN_BITS
, /* IntensityBits */
231 sizeof(GLchan
), /* TexelBytes */
232 _mesa_texstore_rgba
,/*yes*/ /* StoreTexImageFunc */
233 fetch_texel_1d_intensity
, /* FetchTexel1D */
234 fetch_texel_2d_intensity
, /* FetchTexel2D */
235 fetch_texel_3d_intensity
, /* FetchTexel3D */
236 NULL
, /* FetchTexel1Df */
237 NULL
, /* FetchTexel2Df */
238 NULL
, /* FetchTexel3Df */
239 store_texel_intensity
/* StoreTexel */
242 const struct gl_texture_format _mesa_texformat_depth_component_float32
= {
243 MESA_FORMAT_DEPTH_COMPONENT_FLOAT32
, /* MesaFormat */
244 GL_DEPTH_COMPONENT
, /* BaseFormat */
245 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
250 0, /* LuminanceBits */
251 0, /* IntensityBits */
253 sizeof(GLfloat
) * 8, /* DepthBits */
254 sizeof(GLfloat
), /* TexelBytes */
255 _mesa_texstore_depth_component_float32
,/* StoreTexImageFunc */
256 NULL
, /* FetchTexel1D */
257 NULL
, /* FetchTexel1D */
258 NULL
, /* FetchTexel1D */
259 fetch_texel_1d_f_depth_component_f32
,/* FetchTexel1Df */
260 fetch_texel_2d_f_depth_component_f32
,/* FetchTexel2Df */
261 fetch_texel_3d_f_depth_component_f32
,/* FetchTexel3Df */
262 store_texel_depth_component_f32
/* StoreTexel */
265 const struct gl_texture_format _mesa_texformat_depth_component16
= {
266 MESA_FORMAT_DEPTH_COMPONENT16
, /* MesaFormat */
267 GL_DEPTH_COMPONENT
, /* BaseFormat */
268 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
273 0, /* LuminanceBits */
274 0, /* IntensityBits */
276 sizeof(GLushort
) * 8, /* DepthBits */
277 sizeof(GLushort
), /* TexelBytes */
278 _mesa_texstore_depth_component16
, /* StoreTexImageFunc */
279 NULL
, /* FetchTexel1D */
280 NULL
, /* FetchTexel1D */
281 NULL
, /* FetchTexel1D */
282 fetch_texel_1d_f_depth_component16
, /* FetchTexel1Df */
283 fetch_texel_2d_f_depth_component16
, /* FetchTexel2Df */
284 fetch_texel_3d_f_depth_component16
, /* FetchTexel3Df */
285 store_texel_depth_component16
/* StoreTexel */
288 const struct gl_texture_format _mesa_texformat_rgba_float32
= {
289 MESA_FORMAT_RGBA_FLOAT32
, /* MesaFormat */
290 GL_RGBA
, /* BaseFormat */
291 GL_FLOAT
, /* DataType */
292 8 * sizeof(GLfloat
), /* RedBits */
293 8 * sizeof(GLfloat
), /* GreenBits */
294 8 * sizeof(GLfloat
), /* BlueBits */
295 8 * sizeof(GLfloat
), /* AlphaBits */
296 0, /* LuminanceBits */
297 0, /* IntensityBits */
300 4 * sizeof(GLfloat
), /* TexelBytes */
301 _mesa_texstore_rgba_float32
, /* StoreTexImageFunc */
302 NULL
, /* FetchTexel1D */
303 NULL
, /* FetchTexel1D */
304 NULL
, /* FetchTexel1D */
305 fetch_texel_1d_f_rgba_f32
, /* FetchTexel1Df */
306 fetch_texel_2d_f_rgba_f32
, /* FetchTexel2Df */
307 fetch_texel_3d_f_rgba_f32
, /* FetchTexel3Df */
308 store_texel_rgba_f32
/* StoreTexel */
311 const struct gl_texture_format _mesa_texformat_rgba_float16
= {
312 MESA_FORMAT_RGBA_FLOAT16
, /* MesaFormat */
313 GL_RGBA
, /* BaseFormat */
314 GL_FLOAT
, /* DataType */
315 8 * sizeof(GLhalfARB
), /* RedBits */
316 8 * sizeof(GLhalfARB
), /* GreenBits */
317 8 * sizeof(GLhalfARB
), /* BlueBits */
318 8 * sizeof(GLhalfARB
), /* AlphaBits */
319 0, /* LuminanceBits */
320 0, /* IntensityBits */
323 4 * sizeof(GLhalfARB
), /* TexelBytes */
324 _mesa_texstore_rgba_float16
, /* StoreTexImageFunc */
325 NULL
, /* FetchTexel1D */
326 NULL
, /* FetchTexel1D */
327 NULL
, /* FetchTexel1D */
328 fetch_texel_1d_f_rgba_f16
, /* FetchTexel1Df */
329 fetch_texel_2d_f_rgba_f16
, /* FetchTexel2Df */
330 fetch_texel_3d_f_rgba_f16
, /* FetchTexel3Df */
331 store_texel_rgba_f16
/* StoreTexel */
334 const struct gl_texture_format _mesa_texformat_rgb_float32
= {
335 MESA_FORMAT_RGB_FLOAT32
, /* MesaFormat */
336 GL_RGB
, /* BaseFormat */
337 GL_FLOAT
, /* DataType */
338 8 * sizeof(GLfloat
), /* RedBits */
339 8 * sizeof(GLfloat
), /* GreenBits */
340 8 * sizeof(GLfloat
), /* BlueBits */
342 0, /* LuminanceBits */
343 0, /* IntensityBits */
346 3 * sizeof(GLfloat
), /* TexelBytes */
347 _mesa_texstore_rgba_float32
,/*yes*/ /* StoreTexImageFunc */
348 NULL
, /* FetchTexel1D */
349 NULL
, /* FetchTexel1D */
350 NULL
, /* FetchTexel1D */
351 fetch_texel_1d_f_rgb_f32
, /* FetchTexel1Df */
352 fetch_texel_2d_f_rgb_f32
, /* FetchTexel2Df */
353 fetch_texel_3d_f_rgb_f32
, /* FetchTexel3Df */
354 store_texel_rgb_f32
/* StoreTexel */
357 const struct gl_texture_format _mesa_texformat_rgb_float16
= {
358 MESA_FORMAT_RGB_FLOAT16
, /* MesaFormat */
359 GL_RGB
, /* BaseFormat */
360 GL_FLOAT
, /* DataType */
361 8 * sizeof(GLhalfARB
), /* RedBits */
362 8 * sizeof(GLhalfARB
), /* GreenBits */
363 8 * sizeof(GLhalfARB
), /* BlueBits */
365 0, /* LuminanceBits */
366 0, /* IntensityBits */
369 3 * sizeof(GLhalfARB
), /* TexelBytes */
370 _mesa_texstore_rgba_float16
,/*yes*/ /* StoreTexImageFunc */
371 NULL
, /* FetchTexel1D */
372 NULL
, /* FetchTexel1D */
373 NULL
, /* FetchTexel1D */
374 fetch_texel_1d_f_rgb_f16
, /* FetchTexel1Df */
375 fetch_texel_2d_f_rgb_f16
, /* FetchTexel2Df */
376 fetch_texel_3d_f_rgb_f16
, /* FetchTexel3Df */
377 store_texel_rgb_f16
/* StoreTexel */
380 const struct gl_texture_format _mesa_texformat_alpha_float32
= {
381 MESA_FORMAT_ALPHA_FLOAT32
, /* MesaFormat */
382 GL_ALPHA
, /* BaseFormat */
383 GL_FLOAT
, /* DataType */
387 8 * sizeof(GLfloat
), /* AlphaBits */
388 0, /* LuminanceBits */
389 0, /* IntensityBits */
392 1 * sizeof(GLfloat
), /* TexelBytes */
393 _mesa_texstore_rgba_float32
,/*yes*/ /* StoreTexImageFunc */
394 NULL
, /* FetchTexel1D */
395 NULL
, /* FetchTexel1D */
396 NULL
, /* FetchTexel1D */
397 fetch_texel_1d_f_alpha_f32
, /* FetchTexel1Df */
398 fetch_texel_2d_f_alpha_f32
, /* FetchTexel2Df */
399 fetch_texel_3d_f_alpha_f32
, /* FetchTexel3Df */
400 store_texel_alpha_f32
/* StoreTexel */
403 const struct gl_texture_format _mesa_texformat_alpha_float16
= {
404 MESA_FORMAT_ALPHA_FLOAT16
, /* MesaFormat */
405 GL_ALPHA
, /* BaseFormat */
406 GL_FLOAT
, /* DataType */
410 8 * sizeof(GLhalfARB
), /* AlphaBits */
411 0, /* LuminanceBits */
412 0, /* IntensityBits */
415 1 * sizeof(GLhalfARB
), /* TexelBytes */
416 _mesa_texstore_rgba_float16
,/*yes*/ /* StoreTexImageFunc */
417 NULL
, /* FetchTexel1D */
418 NULL
, /* FetchTexel1D */
419 NULL
, /* FetchTexel1D */
420 fetch_texel_1d_f_alpha_f16
, /* FetchTexel1Df */
421 fetch_texel_2d_f_alpha_f16
, /* FetchTexel2Df */
422 fetch_texel_3d_f_alpha_f16
, /* FetchTexel3Df */
423 store_texel_alpha_f16
/* StoreTexel */
426 const struct gl_texture_format _mesa_texformat_luminance_float32
= {
427 MESA_FORMAT_LUMINANCE_FLOAT32
, /* MesaFormat */
428 GL_LUMINANCE
, /* BaseFormat */
429 GL_FLOAT
, /* DataType */
434 8 * sizeof(GLfloat
), /* LuminanceBits */
435 0, /* IntensityBits */
438 1 * sizeof(GLfloat
), /* TexelBytes */
439 _mesa_texstore_rgba_float32
,/*yes*/ /* StoreTexImageFunc */
440 NULL
, /* FetchTexel1D */
441 NULL
, /* FetchTexel2D */
442 NULL
, /* FetchTexel3D */
443 fetch_texel_1d_f_luminance_f32
, /* FetchTexel1Df */
444 fetch_texel_2d_f_luminance_f32
, /* FetchTexel2Df */
445 fetch_texel_3d_f_luminance_f32
, /* FetchTexel3Df */
446 store_texel_luminance_f32
/* StoreTexel */
449 const struct gl_texture_format _mesa_texformat_luminance_float16
= {
450 MESA_FORMAT_LUMINANCE_FLOAT16
, /* MesaFormat */
451 GL_LUMINANCE
, /* BaseFormat */
452 GL_FLOAT
, /* DataType */
457 8 * sizeof(GLhalfARB
), /* LuminanceBits */
458 0, /* IntensityBits */
461 1 * sizeof(GLhalfARB
), /* TexelBytes */
462 _mesa_texstore_rgba_float16
,/*yes*/ /* StoreTexImageFunc */
463 NULL
, /* FetchTexel1D */
464 NULL
, /* FetchTexel2D */
465 NULL
, /* FetchTexel3D */
466 fetch_texel_1d_f_luminance_f16
, /* FetchTexel1Df */
467 fetch_texel_2d_f_luminance_f16
, /* FetchTexel2Df */
468 fetch_texel_3d_f_luminance_f16
, /* FetchTexel3Df */
469 store_texel_luminance_f16
/* StoreTexel */
472 const struct gl_texture_format _mesa_texformat_luminance_alpha_float32
= {
473 MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32
, /* MesaFormat */
474 GL_LUMINANCE_ALPHA
, /* BaseFormat */
475 GL_FLOAT
, /* DataType */
479 8 * sizeof(GLfloat
), /* AlphaBits */
480 8 * sizeof(GLfloat
), /* LuminanceBits */
481 0, /* IntensityBits */
484 2 * sizeof(GLfloat
), /* TexelBytes */
485 _mesa_texstore_rgba_float32
, /* StoreTexImageFunc */
486 NULL
, /* FetchTexel1D */
487 NULL
, /* FetchTexel2D */
488 NULL
, /* FetchTexel3D */
489 fetch_texel_1d_f_luminance_alpha_f32
,/* FetchTexel1Df */
490 fetch_texel_2d_f_luminance_alpha_f32
,/* FetchTexel2Df */
491 fetch_texel_3d_f_luminance_alpha_f32
,/* FetchTexel3Df */
492 store_texel_luminance_alpha_f32
/* StoreTexel */
495 const struct gl_texture_format _mesa_texformat_luminance_alpha_float16
= {
496 MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16
, /* MesaFormat */
497 GL_LUMINANCE_ALPHA
, /* BaseFormat */
498 GL_FLOAT
, /* DataType */
502 8 * sizeof(GLhalfARB
), /* AlphaBits */
503 8 * sizeof(GLhalfARB
), /* LuminanceBits */
504 0, /* IntensityBits */
507 2 * sizeof(GLhalfARB
), /* TexelBytes */
508 _mesa_texstore_rgba_float16
, /* StoreTexImageFunc */
509 NULL
, /* FetchTexel1D */
510 NULL
, /* FetchTexel2D */
511 NULL
, /* FetchTexel3D */
512 fetch_texel_1d_f_luminance_alpha_f16
,/* FetchTexel1Df */
513 fetch_texel_2d_f_luminance_alpha_f16
,/* FetchTexel2Df */
514 fetch_texel_3d_f_luminance_alpha_f16
,/* FetchTexel3Df */
515 store_texel_luminance_alpha_f16
/* StoreTexel */
518 const struct gl_texture_format _mesa_texformat_intensity_float32
= {
519 MESA_FORMAT_INTENSITY_FLOAT32
, /* MesaFormat */
520 GL_INTENSITY
, /* BaseFormat */
521 GL_FLOAT
, /* DataType */
526 0, /* LuminanceBits */
527 8 * sizeof(GLfloat
), /* IntensityBits */
530 1 * sizeof(GLfloat
), /* TexelBytes */
531 _mesa_texstore_rgba_float32
,/*yes*/ /* StoreTexImageFunc */
532 NULL
, /* FetchTexel1D */
533 NULL
, /* FetchTexel2D */
534 NULL
, /* FetchTexel3D */
535 fetch_texel_1d_f_intensity_f32
, /* FetchTexel1Df */
536 fetch_texel_2d_f_intensity_f32
, /* FetchTexel2Df */
537 fetch_texel_3d_f_intensity_f32
, /* FetchTexel3Df */
538 store_texel_intensity_f32
/* StoreTexel */
541 const struct gl_texture_format _mesa_texformat_intensity_float16
= {
542 MESA_FORMAT_INTENSITY_FLOAT16
, /* MesaFormat */
543 GL_INTENSITY
, /* BaseFormat */
544 GL_FLOAT
, /* DataType */
549 0, /* LuminanceBits */
550 8 * sizeof(GLhalfARB
), /* IntensityBits */
553 1 * sizeof(GLhalfARB
), /* TexelBytes */
554 _mesa_texstore_rgba_float16
,/*yes*/ /* StoreTexImageFunc */
555 NULL
, /* FetchTexel1D */
556 NULL
, /* FetchTexel2D */
557 NULL
, /* FetchTexel3D */
558 fetch_texel_1d_f_intensity_f16
, /* FetchTexel1Df */
559 fetch_texel_2d_f_intensity_f16
, /* FetchTexel2Df */
560 fetch_texel_3d_f_intensity_f16
, /* FetchTexel3Df */
561 store_texel_intensity_f16
/* StoreTexel */
568 /***************************************************************/
569 /** \name Hardware formats */
572 const struct gl_texture_format _mesa_texformat_rgba8888
= {
573 MESA_FORMAT_RGBA8888
, /* MesaFormat */
574 GL_RGBA
, /* BaseFormat */
575 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
580 0, /* LuminanceBits */
581 0, /* IntensityBits */
585 _mesa_texstore_rgba8888
, /* StoreTexImageFunc */
586 fetch_texel_1d_rgba8888
, /* FetchTexel1D */
587 fetch_texel_2d_rgba8888
, /* FetchTexel2D */
588 fetch_texel_3d_rgba8888
, /* FetchTexel3D */
589 NULL
, /* FetchTexel1Df */
590 NULL
, /* FetchTexel2Df */
591 NULL
, /* FetchTexel3Df */
592 store_texel_rgba8888
/* StoreTexel */
595 const struct gl_texture_format _mesa_texformat_rgba8888_rev
= {
596 MESA_FORMAT_RGBA8888_REV
, /* MesaFormat */
597 GL_RGBA
, /* BaseFormat */
598 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
603 0, /* LuminanceBits */
604 0, /* IntensityBits */
608 _mesa_texstore_rgba8888
, /* StoreTexImageFunc */
609 fetch_texel_1d_rgba8888_rev
, /* FetchTexel1D */
610 fetch_texel_2d_rgba8888_rev
, /* FetchTexel2D */
611 fetch_texel_3d_rgba8888_rev
, /* FetchTexel3D */
612 NULL
, /* FetchTexel1Df */
613 NULL
, /* FetchTexel2Df */
614 NULL
, /* FetchTexel3Df */
615 store_texel_rgba8888_rev
/* StoreTexel */
618 const struct gl_texture_format _mesa_texformat_argb8888
= {
619 MESA_FORMAT_ARGB8888
, /* MesaFormat */
620 GL_RGBA
, /* BaseFormat */
621 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
626 0, /* LuminanceBits */
627 0, /* IntensityBits */
631 _mesa_texstore_argb8888
, /* StoreTexImageFunc */
632 fetch_texel_1d_argb8888
, /* FetchTexel1D */
633 fetch_texel_2d_argb8888
, /* FetchTexel2D */
634 fetch_texel_3d_argb8888
, /* FetchTexel3D */
635 NULL
, /* FetchTexel1Df */
636 NULL
, /* FetchTexel2Df */
637 NULL
, /* FetchTexel3Df */
638 store_texel_argb8888
/* StoreTexel */
641 const struct gl_texture_format _mesa_texformat_argb8888_rev
= {
642 MESA_FORMAT_ARGB8888_REV
, /* MesaFormat */
643 GL_RGBA
, /* BaseFormat */
644 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
649 0, /* LuminanceBits */
650 0, /* IntensityBits */
654 _mesa_texstore_argb8888
, /* StoreTexImageFunc */
655 fetch_texel_1d_argb8888_rev
, /* FetchTexel1D */
656 fetch_texel_2d_argb8888_rev
, /* FetchTexel2D */
657 fetch_texel_3d_argb8888_rev
, /* FetchTexel3D */
658 NULL
, /* FetchTexel1Df */
659 NULL
, /* FetchTexel2Df */
660 NULL
, /* FetchTexel3Df */
661 store_texel_argb8888_rev
/* StoreTexel */
664 const struct gl_texture_format _mesa_texformat_rgb888
= {
665 MESA_FORMAT_RGB888
, /* MesaFormat */
666 GL_RGB
, /* BaseFormat */
667 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
672 0, /* LuminanceBits */
673 0, /* IntensityBits */
677 _mesa_texstore_rgb888
, /* StoreTexImageFunc */
678 fetch_texel_1d_rgb888
, /* FetchTexel1D */
679 fetch_texel_2d_rgb888
, /* FetchTexel2D */
680 fetch_texel_3d_rgb888
, /* FetchTexel3D */
681 NULL
, /* FetchTexel1Df */
682 NULL
, /* FetchTexel2Df */
683 NULL
, /* FetchTexel3Df */
684 store_texel_rgb888
/* StoreTexel */
687 const struct gl_texture_format _mesa_texformat_bgr888
= {
688 MESA_FORMAT_BGR888
, /* MesaFormat */
689 GL_RGB
, /* BaseFormat */
690 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
695 0, /* LuminanceBits */
696 0, /* IntensityBits */
700 _mesa_texstore_bgr888
, /* StoreTexImageFunc */
701 fetch_texel_1d_bgr888
, /* FetchTexel1D */
702 fetch_texel_2d_bgr888
, /* FetchTexel2D */
703 fetch_texel_3d_bgr888
, /* FetchTexel3D */
704 NULL
, /* FetchTexel1Df */
705 NULL
, /* FetchTexel2Df */
706 NULL
, /* FetchTexel3Df */
707 store_texel_bgr888
/* StoreTexel */
710 const struct gl_texture_format _mesa_texformat_rgb565
= {
711 MESA_FORMAT_RGB565
, /* MesaFormat */
712 GL_RGB
, /* BaseFormat */
713 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
718 0, /* LuminanceBits */
719 0, /* IntensityBits */
723 _mesa_texstore_rgb565
, /* StoreTexImageFunc */
724 fetch_texel_1d_rgb565
, /* FetchTexel1D */
725 fetch_texel_2d_rgb565
, /* FetchTexel2D */
726 fetch_texel_3d_rgb565
, /* FetchTexel3D */
727 NULL
, /* FetchTexel1Df */
728 NULL
, /* FetchTexel2Df */
729 NULL
, /* FetchTexel3Df */
730 store_texel_rgb565
/* StoreTexel */
733 const struct gl_texture_format _mesa_texformat_rgb565_rev
= {
734 MESA_FORMAT_RGB565_REV
, /* MesaFormat */
735 GL_RGB
, /* BaseFormat */
736 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
741 0, /* LuminanceBits */
742 0, /* IntensityBits */
746 _mesa_texstore_rgb565
, /* StoreTexImageFunc */
747 fetch_texel_1d_rgb565_rev
, /* FetchTexel1D */
748 fetch_texel_2d_rgb565_rev
, /* FetchTexel2D */
749 fetch_texel_3d_rgb565_rev
, /* FetchTexel3D */
750 NULL
, /* FetchTexel1Df */
751 NULL
, /* FetchTexel2Df */
752 NULL
, /* FetchTexel3Df */
753 store_texel_rgb565_rev
/* StoreTexel */
756 const struct gl_texture_format _mesa_texformat_argb4444
= {
757 MESA_FORMAT_ARGB4444
, /* MesaFormat */
758 GL_RGBA
, /* BaseFormat */
759 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
764 0, /* LuminanceBits */
765 0, /* IntensityBits */
769 _mesa_texstore_argb4444
, /* StoreTexImageFunc */
770 fetch_texel_1d_argb4444
, /* FetchTexel1D */
771 fetch_texel_2d_argb4444
, /* FetchTexel2D */
772 fetch_texel_3d_argb4444
, /* FetchTexel3D */
773 NULL
, /* FetchTexel1Df */
774 NULL
, /* FetchTexel2Df */
775 NULL
, /* FetchTexel3Df */
776 store_texel_argb4444
/* StoreTexel */
779 const struct gl_texture_format _mesa_texformat_argb4444_rev
= {
780 MESA_FORMAT_ARGB4444_REV
, /* MesaFormat */
781 GL_RGBA
, /* BaseFormat */
782 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
787 0, /* LuminanceBits */
788 0, /* IntensityBits */
792 _mesa_texstore_argb4444
, /* StoreTexImageFunc */
793 fetch_texel_1d_argb4444_rev
, /* FetchTexel1D */
794 fetch_texel_2d_argb4444_rev
, /* FetchTexel2D */
795 fetch_texel_3d_argb4444_rev
, /* FetchTexel3D */
796 NULL
, /* FetchTexel1Df */
797 NULL
, /* FetchTexel2Df */
798 NULL
, /* FetchTexel3Df */
799 store_texel_argb4444_rev
/* StoreTexel */
802 const struct gl_texture_format _mesa_texformat_argb1555
= {
803 MESA_FORMAT_ARGB1555
, /* MesaFormat */
804 GL_RGBA
, /* BaseFormat */
805 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
810 0, /* LuminanceBits */
811 0, /* IntensityBits */
815 _mesa_texstore_argb1555
, /* StoreTexImageFunc */
816 fetch_texel_1d_argb1555
, /* FetchTexel1D */
817 fetch_texel_2d_argb1555
, /* FetchTexel2D */
818 fetch_texel_3d_argb1555
, /* FetchTexel3D */
819 NULL
, /* FetchTexel1Df */
820 NULL
, /* FetchTexel2Df */
821 NULL
, /* FetchTexel3Df */
822 store_texel_argb1555
/* StoreTexel */
825 const struct gl_texture_format _mesa_texformat_argb1555_rev
= {
826 MESA_FORMAT_ARGB1555_REV
, /* MesaFormat */
827 GL_RGBA
, /* BaseFormat */
828 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
833 0, /* LuminanceBits */
834 0, /* IntensityBits */
838 _mesa_texstore_argb1555
, /* StoreTexImageFunc */
839 fetch_texel_1d_argb1555_rev
, /* FetchTexel1D */
840 fetch_texel_2d_argb1555_rev
, /* FetchTexel2D */
841 fetch_texel_3d_argb1555_rev
, /* FetchTexel3D */
842 NULL
, /* FetchTexel1Df */
843 NULL
, /* FetchTexel2Df */
844 NULL
, /* FetchTexel3Df */
845 store_texel_argb1555_rev
/* StoreTexel */
848 const struct gl_texture_format _mesa_texformat_al88
= {
849 MESA_FORMAT_AL88
, /* MesaFormat */
850 GL_LUMINANCE_ALPHA
, /* BaseFormat */
851 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
856 8, /* LuminanceBits */
857 0, /* IntensityBits */
861 _mesa_texstore_al88
, /* StoreTexImageFunc */
862 fetch_texel_1d_al88
, /* FetchTexel1D */
863 fetch_texel_2d_al88
, /* FetchTexel2D */
864 fetch_texel_3d_al88
, /* FetchTexel3D */
865 NULL
, /* FetchTexel1Df */
866 NULL
, /* FetchTexel2Df */
867 NULL
, /* FetchTexel3Df */
868 store_texel_al88
/* StoreTexel */
871 const struct gl_texture_format _mesa_texformat_al88_rev
= {
872 MESA_FORMAT_AL88_REV
, /* MesaFormat */
873 GL_LUMINANCE_ALPHA
, /* BaseFormat */
874 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
879 8, /* LuminanceBits */
880 0, /* IntensityBits */
884 _mesa_texstore_al88
, /* StoreTexImageFunc */
885 fetch_texel_1d_al88_rev
, /* FetchTexel1D */
886 fetch_texel_2d_al88_rev
, /* FetchTexel2D */
887 fetch_texel_3d_al88_rev
, /* FetchTexel3D */
888 NULL
, /* FetchTexel1Df */
889 NULL
, /* FetchTexel2Df */
890 NULL
, /* FetchTexel3Df */
891 store_texel_al88_rev
/* StoreTexel */
894 const struct gl_texture_format _mesa_texformat_rgb332
= {
895 MESA_FORMAT_RGB332
, /* MesaFormat */
896 GL_RGB
, /* BaseFormat */
897 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
902 0, /* LuminanceBits */
903 0, /* IntensityBits */
907 _mesa_texstore_rgb332
, /* StoreTexImageFunc */
908 fetch_texel_1d_rgb332
, /* FetchTexel1D */
909 fetch_texel_2d_rgb332
, /* FetchTexel2D */
910 fetch_texel_3d_rgb332
, /* FetchTexel3D */
911 NULL
, /* FetchTexel1Df */
912 NULL
, /* FetchTexel2Df */
913 NULL
, /* FetchTexel3Df */
914 store_texel_rgb332
/* StoreTexel */
917 const struct gl_texture_format _mesa_texformat_a8
= {
918 MESA_FORMAT_A8
, /* MesaFormat */
919 GL_ALPHA
, /* BaseFormat */
920 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
925 0, /* LuminanceBits */
926 0, /* IntensityBits */
930 _mesa_texstore_a8
, /* StoreTexImageFunc */
931 fetch_texel_1d_a8
, /* FetchTexel1D */
932 fetch_texel_2d_a8
, /* FetchTexel2D */
933 fetch_texel_3d_a8
, /* FetchTexel3D */
934 NULL
, /* FetchTexel1Df */
935 NULL
, /* FetchTexel2Df */
936 NULL
, /* FetchTexel3Df */
937 store_texel_a8
/* StoreTexel */
940 const struct gl_texture_format _mesa_texformat_l8
= {
941 MESA_FORMAT_L8
, /* MesaFormat */
942 GL_LUMINANCE
, /* BaseFormat */
943 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
948 8, /* LuminanceBits */
949 0, /* IntensityBits */
953 _mesa_texstore_a8
,/*yes*/ /* StoreTexImageFunc */
954 fetch_texel_1d_l8
, /* FetchTexel1D */
955 fetch_texel_2d_l8
, /* FetchTexel2D */
956 fetch_texel_3d_l8
, /* FetchTexel3D */
957 NULL
, /* FetchTexel1Df */
958 NULL
, /* FetchTexel2Df */
959 NULL
, /* FetchTexel3Df */
960 store_texel_l8
/* StoreTexel */
963 const struct gl_texture_format _mesa_texformat_i8
= {
964 MESA_FORMAT_I8
, /* MesaFormat */
965 GL_INTENSITY
, /* BaseFormat */
966 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
971 0, /* LuminanceBits */
972 8, /* IntensityBits */
976 _mesa_texstore_a8
,/*yes*/ /* StoreTexImageFunc */
977 fetch_texel_1d_i8
, /* FetchTexel1D */
978 fetch_texel_2d_i8
, /* FetchTexel2D */
979 fetch_texel_3d_i8
, /* FetchTexel3D */
980 NULL
, /* FetchTexel1Df */
981 NULL
, /* FetchTexel2Df */
982 NULL
, /* FetchTexel3Df */
983 store_texel_i8
/* StoreTexel */
986 const struct gl_texture_format _mesa_texformat_ci8
= {
987 MESA_FORMAT_CI8
, /* MesaFormat */
988 GL_COLOR_INDEX
, /* BaseFormat */
989 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
994 0, /* LuminanceBits */
995 0, /* IntensityBits */
999 _mesa_texstore_ci8
, /* StoreTexImageFunc */
1000 fetch_texel_1d_ci8
, /* FetchTexel1D */
1001 fetch_texel_2d_ci8
, /* FetchTexel2D */
1002 fetch_texel_3d_ci8
, /* FetchTexel3D */
1003 NULL
, /* FetchTexel1Df */
1004 NULL
, /* FetchTexel2Df */
1005 NULL
, /* FetchTexel3Df */
1006 store_texel_ci8
/* StoreTexel */
1009 const struct gl_texture_format _mesa_texformat_ycbcr
= {
1010 MESA_FORMAT_YCBCR
, /* MesaFormat */
1011 GL_YCBCR_MESA
, /* BaseFormat */
1012 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
1017 0, /* LuminanceBits */
1018 0, /* IntensityBits */
1022 _mesa_texstore_ycbcr
, /* StoreTexImageFunc */
1023 fetch_texel_1d_ycbcr
, /* FetchTexel1D */
1024 fetch_texel_2d_ycbcr
, /* FetchTexel2D */
1025 fetch_texel_3d_ycbcr
, /* FetchTexel3D */
1026 NULL
, /* FetchTexel1Df */
1027 NULL
, /* FetchTexel2Df */
1028 NULL
, /* FetchTexel3Df */
1029 store_texel_ycbcr
/* StoreTexel */
1032 const struct gl_texture_format _mesa_texformat_ycbcr_rev
= {
1033 MESA_FORMAT_YCBCR_REV
, /* MesaFormat */
1034 GL_YCBCR_MESA
, /* BaseFormat */
1035 GL_UNSIGNED_NORMALIZED_ARB
, /* DataType */
1040 0, /* LuminanceBits */
1041 0, /* IntensityBits */
1045 _mesa_texstore_ycbcr
, /* StoreTexImageFunc */
1046 fetch_texel_1d_ycbcr_rev
, /* FetchTexel1D */
1047 fetch_texel_2d_ycbcr_rev
, /* FetchTexel2D */
1048 fetch_texel_3d_ycbcr_rev
, /* FetchTexel3D */
1049 NULL
, /* FetchTexel1Df */
1050 NULL
, /* FetchTexel2Df */
1051 NULL
, /* FetchTexel3Df */
1052 store_texel_ycbcr_rev
/* StoreTexel */
1058 /***************************************************************/
1059 /** \name Null format (useful for proxy textures) */
1062 const struct gl_texture_format _mesa_null_texformat
= {
1063 -1, /* MesaFormat */
1065 GL_NONE
, /* DataType */
1070 0, /* LuminanceBits */
1071 0, /* IntensityBits */
1075 NULL
, /* StoreTexImageFunc */
1076 fetch_null_texel
, /* FetchTexel1D */
1077 fetch_null_texel
, /* FetchTexel2D */
1078 fetch_null_texel
, /* FetchTexel3D */
1079 fetch_null_texelf
, /* FetchTexel1Df */
1080 fetch_null_texelf
, /* FetchTexel2Df */
1081 fetch_null_texelf
, /* FetchTexel3Df */
1082 store_null_texel
/* StoreTexel */
1089 * Choose an appropriate texture format given the format, type and
1090 * internalFormat parameters passed to glTexImage().
1092 * \param ctx the GL context.
1093 * \param internalFormat user's prefered internal texture format.
1094 * \param format incoming image pixel format.
1095 * \param type incoming image data type.
1097 * \return a pointer to a gl_texture_format object which describes the
1098 * choosen texture format, or NULL on failure.
1100 * This is called via dd_function_table::ChooseTextureFormat. Hardware drivers
1101 * will typically override this function with a specialized version.
1103 const struct gl_texture_format
*
1104 _mesa_choose_tex_format( GLcontext
*ctx
, GLint internalFormat
,
1105 GLenum format
, GLenum type
)
1110 switch (internalFormat
) {
1117 return &_mesa_texformat_rgba
;
1119 return &_mesa_texformat_rgba8888
;
1121 return &_mesa_texformat_argb1555
;
1123 return &_mesa_texformat_argb4444_rev
; /* just to test another format*/
1125 return &_mesa_texformat_argb4444
;
1133 return &_mesa_texformat_rgb
;
1135 return &_mesa_texformat_rgb888
;
1137 return &_mesa_texformat_rgb332
;
1139 return &_mesa_texformat_rgb565_rev
; /* just to test another format */
1141 return &_mesa_texformat_rgb565
;
1148 return &_mesa_texformat_alpha
;
1150 return &_mesa_texformat_a8
;
1152 /* Luminance formats */
1156 case GL_LUMINANCE12
:
1157 case GL_LUMINANCE16
:
1158 return &_mesa_texformat_luminance
;
1160 return &_mesa_texformat_l8
;
1162 /* Luminance/Alpha formats */
1164 case GL_LUMINANCE_ALPHA
:
1165 case GL_LUMINANCE4_ALPHA4
:
1166 case GL_LUMINANCE6_ALPHA2
:
1167 case GL_LUMINANCE12_ALPHA4
:
1168 case GL_LUMINANCE12_ALPHA12
:
1169 case GL_LUMINANCE16_ALPHA16
:
1170 return &_mesa_texformat_luminance_alpha
;
1171 case GL_LUMINANCE8_ALPHA8
:
1172 return &_mesa_texformat_al88
;
1176 case GL_INTENSITY12
:
1177 case GL_INTENSITY16
:
1178 return &_mesa_texformat_intensity
;
1180 return &_mesa_texformat_i8
;
1182 case GL_COLOR_INDEX
:
1183 case GL_COLOR_INDEX1_EXT
:
1184 case GL_COLOR_INDEX2_EXT
:
1185 case GL_COLOR_INDEX4_EXT
:
1186 case GL_COLOR_INDEX12_EXT
:
1187 case GL_COLOR_INDEX16_EXT
:
1188 case GL_COLOR_INDEX8_EXT
:
1189 return &_mesa_texformat_ci8
;
1195 if (ctx
->Extensions
.SGIX_depth_texture
||
1196 ctx
->Extensions
.ARB_depth_texture
) {
1197 switch (internalFormat
) {
1198 case GL_DEPTH_COMPONENT
:
1199 case GL_DEPTH_COMPONENT24_SGIX
:
1200 case GL_DEPTH_COMPONENT32_SGIX
:
1201 return &_mesa_texformat_depth_component_float32
;
1202 case GL_DEPTH_COMPONENT16_SGIX
:
1203 return &_mesa_texformat_depth_component16
;
1209 if (ctx
->Extensions
.ARB_texture_compression
) {
1210 switch (internalFormat
) {
1211 case GL_COMPRESSED_ALPHA_ARB
:
1212 return &_mesa_texformat_alpha
;
1213 case GL_COMPRESSED_LUMINANCE_ARB
:
1214 return &_mesa_texformat_luminance
;
1215 case GL_COMPRESSED_LUMINANCE_ALPHA_ARB
:
1216 return &_mesa_texformat_luminance_alpha
;
1217 case GL_COMPRESSED_INTENSITY_ARB
:
1218 return &_mesa_texformat_intensity
;
1219 case GL_COMPRESSED_RGB_ARB
:
1220 if (ctx
->Extensions
.TDFX_texture_compression_FXT1
)
1221 return &_mesa_texformat_rgb_fxt1
;
1222 else if (ctx
->Extensions
.EXT_texture_compression_s3tc
||
1223 ctx
->Extensions
.S3_s3tc
)
1224 return &_mesa_texformat_rgb_dxt1
;
1226 return &_mesa_texformat_rgb
;
1227 case GL_COMPRESSED_RGBA_ARB
:
1228 if (ctx
->Extensions
.TDFX_texture_compression_FXT1
)
1229 return &_mesa_texformat_rgba_fxt1
;
1230 else if (ctx
->Extensions
.EXT_texture_compression_s3tc
||
1231 ctx
->Extensions
.S3_s3tc
)
1232 return &_mesa_texformat_rgba_dxt3
; /* Not rgba_dxt1, see spec */
1234 return &_mesa_texformat_rgba
;
1240 if (ctx
->Extensions
.MESA_ycbcr_texture
) {
1241 if (internalFormat
== GL_YCBCR_MESA
) {
1242 if (type
== GL_UNSIGNED_SHORT_8_8_MESA
)
1243 return &_mesa_texformat_ycbcr
;
1245 return &_mesa_texformat_ycbcr_rev
;
1249 if (ctx
->Extensions
.TDFX_texture_compression_FXT1
) {
1250 switch (internalFormat
) {
1251 case GL_COMPRESSED_RGB_FXT1_3DFX
:
1252 return &_mesa_texformat_rgb_fxt1
;
1253 case GL_COMPRESSED_RGBA_FXT1_3DFX
:
1254 return &_mesa_texformat_rgba_fxt1
;
1260 if (ctx
->Extensions
.EXT_texture_compression_s3tc
) {
1261 switch (internalFormat
) {
1262 case GL_COMPRESSED_RGB_S3TC_DXT1_EXT
:
1263 return &_mesa_texformat_rgb_dxt1
;
1264 case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
:
1265 return &_mesa_texformat_rgba_dxt1
;
1266 case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
:
1267 return &_mesa_texformat_rgba_dxt3
;
1268 case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
:
1269 return &_mesa_texformat_rgba_dxt5
;
1275 if (ctx
->Extensions
.S3_s3tc
) {
1276 switch (internalFormat
) {
1279 return &_mesa_texformat_rgb_dxt1
;
1282 return &_mesa_texformat_rgba_dxt3
;
1288 if (ctx
->Extensions
.ARB_texture_float
) {
1289 switch (internalFormat
) {
1290 case GL_ALPHA16F_ARB
:
1291 return &_mesa_texformat_alpha_float16
;
1292 case GL_ALPHA32F_ARB
:
1293 return &_mesa_texformat_alpha_float32
;
1294 case GL_LUMINANCE16F_ARB
:
1295 return &_mesa_texformat_luminance_float16
;
1296 case GL_LUMINANCE32F_ARB
:
1297 return &_mesa_texformat_luminance_float32
;
1298 case GL_LUMINANCE_ALPHA16F_ARB
:
1299 return &_mesa_texformat_luminance_alpha_float16
;
1300 case GL_LUMINANCE_ALPHA32F_ARB
:
1301 return &_mesa_texformat_luminance_alpha_float32
;
1302 case GL_INTENSITY16F_ARB
:
1303 return &_mesa_texformat_intensity_float16
;
1304 case GL_INTENSITY32F_ARB
:
1305 return &_mesa_texformat_intensity_float32
;
1307 return &_mesa_texformat_rgb_float16
;
1309 return &_mesa_texformat_rgb_float32
;
1310 case GL_RGBA16F_ARB
:
1311 return &_mesa_texformat_rgba_float16
;
1312 case GL_RGBA32F_ARB
:
1313 return &_mesa_texformat_rgba_float32
;
1319 _mesa_problem(ctx
, "unexpected format in _mesa_choose_tex_format()");