1 from __future__
import print_function
3 from mako
.template
import Template
7 * Mesa 3-D graphics library
9 * Copyright (c) 2011 VMware, Inc.
10 * Copyright (c) 2014 Intel Corporation.
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28 * OTHER DEALINGS IN THE SOFTWARE.
33 * Color, depth, stencil packing functions.
34 * Used to pack basic color, depth and stencil formats to specific
37 * There are both per-pixel and per-row packing functions:
38 * - The former will be used by swrast to write values to the color, depth,
39 * stencil buffers when drawing points, lines and masked spans.
40 * - The later will be used for image-oriented functions like glDrawPixels,
41 * glAccum, and glTexImage.
46 #include "format_unpack.h"
47 #include "format_utils.h"
49 #include "util/format_rgb9e5.h"
50 #include "util/format_r11g11b10f.h"
51 #include "util/format_srgb.h"
53 #define UNPACK(SRC, OFFSET, BITS) (((SRC) >> (OFFSET)) & MAX_UINT(BITS))
56 import format_parser as parser
58 formats = parser.parse(argv[1])
62 if f.name == 'MESA_FORMAT_NONE':
64 if f.colorspace not in ('rgb', 'srgb'):
70 /* float unpacking functions */
72 %for f in rgb_formats:
73 %if f.name in ('MESA_FORMAT_R9G9B9E5_FLOAT', 'MESA_FORMAT_R11G11B10_FLOAT'):
75 %elif f.is_int() and not f.is_normalized():
77 %elif f.is_compressed():
82 unpack_float_${f.short_name()}(const void *void_src, float dst[4])
84 ${f.datatype()} *src = (${f.datatype()} *)void_src;
85 %if f.layout == parser.PACKED:
88 ${c.datatype()} ${c.name} = UNPACK(*src, ${c.shift}, ${c.size});
91 %elif f.layout == parser.ARRAY:
92 %for (i, c) in enumerate(f.channels):
94 ${c.datatype()} ${c.name} = src[${i}];
102 <% s = f.swizzle[i] %>
103 %if 0 <= s and s <= parser.Swizzle.SWIZZLE_W:
104 <% c = f.channels[s] %>
105 %if c.type == parser.UNSIGNED:
106 %if f.colorspace == 'srgb' and c.name in 'rgb':
107 <% assert c.size == 8 %>
108 dst[${i}] = util_format_srgb_8unorm_to_linear_float(${c.name});
110 dst[${i}] = _mesa_unorm_to_float(${c.name}, ${c.size});
112 %elif c.type == parser.SIGNED:
113 dst[${i}] = _mesa_snorm_to_float(${c.name}, ${c.size});
114 %elif c.type == parser.FLOAT:
116 dst[${i}] = ${c.name};
118 dst[${i}] = _mesa_half_to_float(${c.name});
125 %elif s == parser.Swizzle.SWIZZLE_ZERO:
127 %elif s == parser.Swizzle.SWIZZLE_ONE:
137 unpack_float_r9g9b9e5_float(const void *src, float dst[4])
139 rgb9e5_to_float3(*(const uint32_t *)src, dst);
144 unpack_float_r11g11b10_float(const void *src, float dst[4])
146 r11g11b10f_to_float3(*(const uint32_t *)src, dst);
151 unpack_float_ycbcr(const void *src, float dst[][4], uint32_t n)
154 for (i = 0; i < n; i++) {
155 const uint16_t *src0 = ((const uint16_t *) src) + i * 2; /* even */
156 const uint16_t *src1 = src0 + 1; /* odd */
157 const uint8_t y0 = (*src0 >> 8) & 0xff; /* luminance */
158 const uint8_t cb = *src0 & 0xff; /* chroma U */
159 const uint8_t y1 = (*src1 >> 8) & 0xff; /* luminance */
160 const uint8_t cr = *src1 & 0xff; /* chroma V */
161 const uint8_t y = (i & 1) ? y1 : y0; /* choose even/odd luminance */
162 float r = 1.164F * (y - 16) + 1.596F * (cr - 128);
163 float g = 1.164F * (y - 16) - 0.813F * (cr - 128) - 0.391F * (cb - 128);
164 float b = 1.164F * (y - 16) + 2.018F * (cb - 128);
165 r *= (1.0F / 255.0F);
166 g *= (1.0F / 255.0F);
167 b *= (1.0F / 255.0F);
168 dst[i][0] = CLAMP(r, 0.0F, 1.0F);
169 dst[i][1] = CLAMP(g, 0.0F, 1.0F);
170 dst[i][2] = CLAMP(b, 0.0F, 1.0F);
176 unpack_float_ycbcr_rev(const void *src, float dst[][4], uint32_t n)
179 for (i = 0; i < n; i++) {
180 const uint16_t *src0 = ((const uint16_t *) src) + i * 2; /* even */
181 const uint16_t *src1 = src0 + 1; /* odd */
182 const uint8_t y0 = *src0 & 0xff; /* luminance */
183 const uint8_t cr = (*src0 >> 8) & 0xff; /* chroma V */
184 const uint8_t y1 = *src1 & 0xff; /* luminance */
185 const uint8_t cb = (*src1 >> 8) & 0xff; /* chroma U */
186 const uint8_t y = (i & 1) ? y1 : y0; /* choose even/odd luminance */
187 float r = 1.164F * (y - 16) + 1.596F * (cr - 128);
188 float g = 1.164F * (y - 16) - 0.813F * (cr - 128) - 0.391F * (cb - 128);
189 float b = 1.164F * (y - 16) + 2.018F * (cb - 128);
190 r *= (1.0F / 255.0F);
191 g *= (1.0F / 255.0F);
192 b *= (1.0F / 255.0F);
193 dst[i][0] = CLAMP(r, 0.0F, 1.0F);
194 dst[i][1] = CLAMP(g, 0.0F, 1.0F);
195 dst[i][2] = CLAMP(b, 0.0F, 1.0F);
200 /* ubyte packing functions */
202 %for f in rgb_formats:
203 %if not f.is_normalized():
208 unpack_ubyte_${f.short_name()}(const void *void_src, uint8_t dst[4])
210 ${f.datatype()} *src = (${f.datatype()} *)void_src;
211 %if f.layout == parser.PACKED:
212 %for c in f.channels:
214 ${c.datatype()} ${c.name} = UNPACK(*src, ${c.shift}, ${c.size});
217 %elif f.layout == parser.ARRAY:
218 %for (i, c) in enumerate(f.channels):
220 ${c.datatype()} ${c.name} = src[${i}];
228 <% s = f.swizzle[i] %>
229 %if 0 <= s and s <= parser.Swizzle.SWIZZLE_W:
230 <% c = f.channels[s] %>
231 %if c.type == parser.UNSIGNED:
232 %if f.colorspace == 'srgb' and c.name in 'rgb':
233 <% assert c.size == 8 %>
234 dst[${i}] = util_format_srgb_to_linear_8unorm(${c.name});
236 dst[${i}] = _mesa_unorm_to_unorm(${c.name}, ${c.size}, 8);
238 %elif c.type == parser.SIGNED:
239 dst[${i}] = _mesa_snorm_to_unorm(${c.name}, ${c.size}, 8);
240 %elif c.type == parser.FLOAT:
242 dst[${i}] = _mesa_float_to_unorm(${c.name}, 8);
244 dst[${i}] = _mesa_half_to_unorm(${c.name}, 8);
251 %elif s == parser.Swizzle.SWIZZLE_ZERO:
253 %elif s == parser.Swizzle.SWIZZLE_ONE:
262 /* integer packing functions */
264 %for f in rgb_formats:
267 %elif f.is_normalized():
272 unpack_int_${f.short_name()}(const void *void_src, uint32_t dst[4])
274 ${f.datatype()} *src = (${f.datatype()} *)void_src;
275 %if f.layout == parser.PACKED:
276 %for c in f.channels:
278 ${c.datatype()} ${c.name} = UNPACK(*src, ${c.shift}, ${c.size});
281 %elif f.layout == parser.ARRAY:
282 %for (i, c) in enumerate(f.channels):
284 ${c.datatype()} ${c.name} = src[${i}];
292 <% s = f.swizzle[i] %>
293 %if 0 <= s and s <= parser.Swizzle.SWIZZLE_W:
294 dst[${i}] = ${f.channels[s].name};
295 %elif s == parser.Swizzle.SWIZZLE_ZERO:
297 %elif s == parser.Swizzle.SWIZZLE_ONE:
308 _mesa_unpack_rgba_row(mesa_format format, uint32_t n,
309 const void *src, float dst[][4])
311 uint8_t *s = (uint8_t *)src;
315 %for f in rgb_formats:
316 %if f.is_compressed():
318 %elif f.is_int() and not f.is_normalized():
322 for (i = 0; i < n; ++i) {
323 unpack_float_${f.short_name()}(s, dst[i]);
324 s += ${f.block_size() // 8};
328 case MESA_FORMAT_YCBCR:
329 unpack_float_ycbcr(src, dst, n);
331 case MESA_FORMAT_YCBCR_REV:
332 unpack_float_ycbcr_rev(src, dst, n);
335 unreachable("bad format");
340 _mesa_unpack_ubyte_rgba_row(mesa_format format, uint32_t n,
341 const void *src, uint8_t dst[][4])
343 uint8_t *s = (uint8_t *)src;
347 %for f in rgb_formats:
348 %if not f.is_normalized():
353 for (i = 0; i < n; ++i) {
354 unpack_ubyte_${f.short_name()}(s, dst[i]);
355 s += ${f.block_size() // 8};
360 /* get float values, convert to ubyte */
362 float *tmp = malloc(n * 4 * sizeof(float));
365 _mesa_unpack_rgba_row(format, n, src, (float (*)[4]) tmp);
366 for (i = 0; i < n; i++) {
367 dst[i][0] = _mesa_float_to_unorm(tmp[i*4+0], 8);
368 dst[i][1] = _mesa_float_to_unorm(tmp[i*4+1], 8);
369 dst[i][2] = _mesa_float_to_unorm(tmp[i*4+2], 8);
370 dst[i][3] = _mesa_float_to_unorm(tmp[i*4+3], 8);
380 _mesa_unpack_uint_rgba_row(mesa_format format, uint32_t n,
381 const void *src, uint32_t dst[][4])
383 uint8_t *s = (uint8_t *)src;
387 %for f in rgb_formats:
390 %elif f.is_normalized():
395 for (i = 0; i < n; ++i) {
396 unpack_int_${f.short_name()}(s, dst[i]);
397 s += ${f.block_size() // 8};
402 unreachable("bad format");
407 * Unpack a 2D rect of pixels returning float RGBA colors.
408 * \param format the source image format
409 * \param src start address of the source image
410 * \param srcRowStride source image row stride in bytes
411 * \param dst start address of the dest image
412 * \param dstRowStride dest image row stride in bytes
413 * \param x source image start X pos
414 * \param y source image start Y pos
415 * \param width width of rect region to convert
416 * \param height height of rect region to convert
419 _mesa_unpack_rgba_block(mesa_format format,
420 const void *src, int32_t srcRowStride,
421 float dst[][4], int32_t dstRowStride,
422 uint32_t x, uint32_t y, uint32_t width, uint32_t height)
424 const uint32_t srcPixStride = _mesa_get_format_bytes(format);
425 const uint32_t dstPixStride = 4 * sizeof(float);
426 const uint8_t *srcRow;
430 /* XXX needs to be fixed for compressed formats */
432 srcRow = ((const uint8_t *) src) + srcRowStride * y + srcPixStride * x;
433 dstRow = ((uint8_t *) dst) + dstRowStride * y + dstPixStride * x;
435 for (i = 0; i < height; i++) {
436 _mesa_unpack_rgba_row(format, width, srcRow, (float (*)[4]) dstRow);
438 dstRow += dstRowStride;
439 srcRow += srcRowStride;
443 /** Helper struct for MESA_FORMAT_Z32_FLOAT_S8X24_UINT */
450 typedef void (*unpack_float_z_func)(uint32_t n, const void *src, float *dst);
453 unpack_float_z_X8_UINT_Z24_UNORM(uint32_t n, const void *src, float *dst)
455 /* only return Z, not stencil data */
456 const uint32_t *s = ((const uint32_t *) src);
457 const double scale = 1.0 / (double) 0xffffff;
459 for (i = 0; i < n; i++) {
460 dst[i] = (float) ((s[i] >> 8) * scale);
461 assert(dst[i] >= 0.0F);
462 assert(dst[i] <= 1.0F);
467 unpack_float_z_Z24_UNORM_X8_UINT(uint32_t n, const void *src, float *dst)
469 /* only return Z, not stencil data */
470 const uint32_t *s = ((const uint32_t *) src);
471 const double scale = 1.0 / (double) 0xffffff;
473 for (i = 0; i < n; i++) {
474 dst[i] = (float) ((s[i] & 0x00ffffff) * scale);
475 assert(dst[i] >= 0.0F);
476 assert(dst[i] <= 1.0F);
481 unpack_float_Z_UNORM16(uint32_t n, const void *src, float *dst)
483 const uint16_t *s = ((const uint16_t *) src);
485 for (i = 0; i < n; i++) {
486 dst[i] = s[i] * (1.0F / 65535.0F);
491 unpack_float_Z_UNORM32(uint32_t n, const void *src, float *dst)
493 const uint32_t *s = ((const uint32_t *) src);
495 for (i = 0; i < n; i++) {
496 dst[i] = s[i] * (1.0F / 0xffffffff);
501 unpack_float_Z_FLOAT32(uint32_t n, const void *src, float *dst)
503 memcpy(dst, src, n * sizeof(float));
507 unpack_float_z_Z32X24S8(uint32_t n, const void *src, float *dst)
509 const struct z32f_x24s8 *s = (const struct z32f_x24s8 *) src;
511 for (i = 0; i < n; i++) {
520 * The returned values will always be in the range [0.0, 1.0].
523 _mesa_unpack_float_z_row(mesa_format format, uint32_t n,
524 const void *src, float *dst)
526 unpack_float_z_func unpack;
529 case MESA_FORMAT_S8_UINT_Z24_UNORM:
530 case MESA_FORMAT_X8_UINT_Z24_UNORM:
531 unpack = unpack_float_z_X8_UINT_Z24_UNORM;
533 case MESA_FORMAT_Z24_UNORM_S8_UINT:
534 case MESA_FORMAT_Z24_UNORM_X8_UINT:
535 unpack = unpack_float_z_Z24_UNORM_X8_UINT;
537 case MESA_FORMAT_Z_UNORM16:
538 unpack = unpack_float_Z_UNORM16;
540 case MESA_FORMAT_Z_UNORM32:
541 unpack = unpack_float_Z_UNORM32;
543 case MESA_FORMAT_Z_FLOAT32:
544 unpack = unpack_float_Z_FLOAT32;
546 case MESA_FORMAT_Z32_FLOAT_S8X24_UINT:
547 unpack = unpack_float_z_Z32X24S8;
550 unreachable("bad format in _mesa_unpack_float_z_row");
558 typedef void (*unpack_uint_z_func)(const void *src, uint32_t *dst, uint32_t n);
561 unpack_uint_z_X8_UINT_Z24_UNORM(const void *src, uint32_t *dst, uint32_t n)
563 /* only return Z, not stencil data */
564 const uint32_t *s = ((const uint32_t *) src);
566 for (i = 0; i < n; i++) {
567 dst[i] = (s[i] & 0xffffff00) | (s[i] >> 24);
572 unpack_uint_z_Z24_UNORM_X8_UINT(const void *src, uint32_t *dst, uint32_t n)
574 /* only return Z, not stencil data */
575 const uint32_t *s = ((const uint32_t *) src);
577 for (i = 0; i < n; i++) {
578 dst[i] = (s[i] << 8) | ((s[i] >> 16) & 0xff);
583 unpack_uint_Z_UNORM16(const void *src, uint32_t *dst, uint32_t n)
585 const uint16_t *s = ((const uint16_t *)src);
587 for (i = 0; i < n; i++) {
588 dst[i] = (s[i] << 16) | s[i];
593 unpack_uint_Z_UNORM32(const void *src, uint32_t *dst, uint32_t n)
595 memcpy(dst, src, n * sizeof(uint32_t));
599 unpack_uint_Z_FLOAT32(const void *src, uint32_t *dst, uint32_t n)
601 const float *s = (const float *)src;
603 for (i = 0; i < n; i++) {
604 dst[i] = FLOAT_TO_UINT(CLAMP(s[i], 0.0F, 1.0F));
609 unpack_uint_Z_FLOAT32_X24S8(const void *src, uint32_t *dst, uint32_t n)
611 const struct z32f_x24s8 *s = (const struct z32f_x24s8 *) src;
614 for (i = 0; i < n; i++) {
615 dst[i] = FLOAT_TO_UINT(CLAMP(s[i].z, 0.0F, 1.0F));
622 * The returned values will always be in the range [0, 0xffffffff].
625 _mesa_unpack_uint_z_row(mesa_format format, uint32_t n,
626 const void *src, uint32_t *dst)
628 unpack_uint_z_func unpack;
629 const uint8_t *srcPtr = (uint8_t *) src;
632 case MESA_FORMAT_S8_UINT_Z24_UNORM:
633 case MESA_FORMAT_X8_UINT_Z24_UNORM:
634 unpack = unpack_uint_z_X8_UINT_Z24_UNORM;
636 case MESA_FORMAT_Z24_UNORM_S8_UINT:
637 case MESA_FORMAT_Z24_UNORM_X8_UINT:
638 unpack = unpack_uint_z_Z24_UNORM_X8_UINT;
640 case MESA_FORMAT_Z_UNORM16:
641 unpack = unpack_uint_Z_UNORM16;
643 case MESA_FORMAT_Z_UNORM32:
644 unpack = unpack_uint_Z_UNORM32;
646 case MESA_FORMAT_Z_FLOAT32:
647 unpack = unpack_uint_Z_FLOAT32;
649 case MESA_FORMAT_Z32_FLOAT_S8X24_UINT:
650 unpack = unpack_uint_Z_FLOAT32_X24S8;
653 unreachable("bad format %s in _mesa_unpack_uint_z_row");
656 unpack(srcPtr, dst, n);
661 unpack_ubyte_s_S_UINT8(const void *src, uint8_t *dst, uint32_t n)
667 unpack_ubyte_s_S8_UINT_Z24_UNORM(const void *src, uint8_t *dst, uint32_t n)
670 const uint32_t *src32 = src;
672 for (i = 0; i < n; i++)
673 dst[i] = src32[i] & 0xff;
677 unpack_ubyte_s_Z24_UNORM_S8_UINT(const void *src, uint8_t *dst, uint32_t n)
680 const uint32_t *src32 = src;
682 for (i = 0; i < n; i++)
683 dst[i] = src32[i] >> 24;
687 unpack_ubyte_s_Z32_FLOAT_S8X24_UINT(const void *src, uint8_t *dst, uint32_t n)
690 const struct z32f_x24s8 *s = (const struct z32f_x24s8 *) src;
692 for (i = 0; i < n; i++)
693 dst[i] = s[i].x24s8 & 0xff;
697 _mesa_unpack_ubyte_stencil_row(mesa_format format, uint32_t n,
698 const void *src, uint8_t *dst)
701 case MESA_FORMAT_S_UINT8:
702 unpack_ubyte_s_S_UINT8(src, dst, n);
704 case MESA_FORMAT_S8_UINT_Z24_UNORM:
705 unpack_ubyte_s_S8_UINT_Z24_UNORM(src, dst, n);
707 case MESA_FORMAT_Z24_UNORM_S8_UINT:
708 unpack_ubyte_s_Z24_UNORM_S8_UINT(src, dst, n);
710 case MESA_FORMAT_Z32_FLOAT_S8X24_UINT:
711 unpack_ubyte_s_Z32_FLOAT_S8X24_UINT(src, dst, n);
714 unreachable("bad format %s in _mesa_unpack_ubyte_s_row");
719 unpack_uint_24_8_depth_stencil_Z24_UNORM_S8_UINT(const uint32_t *src, uint32_t *dst, uint32_t n)
723 for (i = 0; i < n; i++) {
724 uint32_t val = src[i];
725 dst[i] = val >> 24 | val << 8;
730 unpack_uint_24_8_depth_stencil_Z32_S8X24(const uint32_t *src,
731 uint32_t *dst, uint32_t n)
735 for (i = 0; i < n; i++) {
736 /* 8 bytes per pixel (float + uint32) */
737 float zf = ((float *) src)[i * 2 + 0];
738 uint32_t z24 = (uint32_t) (zf * (float) 0xffffff);
739 uint32_t s = src[i * 2 + 1] & 0xff;
740 dst[i] = (z24 << 8) | s;
745 unpack_uint_24_8_depth_stencil_S8_UINT_Z24_UNORM(const uint32_t *src, uint32_t *dst, uint32_t n)
747 memcpy(dst, src, n * 4);
751 * Unpack depth/stencil returning as GL_UNSIGNED_INT_24_8.
752 * \param format the source data format
755 _mesa_unpack_uint_24_8_depth_stencil_row(mesa_format format, uint32_t n,
756 const void *src, uint32_t *dst)
759 case MESA_FORMAT_S8_UINT_Z24_UNORM:
760 unpack_uint_24_8_depth_stencil_S8_UINT_Z24_UNORM(src, dst, n);
762 case MESA_FORMAT_Z24_UNORM_S8_UINT:
763 unpack_uint_24_8_depth_stencil_Z24_UNORM_S8_UINT(src, dst, n);
765 case MESA_FORMAT_Z32_FLOAT_S8X24_UINT:
766 unpack_uint_24_8_depth_stencil_Z32_S8X24(src, dst, n);
769 unreachable("bad format %s in _mesa_unpack_uint_24_8_depth_stencil_row");
774 unpack_float_32_uint_24_8_Z24_UNORM_S8_UINT(const uint32_t *src,
775 uint32_t *dst, uint32_t n)
778 struct z32f_x24s8 *d = (struct z32f_x24s8 *) dst;
779 const double scale = 1.0 / (double) 0xffffff;
781 for (i = 0; i < n; i++) {
782 const uint32_t z24 = src[i] & 0xffffff;
783 d[i].z = z24 * scale;
784 d[i].x24s8 = src[i] >> 24;
785 assert(d[i].z >= 0.0f);
786 assert(d[i].z <= 1.0f);
791 unpack_float_32_uint_24_8_Z32_FLOAT_S8X24_UINT(const uint32_t *src,
792 uint32_t *dst, uint32_t n)
794 memcpy(dst, src, n * sizeof(struct z32f_x24s8));
798 unpack_float_32_uint_24_8_S8_UINT_Z24_UNORM(const uint32_t *src,
799 uint32_t *dst, uint32_t n)
802 struct z32f_x24s8 *d = (struct z32f_x24s8 *) dst;
803 const double scale = 1.0 / (double) 0xffffff;
805 for (i = 0; i < n; i++) {
806 const uint32_t z24 = src[i] >> 8;
807 d[i].z = z24 * scale;
808 d[i].x24s8 = src[i] & 0xff;
809 assert(d[i].z >= 0.0f);
810 assert(d[i].z <= 1.0f);
815 * Unpack depth/stencil returning as GL_FLOAT_32_UNSIGNED_INT_24_8_REV.
816 * \param format the source data format
818 * In GL_FLOAT_32_UNSIGNED_INT_24_8_REV lower 4 bytes contain float
819 * component and higher 4 bytes contain packed 24-bit and 8-bit
822 * 31 30 29 28 ... 4 3 2 1 0 31 30 29 ... 9 8 7 6 5 ... 2 1 0
823 * +-------------------------+ +--------------------------------+
824 * | Float Component | | Unused | 8 bit stencil |
825 * +-------------------------+ +--------------------------------+
826 * lower 4 bytes higher 4 bytes
829 _mesa_unpack_float_32_uint_24_8_depth_stencil_row(mesa_format format, uint32_t n,
830 const void *src, uint32_t *dst)
833 case MESA_FORMAT_S8_UINT_Z24_UNORM:
834 unpack_float_32_uint_24_8_S8_UINT_Z24_UNORM(src, dst, n);
836 case MESA_FORMAT_Z24_UNORM_S8_UINT:
837 unpack_float_32_uint_24_8_Z24_UNORM_S8_UINT(src, dst, n);
839 case MESA_FORMAT_Z32_FLOAT_S8X24_UINT:
840 unpack_float_32_uint_24_8_Z32_FLOAT_S8X24_UINT(src, dst, n);
843 unreachable("bad format %s in _mesa_unpack_uint_24_8_depth_stencil_row");
849 template
= Template(string
, future_imports
=['division']);
851 print(template
.render(argv
= argv
[0:]))