1 /**************************************************************************
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
29 * RGBA/float tile get/put functions.
30 * Usable both by drivers and state trackers.
34 #include "pipe/p_defines.h"
35 #include "util/u_inlines.h"
37 #include "util/u_format.h"
38 #include "util/u_math.h"
39 #include "util/u_memory.h"
40 #include "util/u_rect.h"
41 #include "util/u_tile.h"
45 * Move raw block of pixels from transfer object to user memory.
48 pipe_get_tile_raw(struct pipe_context
*pipe
,
49 struct pipe_transfer
*pt
,
50 uint x
, uint y
, uint w
, uint h
,
51 void *dst
, int dst_stride
)
56 dst_stride
= util_format_get_stride(pt
->texture
->format
, w
);
58 if (pipe_clip_tile(x
, y
, &w
, &h
, pt
))
61 src
= pipe
->transfer_map(pipe
, pt
);
66 util_copy_rect(dst
, pt
->texture
->format
, dst_stride
, 0, 0, w
, h
, src
, pt
->stride
, x
, y
);
68 pipe
->transfer_unmap(pipe
, pt
);
73 * Move raw block of pixels from user memory to transfer object.
76 pipe_put_tile_raw(struct pipe_context
*pipe
,
77 struct pipe_transfer
*pt
,
78 uint x
, uint y
, uint w
, uint h
,
79 const void *src
, int src_stride
)
82 enum pipe_format format
= pt
->texture
->format
;
85 src_stride
= util_format_get_stride(format
, w
);
87 if (pipe_clip_tile(x
, y
, &w
, &h
, pt
))
90 dst
= pipe
->transfer_map(pipe
, pt
);
95 util_copy_rect(dst
, format
, pt
->stride
, x
, y
, w
, h
, src
, src_stride
, 0, 0);
97 pipe
->transfer_unmap(pipe
, pt
);
103 /** Convert short in [-32768,32767] to GLfloat in [-1.0,1.0] */
104 #define SHORT_TO_FLOAT(S) ((2.0F * (S) + 1.0F) * (1.0F/65535.0F))
106 #define UNCLAMPED_FLOAT_TO_SHORT(us, f) \
107 us = ( (short) ( CLAMP((f), -1.0, 1.0) * 32767.0F) )
111 /*** PIPE_FORMAT_Z16_UNORM ***/
114 * Return each Z value as four floats in [0,1].
117 z16_get_tile_rgba(const ushort
*src
,
118 unsigned w
, unsigned h
,
122 const float scale
= 1.0f
/ 65535.0f
;
125 for (i
= 0; i
< h
; i
++) {
127 for (j
= 0; j
< w
; j
++, pRow
+= 4) {
131 pRow
[3] = *src
++ * scale
;
140 /*** PIPE_FORMAT_A8B8G8R8_SRGB ***/
143 * Convert an 8-bit sRGB value from non-linear space to a
144 * linear RGB value in [0, 1].
145 * Implemented with a 256-entry lookup table.
148 srgb_to_linear(ubyte cs8
)
150 static float table
[256];
151 static boolean tableReady
= FALSE
;
153 /* compute lookup table now */
155 for (i
= 0; i
< 256; i
++) {
156 const float cs
= ubyte_to_float(i
);
158 table
[i
] = cs
/ 12.92f
;
161 table
[i
] = (float) powf((cs
+ 0.055) / 1.055, 2.4);
171 * Convert linear float in [0,1] to an srgb ubyte value in [0,255].
172 * XXX this hasn't been tested (render to srgb surface).
173 * XXX this needs optimization.
176 linear_to_srgb(float cl
)
180 else if (cl
>= 0.0031308F
)
181 return float_to_ubyte(1.055F
* powf(cl
, 0.41666F
) - 0.055F
);
183 return float_to_ubyte(12.92F
* cl
);
190 a8r8g8b8_srgb_get_tile_rgba(const unsigned *src
,
191 unsigned w
, unsigned h
,
197 for (i
= 0; i
< h
; i
++) {
199 for (j
= 0; j
< w
; j
++, pRow
+= 4) {
200 const unsigned pixel
= *src
++;
201 pRow
[0] = srgb_to_linear((pixel
>> 16) & 0xff);
202 pRow
[1] = srgb_to_linear((pixel
>> 8) & 0xff);
203 pRow
[2] = srgb_to_linear((pixel
>> 0) & 0xff);
204 pRow
[3] = ubyte_to_float((pixel
>> 24) & 0xff);
211 a8r8g8b8_srgb_put_tile_rgba(unsigned *dst
,
212 unsigned w
, unsigned h
,
218 for (i
= 0; i
< h
; i
++) {
219 const float *pRow
= p
;
220 for (j
= 0; j
< w
; j
++, pRow
+= 4) {
222 r
= linear_to_srgb(pRow
[0]);
223 g
= linear_to_srgb(pRow
[1]);
224 b
= linear_to_srgb(pRow
[2]);
225 a
= float_to_ubyte(pRow
[3]);
226 *dst
++ = (a
<< 24) | (r
<< 16) | (g
<< 8) | b
;
233 /*** PIPE_FORMAT_L8A8_SRGB ***/
236 a8l8_srgb_get_tile_rgba(const ushort
*src
,
237 unsigned w
, unsigned h
,
243 for (i
= 0; i
< h
; i
++) {
245 for (j
= 0; j
< w
; j
++, pRow
+= 4) {
249 pRow
[2] = srgb_to_linear(p
& 0xff);
250 pRow
[3] = ubyte_to_float(p
>> 8);
257 a8l8_srgb_put_tile_rgba(ushort
*dst
,
258 unsigned w
, unsigned h
,
264 for (i
= 0; i
< h
; i
++) {
265 const float *pRow
= p
;
266 for (j
= 0; j
< w
; j
++, pRow
+= 4) {
268 r
= linear_to_srgb(pRow
[0]);
269 a
= float_to_ubyte(pRow
[3]);
270 *dst
++ = (a
<< 8) | r
;
277 /*** PIPE_FORMAT_L8_SRGB ***/
280 l8_srgb_get_tile_rgba(const ubyte
*src
,
281 unsigned w
, unsigned h
,
287 for (i
= 0; i
< h
; i
++) {
289 for (j
= 0; j
< w
; j
++, src
++, pRow
+= 4) {
292 pRow
[2] = srgb_to_linear(*src
);
300 l8_srgb_put_tile_rgba(ubyte
*dst
,
301 unsigned w
, unsigned h
,
307 for (i
= 0; i
< h
; i
++) {
308 const float *pRow
= p
;
309 for (j
= 0; j
< w
; j
++, pRow
+= 4) {
311 r
= linear_to_srgb(pRow
[0]);
319 /*** PIPE_FORMAT_Z32_UNORM ***/
322 * Return each Z value as four floats in [0,1].
325 z32_get_tile_rgba(const unsigned *src
,
326 unsigned w
, unsigned h
,
330 const double scale
= 1.0 / (double) 0xffffffff;
333 for (i
= 0; i
< h
; i
++) {
335 for (j
= 0; j
< w
; j
++, pRow
+= 4) {
339 pRow
[3] = (float) (*src
++ * scale
);
346 /*** PIPE_FORMAT_Z24_UNORM_S8_USCALED ***/
349 * Return Z component as four float in [0,1]. Stencil part ignored.
352 s8z24_get_tile_rgba(const unsigned *src
,
353 unsigned w
, unsigned h
,
357 const double scale
= 1.0 / ((1 << 24) - 1);
360 for (i
= 0; i
< h
; i
++) {
362 for (j
= 0; j
< w
; j
++, pRow
+= 4) {
366 pRow
[3] = (float) (scale
* (*src
++ & 0xffffff));
373 /*** PIPE_FORMAT_S8_USCALED_Z24_UNORM ***/
376 * Return Z component as four float in [0,1]. Stencil part ignored.
379 z24s8_get_tile_rgba(const unsigned *src
,
380 unsigned w
, unsigned h
,
384 const double scale
= 1.0 / ((1 << 24) - 1);
387 for (i
= 0; i
< h
; i
++) {
389 for (j
= 0; j
< w
; j
++, pRow
+= 4) {
393 pRow
[3] = (float) (scale
* (*src
++ >> 8));
400 /*** PIPE_FORMAT_Z32_FLOAT ***/
403 * Return each Z value as four floats in [0,1].
406 z32f_get_tile_rgba(const float *src
,
407 unsigned w
, unsigned h
,
413 for (i
= 0; i
< h
; i
++) {
415 for (j
= 0; j
< w
; j
++, pRow
+= 4) {
426 /*** PIPE_FORMAT_UYVY / PIPE_FORMAT_YUYV ***/
429 * Convert YCbCr (or YCrCb) to RGBA.
432 ycbcr_get_tile_rgba(const ushort
*src
,
433 unsigned w
, unsigned h
,
438 const float scale
= 1.0f
/ 255.0f
;
441 for (i
= 0; i
< h
; i
++) {
443 /* do two texels at a time */
444 for (j
= 0; j
< (w
& ~1); j
+= 2, src
+= 2) {
445 const ushort t0
= src
[0];
446 const ushort t1
= src
[1];
447 const ubyte y0
= (t0
>> 8) & 0xff; /* luminance */
448 const ubyte y1
= (t1
>> 8) & 0xff; /* luminance */
453 cb
= t1
& 0xff; /* chroma U */
454 cr
= t0
& 0xff; /* chroma V */
457 cb
= t0
& 0xff; /* chroma U */
458 cr
= t1
& 0xff; /* chroma V */
461 /* even pixel: y0,cr,cb */
462 r
= 1.164f
* (y0
-16) + 1.596f
* (cr
-128);
463 g
= 1.164f
* (y0
-16) - 0.813f
* (cr
-128) - 0.391f
* (cb
-128);
464 b
= 1.164f
* (y0
-16) + 2.018f
* (cb
-128);
471 /* odd pixel: use y1,cr,cb */
472 r
= 1.164f
* (y1
-16) + 1.596f
* (cr
-128);
473 g
= 1.164f
* (y1
-16) - 0.813f
* (cr
-128) - 0.391f
* (cb
-128);
474 b
= 1.164f
* (y1
-16) + 2.018f
* (cb
-128);
482 /* do the last texel */
484 const ushort t0
= src
[0];
485 const ushort t1
= src
[1];
486 const ubyte y0
= (t0
>> 8) & 0xff; /* luminance */
491 cb
= t1
& 0xff; /* chroma U */
492 cr
= t0
& 0xff; /* chroma V */
495 cb
= t0
& 0xff; /* chroma U */
496 cr
= t1
& 0xff; /* chroma V */
499 /* even pixel: y0,cr,cb */
500 r
= 1.164f
* (y0
-16) + 1.596f
* (cr
-128);
501 g
= 1.164f
* (y0
-16) - 0.813f
* (cr
-128) - 0.391f
* (cb
-128);
502 b
= 1.164f
* (y0
-16) + 2.018f
* (cb
-128);
515 pipe_tile_raw_to_rgba(enum pipe_format format
,
518 float *dst
, unsigned dst_stride
)
521 case PIPE_FORMAT_B8G8R8A8_SRGB
:
522 a8r8g8b8_srgb_get_tile_rgba((unsigned *) src
, w
, h
, dst
, dst_stride
);
524 case PIPE_FORMAT_L8A8_SRGB
:
525 a8l8_srgb_get_tile_rgba((ushort
*) src
, w
, h
, dst
, dst_stride
);
527 case PIPE_FORMAT_L8_SRGB
:
528 l8_srgb_get_tile_rgba((ubyte
*) src
, w
, h
, dst
, dst_stride
);
530 case PIPE_FORMAT_Z16_UNORM
:
531 z16_get_tile_rgba((ushort
*) src
, w
, h
, dst
, dst_stride
);
533 case PIPE_FORMAT_Z32_UNORM
:
534 z32_get_tile_rgba((unsigned *) src
, w
, h
, dst
, dst_stride
);
536 case PIPE_FORMAT_Z24_UNORM_S8_USCALED
:
537 case PIPE_FORMAT_Z24X8_UNORM
:
538 s8z24_get_tile_rgba((unsigned *) src
, w
, h
, dst
, dst_stride
);
540 case PIPE_FORMAT_S8_USCALED_Z24_UNORM
:
541 case PIPE_FORMAT_X8Z24_UNORM
:
542 z24s8_get_tile_rgba((unsigned *) src
, w
, h
, dst
, dst_stride
);
544 case PIPE_FORMAT_Z32_FLOAT
:
545 z32f_get_tile_rgba((float *) src
, w
, h
, dst
, dst_stride
);
547 case PIPE_FORMAT_UYVY
:
548 ycbcr_get_tile_rgba((ushort
*) src
, w
, h
, dst
, dst_stride
, FALSE
);
550 case PIPE_FORMAT_YUYV
:
551 ycbcr_get_tile_rgba((ushort
*) src
, w
, h
, dst
, dst_stride
, TRUE
);
554 util_format_read_4f(format
,
555 dst
, dst_stride
* sizeof(float),
556 src
, util_format_get_stride(format
, w
),
563 pipe_get_tile_rgba(struct pipe_context
*pipe
,
564 struct pipe_transfer
*pt
,
565 uint x
, uint y
, uint w
, uint h
,
568 unsigned dst_stride
= w
* 4;
570 enum pipe_format format
= pt
->texture
->format
;
572 if (pipe_clip_tile(x
, y
, &w
, &h
, pt
))
575 packed
= MALLOC(util_format_get_nblocks(format
, w
, h
) * util_format_get_blocksize(format
));
580 if(format
== PIPE_FORMAT_UYVY
|| format
== PIPE_FORMAT_YUYV
)
581 assert((x
& 1) == 0);
583 pipe_get_tile_raw(pipe
, pt
, x
, y
, w
, h
, packed
, 0);
585 pipe_tile_raw_to_rgba(format
, packed
, w
, h
, p
, dst_stride
);
592 pipe_get_tile_swizzle(struct pipe_context
*pipe
,
593 struct pipe_transfer
*pt
,
602 enum pipe_format format
,
605 unsigned dst_stride
= w
* 4;
610 if (pipe_clip_tile(x
, y
, &w
, &h
, pt
)) {
614 packed
= MALLOC(util_format_get_nblocks(format
, w
, h
) * util_format_get_blocksize(format
));
619 if (format
== PIPE_FORMAT_UYVY
|| format
== PIPE_FORMAT_YUYV
) {
620 assert((x
& 1) == 0);
623 pipe_get_tile_raw(pipe
, pt
, x
, y
, w
, h
, packed
, 0);
625 pipe_tile_raw_to_rgba(format
, packed
, w
, h
, p
, dst_stride
);
629 if (swizzle_r
== PIPE_SWIZZLE_RED
&&
630 swizzle_g
== PIPE_SWIZZLE_GREEN
&&
631 swizzle_b
== PIPE_SWIZZLE_BLUE
&&
632 swizzle_a
== PIPE_SWIZZLE_ALPHA
) {
637 rgba01
[PIPE_SWIZZLE_ZERO
] = 0.0f
;
638 rgba01
[PIPE_SWIZZLE_ONE
] = 1.0f
;
640 for (i
= 0; i
< w
* h
; i
++) {
641 rgba01
[PIPE_SWIZZLE_RED
] = p
[0];
642 rgba01
[PIPE_SWIZZLE_GREEN
] = p
[1];
643 rgba01
[PIPE_SWIZZLE_BLUE
] = p
[2];
644 rgba01
[PIPE_SWIZZLE_ALPHA
] = p
[3];
646 *p
++ = rgba01
[swizzle_r
];
647 *p
++ = rgba01
[swizzle_g
];
648 *p
++ = rgba01
[swizzle_b
];
649 *p
++ = rgba01
[swizzle_a
];
655 pipe_put_tile_rgba(struct pipe_context
*pipe
,
656 struct pipe_transfer
*pt
,
657 uint x
, uint y
, uint w
, uint h
,
660 unsigned src_stride
= w
* 4;
662 enum pipe_format format
= pt
->texture
->format
;
664 if (pipe_clip_tile(x
, y
, &w
, &h
, pt
))
667 packed
= MALLOC(util_format_get_nblocks(format
, w
, h
) * util_format_get_blocksize(format
));
673 case PIPE_FORMAT_B8G8R8A8_SRGB
:
674 a8r8g8b8_srgb_put_tile_rgba((unsigned *) packed
, w
, h
, p
, src_stride
);
676 case PIPE_FORMAT_L8A8_SRGB
:
677 a8l8_srgb_put_tile_rgba((ushort
*) packed
, w
, h
, p
, src_stride
);
679 case PIPE_FORMAT_L8_SRGB
:
680 l8_srgb_put_tile_rgba((ubyte
*) packed
, w
, h
, p
, src_stride
);
682 case PIPE_FORMAT_Z16_UNORM
:
683 /*z16_put_tile_rgba((ushort *) packed, w, h, p, src_stride);*/
685 case PIPE_FORMAT_Z32_UNORM
:
686 /*z32_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/
688 case PIPE_FORMAT_Z24_UNORM_S8_USCALED
:
689 case PIPE_FORMAT_Z24X8_UNORM
:
690 /*s8z24_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/
692 case PIPE_FORMAT_S8_USCALED_Z24_UNORM
:
693 case PIPE_FORMAT_X8Z24_UNORM
:
694 /*z24s8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/
697 util_format_write_4f(format
,
698 p
, src_stride
* sizeof(float),
699 packed
, util_format_get_stride(format
, w
),
703 pipe_put_tile_raw(pipe
, pt
, x
, y
, w
, h
, packed
, 0);
710 * Get a block of Z values, converted to 32-bit range.
713 pipe_get_tile_z(struct pipe_context
*pipe
,
714 struct pipe_transfer
*pt
,
715 uint x
, uint y
, uint w
, uint h
,
718 const uint dstStride
= w
;
722 enum pipe_format format
= pt
->texture
->format
;
724 if (pipe_clip_tile(x
, y
, &w
, &h
, pt
))
727 map
= (ubyte
*)pipe
->transfer_map(pipe
, pt
);
734 case PIPE_FORMAT_Z32_UNORM
:
737 = (const uint
*)(map
+ y
* pt
->stride
+ x
*4);
738 for (i
= 0; i
< h
; i
++) {
739 memcpy(pDest
, ptrc
, 4 * w
);
741 ptrc
+= pt
->stride
/4;
745 case PIPE_FORMAT_Z24_UNORM_S8_USCALED
:
746 case PIPE_FORMAT_Z24X8_UNORM
:
749 = (const uint
*)(map
+ y
* pt
->stride
+ x
*4);
750 for (i
= 0; i
< h
; i
++) {
751 for (j
= 0; j
< w
; j
++) {
752 /* convert 24-bit Z to 32-bit Z */
753 pDest
[j
] = (ptrc
[j
] << 8) | ((ptrc
[j
] >> 16) & 0xff);
756 ptrc
+= pt
->stride
/4;
760 case PIPE_FORMAT_S8_USCALED_Z24_UNORM
:
761 case PIPE_FORMAT_X8Z24_UNORM
:
764 = (const uint
*)(map
+ y
* pt
->stride
+ x
*4);
765 for (i
= 0; i
< h
; i
++) {
766 for (j
= 0; j
< w
; j
++) {
767 /* convert 24-bit Z to 32-bit Z */
768 pDest
[j
] = (ptrc
[j
] & 0xffffff00) | ((ptrc
[j
] >> 24) & 0xff);
771 ptrc
+= pt
->stride
/4;
775 case PIPE_FORMAT_Z16_UNORM
:
778 = (const ushort
*)(map
+ y
* pt
->stride
+ x
*2);
779 for (i
= 0; i
< h
; i
++) {
780 for (j
= 0; j
< w
; j
++) {
781 /* convert 16-bit Z to 32-bit Z */
782 pDest
[j
] = (ptrc
[j
] << 16) | ptrc
[j
];
785 ptrc
+= pt
->stride
/2;
793 pipe
->transfer_unmap(pipe
, pt
);
798 pipe_put_tile_z(struct pipe_context
*pipe
,
799 struct pipe_transfer
*pt
,
800 uint x
, uint y
, uint w
, uint h
,
803 const uint srcStride
= w
;
804 const uint
*ptrc
= zSrc
;
807 enum pipe_format format
= pt
->texture
->format
;
809 if (pipe_clip_tile(x
, y
, &w
, &h
, pt
))
812 map
= (ubyte
*)pipe
->transfer_map(pipe
, pt
);
819 case PIPE_FORMAT_Z32_UNORM
:
821 uint
*pDest
= (uint
*) (map
+ y
* pt
->stride
+ x
*4);
822 for (i
= 0; i
< h
; i
++) {
823 memcpy(pDest
, ptrc
, 4 * w
);
824 pDest
+= pt
->stride
/4;
829 case PIPE_FORMAT_Z24_UNORM_S8_USCALED
:
831 uint
*pDest
= (uint
*) (map
+ y
* pt
->stride
+ x
*4);
832 assert((pt
->usage
& PIPE_TRANSFER_READ_WRITE
) == PIPE_TRANSFER_READ_WRITE
);
833 for (i
= 0; i
< h
; i
++) {
834 for (j
= 0; j
< w
; j
++) {
835 /* convert 32-bit Z to 24-bit Z, preserve stencil */
836 pDest
[j
] = (pDest
[j
] & 0xff000000) | ptrc
[j
] >> 8;
838 pDest
+= pt
->stride
/4;
843 case PIPE_FORMAT_Z24X8_UNORM
:
845 uint
*pDest
= (uint
*) (map
+ y
* pt
->stride
+ x
*4);
846 for (i
= 0; i
< h
; i
++) {
847 for (j
= 0; j
< w
; j
++) {
848 /* convert 32-bit Z to 24-bit Z (0 stencil) */
849 pDest
[j
] = ptrc
[j
] >> 8;
851 pDest
+= pt
->stride
/4;
856 case PIPE_FORMAT_S8_USCALED_Z24_UNORM
:
858 uint
*pDest
= (uint
*) (map
+ y
* pt
->stride
+ x
*4);
859 assert((pt
->usage
& PIPE_TRANSFER_READ_WRITE
) == PIPE_TRANSFER_READ_WRITE
);
860 for (i
= 0; i
< h
; i
++) {
861 for (j
= 0; j
< w
; j
++) {
862 /* convert 32-bit Z to 24-bit Z, preserve stencil */
863 pDest
[j
] = (pDest
[j
] & 0xff) | (ptrc
[j
] & 0xffffff00);
865 pDest
+= pt
->stride
/4;
870 case PIPE_FORMAT_X8Z24_UNORM
:
872 uint
*pDest
= (uint
*) (map
+ y
* pt
->stride
+ x
*4);
873 for (i
= 0; i
< h
; i
++) {
874 for (j
= 0; j
< w
; j
++) {
875 /* convert 32-bit Z to 24-bit Z (0 stencil) */
876 pDest
[j
] = ptrc
[j
] & 0xffffff00;
878 pDest
+= pt
->stride
/4;
883 case PIPE_FORMAT_Z16_UNORM
:
885 ushort
*pDest
= (ushort
*) (map
+ y
* pt
->stride
+ x
*2);
886 for (i
= 0; i
< h
; i
++) {
887 for (j
= 0; j
< w
; j
++) {
888 /* convert 32-bit Z to 16-bit Z */
889 pDest
[j
] = ptrc
[j
] >> 16;
891 pDest
+= pt
->stride
/2;
900 pipe
->transfer_unmap(pipe
, pt
);