57 f->l = ((
r->left * 2.0f) /
w) - 1.0f;
58 f->t = ((
r->top * 2.0f) /
h) - 1.0f;
59 f->r = ((
r->right * 2.0f) /
w) - 1.0f;
60 f->b = ((
r->bottom * 2.0f) /
h) - 1.0f;
197 gl_info->
gl_ops.gl.p_glEnable(
info.bind_target);
217 gl_info->
gl_ops.gl.p_glTexCoord3fv(&
info.texcoords[0].x);
218 gl_info->
gl_ops.gl.p_glVertex2i(dst_rect->
left, dst_rect->
top);
220 gl_info->
gl_ops.gl.p_glTexCoord3fv(&
info.texcoords[1].x);
223 gl_info->
gl_ops.gl.p_glTexCoord3fv(&
info.texcoords[2].x);
226 gl_info->
gl_ops.gl.p_glTexCoord3fv(&
info.texcoords[3].x);
228 gl_info->
gl_ops.gl.p_glEnd();
254 if ((
r->left &&
r->right) ||
abs(
r->right -
r->left) !=
t)
257 if ((
r->top &&
r->bottom) ||
abs(
r->bottom -
r->top) !=
t)
276 TRACE(
"src_surface %p, src_location %s, src_rect %s,\n",
278 TRACE(
"dst_surface %p, dst_location %s, dst_rect %s.\n",
286 ERR(
"Incompatible formats %s and %s.\n",
294 ERR(
"Not a depth / stencil format: %s.\n",
309 WARN(
"Invalid context, skipping blit.\n");
343 gl_info->gl_ops.gl.p_glStencilMask(~0
U);
355 gl_info->gl_ops.gl.p_glFlush();
383 RECT src_rect, dst_rect;
389 TRACE(
"src_surface %p, src_location %s, src_rect %s,\n",
391 TRACE(
"dst_surface %p, dst_location %s, dst_rect %s.\n",
394 src_rect = *src_rect_in;
395 dst_rect = *dst_rect_in;
431 else required_rt =
NULL;
434 if (restore_rt != required_rt)
443 WARN(
"Invalid context, skipping blit.\n");
451 TRACE(
"Source surface %p is onscreen.\n", src_surface);
457 TRACE(
"Source surface %p is offscreen.\n", src_surface);
468 TRACE(
"Destination surface %p is onscreen.\n", dst_surface);
474 TRACE(
"Destination surface %p is offscreen.\n", dst_surface);
495 && dst_texture->
swapchain->front_buffer == dst_texture))
496 gl_info->
gl_ops.gl.p_glFlush();
559 struct wined3d_texture_sub_resource *sub_resource;
560 unsigned int dst_row_pitch, dst_slice_pitch;
561 unsigned int src_row_pitch, src_slice_pitch;
575 sub_resource = &
texture->sub_resources[sub_resource_idx];
583 FIXME(
"Reading back converted array texture %p is not supported.\n",
texture);
589 ERR(
"Array texture %p uses NP2 emulation.\n",
texture);
591 WARN_(d3d_perf)(
"Downloading all miplevel layers to get the surface data for a single sub-resource.\n");
595 ERR(
"Out of memory.\n");
606 FIXME(
"Reading back converted texture %p with NP2 emulation is not supported.\n",
texture);
614 &src_row_pitch, &src_slice_pitch);
615 if (!(temporary_mem =
heap_alloc(src_slice_pitch)))
617 ERR(
"Out of memory.\n");
621 if (
data.buffer_object)
622 ERR(
"NP2 emulated texture uses PBO unexpectedly.\n");
624 ERR(
"Unexpected compressed format for NP2 emulated texture.\n");
631 if (
data.buffer_object)
632 ERR(
"Converted texture %p uses PBO unexpectedly.\n",
texture);
637 f.byte_count =
format->conv_byte_count;
642 &src_row_pitch, &src_slice_pitch);
644 if (!(temporary_mem =
heap_alloc(src_slice_pitch)))
646 ERR(
"Failed to allocate memory.\n");
655 else if (
data.buffer_object)
668 TRACE(
"Downloading compressed surface %p, level %u, format %#x, type %#x, data %p.\n",
676 TRACE(
"Downloading surface %p, level %u, format %#x, type %#x, data %p.\n",
685 format->download(
mem,
data.addr, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch,
691 const BYTE *src_data;
740 dst_data =
data.addr;
741 TRACE(
"Repacking the surface data from pitch %u to pitch %u.\n", src_row_pitch, dst_row_pitch);
743 for (
y = 0;
y <
h; ++
y)
745 memcpy(dst_data, src_data, dst_row_pitch);
746 src_data += src_row_pitch;
747 dst_data += dst_row_pitch;
750 else if (temporary_mem)
752 unsigned int layer = sub_resource_idx /
texture->level_count;
753 void *src_data = temporary_mem +
layer * sub_resource->size;
754 if (
data.buffer_object)
763 memcpy(
data.addr, src_data, sub_resource->size);
767 if (
data.buffer_object)
790 TRACE(
"surface %p, gl_info %p, format %s, src_rect %s, src_pitch %u, dst_point %s, srgb %#x, data {%#x:%p}.\n",
794 if (
texture->sub_resources[sub_resource_idx].map_count)
796 WARN(
"Uploading a surface that is currently mapped, setting WINED3D_TEXTURE_PIN_SYSMEM.\n");
802 update_h *=
format->height_scale.numerator;
803 update_h /=
format->height_scale.denominator;
806 if (
data->buffer_object)
818 unsigned int dst_row_pitch, dst_slice_pitch;
835 TRACE(
"Uploading compressed data, target %#x, level %u, layer %u, x %d, y %d, w %u, h %u, "
836 "format %#x, image_size %#x, addr %p.\n",
840 if (dst_row_pitch == src_pitch)
855 UINT row_count = (update_h +
format->block_height - 1) /
format->block_height;
883 addr += src_rect->
top * src_pitch;
886 TRACE(
"Uploading data, target %#x, level %u, layer %u, x %d, y %d, w %u, h %u, "
887 "format %#x, type %#x, addr %p.\n",
906 if (
data->buffer_object)
913 gl_info->
gl_ops.gl.p_glFlush();
920 for (
i = 0;
i <
device->context_count; ++
i)
934 unsigned int src_row_pitch, src_slice_pitch;
936 unsigned int src_level, dst_level;
939 UINT update_w, update_h;
941 TRACE(
"dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n",
951 update_w = src_rect->
right - src_rect->
left;
952 update_h = src_rect->
bottom - src_rect->
top;
953 dst_level = dst_sub_resource_idx % dst_texture->
level_count;
961 src_level = src_sub_resource_idx % src_texture->
level_count;
987 unsigned int src_width, src_height;
991 gl_info = &
texture->resource.device->adapter->gl_info;
998 unsigned int rt_level;
1021 if (
width > src_width ||
height > src_height)
return;
1066 unsigned int mantissa;
1075 return (*
in < 0.0f ? 0xfc00 : 0x7c00);
1077 if (tmp < (
float)(1u << 10))
1083 }
while (tmp < (
float)(1u << 10));
1085 else if (tmp >= (
float)(1u << 11))
1091 }
while (tmp >= (
float)(1u << 11));
1094 mantissa = (
unsigned int)tmp;
1095 if (tmp - mantissa >= 0.5f)
1110 mantissa = mantissa >> 1;
1113 ret = mantissa & 0x3ff;
1117 ret = (
exp << 10) | (mantissa & 0x3ff);
1120 ret |= ((*
in < 0.0f ? 1 : 0) << 15);
1125 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1127 unsigned short *dst_s;
1131 TRACE(
"Converting %ux%u pixels, pitches %u %u.\n",
w,
h, pitch_in, pitch_out);
1133 for (
y = 0;
y <
h; ++
y)
1135 src_f = (
const float *)(
src +
y * pitch_in);
1136 dst_s = (
unsigned short *) (
dst +
y * pitch_out);
1137 for (
x = 0;
x <
w; ++
x)
1145 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1147 static const unsigned char convert_5to8[] =
1149 0x00, 0x08, 0x10, 0x19, 0x21, 0x29, 0x31, 0x3a,
1150 0x42, 0x4a, 0x52, 0x5a, 0x63, 0x6b, 0x73, 0x7b,
1151 0x84, 0x8c, 0x94, 0x9c, 0xa5, 0xad, 0xb5, 0xbd,
1152 0xc5, 0xce, 0xd6, 0xde, 0xe6, 0xef, 0xf7, 0xff,
1154 static const unsigned char convert_6to8[] =
1156 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, 0x18, 0x1c,
1157 0x20, 0x24, 0x28, 0x2d, 0x31, 0x35, 0x39, 0x3d,
1158 0x41, 0x45, 0x49, 0x4d, 0x51, 0x55, 0x59, 0x5d,
1159 0x61, 0x65, 0x69, 0x6d, 0x71, 0x75, 0x79, 0x7d,
1160 0x82, 0x86, 0x8a, 0x8e, 0x92, 0x96, 0x9a, 0x9e,
1161 0xa2, 0xa6, 0xaa, 0xae, 0xb2, 0xb6, 0xba, 0xbe,
1162 0xc2, 0xc6, 0xca, 0xce, 0xd2, 0xd7, 0xdb, 0xdf,
1163 0xe3, 0xe7, 0xeb, 0xef, 0xf3, 0xf7, 0xfb, 0xff,
1167 TRACE(
"Converting %ux%u pixels, pitches %u %u.\n",
w,
h, pitch_in, pitch_out);
1169 for (
y = 0;
y <
h; ++
y)
1171 const WORD *src_line = (
const WORD *)(
src +
y * pitch_in);
1173 for (
x = 0;
x <
w; ++
x)
1175 WORD pixel = src_line[
x];
1176 dst_line[
x] = 0xff000000u
1177 | convert_5to8[(pixel & 0xf800u) >> 11] << 16
1178 | convert_6to8[(pixel & 0x07e0u) >> 5] << 8
1179 | convert_5to8[(pixel & 0x001fu)];
1187 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1191 TRACE(
"Converting %ux%u pixels, pitches %u %u.\n",
w,
h, pitch_in, pitch_out);
1193 for (
y = 0;
y <
h; ++
y)
1198 for (
x = 0;
x <
w; ++
x)
1200 dst_line[
x] = 0xff000000 | (src_line[
x] & 0xffffff);
1207 return (
BYTE)((
x < 0) ? 0 : ((
x > 255) ? 255 :
x));
1211 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1213 int c2,
d,
e,
r2 = 0, g2 = 0,
b2 = 0;
1216 TRACE(
"Converting %ux%u pixels, pitches %u %u.\n",
w,
h, pitch_in, pitch_out);
1218 for (
y = 0;
y <
h; ++
y)
1220 const BYTE *src_line =
src +
y * pitch_in;
1222 for (
x = 0;
x <
w; ++
x)
1233 d = (
int) src_line[1] - 128;
1234 e = (
int) src_line[3] - 128;
1236 g2 = - 100 *
d - 208 *
e + 128;
1239 c2 = 298 * ((
int) src_line[0] - 16);
1240 dst_line[
x] = 0xff000000
1253 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1256 int c2,
d,
e,
r2 = 0, g2 = 0,
b2 = 0;
1258 TRACE(
"Converting %ux%u pixels, pitches %u %u\n",
w,
h, pitch_in, pitch_out);
1260 for (
y = 0;
y <
h; ++
y)
1262 const BYTE *src_line =
src +
y * pitch_in;
1264 for (
x = 0;
x <
w; ++
x)
1275 d = (
int) src_line[1] - 128;
1276 e = (
int) src_line[3] - 128;
1278 g2 = - 100 *
d - 208 *
e + 128;
1281 c2 = 298 * ((
int) src_line[0] - 16);
1294 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1300 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1306 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1312 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1318 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1324 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1330 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1336 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1342 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1348 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1354 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1360 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1366 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1372 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1378 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1384 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1390 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1396 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1402 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1408 DWORD pitch_in,
DWORD pitch_out,
unsigned int w,
unsigned int h)
1479 unsigned int texture_level = sub_resource_idx % src_texture->
level_count;
1484 unsigned int src_row_pitch, src_slice_pitch;
1496 FIXME(
"Cannot find a conversion function from format %s to %s.\n",
1505 desc.multisample_quality = 0;
1516 ERR(
"Failed to create a destination texture for conversion.\n");
1520 if (
device->d3d_initialized)
1526 map_binding = src_texture->
resource.map_binding;
1534 unsigned int dst_row_pitch, dst_slice_pitch;
1539 map_binding = dst_texture->
resource.map_binding;
1559 POINT dst_point = {0, 0};
1561 TRACE(
"Using upload conversion.\n");
1587 unsigned int row_pitch, slice_pitch;
1591 BOOL src_is_upside_down;
1598 if (restore_rt != surface)
1604 if (src_location !=
texture->resource.draw_binding)
1623 TRACE(
"Mapping offscreen render target.\n");
1625 src_is_upside_down =
TRUE;
1633 src_is_upside_down =
FALSE;
1637 if (
data.buffer_object)
1653 texture->resource.format->glFormat,
1661 if (!src_is_upside_down)
1669 if (
data.buffer_object)
1689 if (
data.buffer_object)
1694 if (
data.buffer_object)
1722 if (restore_rt != surface)
1733 TRACE(
"Reading back offscreen render target %p.\n", surface);
1762 unsigned int src_height, src_level, dst_level;
1767 RECT dst_rect = *dst_rect_in;
1789 TRACE(
"Reading from an offscreen target\n");
1790 upsidedown = !upsidedown;
1802 if ((xrel - 1.0f < -
eps) || (xrel - 1.0f >
eps))
1804 FIXME_(d3d_perf)(
"Doing a pixel by pixel copy from the framebuffer to a texture.\n");
1807 ERR(
"Texture filtering not supported in direct blit.\n");
1810 && ((yrel - 1.0f < -
eps) || (yrel - 1.0f >
eps)))
1812 ERR(
"Texture filtering not supported in direct blit\n");
1815 src_level = src_sub_resource_idx % src_texture->
level_count;
1816 dst_level = dst_sub_resource_idx % dst_texture->
level_count;
1821 && !((xrel - 1.0f < -
eps) || (xrel - 1.0f >
eps))
1822 && !((yrel - 1.0f < -
eps) || (yrel - 1.0f >
eps)))
1825 gl_info->gl_ops.gl.p_glCopyTexSubImage2D(dst_target, dst_level,
1826 dst_rect.
left , dst_rect.
top ,
1827 src_rect->
left, src_height - src_rect->
bottom,
1841 if ((xrel - 1.0f < -
eps) || (xrel - 1.0f >
eps))
1848 for (col = dst_rect.
left; col < dst_rect.
right; ++col)
1850 gl_info->gl_ops.gl.p_glCopyTexSubImage2D(dst_target, dst_level,
1852 src_rect->
left + col * xrel,
yoffset - (
int) (
row * yrel), 1, 1);
1857 gl_info->gl_ops.gl.p_glCopyTexSubImage2D(dst_target, dst_level,
1877 unsigned int src_width, src_height, src_pow2_width, src_pow2_height, src_level;
1883 GLenum src_target, dst_target, texture_target;
1890 BOOL noBackBufferBackup;
1893 RECT dst_rect = *dst_rect_in;
1895 TRACE(
"Using hwstretch blit\n");
1907 src_level = src_sub_resource_idx % src_texture->
level_count;
1915 if (!noBackBufferBackup && !src_texture->texture_rgb.name)
1924 if (
context->aux_buffers >= 2)
1929 else if ((!src_offscreen || offscreen_buffer ==
GL_BACK) &&
context->aux_buffers >= 1)
1935 if (noBackBufferBackup)
1947 texture_target = src_target;
1949 gl_info->gl_ops.gl.p_glEnable(texture_target);
1968 TRACE(
"Reading from an offscreen target\n");
1969 upsidedown = !upsidedown;
1970 gl_info->gl_ops.gl.p_glReadBuffer(offscreen_buffer);
1978 gl_info->gl_ops.gl.p_glCopyTexSubImage2D(texture_target, 0, 0, 0, 0, 0, src_width, src_height);
1989 if (!src_texture->
swapchain || src_texture == src_texture->
swapchain->back_buffers[0])
2020 gl_info->gl_ops.gl.p_glDisable(texture_target);
2032 top = src_height - src_rect->
top;
2043 left /= src_pow2_width;
2044 right /= src_pow2_width;
2045 top /= src_pow2_height;
2046 bottom /= src_pow2_height;
2054 gl_info->gl_ops.gl.p_glReadBuffer(drawBuffer);
2059 gl_info->gl_ops.gl.p_glVertex2i(0, 0);
2075 if (texture_target != dst_target)
2077 gl_info->gl_ops.gl.p_glDisable(texture_target);
2078 gl_info->gl_ops.gl.p_glEnable(dst_target);
2079 texture_target = dst_target;
2084 gl_info->gl_ops.gl.p_glCopyTexSubImage2D(texture_target,
2098 gl_info->gl_ops.gl.p_glDisable(texture_target);
2106 if (texture_target != src_target)
2108 gl_info->gl_ops.gl.p_glDisable(texture_target);
2109 gl_info->gl_ops.gl.p_glEnable(src_target);
2110 texture_target = src_target;
2117 gl_info->gl_ops.gl.p_glTexCoord2f(0.0f, 0.0f);
2118 gl_info->gl_ops.gl.p_glVertex2i(0, src_height);
2121 gl_info->gl_ops.gl.p_glTexCoord2f(0.0f, (
float)src_height / (
float)src_pow2_height);
2122 gl_info->gl_ops.gl.p_glVertex2i(0, 0);
2125 gl_info->gl_ops.gl.p_glTexCoord2f((
float)src_width / (
float)src_pow2_width,
2126 (
float)src_height / (
float)src_pow2_height);
2127 gl_info->gl_ops.gl.p_glVertex2i(src_width, 0);
2130 gl_info->gl_ops.gl.p_glTexCoord2f((
float)src_width / (
float)src_pow2_width, 0.0f);
2131 gl_info->gl_ops.gl.p_glVertex2i(src_width, src_height);
2134 gl_info->gl_ops.gl.p_glDisable(texture_target);
2138 if (
src != src_texture->texture_rgb.name &&
src !=
backup)
2140 gl_info->gl_ops.gl.p_glDeleteTextures(1, &
src);
2150 gl_info->gl_ops.gl.p_glFlush();
2168 UINT drawable_height;
2181 drawable_height = windowsize.
bottom - windowsize.
top;
2183 rect->top = drawable_height -
rect->top;
2184 rect->bottom = drawable_height -
rect->bottom;
2197 TRACE(
"dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n",
2204 WARN(
"Destination resource is not GPU accessible, rejecting GL blit.\n");
2215 WARN(
"Source resource is not GPU accessible, rejecting GL blit.\n");
2224 src_swapchain =
NULL;
2228 if (!dst_swapchain && !src_swapchain && src_surface != rt && dst_surface != rt)
2230 TRACE(
"No surface is render target, not using hardware blit.\n");
2238 TRACE(
"Destination color key not supported in accelerated Blit, falling back to software\n");
2242 if (dst_swapchain && dst_swapchain == src_swapchain)
2244 FIXME(
"Implement hardware blit between two surfaces on the same swapchain\n");
2248 if (dst_swapchain && src_swapchain)
2250 FIXME(
"Implement hardware blit between two different swapchains\n");
2257 if (src_surface == rt)
2258 TRACE(
"Blit from active render target to a swapchain\n");
2260 else if (src_swapchain && dst_surface == rt)
2262 FIXME(
"Implement blit from a swapchain to the active render target\n");
2266 if ((src_swapchain || src_surface == rt) && !dst_swapchain)
2268 unsigned int src_level, src_width, src_height;
2276 TRACE(
"P8 read back not supported by frame buffer to texture blit\n");
2282 TRACE(
"Color keying not supported by frame buffer to texture blit\n");
2305 if (!stretchx || dst_rect->
right - dst_rect->
left > src_width
2306 || dst_rect->
bottom - dst_rect->
top > src_height)
2308 TRACE(
"No stretching in x direction, using direct framebuffer -> texture copy.\n");
2313 TRACE(
"Using hardware stretching to flip / stretch the texture.\n");
2321 TRACE(
"Didn't find any usable render target setup for hw blit, falling back to software\n");
2332 struct wined3d_texture_sub_resource *sub_resource;
2334 sub_resource = &
texture->sub_resources[sub_resource_idx];
2368 FIXME(
"Can't load surface %p with location flags %s into sysmem.\n",
2387 FIXME(
"Unimplemented copy from %s for depth/stencil buffers.\n",
2395 ERR(
"Trying to load offscreen surface into WINED3D_LOCATION_DRAWABLE.\n");
2401 if (restore_rt != surface)
2424 unsigned int width,
height,
level, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch;
2430 struct wined3d_texture_sub_resource *sub_resource;
2434 POINT dst_point = {0, 0};
2479 &
texture->resource, src_location, &
texture->resource, dst_location))
2481 &src_rect, surface, dst_location, &src_rect);
2493 FIXME_(d3d_perf)(
"Downloading RGB surface %p to reload it as sRGB.\n", surface);
2502 FIXME_(d3d_perf)(
"Downloading sRGB surface %p to reload it as RGB.\n", surface);
2509 WARN(
"Trying to load a texture from sysmem, but no simple location is valid.\n");
2525#if !defined(STAGING_CSMT)
2526 if ((
format.conv_byte_count || conversion) &&
texture->sub_resources[sub_resource_idx].buffer_object)
2528 if ((
format.conv_byte_count || conversion) &&
texture->sub_resources[sub_resource_idx].buffer)
2531 TRACE(
"Removing the pbo attached to surface %p.\n", surface);
2538 if (
format.conv_byte_count)
2546 if (!(dst_mem =
heap_alloc(dst_slice_pitch)))
2548 ERR(
"Out of memory (%u).\n", dst_slice_pitch);
2552 format.upload(src_mem, dst_mem, src_row_pitch, src_slice_pitch,
2553 dst_row_pitch, dst_slice_pitch,
width,
height, 1);
2554 src_row_pitch = dst_row_pitch;
2557 data.buffer_object = 0;
2558 data.addr = dst_mem;
2560 else if (conversion)
2570 if (!(dst_mem =
heap_alloc(dst_slice_pitch)))
2572 ERR(
"Out of memory (%u).\n", dst_slice_pitch);
2578 conversion->
convert(src_mem, src_row_pitch, dst_mem, dst_row_pitch,
2580 src_row_pitch = dst_row_pitch;
2583 data.buffer_object = 0;
2584 data.addr = dst_mem;
2609 FIXME(
"Unimplemented copy from %s for depth/stencil buffers.\n",
2624 surface, src_location, &
rect, surface, dst_location, &
rect);
2654 ERR(
"Don't know how to handle location %#x.\n",
location);
2671 unsigned int rt_count,
const struct wined3d_fb_state *fb,
unsigned int rect_count,
const RECT *clear_rects,
2701 src_resource, src_location, dst_resource, dst_location))
2705 src_rect, dst_surface, dst_location, dst_rect, colour_key,
filter);
2710 TRACE(
"Colour blit.\n");
2712 src_rect, dst_surface, dst_location, dst_rect);
2713 return dst_location;
2718 TRACE(
"Depth/stencil blit.\n");
2720 return dst_location;
2723 ERR(
"This blitter does not implement blit op %#x.\n", blit_op);
2724 return dst_location;
2741 if (!(blitter =
heap_alloc(
sizeof(*blitter))))
2744 TRACE(
"Created blitter %p.\n", blitter);
2764 unsigned int rt_count,
const struct wined3d_fb_state *fb,
unsigned int rect_count,
const RECT *clear_rects,
2771 ERR(
"No blitter to handle clear.\n");
2775 TRACE(
"Forwarding to blitter %p.\n",
next);
2787 unsigned int src_sub_resource_idx, dst_sub_resource_idx;
2788 unsigned int src_level, src_layer, dst_level, dst_layer;
2791 GLuint src_name, dst_name;
2807 ERR(
"No blitter to handle blit op %#x.\n",
op);
2808 return dst_location;
2811 TRACE(
"Forwarding to blitter %p.\n",
next);
2813 src_rect, dst_surface, dst_location, dst_rect, colour_key,
filter);
2816 TRACE(
"Blit using ARB_copy_image.\n");
2819 src_level = src_sub_resource_idx % src_texture->
level_count;
2820 src_layer = src_sub_resource_idx / src_texture->
level_count;
2823 dst_level = dst_sub_resource_idx % dst_texture->
level_count;
2824 dst_layer = dst_sub_resource_idx / dst_texture->
level_count;
2851 src_rect->
left, src_rect->
top, src_layer, dst_name, dst_texture->
target, dst_level,
2852 dst_rect->
left, dst_rect->
top, dst_layer, src_rect->
right - src_rect->
left,
2878 if (!(blitter =
heap_alloc(
sizeof(*blitter))))
2881 TRACE(
"Created blitter %p.\n", blitter);
2911 TRACE(
"Source or destination resource is not GPU accessible.\n");
2926 if (
context->d3d_info->shader_color_key)
2928 TRACE(
"Color keying requires converted textures.\n");
2938 TRACE(
"Checking support for fixup:\n");
2949 WARN(
"Claiming fixup support because of ORM_BACKBUFFER.\n");
2953 TRACE(
"Fixups are not supported.\n");
2960 TRACE(
"Can only blit to render targets.\n");
2966 TRACE(
"Unsupported blit operation %#x.\n", blit_op);
2992 unsigned int rt_count,
const struct wined3d_fb_state *fb,
unsigned int rect_count,
const RECT *clear_rects,
2997 DWORD next_flags = 0;
3002 for (
i = 0;
i < rt_count; ++
i)
3013 flags &= ~WINED3DCLEAR_TARGET;
3035 if (next_flags && (
next = blitter->
next))
3037 clear_rects, draw_rect, next_flags, colour,
depth,
stencil);
3053 DWORD old_color_key_flags;
3056 src_resource = &src_texture->
resource;
3057 dst_resource = &dst_texture->
resource;
3067 TRACE(
"Blt from surface %p to rendertarget %p\n", src_surface, dst_surface);
3069 old_blt_key = src_texture->
async.src_blt_color_key;
3070 old_color_key_flags = src_texture->
async.color_key_flags;
3094 TRACE(
"Destination surface %p is onscreen.\n", dst_surface);
3099 TRACE(
"Destination surface %p is offscreen.\n", dst_surface);
3124 (
float)src_texture->
async.src_blt_color_key.color_space_low_value / 255.0f);
3144 checkGLcall(
"glDisable(GL_TEXTURE_CUBE_MAP_ARB)");
3149 checkGLcall(
"glDisable(GL_TEXTURE_RECTANGLE_ARB)");
3154 gl_info->
gl_ops.gl.p_glFlush();
3160 return dst_location;
3174 if (!(blitter =
heap_alloc(
sizeof(*blitter))))
3177 TRACE(
"Created blitter %p.\n", blitter);
3199 UINT row_block_count;
3200 const BYTE *src_row;
3207 row_block_count = (update_w +
format->block_width - 1) /
format->block_width;
3211 for (
y = 0;
y < update_h;
y +=
format->block_height)
3213 memcpy(dst_row, src_row, row_block_count *
format->block_byte_count);
3214 src_row += src_pitch;
3215 dst_row += dst_pitch;
3223 src_row += (((update_h /
format->block_height) - 1) * src_pitch);
3228 for (
y = 0;
y < update_h;
y +=
format->block_height)
3233 BYTE control_row[4];
3236 const struct block *
s = (
const struct block *)src_row;
3239 for (
x = 0;
x < row_block_count; ++
x)
3241 d[
x].color[0] =
s[
x].color[0];
3242 d[
x].color[1] =
s[
x].color[1];
3243 d[
x].control_row[0] =
s[
x].control_row[3];
3244 d[
x].control_row[1] =
s[
x].control_row[2];
3245 d[
x].control_row[2] =
s[
x].control_row[1];
3246 d[
x].control_row[3] =
s[
x].control_row[0];
3248 src_row -= src_pitch;
3249 dst_row += dst_pitch;
3255 for (
y = 0;
y < update_h;
y +=
format->block_height)
3261 BYTE control_row[4];
3264 const struct block *
s = (
const struct block *)src_row;
3267 for (
x = 0;
x < row_block_count; ++
x)
3269 d[
x].alpha_row[0] =
s[
x].alpha_row[3];
3270 d[
x].alpha_row[1] =
s[
x].alpha_row[2];
3271 d[
x].alpha_row[2] =
s[
x].alpha_row[1];
3272 d[
x].alpha_row[3] =
s[
x].alpha_row[0];
3273 d[
x].color[0] =
s[
x].color[0];
3274 d[
x].color[1] =
s[
x].color[1];
3275 d[
x].control_row[0] =
s[
x].control_row[3];
3276 d[
x].control_row[1] =
s[
x].control_row[2];
3277 d[
x].control_row[2] =
s[
x].control_row[1];
3278 d[
x].control_row[3] =
s[
x].control_row[0];
3280 src_row -= src_pitch;
3281 dst_row += dst_pitch;
3286 FIXME(
"Compressed flip not implemented for format %s.\n",
3292 FIXME(
"Unsupported blit on compressed surface (format %s, flags %#x, DDFX %#x).\n",
3303 unsigned int bpp, src_height, src_width, dst_height, dst_width, row_byte_count;
3308 unsigned int src_fmt_flags, dst_fmt_flags;
3311 unsigned int x, sx, xinc,
y, sy, yinc;
3312 unsigned int texture_level;
3314 BOOL same_sub_resource;
3320 TRACE(
"dst_texture %p, dst_sub_resource_idx %u, dst_box %s, src_texture %p, "
3321 "src_sub_resource_idx %u, src_box %s, flags %#x, fx %p, filter %s.\n",
3322 dst_texture, dst_sub_resource_idx,
debug_box(dst_box), src_texture,
3325 if (
device->d3d_initialized)
3328 if (src_texture == dst_texture && src_sub_resource_idx == dst_sub_resource_idx)
3330 same_sub_resource =
TRUE;
3332 map_binding = dst_texture->
resource.map_binding;
3333 texture_level = dst_sub_resource_idx % dst_texture->
level_count;
3344 src_format = dst_texture->
resource.format;
3346 dst_fmt_flags = dst_texture->
resource.format_flags;
3347 src_fmt_flags = dst_fmt_flags;
3351 same_sub_resource =
FALSE;
3353 dst_fmt_flags = dst_texture->
resource.format_flags;
3364 src_texture = converted_texture;
3365 src_sub_resource_idx = 0;
3367 src_format = src_texture->
resource.format;
3368 src_fmt_flags = src_texture->
resource.format_flags;
3370 map_binding = src_texture->
resource.map_binding;
3371 texture_level = src_sub_resource_idx % src_texture->
level_count;
3379 map_binding = dst_texture->
resource.map_binding;
3380 texture_level = dst_sub_resource_idx % dst_texture->
level_count;
3389 flags &= ~WINED3D_BLT_RAW;
3392 src_height = src_box->
bottom - src_box->
top;
3393 src_width = src_box->
right - src_box->
left;
3394 dst_height = dst_box->
bottom - dst_box->
top;
3395 dst_width = dst_box->
right - dst_box->
left;
3396 row_byte_count = dst_width *
bpp;
3409 if (same_sub_resource)
3411 FIXME(
"Only plain blits supported on compressed surfaces.\n");
3416 if (src_height != dst_height || src_width != dst_width)
3418 WARN(
"Stretching not supported on compressed surfaces.\n");
3430 && (src_width != dst_width || src_height != dst_height))
3437 xinc = (src_width << 16) / dst_width;
3438 yinc = (src_height << 16) / dst_height;
3443 if (dst_width == src_width)
3445 if (dst_height == src_height)
3452 if (!same_sub_resource || dst_box->
top < src_box->
top
3456 for (
y = 0;
y < dst_height; ++
y)
3458 memcpy(dbuf, sbuf, row_byte_count);
3463 else if (dst_box->
top > src_box->
top)
3468 for (
y = 0;
y < dst_height; ++
y)
3472 memcpy(dbuf, sbuf, row_byte_count);
3478 for (
y = 0;
y < dst_height; ++
y)
3480 memmove(dbuf, sbuf, row_byte_count);
3489 for (
y = sy = 0;
y < dst_height; ++
y, sy += yinc)
3491 sbuf = sbase + (sy >> 16) * src_map.
row_pitch;
3492 memcpy(dbuf, sbuf, row_byte_count);
3500 unsigned int last_sy = ~0
u;
3501 for (
y = sy = 0;
y < dst_height; ++
y, sy += yinc)
3503 sbuf = sbase + (sy >> 16) * src_map.
row_pitch;
3505 if ((sy >> 16) == (last_sy >> 16))
3513#define STRETCH_ROW(type) \
3515 const type *s = (const type *)sbuf; \
3516 type *d = (type *)dbuf; \
3517 for (x = sx = 0; x < dst_width; ++x, sx += xinc) \
3518 d[x] = s[sx >> 16]; \
3536 for (
x = sx = 0;
x < dst_width;
x++, sx+= xinc)
3540 s = sbuf + 3 * (sx >> 16);
3541 pixel =
s[0] | (
s[1] << 8) | (
s[2] << 16);
3542 d[0] = (pixel ) & 0xff;
3543 d[1] = (pixel >> 8) & 0xff;
3544 d[2] = (pixel >> 16) & 0xff;
3550 FIXME(
"Stretched blit not implemented for bpp %u.\n",
bpp * 8);
3564 DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff;
3565 DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff;
3572 keylow = src_texture->
async.src_blt_color_key.color_space_low_value;
3573 keyhigh = src_texture->
async.src_blt_color_key.color_space_high_value;
3577 keylow =
fx->src_color_key.color_space_low_value;
3578 keyhigh =
fx->src_color_key.color_space_high_value;
3584 destkeylow = src_texture->
async.dst_blt_color_key.color_space_low_value;
3585 destkeyhigh = src_texture->
async.dst_blt_color_key.color_space_high_value;
3589 destkeylow =
fx->dst_color_key.color_space_low_value;
3590 destkeyhigh =
fx->dst_color_key.color_space_high_value;
3609 BYTE *dTopLeft, *dTopRight, *dBottomLeft, *dBottomRight, *tmp;
3612 dTopRight = dbuf + ((dst_width - 1) *
bpp);
3613 dBottomLeft = dTopLeft + ((dst_height - 1) * dst_map.
row_pitch);
3614 dBottomRight = dBottomLeft + ((dst_width - 1) *
bpp);
3619 WARN(
"Nothing done for WINEDDBLTFX_ARITHSTRETCHY.\n");
3624 dTopRight = dTopLeft;
3627 dBottomRight = dBottomLeft;
3629 dstxinc = dstxinc * -1;
3634 dTopLeft = dBottomLeft;
3637 dTopRight = dBottomRight;
3639 dstyinc = dstyinc * -1;
3644 WARN(
"Nothing done for WINEDDBLTFX_NOTEARING.\n");
3649 dBottomRight = dTopLeft;
3652 dBottomLeft = dTopRight;
3654 dstxinc = dstxinc * -1;
3655 dstyinc = dstyinc * -1;
3660 dTopLeft = dBottomLeft;
3661 dBottomLeft = dBottomRight;
3662 dBottomRight = dTopRight;
3667 dstxinc = dstxinc * -1;
3672 dTopLeft = dTopRight;
3673 dTopRight = dBottomRight;
3674 dBottomRight = dBottomLeft;
3679 dstyinc = dstyinc * -1;
3684 WARN(
"Nothing done for WINEDDBLTFX_ZBUFFERBASEDEST.\n");
3690#define COPY_COLORKEY_FX(type) \
3693 type *d = (type *)dbuf, *dx, tmp; \
3694 for (y = sy = 0; y < dst_height; ++y, sy += yinc) \
3696 s = (const type *)(sbase + (sy >> 16) * src_map.row_pitch); \
3698 for (x = sx = 0; x < dst_width; ++x, sx += xinc) \
3700 tmp = s[sx >> 16]; \
3701 if (((tmp & keymask) < keylow || (tmp & keymask) > keyhigh) \
3702 && ((dx[0] & destkeymask) >= destkeylow && (dx[0] & destkeymask) <= destkeyhigh)) \
3706 dx = (type *)(((BYTE *)dx) + dstxinc); \
3708 d = (type *)(((BYTE *)d) + dstyinc); \
3727 for (
y = sy = 0;
y < dst_height; ++
y, sy += yinc)
3729 sbuf = sbase + (sy >> 16) * src_map.
row_pitch;
3731 for (
x = sx = 0;
x < dst_width; ++
x, sx+= xinc)
3733 DWORD pixel, dpixel = 0;
3734 s = sbuf + 3 * (sx>>16);
3735 pixel =
s[0] | (
s[1] << 8) | (
s[2] << 16);
3736 dpixel =
dx[0] | (
dx[1] << 8 ) | (
dx[2] << 16);
3737 if (((pixel & keymask) < keylow || (pixel & keymask) > keyhigh)
3738 && ((dpixel & keymask) >= destkeylow || (dpixel & keymask) <= keyhigh))
3740 dx[0] = (pixel ) & 0xff;
3741 dx[1] = (pixel >> 8) & 0xff;
3742 dx[2] = (pixel >> 16) & 0xff;
3751 FIXME(
"%s color-keyed blit not implemented for bpp %u.\n",
3755#undef COPY_COLORKEY_FX
3765 if (!same_sub_resource)
3771 dst_texture->
swapchain->swapchain_ops->swapchain_frontbuffer_updated(dst_texture->
swapchain);
3773 if (converted_texture)
3802 if (
view->format->id !=
view->resource->format->id)
3803 FIXME(
"View format %s doesn't match resource format %s.\n",
3808 FIXME(
"Not implemented for buffers.\n");
3812 if (
device->d3d_initialized)
3816 bpp =
view->format->byte_count;
3821 map_binding =
texture->resource.map_binding;
3826 &
map.row_pitch, &
map.slice_pitch);
3831 + (
box->front *
map.slice_pitch)
3832 + ((
box->top /
view->format->block_height) *
map.row_pitch)
3833 + ((
box->left /
view->format->block_width) *
view->format->block_byte_count);
3838 for (
x = 0;
x <
w; ++
x)
3845 for (
x = 0;
x <
w; ++
x)
3854 for (
x = 0;
x <
w; ++
x,
row += 3)
3856 row[0] = (
c ) & 0xff;
3857 row[1] = (
c >> 8) & 0xff;
3858 row[2] = (
c >> 16) & 0xff;
3863 for (
x = 0;
x <
w; ++
x)
3870 FIXME(
"Not implemented for bpp %u.\n",
bpp);
3876 for (
y = 1;
y <
h; ++
y)
3888 unsigned int rt_count,
const struct wined3d_fb_state *fb,
unsigned int rect_count,
const RECT *clear_rects,
3899 clear_rects = draw_rect;
3902 for (
i = 0;
i < rect_count; ++
i)
3916 for (
j = 0;
j < rt_count; ++
j)
3963 FIXME(
"Unhandled op %#x.\n",
op);
3968 src_texture, src_sub_resource_idx, &src_box,
flags, &
fx,
filter)))
3969 ERR(
"Failed to blit.\n");
3972 return dst_location | (dst_texture->
sub_resources[dst_sub_resource_idx].locations
3973 & dst_texture->
resource.map_binding);
3987 if (!(blitter =
heap_alloc(
sizeof(*blitter))))
3990 TRACE(
"Created blitter %p.\n", blitter);
4006 struct wined3d_texture_sub_resource *src_sub_resource, *dst_sub_resource;
4012 DWORD dst_location, valid_locations;
4013 DWORD src_ds_flags, dst_ds_flags;
4023 TRACE(
"dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n",
4031 TRACE(
"dst_color_key {0x%08x, 0x%08x}.\n",
4032 fx->dst_color_key.color_space_low_value,
4033 fx->dst_color_key.color_space_high_value);
4034 TRACE(
"src_color_key {0x%08x, 0x%08x}.\n",
4035 fx->src_color_key.color_space_low_value,
4036 fx->src_color_key.color_space_high_value);
4039 if (!
fx || !(
fx->fx))
4040 flags &= ~WINED3D_BLT_FX;
4045 static unsigned int once;
4048 FIXME(
"Can't handle WINED3D_BLT_DO_NOT_WAIT flag.\n");
4053 if (!
device->d3d_initialized)
4055 WARN(
"D3D not initialized, using fallback.\n");
4065 WARN_(d3d_perf)(
"Converted surface, using CPU blit.\n");
4069 if (
flags & ~simple_blit)
4071 WARN_(d3d_perf)(
"Using fallback for complex blit (%#x).\n",
flags);
4083 if (src_swapchain && dst_swapchain && src_swapchain != dst_swapchain)
4085 FIXME(
"Using fallback for cross-swapchain blit.\n");
4092 resolve = src_texture->
resource.multisample_type != dst_texture->
resource.multisample_type;
4094 dst_ds_flags = dst_texture->
resource.format_flags
4096 src_ds_flags = src_texture->
resource.format_flags
4099 if (src_ds_flags || dst_ds_flags)
4101 TRACE(
"Depth/stencil blit.\n");
4104 dst_location = dst_texture->
resource.draw_binding;
4106 dst_location = dst_texture->
resource.map_binding;
4109 valid_locations =
device->blitter->ops->blitter_blit(
device->blitter,
4111 src_surface, src_texture->
resource.draw_binding, src_rect,
4112 dst_surface, dst_location, dst_rect,
NULL,
filter);
4121 TRACE(
"Colour blit.\n");
4123 dst_sub_resource = &dst_texture->
sub_resources[dst_sub_resource_idx];
4124 src_sub_resource = &src_texture->
sub_resources[src_sub_resource_idx];
4128 if ((dst_sub_resource->locations & dst_texture->
resource.map_binding)
4129 && (src_sub_resource->locations & src_texture->
resource.map_binding))
4132 TRACE(
"Not doing sysmem blit because of scaling.\n");
4134 TRACE(
"Not doing sysmem blit because of format conversion.\n");
4142 colour_key = &
fx->src_color_key;
4147 colour_key = &src_texture->
async.src_blt_color_key;
4159 TRACE(
"Not doing upload because of scaling.\n");
4161 TRACE(
"Not doing upload because of format conversion.\n");
4162 else if (dst_texture->
resource.format->conv_byte_count)
4163 TRACE(
"Not doing upload because the destination format needs conversion.\n");
4193 TRACE(
"Using present for backbuffer -> frontbuffer blit.\n");
4199 dst_swapchain->
desc.swap_effect = swap_effect;
4209 dst_location = dst_texture->
resource.draw_binding;
4211 dst_location = dst_texture->
resource.map_binding;
4215 src_surface, src_texture->
resource.draw_binding, src_rect,
4216 dst_surface, dst_location, dst_rect, colour_key,
filter);
4231 src_texture, src_sub_resource_idx, &src_box,
flags,
fx,
filter);
ios_base &_STLP_CALL internal(ios_base &__s)
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static const char * wine_dbgstr_point(const POINT *ppt)
static const char * wine_dbgstr_rect(const RECT *prc)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
unsigned short float_32_to_16(const float in) DECLSPEC_HIDDEN
void context_unmap_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *data, GLenum binding)
GLenum context_get_offscreen_gl_buffer(const struct wined3d_context *context)
void context_check_fbo_status(const struct wined3d_context *context, GLenum target)
void context_set_draw_buffer(struct wined3d_context *context, GLenum buffer)
struct wined3d_context * context_acquire(const struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint name)
void context_surface_update(struct wined3d_context *context, const struct wined3d_surface *surface)
void context_invalidate_state(struct wined3d_context *context, DWORD state)
void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device)
void context_release(struct wined3d_context *context)
void * context_map_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *data, size_t size, GLenum binding, DWORD flags)
void context_restore(struct wined3d_context *context, struct wined3d_surface *restore)
void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target, struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location)
void device_invalidate_state(const struct wined3d_device *device, DWORD state)
void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb, UINT rect_count, const RECT *clear_rect, const RECT *draw_rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource)
static const struct wined3d_blitter_ops fbo_blitter_ops
static BOOL fbo_blitter_supported(enum wined3d_blit_op blit_op, const struct wined3d_gl_info *gl_info, const struct wined3d_resource *src_resource, DWORD src_location, const struct wined3d_resource *dst_resource, DWORD dst_location)
void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, struct wined3d_context *old_ctx)
static void cube_coords_float(const RECT *r, UINT w, UINT h, struct float_rect *f)
static void convert_dxt1_a1r5g5b5(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static void convert_r32_float_r16_float(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static const struct d3dfmt_converter_desc * find_converter(enum wined3d_format_id from, enum wined3d_format_id to)
#define STRETCH_ROW(type)
static const struct wined3d_blitter_ops cpu_blitter_ops
static void convert_dxt5_a8r8g8b8(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
void wined3d_fbo_blitter_create(struct wined3d_blitter **next, const struct wined3d_gl_info *gl_info)
static void convert_dxt3_a8r8g8b8(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static DWORD cpu_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op, struct wined3d_context *context, struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect, struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect, const struct wined3d_color_key *color_key, enum wined3d_texture_filter_type filter)
static void convert_a8r8g8b8_x8r8g8b8(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static void get_color_masks(const struct wined3d_format *format, DWORD *masks)
static void convert_x8r8g8b8_dxt5(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface, const RECT *src_rect, const RECT *dst_rect_in, enum wined3d_texture_filter_type filter)
static BOOL surface_load_sysmem(struct wined3d_surface *surface, struct wined3d_context *context, DWORD dst_location)
static void convert_dxt1_x1r5g5b5(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static const DWORD surface_simple_locations
static void convert_x8r8g8b8_dxt1(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static void convert_dxt1_x4r4g4b4(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static void surface_blt_fbo(const struct wined3d_device *device, struct wined3d_context *old_ctx, enum wined3d_texture_filter_type filter, struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect_in, struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect_in)
static void surface_download_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, DWORD dst_location)
static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
static struct wined3d_texture * surface_convert_format(struct wined3d_texture *src_texture, unsigned int sub_resource_idx, const struct wined3d_format *dst_format)
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, DWORD flags, const struct wined3d_blt_fx *fx)
static BOOL ffp_blitter_use_cpu_clear(struct wined3d_rendertarget_view *view)
struct wined3d_blitter * wined3d_cpu_blitter_create(void)
static BOOL surface_load_texture(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb)
static void convert_yuy2_x8r8g8b8(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
static void fbo_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context)
static HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, struct wined3d_surface *src_surface, const RECT *src_rect)
static DWORD fbo_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op, struct wined3d_context *context, struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect, struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect, const struct wined3d_color_key *colour_key, enum wined3d_texture_filter_type filter)
#define COPY_COLORKEY_FX(type)
static void convert_dxt3_x4r4g4b4(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static void ffp_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, DWORD flags, const struct wined3d_color *colour, float depth, DWORD stencil)
void draw_textured_quad(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter)
static void convert_a8r8g8b8_dxt5(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static BOOL texture2d_is_full_rect(const struct wined3d_texture *texture, unsigned int level, const RECT *r)
static BOOL is_multisample_location(const struct wined3d_texture *texture, DWORD location)
static void convert_dxt1_a4r4g4b4(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static void convert_dxt1_x8r8g8b8(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
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, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
void surface_set_compatible_renderbuffer(struct wined3d_surface *surface, const struct wined3d_rendertarget_info *rt)
static DWORD ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op, struct wined3d_context *context, struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect, struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect, const struct wined3d_color_key *color_key, enum wined3d_texture_filter_type filter)
static void texture2d_get_blt_info(const struct wined3d_texture *texture, unsigned int sub_resource_idx, const RECT *rect, struct blt_info *info)
static void convert_a1r5g5b5_dxt1(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
void wined3d_raw_blitter_create(struct wined3d_blitter **next, const struct wined3d_gl_info *gl_info)
static const struct wined3d_blitter_ops ffp_blitter_ops
void surface_translate_drawable_coords(const struct wined3d_surface *surface, HWND window, RECT *rect)
static void convert_dxt5_x8r8g8b8(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static DWORD raw_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op, struct wined3d_context *context, struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect, struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect, const struct wined3d_color_key *colour_key, enum wined3d_texture_filter_type filter)
static void convert_x8r8g8b8_dxt3(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD 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 void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface, const RECT *src_rect, const RECT *dst_rect_in, enum wined3d_texture_filter_type filter)
static BYTE cliptobyte(int x)
static void raw_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, DWORD flags, const struct wined3d_color *colour, float depth, DWORD stencil)
static void convert_r5g6b5_x8r8g8b8(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static void surface_cpu_blt_colour_fill(struct wined3d_rendertarget_view *view, const struct wined3d_box *box, const struct wined3d_color *colour)
static void raw_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context)
void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, BOOL srgb, const struct wined3d_const_bo_address *data)
static void surface_depth_blt_fbo(const struct wined3d_device *device, struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect, struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect)
static BOOL surface_load_renderbuffer(struct wined3d_surface *surface, struct wined3d_context *context, DWORD dst_location)
static void convert_a8r8g8b8_dxt1(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static void convert_dxt1_a8r8g8b8(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static BOOL ffp_blit_supported(enum wined3d_blit_op blit_op, const struct wined3d_context *context, const struct wined3d_resource *src_resource, DWORD src_location, const struct wined3d_resource *dst_resource, DWORD dst_location)
static void ffp_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context)
static const struct d3dfmt_converter_desc dxtn_converters[]
BOOL surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location)
static void convert_yuy2_r5g6b5(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
void wined3d_ffp_blitter_create(struct wined3d_blitter **next, const struct wined3d_gl_info *gl_info)
static void convert_x1r5g5b5_dxt1(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static void convert_a8r8g8b8_dxt3(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static void fbo_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, DWORD flags, const struct wined3d_color *colour, float depth, DWORD stencil)
static const struct wined3d_blitter_ops raw_blitter_ops
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, DWORD flags, const struct wined3d_color *colour, float depth, DWORD stencil)
static void convert_dxt3_x8r8g8b8(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
static BOOL surface_load_drawable(struct wined3d_surface *surface, struct wined3d_context *context)
static void read_from_framebuffer(struct wined3d_surface *surface, struct wined3d_context *old_ctx, DWORD src_location, DWORD dst_location)
static void convert_dxt3_a4r4g4b4(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
void wined3d_texture_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
BOOL wined3d_texture_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location)
void wined3d_texture_set_map_binding(struct wined3d_texture *texture, DWORD map_binding)
void wined3d_texture_invalidate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location)
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture)
struct wined3d_texture *__cdecl wined3d_texture_from_resource(struct wined3d_resource *resource)
BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location)
void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, UINT layer_count, UINT level_count, DWORD 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_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_bo_address *data, DWORD locations)
HRESULT CDECL wined3d_texture_set_color_key(struct wined3d_texture *texture, DWORD flags, const struct wined3d_color_key *color_key)
void wined3d_texture_load(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
void wined3d_texture_validate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location)
void CDECL wined3d_texture_get_pitch(const struct wined3d_texture *texture, unsigned int level, unsigned int *row_pitch, unsigned int *slice_pitch)
const struct wined3d_format * wined3d_get_format(const struct wined3d_gl_info *gl_info, enum wined3d_format_id format_id, unsigned int resource_usage)
const char * debug_box(const struct wined3d_box *box)
const char * debug_d3dformat(enum wined3d_format_id format_id)
DWORD wined3d_format_convert_from_float(const struct wined3d_format *format, const struct wined3d_color *color)
const char * debug_d3dresourcetype(enum wined3d_resource_type resource_type)
const char * debug_d3dusage(DWORD usage)
const struct wined3d_color_key_conversion * wined3d_format_get_color_key_conversion(const struct wined3d_texture *texture, BOOL need_alpha_ck)
const char * debug_d3dtexturefiltertype(enum wined3d_texture_filter_type filter_type)
const char * wined3d_debug_location(DWORD location)
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 dump_color_fixup_desc(struct color_fixup_desc fixup)
#define WINE_DECLARE_DEBUG_CHANNEL(x)
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 *
BOOL wined3d_dxt5_encode(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, enum wined3d_format_id format, unsigned int w, unsigned int h)
BOOL wined3d_dxt1_encode(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, enum wined3d_format_id format, unsigned int w, unsigned int h)
BOOL wined3d_dxt5_decode(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, enum wined3d_format_id format, unsigned int w, unsigned int h)
BOOL wined3d_dxt3_decode(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, enum wined3d_format_id format, unsigned int w, unsigned int h)
BOOL wined3d_dxt3_encode(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, enum wined3d_format_id format, unsigned int w, unsigned int h)
BOOL wined3d_dxtn_supported(void)
BOOL wined3d_dxt1_decode(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, enum wined3d_format_id format, unsigned int w, unsigned int h)
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y
#define GL_TEXTURE_MIN_FILTER
GLint GLint GLsizei GLsizei GLsizei depth
#define GL_TEXTURE_WRAP_S
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
GLAPI void GLAPIENTRY glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)
GLint GLint GLint GLint GLint x
GLAPI void GLAPIENTRY glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
#define GL_PACK_ROW_LENGTH
GLAPI void GLAPIENTRY glGetCompressedTexImage(GLenum target, GLint lod, GLvoid *img)
GLint GLint GLint GLint GLint GLint y
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
#define GL_COLOR_BUFFER_BIT
#define GL_TEXTURE_ENV_MODE
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X
GLdouble GLdouble GLdouble r
#define GL_STENCIL_BUFFER_BIT
#define GL_TEXTURE_WRAP_T
#define GL_TEXTURE_MAG_FILTER
#define GL_TRIANGLE_STRIP
GLint GLint GLsizei width
GLAPI void GLAPIENTRY glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
GLint GLint GLint yoffset
#define GL_TEXTURE_BINDING_2D
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X
#define GL_DEPTH_BUFFER_BIT
#define GL_UNPACK_ROW_LENGTH
#define GL_SKIP_DECODE_EXT
GLenum GLenum GLenum GLenum GLenum scale
GLsizei const GLint * locations
#define GL_COLOR_ATTACHMENT0
#define GL_TEXTURE_SRGB_DECODE_EXT
GLdouble GLdouble GLdouble GLdouble top
#define GL_TEXTURE_CUBE_MAP_ARB
#define GL_DRAW_FRAMEBUFFER
#define GL_STENCIL_TEST_TWO_SIDE_EXT
#define GL_PIXEL_PACK_BUFFER
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY
GLenum const GLvoid * addr
#define GL_TEXTURE_2D_MULTISAMPLE
GLenum GLuint GLint GLint layer
#define GL_READ_FRAMEBUFFER
#define GL_TEXTURE_BINDING_CUBE_MAP_ARB
#define GL_TEXTURE_RECTANGLE_ARB
#define GL_TEXTURE_BINDING_RECTANGLE_ARB
#define GL_TEXTURE_2D_ARRAY
GLubyte GLubyte GLubyte GLubyte w
GLint GLfloat GLint stencil
GLfloat GLfloat GLfloat GLfloat h
#define GL_PIXEL_UNPACK_BUFFER
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
_Check_return_ __CRT_INLINE float __CRTDECL fabsf(_In_ float x)
#define location(file, line)
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
struct task_struct * current
static CRYPT_DATA_BLOB b2[]
static const WCHAR desc[]
static const char * dst_format
static const BYTE masks[8]
static IHTMLWindow2 * window
static float(__cdecl *square_half_float)(float x
static unsigned __int64 next
static void * heap_calloc(SIZE_T count, SIZE_T size)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
enum wined3d_gl_resource_type tex_type
struct wined3d_vec3 texcoords[4]
void(* convert)(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
enum wined3d_format_id from to
struct wined3d_blitter * next
const struct wined3d_blitter_ops * ops
void(* convert)(const BYTE *src, unsigned int src_pitch, BYTE *dst, unsigned int dst_pitch, unsigned int width, unsigned int height, const struct wined3d_palette *palette, const struct wined3d_color_key *color_key)
enum wined3d_format_id dst_format
const struct wined3d_gl_info * gl_info
struct wined3d_rendertarget_view * depth_stencil
struct wined3d_rendertarget_view * render_targets[MAX_RENDER_TARGET_VIEWS]
BOOL supported[WINED3D_GL_EXT_COUNT]
struct opengl_funcs gl_ops
struct wined3d_fbo_ops fbo_ops
unsigned int sub_resource_idx
struct wined3d_resource * resource
unsigned int format_flags
struct wined3d_device * device
const struct wined3d_format * format
int offscreen_rendering_mode
BOOL strict_draw_ordering
struct list renderbuffers
const struct wined3d_renderbuffer_entry * current_renderbuffer
struct wined3d_texture * container
struct wined3d_texture ** back_buffers
struct wined3d_swapchain_desc desc
struct wined3d_texture * front_buffer
struct wined3d_swapchain * swapchain
struct wined3d_resource resource
struct wined3d_texture::wined3d_texture_async async
struct wined3d_texture::wined3d_texture_sub_resource sub_resources[1]
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, DWORD swap_interval, DWORD flags)
#define WINEDDBLTFX_ROTATE270
#define WINED3DCLEAR_TARGET
#define WINED3D_TEXTURE_CREATE_DISCARD
@ WINED3D_MULTISAMPLE_NONE
#define WINED3D_BLT_DST_CKEY
@ WINED3D_RS_SCISSORTESTENABLE
@ WINED3D_RS_ZWRITEENABLE
@ WINED3D_RS_TWOSIDEDSTENCILMODE
@ WINED3D_RS_STENCILWRITEMASK
#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
#define WINED3D_CKEY_SRC_BLT
@ WINED3DFMT_B4G4R4A4_UNORM
@ WINED3DFMT_B8G8R8A8_UNORM
@ WINED3DFMT_B8G8R8X8_UNORM
@ WINED3DFMT_B5G5R5X1_UNORM
@ WINED3DFMT_B5G5R5A1_UNORM
@ WINED3DFMT_B5G6R5_UNORM
@ WINED3DFMT_B4G4R4X4_UNORM
#define WINED3D_TEXTURE_CREATE_MAPPABLE
#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 WINED3DUSAGE_PRIVATE
#define WINEDDBLTFX_ARITHSTRETCHY
#define WINED3DUSAGE_RENDERTARGET
#define WINED3DERR_INVALIDCALL
#define WINEDDBLTFX_ROTATE180
#define WINEDDBLTFX_MIRRORLEFTRIGHT
#define WINED3D_RESOURCE_ACCESS_MAP_W
#define WINED3DUSAGE_DEPTHSTENCIL
static enum wined3d_render_state WINED3D_RS_COLORWRITE(int index)
@ EXT_TEXTURE_SRGB_DECODE
@ WINED3D_GL_LEGACY_CONTEXT
static unsigned int wined3d_texture_get_level_height(const struct wined3d_texture *texture, unsigned int level)
static BOOL is_scaling_fixup(struct color_fixup_desc fixup)
#define WINED3D_LOCATION_TEXTURE_SRGB
#define WINED3D_TEXTURE_PIN_SYSMEM
static unsigned int wined3d_texture_get_level_pow2_height(const struct wined3d_texture *texture, unsigned int level)
#define WINED3D_LOCATION_SYSMEM
static GLenum wined3d_gl_mag_filter(enum wined3d_texture_filter_type mag_filter)
static unsigned int wined3d_texture_get_level_width(const struct wined3d_texture *texture, unsigned int level)
#define WINED3DFMT_FLAG_HEIGHT_SCALE
static unsigned int surface_get_sub_resource_idx(const struct wined3d_surface *surface)
#define WINED3D_LOCATION_BUFFER
static struct wined3d_surface * wined3d_rendertarget_view_get_surface(const struct wined3d_rendertarget_view *view)
static BOOL is_complex_fixup(struct color_fixup_desc fixup)
#define WINED3D_LOCATION_RB_RESOLVED
static struct wined3d_texture_sub_resource * surface_get_sub_resource(struct wined3d_surface *surface)
static unsigned int wined3d_texture_get_level_pow2_width(const struct wined3d_texture *texture, unsigned int level)
#define WINED3DFMT_FLAG_FBO_ATTACHABLE
#define WINED3D_TEXTURE_COND_NP2_EMULATED
#define WINED3D_TEXTURE_CONVERTED
static struct wined3d_surface * context_get_rt_surface(const struct wined3d_context *context)
#define MAX_RENDER_TARGETS
static GLenum wined3d_texture_get_sub_resource_target(const struct wined3d_texture *texture, unsigned int sub_resource_idx)
static BOOL is_identity_fixup(struct color_fixup_desc fixup)
@ WINED3D_GL_RES_TYPE_TEX_CUBE
@ WINED3D_GL_RES_TYPE_TEX_2D
@ WINED3D_GL_RES_TYPE_TEX_RECT
#define WINED3D_LOCATION_TEXTURE_RGB
#define WINED3D_LOCATION_USER_MEMORY
#define WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB
#define WINED3D_QUIRK_FBO_TEX_UPDATE
#define WINED3D_LOCATION_DRAWABLE
#define WINED3DFMT_FLAG_BLOCKS
static GLuint wined3d_texture_get_texture_name(const struct wined3d_texture *texture, const struct wined3d_context *context, BOOL srgb)
static GLenum wined3d_gl_min_mip_filter(enum wined3d_texture_filter_type min_filter, enum wined3d_texture_filter_type mip_filter)
#define WINED3D_LOCATION_DISCARDED
#define WINED3DFMT_FLAG_STENCIL
#define WINED3DFMT_FLAG_COMPRESSED
#define WINED3D_LOCATION_RB_MULTISAMPLE
#define WINED3DFMT_FLAG_DEPTH
#define WINED3D_TEXTURE_NORMALIZED_COORDS
#define STATE_FRAMEBUFFER
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
#define WINED3D_TEXTURE_IS_SRGB
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
static unsigned int block