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 debug_printf("couldn't open " DXTN_LIBNAME
", software DXTn "
123 "compression/decompression unavailable");
127 fetch_2d_texel_rgb_dxt1
=
128 util_dl_get_proc_address(library
, "fetch_2d_texel_rgb_dxt1");
129 fetch_2d_texel_rgba_dxt1
=
130 util_dl_get_proc_address(library
, "fetch_2d_texel_rgba_dxt1");
131 fetch_2d_texel_rgba_dxt3
=
132 util_dl_get_proc_address(library
, "fetch_2d_texel_rgba_dxt3");
133 fetch_2d_texel_rgba_dxt5
=
134 util_dl_get_proc_address(library
, "fetch_2d_texel_rgba_dxt5");
136 util_dl_get_proc_address(library
, "tx_compress_dxtn");
138 if (!util_format_dxt1_rgb_fetch
||
139 !util_format_dxt1_rgba_fetch
||
140 !util_format_dxt3_rgba_fetch
||
141 !util_format_dxt5_rgba_fetch
||
142 !util_format_dxtn_pack
) {
143 debug_printf("couldn't reference all symbols in " DXTN_LIBNAME
144 ", software DXTn compression/decompression "
146 util_dl_close(library
);
150 util_format_dxt1_rgb_fetch
= (util_format_dxtn_fetch_t
)fetch_2d_texel_rgb_dxt1
;
151 util_format_dxt1_rgba_fetch
= (util_format_dxtn_fetch_t
)fetch_2d_texel_rgba_dxt1
;
152 util_format_dxt3_rgba_fetch
= (util_format_dxtn_fetch_t
)fetch_2d_texel_rgba_dxt3
;
153 util_format_dxt5_rgba_fetch
= (util_format_dxtn_fetch_t
)fetch_2d_texel_rgba_dxt5
;
154 util_format_dxtn_pack
= (util_format_dxtn_pack_t
)tx_compress_dxtn
;
155 util_format_s3tc_enabled
= TRUE
;
164 util_format_dxt1_rgb_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
166 util_format_dxt1_rgb_fetch(0, src
, i
, j
, dst
);
170 util_format_dxt1_rgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
172 util_format_dxt1_rgba_fetch(0, src
, i
, j
, dst
);
176 util_format_dxt3_rgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
178 util_format_dxt3_rgba_fetch(0, src
, i
, j
, dst
);
182 util_format_dxt5_rgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
184 util_format_dxt5_rgba_fetch(0, src
, i
, j
, dst
);
188 util_format_dxt1_rgb_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
191 util_format_dxt1_rgb_fetch(0, src
, i
, j
, tmp
);
192 dst
[0] = ubyte_to_float(tmp
[0]);
193 dst
[1] = ubyte_to_float(tmp
[1]);
194 dst
[2] = ubyte_to_float(tmp
[2]);
199 util_format_dxt1_rgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
202 util_format_dxt1_rgba_fetch(0, src
, i
, j
, tmp
);
203 dst
[0] = ubyte_to_float(tmp
[0]);
204 dst
[1] = ubyte_to_float(tmp
[1]);
205 dst
[2] = ubyte_to_float(tmp
[2]);
206 dst
[3] = ubyte_to_float(tmp
[3]);
210 util_format_dxt3_rgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
213 util_format_dxt3_rgba_fetch(0, src
, i
, j
, tmp
);
214 dst
[0] = ubyte_to_float(tmp
[0]);
215 dst
[1] = ubyte_to_float(tmp
[1]);
216 dst
[2] = ubyte_to_float(tmp
[2]);
217 dst
[3] = ubyte_to_float(tmp
[3]);
221 util_format_dxt5_rgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
224 util_format_dxt5_rgba_fetch(0, src
, i
, j
, tmp
);
225 dst
[0] = ubyte_to_float(tmp
[0]);
226 dst
[1] = ubyte_to_float(tmp
[1]);
227 dst
[2] = ubyte_to_float(tmp
[2]);
228 dst
[3] = ubyte_to_float(tmp
[3]);
233 * Block decompression.
237 util_format_dxtn_rgb_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
238 const uint8_t *src_row
, unsigned src_stride
,
239 unsigned width
, unsigned height
,
240 util_format_dxtn_fetch_t fetch
,
244 for(y
= 0; y
< height
; y
+= 4) {
245 const uint8_t *src
= src_row
;
246 for(x
= 0; x
< width
; x
+= 4) {
247 for(j
= 0; j
< 4; ++j
) {
248 for(i
= 0; i
< 4; ++i
) {
249 uint8_t *dst
= dst_row
+ (y
+ j
)*dst_stride
/sizeof(*dst_row
) + (x
+ i
)*4;
250 fetch(0, src
, i
, j
, dst
);
255 src_row
+= src_stride
;
260 util_format_dxt1_rgb_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
261 const uint8_t *src_row
, unsigned src_stride
,
262 unsigned width
, unsigned height
)
264 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
267 util_format_dxt1_rgb_fetch
, 8);
271 util_format_dxt1_rgba_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
272 const uint8_t *src_row
, unsigned src_stride
,
273 unsigned width
, unsigned height
)
275 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
278 util_format_dxt1_rgba_fetch
, 8);
282 util_format_dxt3_rgba_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
283 const uint8_t *src_row
, unsigned src_stride
,
284 unsigned width
, unsigned height
)
286 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
289 util_format_dxt3_rgba_fetch
, 16);
293 util_format_dxt5_rgba_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
294 const uint8_t *src_row
, unsigned src_stride
,
295 unsigned width
, unsigned height
)
297 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
300 util_format_dxt5_rgba_fetch
, 16);
304 util_format_dxtn_rgb_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
305 const uint8_t *src_row
, unsigned src_stride
,
306 unsigned width
, unsigned height
,
307 util_format_dxtn_fetch_t fetch
,
311 for(y
= 0; y
< height
; y
+= 4) {
312 const uint8_t *src
= src_row
;
313 for(x
= 0; x
< width
; x
+= 4) {
314 for(j
= 0; j
< 4; ++j
) {
315 for(i
= 0; i
< 4; ++i
) {
316 float *dst
= dst_row
+ (y
+ j
)*dst_stride
/sizeof(*dst_row
) + (x
+ i
)*4;
318 fetch(0, src
, i
, j
, tmp
);
319 dst
[0] = ubyte_to_float(tmp
[0]);
320 dst
[1] = ubyte_to_float(tmp
[1]);
321 dst
[2] = ubyte_to_float(tmp
[2]);
322 dst
[3] = ubyte_to_float(tmp
[3]);
327 src_row
+= src_stride
;
332 util_format_dxt1_rgb_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
333 const uint8_t *src_row
, unsigned src_stride
,
334 unsigned width
, unsigned height
)
336 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
339 util_format_dxt1_rgb_fetch
, 8);
343 util_format_dxt1_rgba_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
344 const uint8_t *src_row
, unsigned src_stride
,
345 unsigned width
, unsigned height
)
347 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
350 util_format_dxt1_rgba_fetch
, 8);
354 util_format_dxt3_rgba_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
355 const uint8_t *src_row
, unsigned src_stride
,
356 unsigned width
, unsigned height
)
358 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
361 util_format_dxt3_rgba_fetch
, 16);
365 util_format_dxt5_rgba_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
366 const uint8_t *src_row
, unsigned src_stride
,
367 unsigned width
, unsigned height
)
369 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
372 util_format_dxt5_rgba_fetch
, 16);
381 util_format_dxt1_rgb_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
382 const uint8_t *src_row
, unsigned src_stride
,
383 unsigned width
, unsigned height
)
385 unsigned x
, y
, i
, j
, k
;
386 for(y
= 0; y
< height
; y
+= 4) {
387 const uint8_t *src
= src_row
;
388 uint8_t *dst
= dst_row
;
389 for(x
= 0; x
< width
; x
+= 4) {
390 uint8_t tmp
[4][4][3];
391 for(j
= 0; j
< 4; ++j
) {
392 for(i
= 0; i
< 4; ++i
) {
393 for(k
= 0; k
< 3; ++k
) {
394 tmp
[j
][i
][k
] = src
[(y
+ j
)*src_stride
/sizeof(*src
) + i
*4 + k
];
398 util_format_dxtn_pack(3, 4, 4, &tmp
[0][0][0], UTIL_FORMAT_DXT1_RGB
, dst
, dst_stride
);
402 src_row
+= src_stride
;
403 dst_row
+= 4*dst_stride
/sizeof(*dst_row
);
408 util_format_dxt1_rgba_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
409 const uint8_t *src_row
, unsigned src_stride
,
410 unsigned width
, unsigned height
)
412 unsigned x
, y
, i
, j
, k
;
413 for(y
= 0; y
< height
; y
+= 4) {
414 const uint8_t *src
= src_row
;
415 uint8_t *dst
= dst_row
;
416 for(x
= 0; x
< width
; x
+= 4) {
417 uint8_t tmp
[4][4][4];
418 for(j
= 0; j
< 4; ++j
) {
419 for(i
= 0; i
< 4; ++i
) {
420 for(k
= 0; k
< 4; ++k
) {
421 tmp
[j
][i
][k
] = src
[(y
+ j
)*src_stride
/sizeof(*src
) + i
*4 + k
];
425 util_format_dxtn_pack(4, 4, 4, &tmp
[0][0][0], UTIL_FORMAT_DXT1_RGBA
, dst
, dst_stride
);
429 src_row
+= src_stride
;
430 dst_row
+= 4*dst_stride
/sizeof(*dst_row
);
435 util_format_dxt3_rgba_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
436 const uint8_t *src_row
, unsigned src_stride
,
437 unsigned width
, unsigned height
)
439 unsigned x
, y
, i
, j
, k
;
440 for(y
= 0; y
< height
; y
+= 4) {
441 const uint8_t *src
= src_row
;
442 uint8_t *dst
= dst_row
;
443 for(x
= 0; x
< width
; x
+= 4) {
444 uint8_t tmp
[4][4][4];
445 for(j
= 0; j
< 4; ++j
) {
446 for(i
= 0; i
< 4; ++i
) {
447 for(k
= 0; k
< 4; ++k
) {
448 tmp
[j
][i
][k
] = src
[(y
+ j
)*src_stride
/sizeof(*src
) + i
*4 + k
];
452 util_format_dxtn_pack(4, 4, 4, &tmp
[0][0][0], UTIL_FORMAT_DXT3_RGBA
, dst
, dst_stride
);
456 src_row
+= src_stride
;
457 dst_row
+= 4*dst_stride
/sizeof(*dst_row
);
462 util_format_dxt5_rgba_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
463 const uint8_t *src_row
, unsigned src_stride
,
464 unsigned width
, unsigned height
)
466 unsigned x
, y
, i
, j
, k
;
467 for(y
= 0; y
< height
; y
+= 4) {
468 const uint8_t *src
= src_row
;
469 uint8_t *dst
= dst_row
;
470 for(x
= 0; x
< width
; x
+= 4) {
471 uint8_t tmp
[4][4][4];
472 for(j
= 0; j
< 4; ++j
) {
473 for(i
= 0; i
< 4; ++i
) {
474 for(k
= 0; k
< 4; ++k
) {
475 tmp
[j
][i
][k
] = src
[(y
+ j
)*src_stride
/sizeof(*src
) + i
*4 + k
];
479 util_format_dxtn_pack(4, 4, 4, &tmp
[0][0][0], UTIL_FORMAT_DXT5_RGBA
, dst
, dst_stride
);
483 src_row
+= src_stride
;
484 dst_row
+= 4*dst_stride
/sizeof(*dst_row
);
489 util_format_dxt1_rgb_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
490 const float *src_row
, unsigned src_stride
,
491 unsigned width
, unsigned height
)
493 unsigned x
, y
, i
, j
, k
;
494 for(y
= 0; y
< height
; y
+= 4) {
495 const float *src
= src_row
;
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
) + i
*4 + k
]);
506 util_format_dxtn_pack(3, 4, 4, &tmp
[0][0][0], UTIL_FORMAT_DXT1_RGB
, dst
, dst_stride
);
510 src_row
+= src_stride
;
511 dst_row
+= 4*dst_stride
/sizeof(*dst_row
);
516 util_format_dxt1_rgba_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
517 const float *src_row
, unsigned src_stride
,
518 unsigned width
, unsigned height
)
520 unsigned x
, y
, i
, j
, k
;
521 for(y
= 0; y
< height
; y
+= 4) {
522 const float *src
= src_row
;
523 uint8_t *dst
= dst_row
;
524 for(x
= 0; x
< width
; x
+= 4) {
525 uint8_t tmp
[4][4][4];
526 for(j
= 0; j
< 4; ++j
) {
527 for(i
= 0; i
< 4; ++i
) {
528 for(k
= 0; k
< 4; ++k
) {
529 tmp
[j
][i
][k
] = float_to_ubyte(src
[(y
+ j
)*src_stride
/sizeof(*src
) + i
*4 + k
]);
533 util_format_dxtn_pack(4, 4, 4, &tmp
[0][0][0], UTIL_FORMAT_DXT1_RGBA
, dst
, dst_stride
);
537 src_row
+= src_stride
;
538 dst_row
+= 4*dst_stride
/sizeof(*dst_row
);
543 util_format_dxt3_rgba_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
, const float *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
545 unsigned x
, y
, i
, j
, k
;
546 for(y
= 0; y
< height
; y
+= 4) {
547 const float *src
= src_row
;
548 uint8_t *dst
= dst_row
;
549 for(x
= 0; x
< width
; x
+= 4) {
550 uint8_t tmp
[4][4][4];
551 for(j
= 0; j
< 4; ++j
) {
552 for(i
= 0; i
< 4; ++i
) {
553 for(k
= 0; k
< 4; ++k
) {
554 tmp
[j
][i
][k
] = float_to_ubyte(src
[(y
+ j
)*src_stride
/sizeof(*src
) + i
*4 + k
]);
558 util_format_dxtn_pack(4, 4, 4, &tmp
[0][0][0], UTIL_FORMAT_DXT3_RGBA
, dst
, dst_stride
);
562 src_row
+= src_stride
;
563 dst_row
+= 4*dst_stride
/sizeof(*dst_row
);
568 util_format_dxt5_rgba_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
, const float *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
570 unsigned x
, y
, i
, j
, k
;
571 for(y
= 0; y
< height
; y
+= 4) {
572 const float *src
= src_row
;
573 uint8_t *dst
= dst_row
;
574 for(x
= 0; x
< width
; x
+= 4) {
575 uint8_t tmp
[4][4][4];
576 for(j
= 0; j
< 4; ++j
) {
577 for(i
= 0; i
< 4; ++i
) {
578 for(k
= 0; k
< 4; ++k
) {
579 tmp
[j
][i
][k
] = float_to_ubyte(src
[(y
+ j
)*src_stride
/sizeof(*src
) + i
*4 + k
]);
583 util_format_dxtn_pack(4, 4, 4, &tmp
[0][0][0], UTIL_FORMAT_DXT5_RGBA
, dst
, dst_stride
);
587 src_row
+= src_stride
;
588 dst_row
+= 4*dst_stride
/sizeof(*dst_row
);
596 * FIXME: shunts to RGB for now
600 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
)
602 util_format_dxt1_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
606 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
)
608 util_format_dxt1_rgb_pack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
612 util_format_dxt1_srgb_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
614 util_format_dxt1_rgb_fetch_rgba_8unorm(dst
, src
, i
, j
);
618 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
)
620 util_format_dxt1_rgba_unpack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
624 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
)
626 util_format_dxt1_rgba_pack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
630 util_format_dxt1_srgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
632 util_format_dxt1_rgba_fetch_rgba_8unorm(dst
, src
, i
, j
);
636 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
)
638 util_format_dxt3_rgba_unpack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
642 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
)
644 util_format_dxt3_rgba_pack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
648 util_format_dxt3_srgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
650 util_format_dxt3_rgba_fetch_rgba_8unorm(dst
, src
, i
, j
);
654 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
)
656 util_format_dxt5_rgba_unpack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
660 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
)
662 util_format_dxt5_rgba_pack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
666 util_format_dxt5_srgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
668 util_format_dxt5_rgba_fetch_rgba_8unorm(dst
, src
, i
, j
);
672 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
)
674 util_format_dxt1_rgb_unpack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
678 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
)
680 util_format_dxt1_rgb_pack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
684 util_format_dxt1_srgb_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
686 util_format_dxt1_rgb_fetch_rgba_float(dst
, src
, i
, j
);
690 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
)
692 util_format_dxt1_rgba_unpack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
696 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
)
698 util_format_dxt1_rgba_pack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
702 util_format_dxt1_srgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
704 util_format_dxt1_rgba_fetch_rgba_float(dst
, src
, i
, j
);
708 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
)
710 util_format_dxt3_rgba_unpack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
714 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
)
716 util_format_dxt3_rgba_pack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
720 util_format_dxt3_srgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
722 util_format_dxt3_rgba_fetch_rgba_float(dst
, src
, i
, j
);
726 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
)
728 util_format_dxt5_rgba_unpack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
732 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
)
734 util_format_dxt5_rgba_pack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
, width
, height
);
738 util_format_dxt5_srgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
740 util_format_dxt5_rgba_fetch_rgba_float(dst
, src
, i
, j
);