Lines Matching refs:texel
29 * Texel fetch functions template.
31 * This template file is used by texfetch.c to generate texel fetch functions
36 * for the texel lookup in the gl_texture_image::Data.
73 /* Fetch depth texel from 1D, 2D or 3D 32-bit depth texture,
78 GLint i, GLint j, GLint k, GLfloat *texel )
81 texel[0] = src[0] * (1.0F / 0xffffffff);
87 /* Fetch depth texel from 1D, 2D or 3D 16-bit depth texture,
92 GLint i, GLint j, GLint k, GLfloat *texel )
95 texel[0] = src[0] * (1.0F / 65535.0F);
102 /* Fetch texel from 1D, 2D or 3D RGBA_FLOAT32 texture, returning 4 GLfloats.
105 GLint i, GLint j, GLint k, GLfloat *texel )
108 texel[RCOMP] = src[0];
109 texel[GCOMP] = src[1];
110 texel[BCOMP] = src[2];
111 texel[ACOMP] = src[3];
119 /* Fetch texel from 1D, 2D or 3D RGBA_FLOAT16 texture,
123 GLint i, GLint j, GLint k, GLfloat *texel )
126 texel[RCOMP] = _mesa_half_to_float(src[0]);
127 texel[GCOMP] = _mesa_half_to_float(src[1]);
128 texel[BCOMP] = _mesa_half_to_float(src[2]);
129 texel[ACOMP] = _mesa_half_to_float(src[3]);
136 /* Fetch texel from 1D, 2D or 3D RGB_FLOAT32 texture,
140 GLint i, GLint j, GLint k, GLfloat *texel )
143 texel[RCOMP] = src[0];
144 texel[GCOMP] = src[1];
145 texel[BCOMP] = src[2];
146 texel[ACOMP] = 1.0F;
154 /* Fetch texel from 1D, 2D or 3D RGB_FLOAT16 texture,
158 GLint i, GLint j, GLint k, GLfloat *texel )
161 texel[RCOMP] = _mesa_half_to_float(src[0]);
162 texel[GCOMP] = _mesa_half_to_float(src[1]);
163 texel[BCOMP] = _mesa_half_to_float(src[2]);
164 texel[ACOMP] = 1.0F;
172 /* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT32 texture,
176 GLint i, GLint j, GLint k, GLfloat *texel )
179 texel[RCOMP] =
180 texel[GCOMP] =
181 texel[BCOMP] = 0.0F;
182 texel[ACOMP] = src[0];
190 /* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT16 texture,
194 GLint i, GLint j, GLint k, GLfloat *texel )
197 texel[RCOMP] =
198 texel[GCOMP] =
199 texel[BCOMP] = 0.0F;
200 texel[ACOMP] = _mesa_half_to_float(src[0]);
208 /* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT32 texture,
212 GLint i, GLint j, GLint k, GLfloat *texel )
215 texel[RCOMP] =
216 texel[GCOMP] =
217 texel[BCOMP] = src[0];
218 texel[ACOMP] = 1.0F;
226 /* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT16 texture,
230 GLint i, GLint j, GLint k, GLfloat *texel )
233 texel[RCOMP] =
234 texel[GCOMP] =
235 texel[BCOMP] = _mesa_half_to_float(src[0]);
236 texel[ACOMP] = 1.0F;
244 /* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT32 texture,
248 GLint i, GLint j, GLint k, GLfloat *texel )
251 texel[RCOMP] =
252 texel[GCOMP] =
253 texel[BCOMP] = src[0];
254 texel[ACOMP] = src[1];
262 /* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT16 texture,
266 GLint i, GLint j, GLint k, GLfloat *texel )
269 texel[RCOMP] =
270 texel[GCOMP] =
271 texel[BCOMP] = _mesa_half_to_float(src[0]);
272 texel[ACOMP] = _mesa_half_to_float(src[1]);
280 /* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT32 texture,
284 GLint i, GLint j, GLint k, GLfloat *texel )
287 texel[RCOMP] =
288 texel[GCOMP] =
289 texel[BCOMP] =
290 texel[ACOMP] = src[0];
298 /* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT16 texture,
302 GLint i, GLint j, GLint k, GLfloat *texel )
305 texel[RCOMP] =
306 texel[GCOMP] =
307 texel[BCOMP] =
308 texel[ACOMP] = _mesa_half_to_float(src[0]);
316 /* Fetch texel from 1D, 2D or 3D R_FLOAT32 texture,
320 GLint i, GLint j, GLint k, GLfloat *texel )
323 texel[RCOMP] = src[0];
324 texel[GCOMP] = 0.0F;
325 texel[BCOMP] = 0.0F;
326 texel[ACOMP] = 1.0F;
334 /* Fetch texel from 1D, 2D or 3D R_FLOAT16 texture,
338 GLint i, GLint j, GLint k, GLfloat *texel )
341 texel[RCOMP] = _mesa_half_to_float(src[0]);
342 texel[GCOMP] = 0.0F;
343 texel[BCOMP] = 0.0F;
344 texel[ACOMP] = 1.0F;
352 /* Fetch texel from 1D, 2D or 3D RG_FLOAT32 texture,
356 GLint i, GLint j, GLint k, GLfloat *texel )
359 texel[RCOMP] = src[0];
360 texel[GCOMP] = src[1];
361 texel[BCOMP] = 0.0F;
362 texel[ACOMP] = 1.0F;
370 /* Fetch texel from 1D, 2D or 3D RG_FLOAT16 texture,
374 GLint i, GLint j, GLint k, GLfloat *texel )
377 texel[RCOMP] = _mesa_half_to_float(src[0]);
378 texel[GCOMP] = _mesa_half_to_float(src[1]);
379 texel[BCOMP] = 0.0F;
380 texel[ACOMP] = 1.0F;
392 /* Fetch texel from 1D, 2D or 3D rgba8888 texture, return 4 GLfloats */
394 GLint i, GLint j, GLint k, GLfloat *texel )
397 texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 24) );
398 texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff );
399 texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff );
400 texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff );
410 /* Fetch texel from 1D, 2D or 3D abgr8888 texture, return 4 GLchans */
412 GLint i, GLint j, GLint k, GLfloat *texel )
415 texel[RCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff );
416 texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff );
417 texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff );
418 texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) );
426 /* Fetch texel from 1D, 2D or 3D argb8888 texture, return 4 GLchans */
428 GLint i, GLint j, GLint k, GLfloat *texel )
431 texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff );
432 texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff );
433 texel[BCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff );
434 texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) );
442 /* Fetch texel from 1D, 2D or 3D argb8888_rev texture, return 4 GLfloats */
444 GLint i, GLint j, GLint k, GLfloat *texel )
447 texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff );
448 texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff );
449 texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 24) );
450 texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff );
458 /* Fetch texel from 1D, 2D or 3D rgbx8888 texture, return 4 GLfloats */
460 GLint i, GLint j, GLint k, GLfloat *texel )
463 texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 24) );
464 texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff );
465 texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff );
466 texel[ACOMP] = 1.0f;
474 /* Fetch texel from 1D, 2D or 3D rgbx8888_rev texture, return 4 GLchans */
476 GLint i, GLint j, GLint k, GLfloat *texel )
479 texel[RCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff );
480 texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff );
481 texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff );
482 texel[ACOMP] = 1.0f;
490 /* Fetch texel from 1D, 2D or 3D xrgb8888 texture, return 4 GLchans */
492 GLint i, GLint j, GLint k, GLfloat *texel )
495 texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff );
496 texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff );
497 texel[BCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff );
498 texel[ACOMP] = 1.0f;
506 /* Fetch texel from 1D, 2D or 3D xrgb8888_rev texture, return 4 GLfloats */
508 GLint i, GLint j, GLint k, GLfloat *texel )
511 texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff );
512 texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff );
513 texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 24) );
514 texel[ACOMP] = 1.0f;
522 /* Fetch texel from 1D, 2D or 3D rgb888 texture, return 4 GLchans */
524 texel )
527 texel[RCOMP] = UBYTE_TO_FLOAT( src[2] );
528 texel[GCOMP] = UBYTE_TO_FLOAT( src[1] );
529 texel[BCOMP] = UBYTE_TO_FLOAT( src[0] );
530 texel[ACOMP] = 1.0F;
538 /* Fetch texel from 1D, 2D or 3D bgr888 texture, return 4 GLchans */
540 GLint i, GLint j, GLint k, GLfloat *texel )
543 texel[RCOMP] = UBYTE_TO_FLOAT( src[0] );
544 texel[GCOMP] = UBYTE_TO_FLOAT( src[1] );
545 texel[BCOMP] = UBYTE_TO_FLOAT( src[2] );
546 texel[ACOMP] = 1.0F;
557 /* Fetch texel from 1D, 2D or 3D rgb565 texture, return 4 GLchans */
559 GLint i, GLint j, GLint k, GLfloat *texel )
563 texel[RCOMP] = ((s >> 11) & 0x1f) * (1.0F / 31.0F);
564 texel[GCOMP] = ((s >> 5 ) & 0x3f) * (1.0F / 63.0F);
565 texel[BCOMP] = ((s ) & 0x1f) * (1.0F / 31.0F);
566 texel[ACOMP] = 1.0F;
574 /* Fetch texel from 1D, 2D or 3D rgb565_rev texture, return 4 GLchans */
576 GLint i, GLint j, GLint k, GLfloat *texel )
580 texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) );
581 texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 3) & 0xfc) | ((s >> 9) & 0x3) );
582 texel[BCOMP] = UBYTE_TO_FLOAT( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) );
583 texel[ACOMP] = 1.0F;
591 /* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */
593 GLint i, GLint j, GLint k, GLfloat *texel )
597 texel[RCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F);
598 texel[GCOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F);
599 texel[BCOMP] = ((s ) & 0xf) * (1.0F / 15.0F);
600 texel[ACOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F);
608 /* Fetch texel from 1D, 2D or 3D argb4444_rev texture, return 4 GLchans */
610 GLint i, GLint j, GLint k, GLfloat *texel )
613 texel[RCOMP] = ((s ) & 0xf) * (1.0F / 15.0F);
614 texel[GCOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F);
615 texel[BCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F);
616 texel[ACOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F);
623 /* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */
625 GLint i, GLint j, GLint k, GLfloat *texel )
629 texel[RCOMP] = ((s >> 11) & 0x1f) * (1.0F / 31.0F);
630 texel[GCOMP] = ((s >> 6) & 0x1f) * (1.0F / 31.0F);
631 texel[BCOMP] = ((s >> 1) & 0x1f) * (1.0F / 31.0F);
632 texel[ACOMP] = ((s ) & 0x01) * 1.0F;
639 /* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */
641 GLint i, GLint j, GLint k, GLfloat *texel )
645 texel[RCOMP] = ((s >> 10) & 0x1f) * (1.0F / 31.0F);
646 texel[GCOMP] = ((s >> 5) & 0x1f) * (1.0F / 31.0F);
647 texel[BCOMP] = ((s >> 0) & 0x1f) * (1.0F / 31.0F);
648 texel[ACOMP] = ((s >> 15) & 0x01) * 1.0F;
656 /* Fetch texel from 1D, 2D or 3D argb1555_rev texture, return 4 GLchans */
658 GLint i, GLint j, GLint k, GLfloat *texel )
662 texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 7) & 0xf8) | ((s >> 12) & 0x7) );
663 texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 2) & 0xf8) | ((s >> 7) & 0x7) );
664 texel[BCOMP] = UBYTE_TO_FLOAT( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) );
665 texel[ACOMP] = UBYTE_TO_FLOAT( ((s >> 15) & 0x01) * 255 );
673 /* Fetch texel from 1D, 2D or 3D argb2101010 texture, return 4 GLchans */
675 GLint i, GLint j, GLint k, GLfloat *texel )
679 texel[RCOMP] = ((s >> 20) & 0x3ff) * (1.0F / 1023.0F);
680 texel[GCOMP] = ((s >> 10) & 0x3ff) * (1.0F / 1023.0F);
681 texel[BCOMP] = ((s >> 0) & 0x3ff) * (1.0F / 1023.0F);
682 texel[ACOMP] = ((s >> 30) & 0x03) * (1.0F / 3.0F);
690 /* Fetch texel from 1D, 2D or 3D rg88 texture, return 4 GLchans */
692 GLint i, GLint j, GLint k, GLfloat *texel )
695 texel[RCOMP] = UBYTE_TO_FLOAT( s & 0xff );
696 texel[GCOMP] = UBYTE_TO_FLOAT( s >> 8 );
697 texel[BCOMP] = 0.0;
698 texel[ACOMP] = 1.0;
706 /* Fetch texel from 1D, 2D or 3D rg88_rev texture, return 4 GLchans */
708 GLint i, GLint j, GLint k, GLfloat *texel )
711 texel[RCOMP] = UBYTE_TO_FLOAT( s >> 8 );
712 texel[GCOMP] = UBYTE_TO_FLOAT( s & 0xff );
713 texel[BCOMP] = 0.0;
714 texel[ACOMP] = 1.0;
722 /* Fetch texel from 1D, 2D or 3D al44 texture, return 4 GLchans */
724 GLint i, GLint j, GLint k, GLfloat *texel )
727 texel[RCOMP] =
728 texel[GCOMP] =
729 texel[BCOMP] = (s & 0xf) * (1.0F / 15.0F);
730 texel[ACOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F);
738 /* Fetch texel from 1D, 2D or 3D al88 texture, return 4 GLchans */
740 GLint i, GLint j, GLint k, GLfloat *texel )
743 texel[RCOMP] =
744 texel[GCOMP] =
745 texel[BCOMP] = UBYTE_TO_FLOAT( s & 0xff );
746 texel[ACOMP] = UBYTE_TO_FLOAT( s >> 8 );
754 /* Fetch texel from 1D, 2D or 3D rg88 texture, return 4 GLchans */
756 GLint i, GLint j, GLint k, GLfloat *texel)
759 texel[RCOMP] = UBYTE_TO_FLOAT(s);
760 texel[GCOMP] = 0.0;
761 texel[BCOMP] = 0.0;
762 texel[ACOMP] = 1.0;
770 /* Fetch texel from 1D, 2D or 3D r16 texture, return 4 GLchans */
772 GLint i, GLint j, GLint k, GLfloat *texel)
775 texel[RCOMP] = USHORT_TO_FLOAT(s);
776 texel[GCOMP] = 0.0;
777 texel[BCOMP] = 0.0;
778 texel[ACOMP] = 1.0;
786 /* Fetch texel from 1D, 2D or 3D al88_rev texture, return 4 GLchans */
788 GLint i, GLint j, GLint k, GLfloat *texel )
791 texel[RCOMP] =
792 texel[GCOMP] =
793 texel[BCOMP] = UBYTE_TO_FLOAT( s >> 8 );
794 texel[ACOMP] = UBYTE_TO_FLOAT( s & 0xff );
802 /* Fetch texel from 1D, 2D or 3D rg1616 texture, return 4 GLchans */
804 GLint i, GLint j, GLint k, GLfloat *texel )
807 texel[RCOMP] = USHORT_TO_FLOAT( s & 0xffff );
808 texel[GCOMP] = USHORT_TO_FLOAT( s >> 16 );
809 texel[BCOMP] = 0.0;
810 texel[ACOMP] = 1.0;
818 /* Fetch texel from 1D, 2D or 3D rg1616_rev texture, return 4 GLchans */
820 GLint i, GLint j, GLint k, GLfloat *texel )
823 texel[RCOMP] = USHORT_TO_FLOAT( s >> 16 );
824 texel[GCOMP] = USHORT_TO_FLOAT( s & 0xffff );
825 texel[BCOMP] = 0.0;
826 texel[ACOMP] = 1.0;
834 /* Fetch texel from 1D, 2D or 3D al1616 texture, return 4 GLchans */
836 GLint i, GLint j, GLint k, GLfloat *texel )
839 texel[RCOMP] =
840 texel[GCOMP] =
841 texel[BCOMP] = USHORT_TO_FLOAT( s & 0xffff );
842 texel[ACOMP] = USHORT_TO_FLOAT( s >> 16 );
850 /* Fetch texel from 1D, 2D or 3D al1616_rev texture, return 4 GLchans */
852 GLint i, GLint j, GLint k, GLfloat *texel )
855 texel[RCOMP] =
856 texel[GCOMP] =
857 texel[BCOMP] = USHORT_TO_FLOAT( s >> 16 );
858 texel[ACOMP] = USHORT_TO_FLOAT( s & 0xffff );
866 /* Fetch texel from 1D, 2D or 3D rgb332 texture, return 4 GLchans */
868 GLint i, GLint j, GLint k, GLfloat *texel )
872 texel[RCOMP] = ((s >> 5) & 0x7) * (1.0F / 7.0F);
873 texel[GCOMP] = ((s >> 2) & 0x7) * (1.0F / 7.0F);
874 texel[BCOMP] = ((s ) & 0x3) * (1.0F / 3.0F);
875 texel[ACOMP] = 1.0F;
883 /* Fetch texel from 1D, 2D or 3D a8 texture, return 4 GLchans */
885 GLint i, GLint j, GLint k, GLfloat *texel )
888 texel[RCOMP] =
889 texel[GCOMP] =
890 texel[BCOMP] = 0.0F;
891 texel[ACOMP] = UBYTE_TO_FLOAT( src[0] );
899 /* Fetch texel from 1D, 2D or 3D a8 texture, return 4 GLchans */
901 GLint i, GLint j, GLint k, GLfloat *texel )
904 texel[RCOMP] =
905 texel[GCOMP] =
906 texel[BCOMP] = 0.0F;
907 texel[ACOMP] = USHORT_TO_FLOAT( src[0] );
915 /* Fetch texel from 1D, 2D or 3D l8 texture, return 4 GLchans */
917 GLint i, GLint j, GLint k, GLfloat *texel )
920 texel[RCOMP] =
921 texel[GCOMP] =
922 texel[BCOMP] = UBYTE_TO_FLOAT( src[0] );
923 texel[ACOMP] = 1.0F;
931 /* Fetch texel from 1D, 2D or 3D l16 texture, return 4 GLchans */
933 GLint i, GLint j, GLint k, GLfloat *texel )
936 texel[RCOMP] =
937 texel[GCOMP] =
938 texel[BCOMP] = USHORT_TO_FLOAT( src[0] );
939 texel[ACOMP] = 1.0F;
947 /* Fetch texel from 1D, 2D or 3D i8 texture, return 4 GLchans */
949 GLint i, GLint j, GLint k, GLfloat *texel )
952 texel[RCOMP] =
953 texel[GCOMP] =
954 texel[BCOMP] =
955 texel[ACOMP] = UBYTE_TO_FLOAT( src[0] );
963 /* Fetch texel from 1D, 2D or 3D i16 texture, return 4 GLchans */
965 GLint i, GLint j, GLint k, GLfloat *texel )
968 texel[RCOMP] =
969 texel[GCOMP] =
970 texel[BCOMP] =
971 texel[ACOMP] = USHORT_TO_FLOAT( src[0] );
977 /* Fetch texel from 1D, 2D or 3D srgb8 texture, return 4 GLfloats */
980 GLint i, GLint j, GLint k, GLfloat *texel )
983 texel[RCOMP] = nonlinear_to_linear(src[2]);
984 texel[GCOMP] = nonlinear_to_linear(src[1]);
985 texel[BCOMP] = nonlinear_to_linear(src[0]);
986 texel[ACOMP] = 1.0F;
991 /* Fetch texel from 1D, 2D or 3D srgba8 texture, return 4 GLfloats */
993 GLint i, GLint j, GLint k, GLfloat *texel )
996 texel[RCOMP] = nonlinear_to_linear( (s >> 24) );
997 texel[GCOMP] = nonlinear_to_linear( (s >> 16) & 0xff );
998 texel[BCOMP] = nonlinear_to_linear( (s >> 8) & 0xff );
999 texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); /* linear! */
1004 /* Fetch texel from 1D, 2D or 3D sargb8 texture, return 4 GLfloats */
1006 GLint i, GLint j, GLint k, GLfloat *texel )
1009 texel[RCOMP] = nonlinear_to_linear( (s >> 16) & 0xff );
1010 texel[GCOMP] = nonlinear_to_linear( (s >> 8) & 0xff );
1011 texel[BCOMP] = nonlinear_to_linear( (s ) & 0xff );
1012 texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); /* linear! */
1017 /* Fetch texel
1019 GLint i, GLint j, GLint k, GLfloat *texel )
1022 texel[RCOMP] =
1023 texel[GCOMP] =
1024 texel[BCOMP] = nonlinear_to_linear(src[0]);
1025 texel[ACOMP] = 1.0F;
1030 /* Fetch texel from 1D, 2D or 3D sla8 texture, return 4 GLfloats */
1032 GLint i, GLint j, GLint k, GLfloat *texel )
1035 texel[RCOMP] =
1036 texel[GCOMP] =
1037 texel[BCOMP] = nonlinear_to_linear(src[0]);
1038 texel[ACOMP] = UBYTE_TO_FLOAT(src[1]); /* linear */
1048 GLint i, GLint j, GLint k, GLfloat *texel )
1051 texel[RCOMP] = (GLfloat) src[0];
1052 texel[GCOMP] = (GLfloat) src[1];
1053 texel[BCOMP] = (GLfloat) src[2];
1054 texel[ACOMP] = (GLfloat) src[3];
1064 GLint i, GLint j, GLint k, GLfloat *texel )
1067 texel[RCOMP] = (GLfloat) src[0];
1068 texel[GCOMP] = (GLfloat) src[1];
1069 texel[BCOMP] = (GLfloat) src[2];
1070 texel[ACOMP] = (GLfloat) src[3];
1080 GLint i, GLint j, GLint k, GLfloat *texel )
1083 texel[RCOMP] = (GLfloat) src[0];
1084 texel[GCOMP] = (GLfloat) src[1];
1085 texel[BCOMP] = (GLfloat) src[2];
1086 texel[ACOMP] = (GLfloat) src[3];
1096 GLint i, GLint j, GLint k, GLfloat *texel )
1099 texel[RCOMP] = (GLfloat) src[0];
1100 texel[GCOMP] = (GLfloat) src[1];
1101 texel[BCOMP] = (GLfloat) src[2];
1102 texel[ACOMP] = (GLfloat) src[3];
1112 GLint i, GLint j, GLint k, GLfloat *texel )
1115 texel[RCOMP] = (GLfloat) src[0];
1116 texel[GCOMP] = (GLfloat) src[1];
1117 texel[BCOMP] = (GLfloat) src[2];
1118 texel[ACOMP] = (GLfloat) src[3];
1128 GLint i, GLint j, GLint k, GLfloat *texel )
1131 texel[RCOMP] = (GLfloat) src[0];
1132 texel[GCOMP] = (GLfloat) src[1];
1133 texel[BCOMP] = (GLfloat) src[2];
1134 texel[ACOMP] = (GLfloat) src[3];
1145 GLint i, GLint j, GLint k, GLfloat *texel )
1148 texel[RCOMP] = BYTE_TO_FLOAT(src[0]);
1149 texel[GCOMP] = BYTE_TO_FLOAT(src[1]);
1150 texel[BCOMP] = 0;
1151 texel[ACOMP] = 0;
1158 GLint i, GLint j, GLint k, GLfloat *texel )
1161 texel[RCOMP] = BYTE_TO_FLOAT_TEX( s );
1162 texel[GCOMP] = 0.0F;
1163 texel[BCOMP] = 0.0F;
1164 texel[ACOMP] = 1.0F;
1173 GLint i, GLint j, GLint k, GLfloat *texel )
1176 texel[RCOMP] = 0.0F;
1177 texel[GCOMP] = 0.0F;
1178 texel[BCOMP] = 0.0F;
1179 texel[ACOMP] = BYTE_TO_FLOAT_TEX( s );
1188 GLint i, GLint j, GLint k, GLfloat *texel )
1191 texel[RCOMP] =
1192 texel[GCOMP] =
1193 texel[BCOMP] = BYTE_TO_FLOAT_TEX( s );
1194 texel[ACOMP] = 1.0F;
1203 GLint i, GLint j, GLint k, GLfloat *texel )
1206 texel[RCOMP] =
1207 texel[GCOMP] =
1208 texel[BCOMP] =
1209 texel[ACOMP] = BYTE_TO_FLOAT_TEX( s );
1218 GLint i, GLint j, GLint k, GLfloat *texel )
1221 texel[RCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s & 0xff) );
1222 texel[GCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 8) );
1223 texel[BCOMP] = 0.0F;
1224 texel[ACOMP] = 1.0F;
1233 GLint i, GLint j, GLint k, GLfloat *texel )
1236 texel[RCOMP] =
1237 texel[GCOMP] =
1238 texel[BCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s & 0xff) );
1239 texel[ACOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 8) );
1248 GLint i, GLint j, GLint k, GLfloat *texel )
1251 texel[RCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 24) );
1252 texel[GCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 16) );
1253 texel[BCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 8) );
1254 texel[ACOMP] = 1.0f;
1263 GLint i, GLint j, GLint k, GLfloat *texel )
1266 texel[RCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 24) );
1267 texel[GCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 16) );
1268 texel[BCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 8) );
1269 texel[ACOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s ) );
1275 GLint i, GLint j, GLint k, GLfloat *texel )
1278 texel[RCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s ) );
1279 texel[GCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 8) );
1280 texel[BCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 16) );
1281 texel[ACOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 24) );
1292 GLint i, GLint j, GLint k, GLfloat *texel)
1295 texel[RCOMP] = SHORT_TO_FLOAT_TEX( s );
1296 texel[GCOMP] = 0.0F;
1297 texel[BCOMP] = 0.0F;
1298 texel[ACOMP] = 1.0F;
1308 GLint i, GLint j, GLint k, GLfloat *texel)
1311 texel[RCOMP] = 0.0F;
1312 texel[GCOMP] = 0.0F;
1313 texel[BCOMP] = 0.0F;
1314 texel[ACOMP] = SHORT_TO_FLOAT_TEX( s );
1324 GLint i, GLint j, GLint k, GLfloat *texel)
1327 texel[RCOMP] =
1328 texel[GCOMP] =
1329 texel[BCOMP] = SHORT_TO_FLOAT_TEX( s );
1330 texel[ACOMP] = 1.0F;
1340 GLint i, GLint j, GLint k, GLfloat *texel)
1343 texel[RCOMP] =
1344 texel[GCOMP] =
1345 texel[BCOMP] =
1346 texel[ACOMP] = SHORT_TO_FLOAT_TEX( s );
1356 GLint i, GLint j, GLint k, GLfloat *texel)
1359 texel[RCOMP] = SHORT_TO_FLOAT_TEX( s[0] );
1360 texel[GCOMP] = SHORT_TO_FLOAT_TEX( s[1] );
1361 texel[BCOMP] = 0.0F;
1362 texel[ACOMP] = 1.0F;
1372 GLint i, GLint j, GLint k, GLfloat *texel)
1375 texel[RCOMP] =
1376 texel[GCOMP] =
1377 texel[BCOMP] = SHORT_TO_FLOAT_TEX( s[0] );
1378 texel[ACOMP] = SHORT_TO_FLOAT_TEX( s[1] );
1388 GLint i, GLint j, GLint k, GLfloat *texel)
1391 texel[RCOMP] = SHORT_TO_FLOAT_TEX( s[0] );
1392 texel[GCOMP] = SHORT_TO_FLOAT_TEX( s[1] );
1393 texel[BCOMP] = SHORT_TO_FLOAT_TEX( s[2] );
1394 texel[ACOMP] = 1.0F;
1404 GLint i, GLint j, GLint k, GLfloat *texel)
1407 texel[RCOMP] = SHORT_TO_FLOAT_TEX( s[0] );
1408 texel[GCOMP] = SHORT_TO_FLOAT_TEX( s[1] );
1409 texel[BCOMP] = SHORT_TO_FLOAT_TEX( s[2] );
1410 texel[ACOMP] = SHORT_TO_FLOAT_TEX( s[3] );
1421 GLint i, GLint j, GLint k, GLfloat *texel)
1424 texel[RCOMP] = USHORT_TO_FLOAT( s[0] );
1425 texel[GCOMP] = USHORT_TO_FLOAT( s[1] );
1426 texel[BCOMP] = USHORT_TO_FLOAT( s[2] );
1427 texel[ACOMP] = USHORT_TO_FLOAT( s[3] );
1436 /* Fetch texel from 1D, 2D or 3D ycbcr texture, return 4 GLfloats.
1440 GLint i, GLint j, GLint k, GLfloat *texel )
1455 texel[RCOMP] = CLAMP(r, 0.0F, 1.0F);
1456 texel[GCOMP] = CLAMP(g, 0.0F, 1.0F);
1457 texel[BCOMP] = CLAMP(b, 0.0F, 1.0F);
1458 texel[ACOMP] = 1.0F;
1466 /* Fetch texel from 1D, 2D or 3D ycbcr_rev texture, return 4 GLfloats.
1470 GLint i, GLint j, GLint k, GLfloat *texel )
1485 texel[RCOMP] = CLAMP(r, 0.0F, 1.0F);
1486 texel[GCOMP] = CLAMP(g, 0.0F, 1.0F);
1487 texel[BCOMP] = CLAMP(b, 0.0F, 1.0F);
1488 texel[ACOMP] = 1.0F;
1497 GLint i, GLint j, GLint k, GLfloat *texel )
1502 texel[0] = ((*src) >> 8) * scale;
1505 ASSERT(texel[0] >= 0.0F);
1506 ASSERT(texel[0] <= 1.0F);
1515 GLint i, GLint j, GLint k, GLfloat *texel )
1520 texel[0] = ((*src) & 0x00ffffff) * scale;
1523 ASSERT(texel[0] >= 0.0F);
1524 ASSERT(texel[0] <= 1.0F);
1533 GLint i, GLint j, GLint k, GLfloat *texel )
1536 rgb9e5_to_float3(*src, texel);
1537 texel[ACOMP] = 1.0F;
1546 GLint i, GLint j, GLint k, GLfloat *texel )
1549 r11g11b10f_to_float3(*src, texel);
1550 texel[ACOMP] = 1.0F;
1559 GLint i, GLint j, GLint k, GLfloat *texel)
1562 texel[RCOMP] = src[0];
1563 texel[GCOMP] = 0.0F;
1564 texel[BCOMP] = 0.0F;
1565 texel[ACOMP] = 1.0F;