1 /**************************************************************************
3 * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
4 * Copyright (c) 2008 VMware, Inc.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 **************************************************************************/
28 #include "u_format_s3tc.h"
31 #if defined(_WIN32) || defined(WIN32)
32 #define DXTN_LIBNAME "dxtn.dll"
33 #elif defined(__APPLE__)
34 #define DXTN_LIBNAME "libtxc_dxtn.dylib"
36 #define DXTN_LIBNAME "libtxc_dxtn.so"
41 util_format_dxt1_rgb_fetch_stub(int src_stride,
51 util_format_dxt1_rgba_fetch_stub(int src_stride,
61 util_format_dxt3_rgba_fetch_stub(int src_stride,
71 util_format_dxt5_rgba_fetch_stub(int src_stride,
81 util_format_dxtn_pack_stub(int src_comps,
82 int width, int height,
84 enum util_format_dxtn dst_format,
92 boolean util_format_s3tc_enabled = FALSE;
94 util_format_dxtn_fetch_t util_format_dxt1_rgb_fetch = util_format_dxt1_rgb_fetch_stub;
95 util_format_dxtn_fetch_t util_format_dxt1_rgba_fetch = util_format_dxt1_rgba_fetch_stub;
96 util_format_dxtn_fetch_t util_format_dxt3_rgba_fetch = util_format_dxt3_rgba_fetch_stub;
97 util_format_dxtn_fetch_t util_format_dxt5_rgba_fetch = util_format_dxt5_rgba_fetch_stub;
99 util_format_dxtn_pack_t util_format_dxtn_pack = util_format_dxtn_pack_stub;
103 util_format_s3tc_init(void)
105 static boolean first_time = TRUE;
106 struct util_dl_library *library = NULL;
107 util_dl_proc fetch_2d_texel_rgb_dxt1;
108 util_dl_proc fetch_2d_texel_rgba_dxt1;
109 util_dl_proc fetch_2d_texel_rgba_dxt3;
110 util_dl_proc fetch_2d_texel_rgba_dxt5;
111 util_dl_proc tx_compress_dxtn;
117 if (util_format_s3tc_enabled)
120 library = util_dl_open(DXTN_LIBNAME);
122 if (getenv("force_s3tc_enable") &&
123 !strcmp(getenv("force_s3tc_enable"), "true")) {
124 debug_printf("couldn't open " DXTN_LIBNAME ", enabling DXTn due to "
125 "force_s3tc_enable=true environment variable\n");
126 util_format_s3tc_enabled = TRUE;
128 debug_printf("couldn't open " DXTN_LIBNAME ", software DXTn "
129 "compression/decompression unavailable\n");
134 fetch_2d_texel_rgb_dxt1 =
135 util_dl_get_proc_address(library, "fetch_2d_texel_rgb_dxt1");
136 fetch_2d_texel_rgba_dxt1 =
137 util_dl_get_proc_address(library, "fetch_2d_texel_rgba_dxt1");
138 fetch_2d_texel_rgba_dxt3 =
139 util_dl_get_proc_address(library, "fetch_2d_texel_rgba_dxt3");
140 fetch_2d_texel_rgba_dxt5 =
141 util_dl_get_proc_address(library, "fetch_2d_texel_rgba_dxt5");
143 util_dl_get_proc_address(library, "tx_compress_dxtn");
145 if (!util_format_dxt1_rgb_fetch ||
146 !util_format_dxt1_rgba_fetch ||
147 !util_format_dxt3_rgba_fetch ||
148 !util_format_dxt5_rgba_fetch ||
149 !util_format_dxtn_pack) {
150 debug_printf("couldn't reference all symbols in " DXTN_LIBNAME
151 ", software DXTn compression/decompression "
153 util_dl_close(library);
157 util_format_dxt1_rgb_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgb_dxt1;
158 util_format_dxt1_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt1;
159 util_format_dxt3_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt3;
160 util_format_dxt5_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt5;
161 util_format_dxtn_pack = (util_format_dxtn_pack_t)tx_compress_dxtn;
162 util_format_s3tc_enabled = TRUE;
171 util_format_dxt1_rgb_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
173 util_format_dxt1_rgb_fetch(0, src, i, j, dst);
177 util_format_dxt1_rgba_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
179 util_format_dxt1_rgba_fetch(0, src, i, j, dst);
183 util_format_dxt3_rgba_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
185 util_format_dxt3_rgba_fetch(0, src, i, j, dst);
189 util_format_dxt5_rgba_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
191 util_format_dxt5_rgba_fetch(0, src, i, j, dst);
195 util_format_dxt1_rgb_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
198 util_format_dxt1_rgb_fetch(0, src, i, j, tmp);
199 dst[0] = ubyte_to_float(tmp[0]);
200 dst[1] = ubyte_to_float(tmp[1]);
201 dst[2] = ubyte_to_float(tmp[2]);
206 util_format_dxt1_rgba_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
209 util_format_dxt1_rgba_fetch(0, src, i, j, tmp);
210 dst[0] = ubyte_to_float(tmp[0]);
211 dst[1] = ubyte_to_float(tmp[1]);
212 dst[2] = ubyte_to_float(tmp[2]);
213 dst[3] = ubyte_to_float(tmp[3]);
217 util_format_dxt3_rgba_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
220 util_format_dxt3_rgba_fetch(0, src, i, j, tmp);
221 dst[0] = ubyte_to_float(tmp[0]);
222 dst[1] = ubyte_to_float(tmp[1]);
223 dst[2] = ubyte_to_float(tmp[2]);
224 dst[3] = ubyte_to_float(tmp[3]);
228 util_format_dxt5_rgba_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
231 util_format_dxt5_rgba_fetch(0, src, i, j, tmp);
232 dst[0] = ubyte_to_float(tmp[0]);
233 dst[1] = ubyte_to_float(tmp[1]);
234 dst[2] = ubyte_to_float(tmp[2]);
235 dst[3] = ubyte_to_float(tmp[3]);
240 * Block decompression.
244 util_format_dxtn_rgb_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
245 const uint8_t *src_row, unsigned src_stride,
246 unsigned width, unsigned height,
247 util_format_dxtn_fetch_t fetch,
250 const unsigned bw = 4, bh = 4, comps = 4;
252 for(y = 0; y < height; y += bh) {
253 const uint8_t *src = src_row;
254 for(x = 0; x < width; x += bw) {
255 for(j = 0; j < bh; ++j) {
256 for(i = 0; i < bw; ++i) {
257 uint8_t *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*comps;
258 fetch(0, src, i, j, dst);
263 src_row += src_stride;
268 util_format_dxt1_rgb_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
269 const uint8_t *src_row, unsigned src_stride,
270 unsigned width, unsigned height)
272 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row, dst_stride,
275 util_format_dxt1_rgb_fetch, 8);
279 util_format_dxt1_rgba_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
280 const uint8_t *src_row, unsigned src_stride,
281 unsigned width, unsigned height)
283 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row, dst_stride,
286 util_format_dxt1_rgba_fetch, 8);
290 util_format_dxt3_rgba_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
291 const uint8_t *src_row, unsigned src_stride,
292 unsigned width, unsigned height)
294 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row, dst_stride,
297 util_format_dxt3_rgba_fetch, 16);
301 util_format_dxt5_rgba_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
302 const uint8_t *src_row, unsigned src_stride,
303 unsigned width, unsigned height)
305 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row, dst_stride,
308 util_format_dxt5_rgba_fetch, 16);
312 util_format_dxtn_rgb_unpack_rgba_float(float *dst_row, unsigned dst_stride,
313 const uint8_t *src_row, unsigned src_stride,
314 unsigned width, unsigned height,
315 util_format_dxtn_fetch_t fetch,
319 for(y = 0; y < height; y += 4) {
320 const uint8_t *src = src_row;
321 for(x = 0; x < width; x += 4) {
322 for(j = 0; j < 4; ++j) {
323 for(i = 0; i < 4; ++i) {
324 float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
326 fetch(0, src, i, j, tmp);
327 dst[0] = ubyte_to_float(tmp[0]);
328 dst[1] = ubyte_to_float(tmp[1]);
329 dst[2] = ubyte_to_float(tmp[2]);
330 dst[3] = ubyte_to_float(tmp[3]);
335 src_row += src_stride;
340 util_format_dxt1_rgb_unpack_rgba_float(float *dst_row, unsigned dst_stride,
341 const uint8_t *src_row, unsigned src_stride,
342 unsigned width, unsigned height)
344 util_format_dxtn_rgb_unpack_rgba_float(dst_row, dst_stride,
347 util_format_dxt1_rgb_fetch, 8);
351 util_format_dxt1_rgba_unpack_rgba_float(float *dst_row, unsigned dst_stride,
352 const uint8_t *src_row, unsigned src_stride,
353 unsigned width, unsigned height)
355 util_format_dxtn_rgb_unpack_rgba_float(dst_row, dst_stride,
358 util_format_dxt1_rgba_fetch, 8);
362 util_format_dxt3_rgba_unpack_rgba_float(float *dst_row, unsigned dst_stride,
363 const uint8_t *src_row, unsigned src_stride,
364 unsigned width, unsigned height)
366 util_format_dxtn_rgb_unpack_rgba_float(dst_row, dst_stride,
369 util_format_dxt3_rgba_fetch, 16);
373 util_format_dxt5_rgba_unpack_rgba_float(float *dst_row, unsigned dst_stride,
374 const uint8_t *src_row, unsigned src_stride,
375 unsigned width, unsigned height)
377 util_format_dxtn_rgb_unpack_rgba_float(dst_row, dst_stride,
380 util_format_dxt5_rgba_fetch, 16);
389 util_format_dxt1_rgb_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
390 const uint8_t *src, unsigned src_stride,
391 unsigned width, unsigned height)
393 const unsigned bw = 4, bh = 4, bytes_per_block = 8;
394 unsigned x, y, i, j, k;
395 for(y = 0; y < height; y += bh) {
396 uint8_t *dst = dst_row;
397 for(x = 0; x < width; x += bw) {
398 uint8_t tmp[4][4][3]; /* [bh][bw][comps] */
399 for(j = 0; j < bh; ++j) {
400 for(i = 0; i < bw; ++i) {
401 for(k = 0; k < 3; ++k) {
402 tmp[j][i][k] = src[(y + j)*src_stride/sizeof(*src) + (x + i)*4 + k];
406 util_format_dxtn_pack(3, 4, 4, &tmp[0][0][0], UTIL_FORMAT_DXT1_RGB, dst, 0);
407 dst += bytes_per_block;
409 dst_row += dst_stride / sizeof(*dst_row);
414 util_format_dxt1_rgba_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
415 const uint8_t *src, unsigned src_stride,
416 unsigned width, unsigned height)
418 const unsigned bw = 4, bh = 4, comps = 4, bytes_per_block = 8;
419 unsigned x, y, i, j, k;
420 for(y = 0; y < height; y += bh) {
421 uint8_t *dst = dst_row;
422 for(x = 0; x < width; x += bw) {
423 uint8_t tmp[4][4][4]; /* [bh][bw][comps] */
424 for(j = 0; j < bh; ++j) {
425 for(i = 0; i < bw; ++i) {
426 for(k = 0; k < comps; ++k) {
427 tmp[j][i][k] = src[(y + j)*src_stride/sizeof(*src) + (x + i)*comps + k];
431 util_format_dxtn_pack(4, 4, 4, &tmp[0][0][0], UTIL_FORMAT_DXT1_RGBA, dst, 0);
432 dst += bytes_per_block;
434 dst_row += dst_stride / sizeof(*dst_row);
439 util_format_dxt3_rgba_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
440 const uint8_t *src, unsigned src_stride,
441 unsigned width, unsigned height)
443 const unsigned bw = 4, bh = 4, comps = 4, bytes_per_block = 16;
444 unsigned x, y, i, j, k;
445 for(y = 0; y < height; y += bh) {
446 uint8_t *dst = dst_row;
447 for(x = 0; x < width; x += bw) {
448 uint8_t tmp[4][4][4]; /* [bh][bw][comps] */
449 for(j = 0; j < bh; ++j) {
450 for(i = 0; i < bw; ++i) {
451 for(k = 0; k < comps; ++k) {
452 tmp[j][i][k] = src[(y + j)*src_stride/sizeof(*src) + (x + i)*comps + k];
456 util_format_dxtn_pack(4, 4, 4, &tmp[0][0][0], UTIL_FORMAT_DXT3_RGBA, dst, 0);
457 dst += bytes_per_block;
459 dst_row += dst_stride / sizeof(*dst_row);
464 util_format_dxt5_rgba_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
465 const uint8_t *src, unsigned src_stride,
466 unsigned width, unsigned height)
468 const unsigned bw = 4, bh = 4, comps = 4, bytes_per_block = 16;
469 unsigned x, y, i, j, k;
471 for(y = 0; y < height; y += bh) {
472 uint8_t *dst = dst_row;
473 for(x = 0; x < width; x += bw) {
474 uint8_t tmp[4][4][4]; /* [bh][bw][comps] */
475 for(j = 0; j < bh; ++j) {
476 for(i = 0; i < bw; ++i) {
477 for(k = 0; k < comps; ++k) {
478 tmp[j][i][k] = src[(y + j)*src_stride/sizeof(*src) + (x + i)*comps + k];
482 util_format_dxtn_pack(4, 4, 4, &tmp[0][0][0], UTIL_FORMAT_DXT5_RGBA, dst, 0);
483 dst += bytes_per_block;
485 dst_row += dst_stride / sizeof(*dst_row);
490 util_format_dxt1_rgb_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
491 const float *src, unsigned src_stride,
492 unsigned width, unsigned height)
494 unsigned x, y, i, j, k;
495 for(y = 0; y < height; y += 4) {
496 uint8_t *dst = dst_row;
497 for(x = 0; x < width; x += 4) {
498 uint8_t tmp[4][4][3];
499 for(j = 0; j < 4; ++j) {
500 for(i = 0; i < 4; ++i) {
501 for(k = 0; k < 3; ++k) {
502 tmp[j][i][k] = float_to_ubyte(src[(y + j)*src_stride/sizeof(*src) + (x+i)*4 + k]);
506 util_format_dxtn_pack(3, 4, 4, &tmp[0][0][0], UTIL_FORMAT_DXT1_RGB, dst, 0);
509 dst_row += 4*dst_stride/sizeof(*dst_row);
514 util_format_dxt1_rgba_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
515 const float *src, unsigned src_stride,
516 unsigned width, unsigned height)
518 unsigned x, y, i, j, k;
519 for(y = 0; y < height; y += 4) {
520 uint8_t *dst = dst_row;
521 for(x = 0; x < width; x += 4) {
522 uint8_t tmp[4][4][4];
523 for(j = 0; j < 4; ++j) {
524 for(i = 0; i < 4; ++i) {
525 for(k = 0; k < 4; ++k) {
526 tmp[j][i][k] = float_to_ubyte(src[(y + j)*src_stride/sizeof(*src) + (x+i)*4 + k]);
530 util_format_dxtn_pack(4, 4, 4, &tmp[0][0][0], UTIL_FORMAT_DXT1_RGBA, dst, 0);
533 dst_row += 4*dst_stride/sizeof(*dst_row);
538 util_format_dxt3_rgba_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
539 const float *src, unsigned src_stride,
540 unsigned width, unsigned height)
542 unsigned x, y, i, j, k;
543 for(y = 0; y < height; y += 4) {
544 uint8_t *dst = dst_row;
545 for(x = 0; x < width; x += 4) {
546 uint8_t tmp[4][4][4];
547 for(j = 0; j < 4; ++j) {
548 for(i = 0; i < 4; ++i) {
549 for(k = 0; k < 4; ++k) {
550 tmp[j][i][k] = float_to_ubyte(src[(y + j)*src_stride/sizeof(*src) + (x+i)*4 + k]);
554 util_format_dxtn_pack(4, 4, 4, &tmp[0][0][0], UTIL_FORMAT_DXT3_RGBA, dst, 0);
557 dst_row += 4*dst_stride/sizeof(*dst_row);
562 util_format_dxt5_rgba_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
563 const float *src, unsigned src_stride,
564 unsigned width, unsigned height)
566 unsigned x, y, i, j, k;
567 for(y = 0; y < height; y += 4) {
568 uint8_t *dst = dst_row;
569 for(x = 0; x < width; x += 4) {
570 uint8_t tmp[4][4][4];
571 for(j = 0; j < 4; ++j) {
572 for(i = 0; i < 4; ++i) {
573 for(k = 0; k < 4; ++k) {
574 tmp[j][i][k] = float_to_ubyte(src[(y + j)*src_stride/sizeof(*src) + (x+i)*4 + k]);
578 util_format_dxtn_pack(4, 4, 4, &tmp[0][0][0], UTIL_FORMAT_DXT5_RGBA, dst, 0);
581 dst_row += 4*dst_stride/sizeof(*dst_row);
589 * FIXME: shunts to RGB for now
593 util_format_dxt1_srgb_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
595 util_format_dxt1_rgb_unpack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
599 util_format_dxt1_srgb_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
601 util_format_dxt1_rgb_pack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
605 util_format_dxt1_srgb_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
607 util_format_dxt1_rgb_fetch_rgba_8unorm(dst, src, i, j);
611 util_format_dxt1_srgba_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
613 util_format_dxt1_rgba_unpack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
617 util_format_dxt1_srgba_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
619 util_format_dxt1_rgba_pack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
623 util_format_dxt1_srgba_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
625 util_format_dxt1_rgba_fetch_rgba_8unorm(dst, src, i, j);
629 util_format_dxt3_srgba_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
631 util_format_dxt3_rgba_unpack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
635 util_format_dxt3_srgba_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
637 util_format_dxt3_rgba_pack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
641 util_format_dxt3_srgba_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
643 util_format_dxt3_rgba_fetch_rgba_8unorm(dst, src, i, j);
647 util_format_dxt5_srgba_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
649 util_format_dxt5_rgba_unpack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
653 util_format_dxt5_srgba_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
655 util_format_dxt5_rgba_pack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
659 util_format_dxt5_srgba_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
661 util_format_dxt5_rgba_fetch_rgba_8unorm(dst, src, i, j);
665 util_format_dxt1_srgb_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
667 util_format_dxt1_rgb_unpack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height);
671 util_format_dxt1_srgb_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
673 util_format_dxt1_rgb_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height);
677 util_format_dxt1_srgb_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
679 util_format_dxt1_rgb_fetch_rgba_float(dst, src, i, j);
683 util_format_dxt1_srgba_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
685 util_format_dxt1_rgba_unpack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height);
689 util_format_dxt1_srgba_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
691 util_format_dxt1_rgba_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height);
695 util_format_dxt1_srgba_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
697 util_format_dxt1_rgba_fetch_rgba_float(dst, src, i, j);
701 util_format_dxt3_srgba_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
703 util_format_dxt3_rgba_unpack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height);
707 util_format_dxt3_srgba_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
709 util_format_dxt3_rgba_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height);
713 util_format_dxt3_srgba_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
715 util_format_dxt3_rgba_fetch_rgba_float(dst, src, i, j);
719 util_format_dxt5_srgba_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
721 util_format_dxt5_rgba_unpack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height);
725 util_format_dxt5_srgba_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
727 util_format_dxt5_rgba_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height);
731 util_format_dxt5_srgba_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
733 util_format_dxt5_rgba_fetch_rgba_float(dst, src, i, j);