44 unsigned int pitch_in,
unsigned int pitch_out,
unsigned int w,
unsigned int h)
46 unsigned short *dst_s;
50 TRACE(
"Converting %ux%u pixels, pitches %u %u.\n",
w,
h, pitch_in, pitch_out);
52 for (
y = 0;
y <
h; ++
y)
54 src_f = (
const float *)(
src +
y * pitch_in);
55 dst_s = (
unsigned short *) (
dst +
y * pitch_out);
56 for (
x = 0;
x <
w; ++
x)
64 unsigned int pitch_in,
unsigned int pitch_out,
unsigned int w,
unsigned int h)
66 static const unsigned char convert_5to8[] =
68 0x00, 0x08, 0x10, 0x19, 0x21, 0x29, 0x31, 0x3a,
69 0x42, 0x4a, 0x52, 0x5a, 0x63, 0x6b, 0x73, 0x7b,
70 0x84, 0x8c, 0x94, 0x9c, 0xa5, 0xad, 0xb5, 0xbd,
71 0xc5, 0xce, 0xd6, 0xde, 0xe6, 0xef, 0xf7, 0xff,
73 static const unsigned char convert_6to8[] =
75 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, 0x18, 0x1c,
76 0x20, 0x24, 0x28, 0x2d, 0x31, 0x35, 0x39, 0x3d,
77 0x41, 0x45, 0x49, 0x4d, 0x51, 0x55, 0x59, 0x5d,
78 0x61, 0x65, 0x69, 0x6d, 0x71, 0x75, 0x79, 0x7d,
79 0x82, 0x86, 0x8a, 0x8e, 0x92, 0x96, 0x9a, 0x9e,
80 0xa2, 0xa6, 0xaa, 0xae, 0xb2, 0xb6, 0xba, 0xbe,
81 0xc2, 0xc6, 0xca, 0xce, 0xd2, 0xd7, 0xdb, 0xdf,
82 0xe3, 0xe7, 0xeb, 0xef, 0xf3, 0xf7, 0xfb, 0xff,
86 TRACE(
"Converting %ux%u pixels, pitches %u %u.\n",
w,
h, pitch_in, pitch_out);
88 for (
y = 0;
y <
h; ++
y)
90 const WORD *src_line = (
const WORD *)(
src +
y * pitch_in);
92 for (
x = 0;
x <
w; ++
x)
94 WORD pixel = src_line[
x];
95 dst_line[
x] = 0xff000000u
96 | convert_5to8[(pixel & 0xf800u) >> 11] << 16
97 | convert_6to8[(pixel & 0x07e0u) >> 5] << 8
98 | convert_5to8[(pixel & 0x001fu)];
106 unsigned int pitch_in,
unsigned int pitch_out,
unsigned int w,
unsigned int h)
110 TRACE(
"Converting %ux%u pixels, pitches %u %u.\n",
w,
h, pitch_in, pitch_out);
112 for (
y = 0;
y <
h; ++
y)
117 for (
x = 0;
x <
w; ++
x)
119 dst_line[
x] = 0xff000000 | (src_line[
x] & 0xffffff);
126 return (
BYTE)((
x < 0) ? 0 : ((
x > 255) ? 255 :
x));
130 unsigned int pitch_in,
unsigned int pitch_out,
unsigned int w,
unsigned int h)
132 int c2,
d,
e,
r2 = 0, g2 = 0,
b2 = 0;
135 TRACE(
"Converting %ux%u pixels, pitches %u %u.\n",
w,
h, pitch_in, pitch_out);
137 for (
y = 0;
y <
h; ++
y)
139 const BYTE *src_line =
src +
y * pitch_in;
141 for (
x = 0;
x <
w; ++
x)
152 d = (
int) src_line[1] - 128;
153 e = (
int) src_line[3] - 128;
155 g2 = - 100 *
d - 208 *
e + 128;
158 c2 = 298 * ((
int) src_line[0] - 16);
159 dst_line[
x] = 0xff000000
172 unsigned int pitch_in,
unsigned int pitch_out,
unsigned int w,
unsigned int h)
175 int c2,
d,
e,
r2 = 0, g2 = 0,
b2 = 0;
177 TRACE(
"Converting %ux%u pixels, pitches %u %u\n",
w,
h, pitch_in, pitch_out);
179 for (
y = 0;
y <
h; ++
y)
181 const BYTE *src_line =
src +
y * pitch_in;
183 for (
x = 0;
x <
w; ++
x)
194 d = (
int) src_line[1] - 128;
195 e = (
int) src_line[3] - 128;
197 g2 = - 100 *
d - 208 *
e + 128;
200 c2 = 298 * ((
int) src_line[0] - 16);
216 unsigned int pitch_in,
unsigned int pitch_out,
217 unsigned int w,
unsigned int h);
247 unsigned int texture_level = sub_resource_idx % src_texture->
level_count;
251 unsigned int src_row_pitch, src_slice_pitch;
264 FIXME(
"Cannot find a conversion function from format %s to %s.\n",
273 desc.multisample_quality = 0;
284 ERR(
"Failed to create a destination texture for conversion.\n");
290 map_binding = src_texture->
resource.map_binding;
298 unsigned int dst_row_pitch, dst_slice_pitch;
304 map_binding = dst_texture->
resource.map_binding;
327 TRACE(
"Using upload conversion.\n");
331 src_format, &src_box, src_row_pitch, src_slice_pitch,
352 unsigned int row_pitch, slice_pitch;
355 bool restore_context =
false;
356 unsigned int restore_idx;
358 BOOL src_is_upside_down;
363 TRACE(
"texture %p, sub_resource_idx %u, context %p, src_location %s, dst_location %s.\n",
370 restore_texture =
context->current_rt.texture;
371 restore_idx =
context->current_rt.sub_resource_idx;
375 restore_context =
true;
394 TRACE(
"Mapping offscreen render target.\n");
396 src_is_upside_down =
TRUE;
404 src_is_upside_down =
FALSE;
409 if (
data.buffer_object)
439 if (!src_is_upside_down)
447 if (
data.buffer_object)
466 if (
data.buffer_object)
471 if (
data.buffer_object)
497 UINT row_block_count;
505 row_block_count = (update_w +
format->block_width - 1) /
format->block_width;
509 for (
y = 0;
y < update_h;
y +=
format->block_height)
511 memcpy(dst_row, src_row, row_block_count *
format->block_byte_count);
512 src_row += src_pitch;
513 dst_row += dst_pitch;
521 src_row += (((update_h /
format->block_height) - 1) * src_pitch);
526 for (
y = 0;
y < update_h;
y +=
format->block_height)
534 const struct block *
s = (
const struct block *)src_row;
537 for (
x = 0;
x < row_block_count; ++
x)
539 d[
x].color[0] =
s[
x].color[0];
540 d[
x].color[1] =
s[
x].color[1];
541 d[
x].control_row[0] =
s[
x].control_row[3];
542 d[
x].control_row[1] =
s[
x].control_row[2];
543 d[
x].control_row[2] =
s[
x].control_row[1];
544 d[
x].control_row[3] =
s[
x].control_row[0];
546 src_row -= src_pitch;
547 dst_row += dst_pitch;
553 for (
y = 0;
y < update_h;
y +=
format->block_height)
562 const struct block *
s = (
const struct block *)src_row;
565 for (
x = 0;
x < row_block_count; ++
x)
567 d[
x].alpha_row[0] =
s[
x].alpha_row[3];
568 d[
x].alpha_row[1] =
s[
x].alpha_row[2];
569 d[
x].alpha_row[2] =
s[
x].alpha_row[1];
570 d[
x].alpha_row[3] =
s[
x].alpha_row[0];
571 d[
x].color[0] =
s[
x].color[0];
572 d[
x].color[1] =
s[
x].color[1];
573 d[
x].control_row[0] =
s[
x].control_row[3];
574 d[
x].control_row[1] =
s[
x].control_row[2];
575 d[
x].control_row[2] =
s[
x].control_row[1];
576 d[
x].control_row[3] =
s[
x].control_row[0];
578 src_row -= src_pitch;
579 dst_row += dst_pitch;
584 FIXME(
"Compressed flip not implemented for format %s.\n",
590 FIXME(
"Unsupported blit on compressed surface (format %s, flags %#x, DDFX %#x).\n",
601 unsigned int bpp, src_height, src_width, dst_height, dst_width, row_byte_count;
606 unsigned int src_fmt_attrs, dst_fmt_attrs;
608 unsigned int x, sx, xinc,
y, sy, yinc;
611 unsigned int texture_level;
613 BOOL same_sub_resource;
620 TRACE(
"dst_texture %p, dst_sub_resource_idx %u, dst_box %s, src_texture %p, "
621 "src_sub_resource_idx %u, src_box %s, flags %#x, fx %p, filter %s.\n",
622 dst_texture, dst_sub_resource_idx,
debug_box(dst_box), src_texture,
627 src_format = src_texture->
resource.format;
635 src_height = src_box->
bottom - src_box->
top;
636 src_width = src_box->
right - src_box->
left;
637 dst_height = dst_box->
bottom - dst_box->
top;
638 dst_width = dst_box->
right - dst_box->
left;
642 if (src_texture == dst_texture && src_sub_resource_idx == dst_sub_resource_idx)
644 same_sub_resource =
TRUE;
646 map_binding = dst_texture->
resource.map_binding;
647 texture_level = dst_sub_resource_idx % dst_texture->
level_count;
660 same_sub_resource =
FALSE;
662 && (dst_width != src_width || dst_height != src_height);
679 src_texture = converted_texture;
680 src_sub_resource_idx = 0;
681 src_format = src_texture->
resource.format;
684 map_binding = src_texture->
resource.map_binding;
685 texture_level = src_sub_resource_idx % src_texture->
level_count;
701 map_binding = dst_texture->
resource.map_binding;
702 texture_level = dst_sub_resource_idx % dst_texture->
level_count;
713 src_fmt_attrs = src_format->
attrs;
715 flags &= ~WINED3D_BLT_RAW;
718 row_byte_count = dst_width *
bpp;
731 if (same_sub_resource)
733 FIXME(
"Only plain blits supported on compressed surfaces.\n");
746 FIXME(
"Unsupported blit between height-scaled formats (src %s, dst %s).\n",
753 && (src_width != dst_width || src_height != dst_height))
759 xinc = (src_width << 16) / dst_width;
760 yinc = (src_height << 16) / dst_height;
765 if (dst_width == src_width)
767 if (dst_height == src_height)
774 if (!same_sub_resource || dst_box->
top < src_box->
top
778 for (
y = 0;
y < dst_height; ++
y)
780 memcpy(dbuf, sbuf, row_byte_count);
785 else if (dst_box->
top > src_box->
top)
790 for (
y = 0;
y < dst_height; ++
y)
794 memcpy(dbuf, sbuf, row_byte_count);
800 for (
y = 0;
y < dst_height; ++
y)
802 memmove(dbuf, sbuf, row_byte_count);
811 for (
y = sy = 0;
y < dst_height; ++
y, sy += yinc)
813 sbuf = sbase + (sy >> 16) * src_map.
row_pitch;
814 memcpy(dbuf, sbuf, row_byte_count);
822 unsigned int last_sy = ~0
u;
823 for (
y = sy = 0;
y < dst_height; ++
y, sy += yinc)
825 sbuf = sbase + (sy >> 16) * src_map.
row_pitch;
827 if ((sy >> 16) == (last_sy >> 16))
835#define STRETCH_ROW(type) \
837 const type *s = (const type *)sbuf; \
838 type *d = (type *)dbuf; \
839 for (x = sx = 0; x < dst_width; ++x, sx += xinc) \
840 d[x] = s[sx >> 16]; \
858 for (
x = sx = 0;
x < dst_width;
x++, sx+= xinc)
862 s = sbuf + 3 * (sx >> 16);
863 pixel =
s[0] | (
s[1] << 8) | (
s[2] << 16);
864 d[0] = (pixel ) & 0xff;
865 d[1] = (pixel >> 8) & 0xff;
866 d[2] = (pixel >> 16) & 0xff;
872 FIXME(
"Stretched blit not implemented for bpp %u.\n",
bpp * 8);
886 DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff;
887 DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff;
894 keylow = src_texture->
async.src_blt_color_key.color_space_low_value;
895 keyhigh = src_texture->
async.src_blt_color_key.color_space_high_value;
899 keylow =
fx->src_color_key.color_space_low_value;
900 keyhigh =
fx->src_color_key.color_space_high_value;
906 destkeylow = src_texture->
async.dst_blt_color_key.color_space_low_value;
907 destkeyhigh = src_texture->
async.dst_blt_color_key.color_space_high_value;
911 destkeylow =
fx->dst_color_key.color_space_low_value;
912 destkeyhigh =
fx->dst_color_key.color_space_high_value;
931 BYTE *dTopLeft, *dTopRight, *dBottomLeft, *dBottomRight, *tmp;
934 dTopRight = dbuf + ((dst_width - 1) *
bpp);
935 dBottomLeft = dTopLeft + ((dst_height - 1) * dst_map.
row_pitch);
936 dBottomRight = dBottomLeft + ((dst_width - 1) *
bpp);
941 WARN(
"Nothing done for WINEDDBLTFX_ARITHSTRETCHY.\n");
946 dTopRight = dTopLeft;
949 dBottomRight = dBottomLeft;
951 dstxinc = dstxinc * -1;
956 dTopLeft = dBottomLeft;
959 dTopRight = dBottomRight;
961 dstyinc = dstyinc * -1;
966 WARN(
"Nothing done for WINEDDBLTFX_NOTEARING.\n");
971 dBottomRight = dTopLeft;
974 dBottomLeft = dTopRight;
976 dstxinc = dstxinc * -1;
977 dstyinc = dstyinc * -1;
982 dTopLeft = dBottomLeft;
983 dBottomLeft = dBottomRight;
984 dBottomRight = dTopRight;
989 dstxinc = dstxinc * -1;
994 dTopLeft = dTopRight;
995 dTopRight = dBottomRight;
996 dBottomRight = dBottomLeft;
1001 dstyinc = dstyinc * -1;
1006 WARN(
"Nothing done for WINEDDBLTFX_ZBUFFERBASEDEST.\n");
1012#define COPY_COLORKEY_FX(type) \
1015 type *d = (type *)dbuf, *dx, tmp; \
1016 for (y = sy = 0; y < dst_height; ++y, sy += yinc) \
1018 s = (const type *)(sbase + (sy >> 16) * src_map.row_pitch); \
1020 for (x = sx = 0; x < dst_width; ++x, sx += xinc) \
1022 tmp = s[sx >> 16]; \
1023 if (((tmp & keymask) < keylow || (tmp & keymask) > keyhigh) \
1024 && ((dx[0] & destkeymask) >= destkeylow && (dx[0] & destkeymask) <= destkeyhigh)) \
1028 dx = (type *)(((BYTE *)dx) + dstxinc); \
1030 d = (type *)(((BYTE *)d) + dstyinc); \
1049 for (
y = sy = 0;
y < dst_height; ++
y, sy += yinc)
1051 sbuf = sbase + (sy >> 16) * src_map.
row_pitch;
1053 for (
x = sx = 0;
x < dst_width; ++
x, sx+= xinc)
1055 DWORD pixel, dpixel = 0;
1056 s = sbuf + 3 * (sx>>16);
1057 pixel =
s[0] | (
s[1] << 8) | (
s[2] << 16);
1058 dpixel =
dx[0] | (
dx[1] << 8 ) | (
dx[2] << 16);
1059 if (((pixel & keymask) < keylow || (pixel & keymask) > keyhigh)
1060 && ((dpixel & keymask) >= destkeylow || (dpixel & keymask) <= keyhigh))
1062 dx[0] = (pixel ) & 0xff;
1063 dx[1] = (pixel >> 8) & 0xff;
1064 dx[2] = (pixel >> 16) & 0xff;
1073 FIXME(
"%s color-keyed blit not implemented for bpp %u.\n",
1077#undef COPY_COLORKEY_FX
1093 texture_level = dst_sub_resource_idx % dst_texture->
level_count;
1113 if (!same_sub_resource)
1119 dst_texture->
swapchain->swapchain_ops->swapchain_frontbuffer_updated(dst_texture->
swapchain);
1121 if (converted_texture)
1137 bool full_subresource;
1141 TRACE(
"texture %p, sub_resource_idx %u, box %s, colour %s.\n",
1154 full_subresource = !
memcmp(
box, &level_box,
sizeof(*
box));
1156 map_binding =
texture->resource.map_binding;
1165 range.size =
texture->sub_resources[sub_resource_idx].size;
1176 if (
view->format->id !=
view->resource->format->id)
1177 FIXME(
"View format %s doesn't match resource format %s.\n",
1182 FIXME(
"Not implemented for buffers.\n");
1199 unsigned int rt_count,
const struct wined3d_fb_state *fb,
unsigned int rect_count,
const RECT *clear_rects,
1210 clear_rects = draw_rect;
1213 for (
i = 0;
i < rect_count; ++
i)
1227 for (
j = 0;
j < rt_count; ++
j)
1254 unsigned int dst_sub_resource_idx,
DWORD dst_location,
const RECT *dst_rect,
1280 FIXME(
"Unhandled op %#x.\n",
op);
1285 src_texture, src_sub_resource_idx, &src_box,
flags, &
fx,
filter)))
1286 ERR(
"Failed to blit.\n");
1289 return dst_location | (dst_texture->
sub_resources[dst_sub_resource_idx].locations
1290 & dst_texture->
resource.map_binding);
1304 if (!(blitter =
malloc(
sizeof(*blitter))))
1307 TRACE(
"Created blitter %p.\n", blitter);
1347 struct wined3d_texture_sub_resource *src_sub_resource, *dst_sub_resource;
1353 DWORD src_location, dst_location, valid_locations;
1356 RECT src_rect, dst_rect;
1357 bool src_ds, dst_ds;
1364 TRACE(
"dst_texture %p, dst_sub_resource_idx %u, dst_box %s, src_texture %p, "
1365 "src_sub_resource_idx %u, src_box %s, flags %#x, fx %p, filter %s.\n",
1366 dst_texture, dst_sub_resource_idx,
debug_box(dst_box), src_texture, src_sub_resource_idx,
1373 TRACE(
"dst_color_key {0x%08x, 0x%08x}.\n",
1374 fx->dst_color_key.color_space_low_value,
1375 fx->dst_color_key.color_space_high_value);
1376 TRACE(
"src_color_key {0x%08x, 0x%08x}.\n",
1377 fx->src_color_key.color_space_low_value,
1378 fx->src_color_key.color_space_high_value);
1385 dst_sub_resource = &dst_texture->
sub_resources[dst_sub_resource_idx];
1386 src_sub_resource = &src_texture->
sub_resources[src_sub_resource_idx];
1390 WARN(
"Source sub-resource is discarded, nothing to do.\n");
1397 if (!
fx || !(
fx->fx))
1398 flags &= ~WINED3D_BLT_FX;
1403 static unsigned int once;
1406 FIXME(
"Can't handle WINED3D_BLT_DO_NOT_WAIT flag.\n");
1411 if (
flags & ~simple_blit)
1413 WARN_(d3d_perf)(
"Using CPU fallback for complex blit (%#x).\n",
flags);
1420 if (src_swapchain && dst_swapchain && src_swapchain != dst_swapchain
1425 FIXME(
"Cross-swapchain blit not supported.\n");
1432 resolve = src_texture->
resource.multisample_type != dst_texture->
resource.multisample_type;
1437 && (src_texture->
resource.format->typeless_id == dst_texture->
resource.format->typeless_id);
1438 if (resolve_typeless && !resolve_format)
1439 WARN(
"Resolve format for typeless resolve not specified.\n");
1442 dst_ds = dst_texture->
resource.format->depth_size || dst_texture->
resource.format->stencil_size;
1443 src_ds = src_texture->
resource.format->depth_size || src_texture->
resource.format->stencil_size;
1445 if (src_ds || dst_ds)
1447 TRACE(
"Depth/stencil blit.\n");
1450 dst_location = dst_texture->
resource.draw_binding;
1452 dst_location = dst_texture->
resource.map_binding;
1461 src_texture, src_sub_resource_idx, src_texture->
resource.draw_binding, &src_rect,
1462 dst_texture, dst_sub_resource_idx, dst_location, &dst_rect,
NULL,
filter, resolve_format);
1471 TRACE(
"Colour blit.\n");
1475 if ((dst_sub_resource->locations & dst_texture->
resource.map_binding)
1476 && (src_sub_resource->locations & src_texture->
resource.map_binding))
1479 TRACE(
"Not doing sysmem blit because of scaling.\n");
1481 TRACE(
"Not doing sysmem blit because of format conversion.\n");
1489 colour_key = &
fx->src_color_key;
1494 colour_key = &src_texture->
async.src_blt_color_key;
1507 TRACE(
"Not doing upload because of scaling.\n");
1509 TRACE(
"Not doing upload because of format conversion.\n");
1510 else if (dst_texture->
resource.format->conv_byte_count)
1511 TRACE(
"Not doing upload because the destination format needs conversion.\n");
1515 dst_box->
top, dst_box->
front, src_texture, src_sub_resource_idx, src_box);
1531 TRACE(
"Not doing download because of scaling.\n");
1533 TRACE(
"Not doing download because of format conversion.\n");
1534 else if (src_texture->
resource.format->conv_byte_count)
1535 TRACE(
"Not doing download because the source format needs conversion.\n");
1537 TRACE(
"Not doing download because texture is not downloadable.\n");
1539 TRACE(
"Not doing download because of partial download (src).\n");
1541 TRACE(
"Not doing download because of partial download (dst).\n");
1545 src_sub_resource_idx);
1561 TRACE(
"Using present for backbuffer -> frontbuffer blit.\n");
1568 dst_swapchain->
state.desc.swap_effect = swap_effect;
1583 src_location = src_texture->
resource.draw_binding;
1586 dst_location = dst_texture->
resource.map_binding;
1591 dst_location = dst_texture->
resource.draw_binding;
1594 src_texture, src_sub_resource_idx, src_location, &src_rect,
1595 dst_texture, dst_sub_resource_idx, dst_location, &dst_rect, colour_key,
filter, resolve_format);
1606 src_texture, src_sub_resource_idx, src_box,
flags,
fx,
filter);
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void wined3d_context_gl_check_fbo_status(const struct wined3d_context_gl *context_gl, GLenum target)
void wined3d_context_gl_apply_fbo_state_explicit(struct wined3d_context_gl *context_gl, GLenum target, struct wined3d_resource *rt, unsigned int rt_sub_resource_idx, struct wined3d_resource *ds, unsigned int ds_sub_resource_idx, uint32_t location)
GLenum wined3d_context_gl_get_offscreen_gl_buffer(const struct wined3d_context_gl *context_gl)
unsigned short float_32_to_16(const float in)
void context_restore(struct wined3d_context *context, struct wined3d_texture *texture, unsigned int sub_resource_idx)
void wined3d_resource_memory_colour_fill(struct wined3d_resource *resource, const struct wined3d_map_desc *map, const struct wined3d_color *colour, const struct wined3d_box *box, bool full_subresource)
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource)
static DWORD cpu_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op, struct wined3d_context *context, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, DWORD src_location, const RECT *src_rect, struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, DWORD dst_location, const RECT *dst_rect, const struct wined3d_color_key *color_key, enum wined3d_texture_filter_type filter, const struct wined3d_format *resolve_format)
static const struct d3dfmt_converter_desc * find_converter(enum wined3d_format_id from, enum wined3d_format_id to)
#define STRETCH_ROW(type)
static HRESULT surface_cpu_blt_compressed(const BYTE *src_data, BYTE *dst_data, UINT src_pitch, UINT dst_pitch, UINT update_w, UINT update_h, const struct wined3d_format *format, uint32_t flags, const struct wined3d_blt_fx *fx)
static const struct wined3d_blitter_ops cpu_blitter_ops
static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const struct wined3d_box *dst_box, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, uint32_t flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
static void cpu_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_device *device, unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects, const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, unsigned int stencil)
static struct wined3d_texture * surface_convert_format(struct wined3d_texture *src_texture, unsigned int sub_resource_idx, const struct wined3d_format *dst_format)
HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const struct wined3d_box *dst_box, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, uint32_t flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
struct wined3d_blitter * wined3d_cpu_blitter_create(void)
#define COPY_COLORKEY_FX(type)
static void convert_yuy2_r5g6b5(const BYTE *src, BYTE *dst, unsigned int pitch_in, unsigned int pitch_out, unsigned int w, unsigned int h)
static bool sub_resource_is_on_cpu(const struct wined3d_texture *texture, unsigned int sub_resource_idx)
static bool wined3d_box_intersect(struct wined3d_box *ret, const struct wined3d_box *b1, const struct wined3d_box *b2)
static void convert_r5g6b5_x8r8g8b8(const BYTE *src, BYTE *dst, unsigned int pitch_in, unsigned int pitch_out, unsigned int w, unsigned int h)
static const struct d3dfmt_converter_desc converters[]
static void cpu_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context)
static BYTE cliptobyte(int x)
static void convert_yuy2_x8r8g8b8(const BYTE *src, BYTE *dst, unsigned int pitch_in, unsigned int pitch_out, unsigned int w, unsigned int h)
void texture2d_read_from_framebuffer(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD src_location, DWORD dst_location)
static bool wined3d_is_colour_blit(enum wined3d_blit_op blit_op)
static void cpu_blitter_clear_rtv(struct wined3d_rendertarget_view *view, const struct wined3d_box *box, const struct wined3d_color *colour)
static void get_color_masks(const struct wined3d_format *format, uint32_t *masks)
static void convert_a8r8g8b8_x8r8g8b8(const BYTE *src, BYTE *dst, unsigned int pitch_in, unsigned int pitch_out, unsigned int w, unsigned int h)
static void convert_r32_float_r16_float(const BYTE *src, BYTE *dst, unsigned int pitch_in, unsigned int pitch_out, unsigned int w, unsigned int h)
void cpu_blitter_clear_texture(struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_box *box, const struct wined3d_color *colour)
void wined3d_texture_invalidate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, uint32_t location)
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture)
HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, UINT layer_count, UINT level_count, uint32_t flags, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
void wined3d_texture_validate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, uint32_t location)
void wined3d_texture_upload_from_texture(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box)
BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, unsigned int location)
void wined3d_texture_download_from_texture(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx)
BOOL wined3d_texture_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, uint32_t location)
void wined3d_texture_get_bo_address(const struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_bo_address *data, uint32_t location)
void CDECL wined3d_texture_get_pitch(const struct wined3d_texture *texture, unsigned int level, unsigned int *row_pitch, unsigned int *slice_pitch)
const char * debug_d3dusage(uint32_t usage)
const char * debug_box(const struct wined3d_box *box)
const char * debug_d3dformat(enum wined3d_format_id format_id)
const char * wined3d_debug_location(uint32_t location)
const struct wined3d_format * wined3d_get_format(const struct wined3d_adapter *adapter, enum wined3d_format_id format_id, unsigned int bind_flags)
const char * debug_d3dtexturefiltertype(enum wined3d_texture_filter_type filter_type)
void wined3d_format_calculate_pitch(const struct wined3d_format *format, unsigned int alignment, unsigned int width, unsigned int height, unsigned int *row_pitch, unsigned int *slice_pitch)
const char * debug_color(const struct wined3d_color *color)
void wined3d_rendertarget_view_get_box(struct wined3d_rendertarget_view *view, struct wined3d_box *box)
#define WINE_DECLARE_DEBUG_CHANNEL(x)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLint GLint GLint GLint x
#define GL_PACK_ROW_LENGTH
GLint GLint GLsizei GLsizei height
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei width
GLenum GLenum GLenum GLenum GLenum scale
GLsizei const GLint * locations
GLdouble GLdouble GLdouble GLdouble top
#define GL_PIXEL_PACK_BUFFER
#define GL_READ_FRAMEBUFFER
GLubyte GLubyte GLubyte GLubyte w
GLint GLfloat GLint stencil
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
static CRYPT_DATA_BLOB b2[]
static CRYPT_DATA_BLOB b1[]
D3D11_SHADER_VARIABLE_DESC desc
static const char * dst_format
static const BYTE masks[8]
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
for(i=0;i< sizeof(testsuite)/sizeof(testsuite[0]);++i) ok(call_test(testsuite[i].func)
static unsigned __int64 next
void(* convert)(const BYTE *src, BYTE *dst, unsigned int pitch_in, unsigned int pitch_out, unsigned int w, unsigned int h)
enum wined3d_format_id from to
struct wined3d_blitter * next
const struct wined3d_blitter_ops * ops
struct wined3d_bo * buffer_object
const struct wined3d_gl_info * gl_info
unsigned int sub_resource_idx
struct wined3d_rendertarget_view * depth_stencil
struct wined3d_rendertarget_view * render_targets[WINED3D_MAX_RENDER_TARGETS]
struct opengl_funcs gl_ops
struct wined3d_texture ** back_buffers
unsigned int swap_interval
struct wined3d_texture * front_buffer
struct wined3d_swapchain_state state
struct wined3d_texture::wined3d_texture_sub_resource * sub_resources
const struct wined3d_texture_ops * texture_ops
struct wined3d_swapchain * swapchain
struct wined3d_resource resource
struct wined3d_texture::wined3d_texture_async async
const struct wined3d_parent_ops wined3d_null_parent_ops
HRESULT CDECL wined3d_swapchain_present(struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, unsigned int swap_interval, uint32_t flags)
#define WINEDDBLTFX_ROTATE270
#define WINED3DCLEAR_TARGET
#define WINED3D_TEXTURE_CREATE_DISCARD
@ WINED3D_MULTISAMPLE_NONE
#define WINED3D_BLT_DST_CKEY
#define WINED3D_BLT_ALPHA_TEST
@ WINED3D_SWAP_EFFECT_COPY
#define WINED3D_RESOURCE_ACCESS_GPU
#define WINED3D_BLT_SRC_CKEY
#define WINED3D_RESOURCE_ACCESS_CPU
#define WINEDDBLTFX_NOTEARING
@ WINED3D_RTYPE_TEXTURE_2D
#define WINEDDBLTFX_MIRRORUPDOWN
#define WINEDDBLTFX_ROTATE90
#define WINED3DERR_NOTAVAILABLE
wined3d_texture_filter_type
#define WINED3D_BLT_DST_CKEY_OVERRIDE
#define WINED3D_BLT_SRC_CKEY_OVERRIDE
@ WINED3DFMT_B8G8R8A8_UNORM
@ WINED3DFMT_B8G8R8X8_UNORM
@ WINED3DFMT_B5G6R5_UNORM
static void wined3d_box_set(struct wined3d_box *box, unsigned int left, unsigned int top, unsigned int right, unsigned int bottom, unsigned int front, unsigned int back)
#define WINED3DCLEAR_STENCIL
#define WINED3D_RESOURCE_ACCESS_MAP_R
#define WINED3D_MAP_WRITE
#define WINED3D_BLT_SYNCHRONOUS
#define WINED3D_BLT_DO_NOT_WAIT
#define WINED3DUSAGE_SCRATCH
#define WINEDDBLTFX_ZBUFFERBASEDEST
#define WINED3DCLEAR_ZBUFFER
#define WINEDDBLTFX_ARITHSTRETCHY
#define WINED3DERR_INVALIDCALL
#define WINEDDBLTFX_ROTATE180
#define WINEDDBLTFX_MIRRORLEFTRIGHT
#define WINED3D_RESOURCE_ACCESS_MAP_W
static void wined3d_context_gl_reference_bo(struct wined3d_context_gl *context_gl, struct wined3d_bo_gl *bo_gl)
static BOOL wined3d_format_is_typeless(const struct wined3d_format *format)
static unsigned int wined3d_texture_get_level_height(const struct wined3d_texture *texture, unsigned int level)
#define WINED3D_FORMAT_ATTR_HEIGHT_SCALE
#define WINED3D_LOCATION_SYSMEM
#define WINED3D_TEXTURE_DOWNLOADABLE
static unsigned int wined3d_texture_get_level_width(const struct wined3d_texture *texture, unsigned int level)
static bool wined3d_texture_is_full_rect(const struct wined3d_texture *texture, unsigned int level, const RECT *r)
#define WINED3D_LOCATION_BUFFER
#define WINED3D_LOCATION_RB_RESOLVED
#define WINED3D_FORMAT_ATTR_COMPRESSED
static void context_release(struct wined3d_context *context)
static uint32_t wined3d_mask_from_size(unsigned int size)
static BOOL is_identity_fixup(struct color_fixup_desc fixup)
#define WINED3D_LOCATION_TEXTURE_RGB
static void wined3d_context_unmap_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *data, unsigned int range_count, const struct wined3d_range *ranges)
#define WINED3D_LOCATION_DRAWABLE
#define WINED3D_LOCATION_CLEARED
#define WINED3D_LOCATION_DISCARDED
static void wined3d_texture_get_level_box(const struct wined3d_texture *texture, unsigned int level, struct wined3d_box *box)
static void * wined3d_context_map_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *data, size_t size, uint32_t map_flags)
#define WINED3D_FORMAT_ATTR_BLOCKS
static struct wined3d_context * context_acquire(struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
@ WINED3D_BLIT_OP_COLOR_BLIT_CKEY
@ WINED3D_BLIT_OP_RAW_BLIT
@ WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST
@ WINED3D_BLIT_OP_DEPTH_BLIT
@ WINED3D_BLIT_OP_COLOR_BLIT
static unsigned int block