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 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
24 **************************************************************************/
26 #include "util/format/u_format.h"
27 #include "util/format/u_format_s3tc.h"
28 #include "util/format_srgb.h"
29 #include "util/u_math.h"
30 #include "../../mesa/main/texcompress_s3tc_tmp.h"
33 util_format_dxtn_fetch_t util_format_dxt1_rgb_fetch
= (util_format_dxtn_fetch_t
)fetch_2d_texel_rgb_dxt1
;
34 util_format_dxtn_fetch_t util_format_dxt1_rgba_fetch
= (util_format_dxtn_fetch_t
)fetch_2d_texel_rgba_dxt1
;
35 util_format_dxtn_fetch_t util_format_dxt3_rgba_fetch
= (util_format_dxtn_fetch_t
)fetch_2d_texel_rgba_dxt3
;
36 util_format_dxtn_fetch_t util_format_dxt5_rgba_fetch
= (util_format_dxtn_fetch_t
)fetch_2d_texel_rgba_dxt5
;
38 util_format_dxtn_pack_t util_format_dxtn_pack
= (util_format_dxtn_pack_t
)tx_compress_dxtn
;
46 util_format_dxt1_rgb_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
48 util_format_dxt1_rgb_fetch(0, src
, i
, j
, dst
);
52 util_format_dxt1_rgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
54 util_format_dxt1_rgba_fetch(0, src
, i
, j
, dst
);
58 util_format_dxt3_rgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
60 util_format_dxt3_rgba_fetch(0, src
, i
, j
, dst
);
64 util_format_dxt5_rgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
66 util_format_dxt5_rgba_fetch(0, src
, i
, j
, dst
);
70 util_format_dxt1_rgb_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
73 util_format_dxt1_rgb_fetch(0, src
, i
, j
, tmp
);
74 dst
[0] = ubyte_to_float(tmp
[0]);
75 dst
[1] = ubyte_to_float(tmp
[1]);
76 dst
[2] = ubyte_to_float(tmp
[2]);
81 util_format_dxt1_rgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
84 util_format_dxt1_rgba_fetch(0, src
, i
, j
, tmp
);
85 dst
[0] = ubyte_to_float(tmp
[0]);
86 dst
[1] = ubyte_to_float(tmp
[1]);
87 dst
[2] = ubyte_to_float(tmp
[2]);
88 dst
[3] = ubyte_to_float(tmp
[3]);
92 util_format_dxt3_rgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
95 util_format_dxt3_rgba_fetch(0, src
, i
, j
, tmp
);
96 dst
[0] = ubyte_to_float(tmp
[0]);
97 dst
[1] = ubyte_to_float(tmp
[1]);
98 dst
[2] = ubyte_to_float(tmp
[2]);
99 dst
[3] = ubyte_to_float(tmp
[3]);
103 util_format_dxt5_rgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
106 util_format_dxt5_rgba_fetch(0, src
, i
, j
, tmp
);
107 dst
[0] = ubyte_to_float(tmp
[0]);
108 dst
[1] = ubyte_to_float(tmp
[1]);
109 dst
[2] = ubyte_to_float(tmp
[2]);
110 dst
[3] = ubyte_to_float(tmp
[3]);
115 * Block decompression.
119 util_format_dxtn_rgb_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
120 const uint8_t *src_row
, unsigned src_stride
,
121 unsigned width
, unsigned height
,
122 util_format_dxtn_fetch_t fetch
,
123 unsigned block_size
, boolean srgb
)
125 const unsigned bw
= 4, bh
= 4, comps
= 4;
127 for(y
= 0; y
< height
; y
+= bh
) {
128 const uint8_t *src
= src_row
;
129 for(x
= 0; x
< width
; x
+= bw
) {
130 for(j
= 0; j
< bh
; ++j
) {
131 for(i
= 0; i
< bw
; ++i
) {
132 uint8_t *dst
= dst_row
+ (y
+ j
)*dst_stride
/sizeof(*dst_row
) + (x
+ i
)*comps
;
133 fetch(0, src
, i
, j
, dst
);
135 dst
[0] = util_format_srgb_to_linear_8unorm(dst
[0]);
136 dst
[1] = util_format_srgb_to_linear_8unorm(dst
[1]);
137 dst
[2] = util_format_srgb_to_linear_8unorm(dst
[2]);
143 src_row
+= src_stride
;
148 util_format_dxt1_rgb_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
149 const uint8_t *src_row
, unsigned src_stride
,
150 unsigned width
, unsigned height
)
152 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
155 util_format_dxt1_rgb_fetch
,
160 util_format_dxt1_rgba_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
161 const uint8_t *src_row
, unsigned src_stride
,
162 unsigned width
, unsigned height
)
164 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
167 util_format_dxt1_rgba_fetch
,
172 util_format_dxt3_rgba_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
173 const uint8_t *src_row
, unsigned src_stride
,
174 unsigned width
, unsigned height
)
176 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
179 util_format_dxt3_rgba_fetch
,
184 util_format_dxt5_rgba_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
185 const uint8_t *src_row
, unsigned src_stride
,
186 unsigned width
, unsigned height
)
188 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
191 util_format_dxt5_rgba_fetch
,
196 util_format_dxtn_rgb_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
197 const uint8_t *src_row
, unsigned src_stride
,
198 unsigned width
, unsigned height
,
199 util_format_dxtn_fetch_t fetch
,
200 unsigned block_size
, boolean srgb
)
203 for(y
= 0; y
< height
; y
+= 4) {
204 const uint8_t *src
= src_row
;
205 for(x
= 0; x
< width
; x
+= 4) {
206 for(j
= 0; j
< 4; ++j
) {
207 for(i
= 0; i
< 4; ++i
) {
208 float *dst
= dst_row
+ (y
+ j
)*dst_stride
/sizeof(*dst_row
) + (x
+ i
)*4;
210 fetch(0, src
, i
, j
, tmp
);
212 dst
[0] = util_format_srgb_8unorm_to_linear_float(tmp
[0]);
213 dst
[1] = util_format_srgb_8unorm_to_linear_float(tmp
[1]);
214 dst
[2] = util_format_srgb_8unorm_to_linear_float(tmp
[2]);
217 dst
[0] = ubyte_to_float(tmp
[0]);
218 dst
[1] = ubyte_to_float(tmp
[1]);
219 dst
[2] = ubyte_to_float(tmp
[2]);
221 dst
[3] = ubyte_to_float(tmp
[3]);
226 src_row
+= src_stride
;
231 util_format_dxt1_rgb_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
232 const uint8_t *src_row
, unsigned src_stride
,
233 unsigned width
, unsigned height
)
235 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
238 util_format_dxt1_rgb_fetch
,
243 util_format_dxt1_rgba_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
244 const uint8_t *src_row
, unsigned src_stride
,
245 unsigned width
, unsigned height
)
247 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
250 util_format_dxt1_rgba_fetch
,
255 util_format_dxt3_rgba_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
256 const uint8_t *src_row
, unsigned src_stride
,
257 unsigned width
, unsigned height
)
259 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
262 util_format_dxt3_rgba_fetch
,
267 util_format_dxt5_rgba_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
268 const uint8_t *src_row
, unsigned src_stride
,
269 unsigned width
, unsigned height
)
271 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
274 util_format_dxt5_rgba_fetch
,
284 util_format_dxtn_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
285 const uint8_t *src
, unsigned src_stride
,
286 unsigned width
, unsigned height
,
287 enum util_format_dxtn format
,
288 unsigned block_size
, boolean srgb
)
290 const unsigned bw
= 4, bh
= 4, comps
= 4;
291 unsigned x
, y
, i
, j
, k
;
292 for(y
= 0; y
< height
; y
+= bh
) {
293 uint8_t *dst
= dst_row
;
294 for(x
= 0; x
< width
; x
+= bw
) {
295 uint8_t tmp
[4][4][4]; /* [bh][bw][comps] */
296 for(j
= 0; j
< bh
; ++j
) {
297 for(i
= 0; i
< bw
; ++i
) {
299 for(k
= 0; k
< 3; ++k
) {
300 src_tmp
= src
[(y
+ j
)*src_stride
/sizeof(*src
) + (x
+i
)*comps
+ k
];
302 tmp
[j
][i
][k
] = util_format_linear_to_srgb_8unorm(src_tmp
);
305 tmp
[j
][i
][k
] = src_tmp
;
308 /* for sake of simplicity there's an unneeded 4th component for dxt1_rgb */
309 tmp
[j
][i
][3] = src
[(y
+ j
)*src_stride
/sizeof(*src
) + (x
+i
)*comps
+ 3];
312 /* even for dxt1_rgb have 4 src comps */
313 util_format_dxtn_pack(4, 4, 4, &tmp
[0][0][0], format
, dst
, 0);
316 dst_row
+= dst_stride
/ sizeof(*dst_row
);
322 util_format_dxt1_rgb_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
323 const uint8_t *src
, unsigned src_stride
,
324 unsigned width
, unsigned height
)
326 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src
, src_stride
,
327 width
, height
, UTIL_FORMAT_DXT1_RGB
,
332 util_format_dxt1_rgba_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
333 const uint8_t *src
, unsigned src_stride
,
334 unsigned width
, unsigned height
)
336 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src
, src_stride
,
337 width
, height
, UTIL_FORMAT_DXT1_RGBA
,
342 util_format_dxt3_rgba_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
343 const uint8_t *src
, unsigned src_stride
,
344 unsigned width
, unsigned height
)
346 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src
, src_stride
,
347 width
, height
, UTIL_FORMAT_DXT3_RGBA
,
352 util_format_dxt5_rgba_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
353 const uint8_t *src
, unsigned src_stride
,
354 unsigned width
, unsigned height
)
356 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src
, src_stride
,
357 width
, height
, UTIL_FORMAT_DXT5_RGBA
,
362 util_format_dxtn_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
363 const float *src
, unsigned src_stride
,
364 unsigned width
, unsigned height
,
365 enum util_format_dxtn format
,
366 unsigned block_size
, boolean srgb
)
368 unsigned x
, y
, i
, j
, k
;
369 for(y
= 0; y
< height
; y
+= 4) {
370 uint8_t *dst
= dst_row
;
371 for(x
= 0; x
< width
; x
+= 4) {
372 uint8_t tmp
[4][4][4];
373 for(j
= 0; j
< 4; ++j
) {
374 for(i
= 0; i
< 4; ++i
) {
376 for(k
= 0; k
< 3; ++k
) {
377 src_tmp
= src
[(y
+ j
)*src_stride
/sizeof(*src
) + (x
+i
)*4 + k
];
379 tmp
[j
][i
][k
] = util_format_linear_float_to_srgb_8unorm(src_tmp
);
382 tmp
[j
][i
][k
] = float_to_ubyte(src_tmp
);
385 /* for sake of simplicity there's an unneeded 4th component for dxt1_rgb */
386 src_tmp
= src
[(y
+ j
)*src_stride
/sizeof(*src
) + (x
+i
)*4 + 3];
387 tmp
[j
][i
][3] = float_to_ubyte(src_tmp
);
390 util_format_dxtn_pack(4, 4, 4, &tmp
[0][0][0], format
, dst
, 0);
393 dst_row
+= 4*dst_stride
/sizeof(*dst_row
);
398 util_format_dxt1_rgb_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
399 const float *src
, unsigned src_stride
,
400 unsigned width
, unsigned height
)
402 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src
, src_stride
,
403 width
, height
, UTIL_FORMAT_DXT1_RGB
,
408 util_format_dxt1_rgba_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
409 const float *src
, unsigned src_stride
,
410 unsigned width
, unsigned height
)
412 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src
, src_stride
,
413 width
, height
, UTIL_FORMAT_DXT1_RGBA
,
418 util_format_dxt3_rgba_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
419 const float *src
, unsigned src_stride
,
420 unsigned width
, unsigned height
)
422 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src
, src_stride
,
423 width
, height
, UTIL_FORMAT_DXT3_RGBA
,
428 util_format_dxt5_rgba_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
429 const float *src
, unsigned src_stride
,
430 unsigned width
, unsigned height
)
432 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src
, src_stride
,
433 width
, height
, UTIL_FORMAT_DXT5_RGBA
,
443 util_format_dxt1_srgb_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
446 util_format_dxt1_rgb_fetch(0, src
, i
, j
, tmp
);
447 dst
[0] = util_format_srgb_to_linear_8unorm(tmp
[0]);
448 dst
[1] = util_format_srgb_to_linear_8unorm(tmp
[1]);
449 dst
[2] = util_format_srgb_to_linear_8unorm(tmp
[2]);
454 util_format_dxt1_srgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
457 util_format_dxt1_rgba_fetch(0, src
, i
, j
, tmp
);
458 dst
[0] = util_format_srgb_to_linear_8unorm(tmp
[0]);
459 dst
[1] = util_format_srgb_to_linear_8unorm(tmp
[1]);
460 dst
[2] = util_format_srgb_to_linear_8unorm(tmp
[2]);
465 util_format_dxt3_srgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
468 util_format_dxt3_rgba_fetch(0, src
, i
, j
, tmp
);
469 dst
[0] = util_format_srgb_to_linear_8unorm(tmp
[0]);
470 dst
[1] = util_format_srgb_to_linear_8unorm(tmp
[1]);
471 dst
[2] = util_format_srgb_to_linear_8unorm(tmp
[2]);
476 util_format_dxt5_srgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
479 util_format_dxt5_rgba_fetch(0, src
, i
, j
, tmp
);
480 dst
[0] = util_format_srgb_to_linear_8unorm(tmp
[0]);
481 dst
[1] = util_format_srgb_to_linear_8unorm(tmp
[1]);
482 dst
[2] = util_format_srgb_to_linear_8unorm(tmp
[2]);
487 util_format_dxt1_srgb_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
490 util_format_dxt1_rgb_fetch(0, src
, i
, j
, tmp
);
491 dst
[0] = util_format_srgb_8unorm_to_linear_float(tmp
[0]);
492 dst
[1] = util_format_srgb_8unorm_to_linear_float(tmp
[1]);
493 dst
[2] = util_format_srgb_8unorm_to_linear_float(tmp
[2]);
498 util_format_dxt1_srgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
501 util_format_dxt1_rgba_fetch(0, src
, i
, j
, tmp
);
502 dst
[0] = util_format_srgb_8unorm_to_linear_float(tmp
[0]);
503 dst
[1] = util_format_srgb_8unorm_to_linear_float(tmp
[1]);
504 dst
[2] = util_format_srgb_8unorm_to_linear_float(tmp
[2]);
505 dst
[3] = ubyte_to_float(tmp
[3]);
509 util_format_dxt3_srgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
512 util_format_dxt3_rgba_fetch(0, src
, i
, j
, tmp
);
513 dst
[0] = util_format_srgb_8unorm_to_linear_float(tmp
[0]);
514 dst
[1] = util_format_srgb_8unorm_to_linear_float(tmp
[1]);
515 dst
[2] = util_format_srgb_8unorm_to_linear_float(tmp
[2]);
516 dst
[3] = ubyte_to_float(tmp
[3]);
520 util_format_dxt5_srgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
523 util_format_dxt5_rgba_fetch(0, src
, i
, j
, tmp
);
524 dst
[0] = util_format_srgb_8unorm_to_linear_float(tmp
[0]);
525 dst
[1] = util_format_srgb_8unorm_to_linear_float(tmp
[1]);
526 dst
[2] = util_format_srgb_8unorm_to_linear_float(tmp
[2]);
527 dst
[3] = ubyte_to_float(tmp
[3]);
531 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
)
533 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
536 util_format_dxt1_rgb_fetch
,
541 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
)
543 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
546 util_format_dxt1_rgba_fetch
,
551 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
)
553 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
556 util_format_dxt3_rgba_fetch
,
561 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
)
563 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
566 util_format_dxt5_rgba_fetch
,
571 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
)
573 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
576 util_format_dxt1_rgb_fetch
,
581 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
)
583 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
586 util_format_dxt1_rgba_fetch
,
591 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
)
593 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
596 util_format_dxt3_rgba_fetch
,
601 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
)
603 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
606 util_format_dxt5_rgba_fetch
,
611 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
)
613 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
,
614 width
, height
, UTIL_FORMAT_DXT1_RGB
,
619 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
)
621 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
,
622 width
, height
, UTIL_FORMAT_DXT1_RGBA
,
627 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
)
629 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
,
630 width
, height
, UTIL_FORMAT_DXT3_RGBA
,
635 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
)
637 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
,
638 width
, height
, UTIL_FORMAT_DXT5_RGBA
,
643 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
)
645 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
,
646 width
, height
, UTIL_FORMAT_DXT1_RGB
,
651 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
)
653 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
,
654 width
, height
, UTIL_FORMAT_DXT1_RGBA
,
659 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
)
661 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
,
662 width
, height
, UTIL_FORMAT_DXT3_RGBA
,
667 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
)
669 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
,
670 width
, height
, UTIL_FORMAT_DXT5_RGBA
,