31#define WINED3D_TEXTURE_DYNAMIC_MAP_THRESHOLD 50
52 if (sub_resource_idx < texture->level_count *
texture->layer_count)
55 WARN(
"Invalid sub-resource index %u.\n", sub_resource_idx);
61 if (!d3d_info->
pbo ||
texture->resource.format->conv_byte_count ||
texture->resource.pin_sysmem)
93 unsigned int drawable_height;
107 drawable_height = windowsize.
bottom - windowsize.
top;
121 ERR(
"Texture %p is not part of a swapchain.\n",
texture);
127 TRACE(
"Returning GL_FRONT.\n");
133 TRACE(
"Returning GL_BACK.\n");
137 FIXME(
"Higher back buffer, returning GL_BACK.\n");
167 f->l = ((
r->left * 2.0f) /
w) - 1.0f;
168 f->t = ((
r->top * 2.0f) /
h) - 1.0f;
169 f->r = ((
r->right * 2.0f) /
w) - 1.0f;
170 f->b = ((
r->bottom * 2.0f) /
h) - 1.0f;
182 level = sub_resource_idx % texture_gl->
t.level_count;
190 FIXME(
"Unsupported texture target %#x.\n",
target);
298 if (src_ds != dst_ds)
339 unsigned int src_sub_resource_idx,
DWORD src_location,
const RECT *src_rect,
343 struct wined3d_texture *required_texture, *restore_texture, *dst_save_texture = dst_texture;
344 unsigned int restore_idx, dst_save_sub_resource_idx = dst_sub_resource_idx;
345 bool resolve, scaled_resolve, restore_context =
false;
353 TRACE(
"device %p, context %p, filter %s, src_texture %p, src_sub_resource_idx %u, src_location %s, "
354 "src_rect %s, dst_texture %p, dst_sub_resource_idx %u, dst_location %s, dst_rect %s, resolve format %p.\n",
360 scaled_resolve = resolve
371 GLint resolve_internal, src_internal, dst_internal;
382 resolve_format_id = resolve_format->
id;
386 resolve_internal = src_internal;
387 resolve_format_id = src_texture->
resource.format->id;
391 resolve_internal = dst_internal;
392 resolve_format_id = dst_texture->
resource.format->id;
398 if (src_internal != resolve_internal)
404 src_level = src_sub_resource_idx % src_texture->
level_count;
406 desc.format = resolve_format_id;
407 desc.multisample_type = src_texture->
resource.multisample_type;
408 desc.multisample_quality = src_texture->
resource.multisample_quality;
418 &src_staging_texture);
421 ERR(
"Failed to create staging texture, hr %#lx.\n",
hr);
426 FIXME(
"WINED3D_LOCATION_DRAWABLE not supported for the source of a typeless resolve.\n");
429 src_texture, src_sub_resource_idx, src_location, src_rect,
430 src_staging_texture, 0, src_location, src_rect,
433 src_texture = src_staging_texture;
434 src_sub_resource_idx = 0;
437 if (dst_internal != resolve_internal)
443 dst_level = dst_sub_resource_idx % dst_texture->
level_count;
445 desc.format = resolve_format_id;
446 desc.multisample_type = dst_texture->
resource.multisample_type;
447 desc.multisample_quality = dst_texture->
resource.multisample_quality;
460 ERR(
"Failed to create staging texture, hr %#lx.\n",
hr);
465 dst_sub_resource_idx = 0;
484 required_texture = src_texture->
swapchain->front_buffer;
486 required_texture = dst_texture->
swapchain->front_buffer;
488 required_texture =
NULL;
490 restore_texture =
context->current_rt.texture;
491 restore_idx =
context->current_rt.sub_resource_idx;
492 if (restore_texture != required_texture)
495 restore_context =
true;
499 if (!context_gl->
valid)
502 WARN(
"Invalid context, skipping blit.\n");
503 restore_context =
false;
511 TRACE(
"Source texture %p is onscreen.\n", src_texture);
519 TRACE(
"Source texture %p is offscreen.\n", src_texture);
524 &src_texture->
resource, src_sub_resource_idx,
NULL, 0, src_location);
549 gl_info->
gl_ops.gl.p_glFlush();
551 if (dst_texture != dst_save_texture)
554 FIXME(
"WINED3D_LOCATION_DRAWABLE not supported for the destination of a typeless resolve.\n");
557 dst_texture, 0, dst_location, dst_rect,
558 dst_save_texture, dst_save_sub_resource_idx, dst_location, dst_rect,
563 if (dst_texture != dst_save_texture)
566 if (src_staging_texture)
575 const RECT *src_rect,
struct wined3d_texture *dst_texture,
unsigned int dst_sub_resource_idx,
576 DWORD dst_location,
const RECT *dst_rect)
583 TRACE(
"device %p, src_texture %p, src_sub_resource_idx %u, src_location %s, src_rect %s, "
584 "dst_texture %p, dst_sub_resource_idx %u, dst_location %s, dst_rect %s.\n",
device,
589 if (src_texture->
resource.format->depth_size)
591 if (src_texture->
resource.format->stencil_size)
595 if (dst_texture->
resource.format->depth_size)
597 if (dst_texture->
resource.format->stencil_size)
602 ERR(
"Incompatible formats %s and %s.\n",
610 ERR(
"Not a depth / stencil format: %s.\n",
625 &src_texture->
resource, src_sub_resource_idx, src_location);
639 gl_info->
gl_ops.gl.p_glStencilMask(~0
U);
653 struct wined3d_texture_sub_resource *sub_resource;
654 unsigned int i, sub_count;
657 ||
texture->resource.pin_sysmem
660 TRACE(
"Not evicting system memory for texture %p.\n",
texture);
664 TRACE(
"Evicting system memory for texture %p.\n",
texture);
667 for (
i = 0;
i < sub_count; ++
i)
669 sub_resource = &
texture->sub_resources[
i];
671 ERR(
"WINED3D_LOCATION_SYSMEM is the only location for sub-resource %u of texture %p.\n",
673 sub_resource->locations &= ~WINED3D_LOCATION_SYSMEM;
681 struct wined3d_texture_sub_resource *sub_resource;
682 DWORD previous_locations;
684 TRACE(
"texture %p, sub_resource_idx %u, location %s.\n",
687 sub_resource = &
texture->sub_resources[sub_resource_idx];
688 previous_locations = sub_resource->locations;
689 sub_resource->locations |=
location;
705 struct wined3d_texture_sub_resource *sub_resource;
706 DWORD previous_locations;
708 TRACE(
"texture %p, sub_resource_idx %u, location %s.\n",
714 sub_resource = &
texture->sub_resources[sub_resource_idx];
715 previous_locations = sub_resource->locations;
722 if (!sub_resource->locations)
723 ERR(
"Sub-resource %u of texture %p does not have any up to date location.\n",
730 struct wined3d_texture_sub_resource *sub_resource = &
texture->sub_resources[sub_resource_idx];
735 data->buffer_object = sub_resource->bo;
740 if (sub_resource->user_memory)
742 data->addr = sub_resource->user_memory;
747 data->addr += sub_resource->offset;
749 data->buffer_object = 0;
764 texture->dirty_regions[
i].box_count = 0;
776 TRACE(
"texture %p, sub_resource_idx %u, context %p, location %s.\n",
790 if ((
texture->resource.access & required_access) != required_access)
791 WARN(
"Operation requires %#x access, but texture only has %#x.\n",
792 required_access,
texture->resource.access);
797 TRACE(
"Sub-resource previously discarded, nothing to do.\n");
807 ERR(
"Sub-resource %u of texture %p does not have any up to date location.\n",
823 range.size =
texture->sub_resources[sub_resource_idx].size;
826 unsigned int level_idx = sub_resource_idx %
texture->level_count;
834 c.
r =
texture->sub_resources[sub_resource_idx].clear_value.depth;
835 c.g =
texture->sub_resources[sub_resource_idx].clear_value.stencil;
840 c =
texture->sub_resources[sub_resource_idx].clear_value.colour;
879 struct wined3d_texture_sub_resource *sub_resource = &
texture->sub_resources[sub_resource_idx];
882 TRACE(
"texture %p, context %p, sub_resource_idx %u, data %p, locations %s.\n",
890 data->buffer_object = 0;
909 data->buffer_object = 0;
916 struct wined3d_texture_sub_resource *sub_resource = &
texture->sub_resources[sub_resource_idx];
919 TRACE(
"texture %p, sub_resource_idx %u, context_gl %p.\n",
texture, sub_resource_idx, context_gl);
923 sub_resource->bo =
NULL;
935 unsigned int sub_count =
texture->level_count *
texture->layer_count;
943 for (
i = 0;
i < sub_count; ++
i)
945 if (
texture->sub_resources[
i].locations ==
texture->resource.map_binding
955 texture->resource.map_binding = map_binding;
956 texture->update_map_binding = 0;
961 texture->update_map_binding = map_binding;
962 if (!
texture->resource.map_count)
971 gl_info->
gl_ops.gl.p_glDeleteTextures(1, &tex->
name);
981 unsigned int level, level_count,
layer, layer_count;
985 level_count = texture_gl->
t.level_count;
989 layer_count = texture_gl->
t.layer_count;
1008 TRACE(
"texture_gl %p, layer %u, level %u, target %#x, width %u, height %u.\n",
1046 switch (texture_gl->
target)
1054 gl_internal_format,
width,
height, texture_gl->
t.layer_count));
1058 gl_internal_format,
width,
height, standard_pattern));
1062 gl_internal_format,
width,
height, texture_gl->
t.layer_count, standard_pattern));
1066 gl_internal_format,
width, texture_gl->
t.layer_count));
1083 struct wined3d_dirty_regions *regions;
1090 count = regions->box_count + 1;
1092 || (!
box->left && !
box->top && !
box->front
1103 ERR(
"Failed to grow boxes array, marking entire texture dirty.\n");
1108 regions->boxes[regions->box_count++] = *
box;
1113 unsigned int sub_count =
texture->level_count *
texture->layer_count;
1114 struct wined3d_texture_sub_resource *sub_resource;
1117 for (
i = 0;
i < sub_count; ++
i)
1119 sub_resource = &
texture->sub_resources[
i];
1120 if (sub_resource->parent)
1122 TRACE(
"sub-resource %u.\n",
i);
1123 sub_resource->parent_ops->wined3d_object_destroyed(sub_resource->parent);
1124 sub_resource->parent =
NULL;
1135 unsigned int row_pitch, slice_pitch;
1137 struct wined3d_dc_info *dc_info;
1143 TRACE(
"texture %p, sub_resource_idx %u.\n",
idx->texture,
idx->sub_resource_idx);
1146 sub_resource_idx =
idx->sub_resource_idx;
1159 unsigned int sub_count =
texture->level_count *
texture->layer_count;
1163 ERR(
"Failed to allocate DC info.\n");
1168 if (!(
texture->sub_resources[sub_resource_idx].locations &
texture->resource.map_binding))
1180 if (
data.buffer_object)
1198 desc.Pitch = row_pitch;
1206 WARN(
"Failed to create DC, status %#lx.\n",
status);
1210 dc_info = &
texture->dc_info[sub_resource_idx];
1211 dc_info->dc =
desc.hDc;
1212 dc_info->bitmap =
desc.hBitmap;
1214 TRACE(
"Created DC %p, bitmap %p for texture %p, %u.\n", dc_info->dc, dc_info->bitmap,
texture, sub_resource_idx);
1223 struct wined3d_dc_info *dc_info;
1225 unsigned int sub_resource_idx;
1230 TRACE(
"texture %p, sub_resource_idx %u.\n",
idx->texture,
idx->sub_resource_idx);
1233 sub_resource_idx =
idx->sub_resource_idx;
1235 dc_info = &
texture->dc_info[sub_resource_idx];
1239 ERR(
"Sub-resource {%p, %u} has no DC.\n",
texture, sub_resource_idx);
1243 TRACE(
"dc %p, bitmap %p.\n", dc_info->dc, dc_info->bitmap);
1245 destroy_desc.
hDc = dc_info->dc;
1246 destroy_desc.
hBitmap = dc_info->bitmap;
1248 ERR(
"Failed to destroy dc, status %#lx.\n",
status);
1250 dc_info->bitmap =
NULL;
1253 if (
data.buffer_object)
1257 range.size =
texture->sub_resources[sub_resource_idx].size;
1265 texture->swapchain = swapchain;
1271 static const GLenum swizzle_source[] =
1297 TRACE(
"texture_gl %p, context_gl %p, srgb %#x.\n", texture_gl, context_gl, srgb);
1306 texture_gl->
t.flags &= ~WINED3D_TEXTURE_IS_SRGB;
1317 gl_info->
gl_ops.gl.p_glGenTextures(1, &gl_tex->
name);
1319 TRACE(
"Generated texture %d.\n", gl_tex->
name);
1323 ERR(
"Failed to generate a texture name.\n");
1353 TRACE(
"Setting GL_TEXTURE_MAX_LEVEL to %u.\n", texture_gl->
t.level_count - 1);
1355 checkGLcall(
"glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, texture->level_count)");
1391 checkGLcall(
"glTexParameteri(GL_DEPTH_TEXTURE_MODE_ARB, GL_INTENSITY)");
1426 TRACE(
"texture_gl %p, sampler_desc %p, context_gl %p.\n", texture_gl,
sampler_desc, context_gl);
1484 WARN(
"Anisotropic filtering not supported.\n");
1512 checkGLcall(
"glTexEnvf(GL_TEXTURE_LOD_BIAS_EXT, ...)");
1518 unsigned int refcount;
1523 TRACE(
"%p increasing refcount to %u.\n",
texture, refcount);
1532 struct wined3d_dc_info *dc_info;
1533 unsigned int sub_count;
1541 if ((dc_info =
texture->dc_info))
1543 for (
i = 0;
i < sub_count; ++
i)
1557 for (
i = 0;
i < sub_count; ++
i)
1559 struct wined3d_overlay_info *
info = &
texture->overlay_info[
i];
1560 struct wined3d_overlay_info *overlay, *
cur;
1584 for (
i = 0;
i < sub_count; ++
i)
1608 unsigned int i, sub_resource_count, refcount;
1613 TRACE(
"%p decreasing refcount to %u.\n",
texture, refcount);
1632 sub_resource_count =
texture->layer_count *
texture->level_count;
1633 for (
i = 0;
i < sub_resource_count; ++
i)
1635 if (
texture->sub_resources[
i].user_memory)
1641 texture->resource.device->adapter->adapter_ops->adapter_destroy_texture(
texture);
1676 TRACE(
"Texture %p not dirty, nothing to do.\n",
texture);
1681 for (
i = 0;
i < sub_count; ++
i)
1685 ERR(
"Failed to load location (srgb %#x).\n", srgb);
1694 return texture->resource.parent;
1698 unsigned int level,
unsigned int *row_pitch,
unsigned int *slice_pitch)
1706 *row_pitch =
texture->row_pitch;
1707 *slice_pitch =
texture->slice_pitch;
1725 unsigned int old =
texture->lod;
1734 TRACE(
"Ignoring LOD on texture with resource access %s.\n",
1762 if (
flags & ~all_flags)
1764 WARN(
"Invalid flags passed, returning WINED3DERR_INVALIDCALL.\n");
1793 unsigned int src_width, src_height;
1803 unsigned int rt_level;
1869 unsigned int sub_resource_idx,
void *
mem,
unsigned int pitch)
1871 unsigned int current_row_pitch, current_slice_pitch,
width,
height;
1872 struct wined3d_texture_sub_resource *sub_resource;
1873 unsigned int i,
level, sub_resource_count;
1876 unsigned int slice_pitch;
1877 bool update_memory_only;
1880 TRACE(
"texture %p, sub_resource_idx %u, mem %p, pitch %u.\n",
texture, sub_resource_idx,
mem, pitch);
1885 sub_resource_count =
texture->level_count *
texture->layer_count;
1890 slice_pitch =
height * pitch;
1895 update_memory_only = (pitch == current_row_pitch && slice_pitch == current_slice_pitch);
1897 if (sub_resource_count > 1 && !update_memory_only)
1899 FIXME(
"Texture has multiple sub-resources, not supported.\n");
1909 if (
texture->resource.map_count)
1911 WARN(
"Texture is mapped.\n");
1922 if (pitch %
format->byte_count)
1924 WARN(
"Pitch unsupported, not a multiple of the texture format byte width.\n");
1928 if (
device->d3d_initialized)
1943 if (update_memory_only)
1945 for (
i = 0;
i < sub_resource_count; ++
i)
1946 if (!
texture->sub_resources[
i].user_memory)
1949 if (
i == sub_resource_count)
1959 texture->slice_pitch = slice_pitch;
1965 sub_resource->size =
texture->slice_pitch;
1970 ERR(
"Failed to allocate resource memory.\n");
1990 struct wined3d_texture_sub_resource *sub_resource;
1993 sub_resource = &texture_gl->
t.sub_resources[sub_resource_idx];
1995 if (sub_resource->bo)
1998 if (!(bo =
malloc(
sizeof(*bo))))
2009 TRACE(
"Created buffer object %u for texture %p, sub-resource %u.\n", bo->
id, texture_gl, sub_resource_idx);
2010 sub_resource->bo = &bo->
b;
2015 unsigned int sub_count =
texture->level_count *
texture->layer_count;
2020 texture->async.flags &= ~WINED3D_TEXTURE_ASYNC_COLOR_KEY;
2021 for (
i = 0;
i < sub_count; ++
i)
2041 TRACE(
"texture_gl %p, context_gl %p, srgb %d, format %s.\n",
2044 if (texture_gl->
t.flags & alloc_flag)
2049 TRACE(
"WINED3D_FORMAT_CAP_DECOMPRESS set.\n");
2053 else if (
format->conv_byte_count)
2077 texture_gl->
t.flags |= alloc_flag;
2098 format_gl->
internal, texture_gl->
t.resource.width, texture_gl->
t.resource.height);
2099 checkGLcall(
"glRenderbufferStorageMultisample()");
2110 texture_gl->
t.resource.width, texture_gl->
t.resource.height);
2123 unsigned int sub_resource_idx)
2125 TRACE(
"texture %p, sub_resource_idx %u.\n",
texture, sub_resource_idx);
2129 return &
texture->sub_resources[sub_resource_idx];
2139 WARN(
"Invalid layer %u specified.\n",
layer);
2145 WARN(
"Invalid dirty_region %s specified.\n",
debug_box(dirty_region));
2156 unsigned int level,
unsigned int src_row_pitch,
unsigned int src_slice_pitch,
2157 unsigned int dst_x,
unsigned int dst_y,
unsigned int dst_z,
unsigned int update_w,
2158 unsigned int update_h,
unsigned int update_d,
const BYTE *
addr,
BOOL srgb,
2166 unsigned int dst_row_pitch, dst_slice_pitch;
2170 TRACE(
"Uploading compressed data, target %#x, level %u, x %u, y %u, z %u, "
2171 "w %u, h %u, d %u, format %#x, image_size %#x, addr %p.\n",
2172 target,
level, dst_x, dst_y, dst_z, update_w, update_h,
2182 unsigned int row,
y,
slice, slice_count = 1, row_count = 1;
2186 if (dst_row_pitch != src_row_pitch)
2191 &dst_row_pitch, &dst_slice_pitch);
2194 if (dst_slice_pitch != src_slice_pitch)
2196 slice_count = update_d;
2202 for (
row = 0,
y = dst_y;
row < row_count; ++
row)
2204 const BYTE *upload_addr = &
addr[
slice * src_slice_pitch +
row * src_row_pitch];
2209 update_h, update_d,
internal, update_d * dst_slice_pitch, upload_addr));
2214 update_h,
internal, dst_slice_pitch, upload_addr));
2225 unsigned int y, y_count,
z, z_count;
2226 bool unpacking_rows =
false;
2228 TRACE(
"Uploading data, target %#x, level %u, x %u, y %u, z %u, "
2229 "w %u, h %u, d %u, format %#x, type %#x, addr %p.\n",
2230 target,
level, dst_x, dst_y, dst_z, update_w, update_h,
2233 if (src_row_pitch && !(src_row_pitch % src_format->
byte_count))
2237 unpacking_rows =
true;
2245 if (src_slice_pitch && unpacking_rows && !(src_slice_pitch % src_row_pitch))
2250 else if (src_slice_pitch && !unpacking_rows && !(src_slice_pitch % (update_w * src_format->
byte_count)))
2253 src_slice_pitch / (update_w * src_format->
byte_count));
2262 for (
z = 0;
z < z_count; ++
z)
2264 for (
y = 0;
y < y_count; ++
y)
2266 const BYTE *upload_addr = &
addr[
z * src_slice_pitch +
y * src_row_pitch];
2270 update_h, update_d, format_gl->
format, format_gl->
type, upload_addr));
2275 update_w, format_gl->
format, format_gl->
type, upload_addr);
2280 update_w, update_h, format_gl->
format, format_gl->
type, upload_addr);
2319 unsigned int src_row_pitch,
uint8_t *
dst,
unsigned int dst_row_pitch,
2322 unsigned int byte_count, alpha_mask;
2325 byte_count =
format->byte_count;
2338 dst_row[
x] = src_row[
x] | alpha_mask;
2351 dst_row[
x] = src_row[
x] | alpha_mask;
2357 ERR(
"Unsupported byte count %u.\n", byte_count);
2364 const struct wined3d_box *src_box,
unsigned int src_row_pitch,
unsigned int src_slice_pitch,
2365 struct wined3d_texture *dst_texture,
unsigned int dst_sub_resource_idx,
unsigned int dst_location,
2366 unsigned int dst_x,
unsigned int dst_y,
unsigned int dst_z)
2371 unsigned int update_w = src_box->
right - src_box->
left;
2372 unsigned int update_h = src_box->
bottom - src_box->
top;
2373 unsigned int update_d = src_box->
back - src_box->
front;
2380 TRACE(
"context %p, src_bo_addr %s, src_format %s, src_box %s, src_row_pitch %u, src_slice_pitch %u, "
2381 "dst_texture %p, dst_sub_resource_idx %u, dst_location %s, dst_x %u, dst_y %u, dst_z %u.\n",
2383 src_row_pitch, src_slice_pitch, dst_texture, dst_sub_resource_idx,
2398 if (dst_texture->
sub_resources[dst_sub_resource_idx].map_count)
2400 WARN(
"Uploading a texture that is currently mapped, pinning sysmem.\n");
2401 dst_texture->
resource.pin_sysmem = 1;
2416 dst_y = dst_sub_resource_idx / dst_texture->
level_count;
2420 dst_z = dst_sub_resource_idx / dst_texture->
level_count;
2425 FIXME(
"Not supported for multisample textures.\n");
2438 bo.
addr += src_box->
top * src_row_pitch;
2445 if (src_format->
upload || decompress
2450 unsigned int dst_row_pitch, dst_slice_pitch;
2452 void *converted_mem;
2468 ERR(
"Converting a block-based format.\n");
2477 if (!(converted_mem =
malloc(dst_slice_pitch)))
2479 ERR(
"Failed to allocate upload buffer.\n");
2488 for (
z = 0;
z < update_d; ++
z, src_mem += src_slice_pitch)
2491 compressed_format->
decompress(src_mem, converted_mem, src_row_pitch, src_slice_pitch,
2492 dst_row_pitch, dst_slice_pitch, update_w, update_h, 1);
2495 update_w, update_h);
2497 src_format->
upload(src_mem, converted_mem, src_row_pitch, src_slice_pitch,
2498 dst_row_pitch, dst_slice_pitch, update_w, update_h, 1);
2501 dst_y, dst_z +
z, update_w, update_h, 1, converted_mem, srgb, dst_texture, gl_info);
2505 free(converted_mem);
2524 dst_y, dst_z, update_w, update_h, update_d,
offset, srgb, dst_texture, gl_info);
2539 for (
i = 0;
i <
device->context_count; ++
i)
2551 struct wined3d_texture_sub_resource *sub_resource;
2552 unsigned int dst_row_pitch, dst_slice_pitch;
2553 unsigned int src_row_pitch, src_slice_pitch;
2564 && !format_gl->
f.download)
2566 ERR(
"Trying to read back converted texture %p, %u with format %s.\n",
2571 sub_resource = &texture_gl->
t.sub_resources[sub_resource_idx];
2573 level = sub_resource_idx % texture_gl->
t.level_count;
2577 if (format_gl->
f.download)
2579 FIXME(
"Reading back converted array texture %p is not supported.\n", texture_gl);
2583 WARN_(d3d_perf)(
"Downloading all miplevel layers to get the data for a single sub-resource.\n");
2585 if (!(temporary_mem =
calloc(texture_gl->
t.layer_count, sub_resource->size)))
2587 ERR(
"Out of memory.\n");
2592 if (format_gl->
f.download)
2597 ERR(
"Converted texture %p uses PBO unexpectedly.\n", texture_gl);
2599 WARN_(d3d_perf)(
"Downloading converted texture %p, %u with format %s.\n",
2603 f.byte_count = format_gl->
f.conv_byte_count;
2608 &src_row_pitch, &src_slice_pitch);
2610 if (!(temporary_mem =
malloc(src_slice_pitch)))
2612 ERR(
"Failed to allocate memory.\n");
2621 mem = temporary_mem;
2638 TRACE(
"Downloading compressed texture %p, %u, level %u, format %#x, type %#x, data %p.\n",
2646 TRACE(
"Downloading texture %p, %u, level %u, format %#x, type %#x, data %p.\n",
2653 if (format_gl->
f.download)
2655 format_gl->
f.download(
mem,
data->addr, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch,
2659 else if (temporary_mem)
2661 unsigned int layer = sub_resource_idx / texture_gl->
t.level_count;
2662 void *src_data = temporary_mem +
layer * sub_resource->size;
2668 (
GLintptr)
data->addr + bo->
b.buffer_offset, sub_resource->size, src_data));
2673 memcpy(
data->addr, src_data, sub_resource->size);
2684 free(temporary_mem);
2688 struct wined3d_texture *src_texture,
unsigned int src_sub_resource_idx,
unsigned int src_location,
2691 unsigned int dst_row_pitch,
unsigned int dst_slice_pitch)
2696 unsigned int src_level, src_width, src_height, src_depth;
2697 unsigned int src_row_pitch, src_slice_pitch;
2704 TRACE(
"context %p, src_texture %p, src_sub_resource_idx %u, src_location %s, src_box %s, dst_bo_addr %s, "
2705 "dst_format %s, dst_x %u, dst_y %u, dst_z %u, dst_row_pitch %u, dst_slice_pitch %u.\n",
2708 dst_x, dst_y, dst_z, dst_row_pitch, dst_slice_pitch);
2720 src_level = src_sub_resource_idx % src_texture->
level_count;
2724 if (src_box->
left || src_box->
top || src_box->
right != src_width || src_box->
bottom != src_height
2725 || src_box->
front || src_box->
back != src_depth)
2731 if (dst_x || dst_y || dst_z)
2733 FIXME(
"Unhandled destination (%u, %u, %u).\n", dst_x, dst_y, dst_z);
2739 FIXME(
"Unhandled format conversion (%s -> %s).\n",
2746 if (src_row_pitch != dst_row_pitch || src_slice_pitch != dst_slice_pitch)
2748 FIXME(
"Unhandled destination pitches %u/%u (source pitches %u/%u).\n",
2749 dst_row_pitch, dst_slice_pitch, src_row_pitch, src_slice_pitch);
2767 if (format_gl->
f.conv_byte_count)
2769 FIXME(
"Attempting to download a converted texture, type %s format %s.\n",
2789 TRACE(
"Downloading compressed texture %p, %u, level %u, format %#x, type %#x, data %p.\n",
2790 src_texture, src_sub_resource_idx, src_level, format_gl->
format, format_gl->
type,
offset);
2797 TRACE(
"Downloading texture %p, %u, level %u, format %#x, type %#x, data %p.\n",
2798 src_texture, src_sub_resource_idx, src_level, format_gl->
format, format_gl->
type,
offset);
2816 struct wined3d_texture_sub_resource *sub_resource;
2818 sub_resource = &texture_gl->
t.sub_resources[sub_resource_idx];
2834 unsigned int row_pitch, slice_pitch,
level;
2837 unsigned int src_location;
2839 level = sub_resource_idx % texture_gl->
t.level_count;
2846 &src_box, &
data, texture_gl->
t.resource.format, 0, 0, 0, row_pitch, slice_pitch);
2848 ++texture_gl->
t.download_count;
2855 texture_gl->
t.resource.draw_binding, dst_location);
2859 FIXME(
"Can't load texture %p, %u with location flags %s into sysmem.\n",
2875 FIXME(
"Unimplemented copy from %s for depth/stencil buffers.\n",
2882 ERR(
"Trying to load offscreen texture into WINED3D_LOCATION_DRAWABLE.\n");
2902 unsigned int level = sub_resource_idx %
texture->level_count;
2906 struct wined3d_texture_sub_resource *sub_resource;
2909 sub_resource = &
texture->sub_resources[sub_resource_idx];
2913 FIXME(
"Unimplemented copy from %s for depth/stencil buffers.\n",
2932 sub_resource_idx, src_location, &
rect,
texture, sub_resource_idx, dst_location, &
rect,
NULL);
2940 unsigned int width,
height,
level, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch;
2944 struct wined3d_texture_sub_resource *sub_resource;
2953 sub_resource = &texture_gl->
t.sub_resources[sub_resource_idx];
2954 level = sub_resource_idx % texture_gl->
t.level_count;
2988 &texture_gl->
t.resource, src_location, &texture_gl->
t.resource, dst_location))
2990 src_location, &src_rect, &texture_gl->
t, sub_resource_idx, dst_location, &src_rect,
NULL);
3003 FIXME_(d3d_perf)(
"Downloading RGB texture %p, %u to reload it as sRGB.\n", texture_gl, sub_resource_idx);
3005 &context_gl->
c, texture_gl->
t.resource.map_binding);
3014 FIXME_(d3d_perf)(
"Downloading sRGB texture %p, %u to reload it as RGB.\n", texture_gl, sub_resource_idx);
3016 &context_gl->
c, texture_gl->
t.resource.map_binding);
3022 WARN(
"Trying to load a texture from sysmem, but no simple location is valid.\n");
3029 format = texture_gl->
t.resource.format;
3036 if (conversion && sub_resource->bo)
3038 TRACE(
"Removing the pbo attached to texture %p, %u.\n", texture_gl, sub_resource_idx);
3053 if (!(dst_mem =
malloc(dst_slice_pitch)))
3055 ERR(
"Out of memory (%u).\n", dst_slice_pitch);
3058 conversion->
convert(src_mem, src_row_pitch, dst_mem, dst_row_pitch,
3060 src_row_pitch = dst_row_pitch;
3061 src_slice_pitch = dst_slice_pitch;
3064 data.buffer_object = 0;
3065 data.addr = dst_mem;
3069 src_row_pitch, src_slice_pitch, &texture_gl->
t, sub_resource_idx, dst_location, 0, 0, 0);
3085 return texture->sub_resources[sub_resource_idx].user_memory ?
TRUE
3102 ERR(
"Texture %p does not have a drawable.\n",
texture);
3138 struct wined3d_texture_sub_resource *sub_resource = &
texture->sub_resources[sub_resource_idx];
3148 if (sub_resource->clear_value.colour.r || sub_resource->clear_value.colour.g
3149 || sub_resource->clear_value.colour.b || sub_resource->clear_value.colour.a)
3151 ERR(
"Unexpected color clear value r=%08e, g=%08e, b=%08e, a=%08e.\n",
3152 sub_resource->clear_value.colour.r, sub_resource->clear_value.colour.g,
3153 sub_resource->clear_value.colour.b, sub_resource->clear_value.colour.a);
3158 if (
format->depth_size && sub_resource->clear_value.depth)
3159 ERR(
"Unexpected depth clear value %08e.\n", sub_resource->clear_value.depth);
3160 if (
format->stencil_size && sub_resource->clear_value.stencil)
3161 ERR(
"Unexpected stencil clear value %x.\n", sub_resource->clear_value.stencil);
3181 gl_info->
gl_ops.gl.p_glClearDepth(0.0);
3185 if (
format->stencil_size)
3189 gl_info->
gl_ops.gl.p_glStencilMask(~0
u);
3191 gl_info->
gl_ops.gl.p_glClearStencil(0);
3199 gl_info->
gl_ops.gl.p_glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
3203 gl_info->
gl_ops.gl.p_glClear(clear_mask);
3222 struct wined3d_texture_sub_resource *sub_resource = &
texture->sub_resources[sub_resource_idx];
3226 TRACE(
"texture %p, sub_resource_idx %u, context %p, location %s.\n",
3237 if (sub_resource->locations &
location)
3272 unsigned int i, sub_count;
3280 for (
i = 0;
i < sub_count; ++
i)
3282 if (texture_gl->
t.sub_resources[
i].bo)
3288 if (texture_gl->texture_rgb.name)
3312 context_gl->
gl_info->fbo_ops.glDeleteRenderbuffers(1, &
entry->id);
3374 unsigned int sub_count,
i;
3380 if (!
device->d3d_initialized)
3389 for (
i = 0;
i < sub_count; ++
i)
3399 ERR(
"Discarding %s %p sub-resource %u with resource access %s.\n",
3437 unsigned int level = sub_resource_idx %
texture->level_count;
3453 struct wined3d_texture_sub_resource *sub_resource;
3458 unsigned int texture_level;
3462 TRACE(
"resource %p, sub_resource_idx %u, map_ptr %p, box %s, flags %#x.\n",
3468 texture_level = sub_resource_idx %
texture->level_count;
3472 WARN(
"DC is in use.\n");
3476 if (sub_resource->map_count)
3478 WARN(
"Sub-resource is already mapped.\n");
3486 TRACE(
"WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n",
3494 WARN_(d3d_perf)(
"Mapping a dynamic texture without WINED3D_MAP_DISCARD.\n");
3513 ERR(
"Failed to prepare location.\n");
3540 sub_resource->map_flags =
flags;
3541 TRACE(
"Base memory pointer %p.\n", base_memory);
3556 ++sub_resource->map_count;
3558 TRACE(
"Returning memory %p.\n", *map_ptr);
3565 struct wined3d_texture_sub_resource *sub_resource;
3572 TRACE(
"resource %p, sub_resource_idx %u.\n",
resource, sub_resource_idx);
3578 if (!sub_resource->map_count)
3580 WARN(
"Trying to unmap unmapped sub-resource.\n");
3590 range.size = sub_resource->size;
3598 texture->swapchain->swapchain_ops->swapchain_frontbuffer_updated(
texture->swapchain);
3601 --sub_resource->map_count;
3631 TRACE(
"texture %p, resource_type %s, format %s, multisample_type %#x, multisample_quality %#x, "
3632 "usage %s, bind_flags %s, access %s, width %u, height %u, depth %u, layer_count %u, level_count %u, "
3633 "flags %#x, device %p, parent %p, parent_ops %p, sub_resources %p, texture_ops %p.\n",
3637 layer_count, level_count,
flags,
device,
parent, parent_ops, sub_resources, texture_ops);
3644 ERR(
"Invalid layer count for volume texture.\n");
3648 texture->sub_resources = sub_resources;
3654 WARN(
"Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n");
3665 if (((
desc->width & (
desc->width - 1)) || (
desc->height & (
desc->height - 1)) || (
desc->depth & (
desc->depth - 1)))
3673 WARN(
"Attempted to create a mipmapped/cube/array/volume NPOT "
3674 "texture without unconditional NPOT support.\n");
3678 WARN(
"Creating a scratch mipmapped/cube/array NPOT texture despite lack of HW support.\n");
3683 if ((
desc->width > d3d_info->
limits.texture_size ||
desc->height > d3d_info->
limits.texture_size)
3697 WARN(
"Dimensions (%ux%u) exceed the maximum texture size.\n",
desc->width,
desc->height);
3702 TRACE(
"Creating an oversized (%ux%u) surface.\n",
desc->width,
desc->height);
3705 for (
i = 0;
i < layer_count; ++
i)
3707 for (
j = 0;
j < level_count; ++
j)
3709 unsigned int idx =
i * level_count +
j;
3729 unsigned int min_size;
3731 min_size =
texture->sub_resources[level_count * layer_count - 1].offset +
format->block_byte_count;
3738 desc->multisample_type,
desc->multisample_quality,
desc->usage,
desc->bind_flags,
desc->access,
3741 static unsigned int once;
3748 ERR_(winediag)(
"The application tried to create a DXTn texture, but the driver does not support them.\n");
3750 WARN(
"Failed to initialize resource, returning %#lx\n",
hr);
3755 texture->texture_ops = texture_ops;
3757 texture->layer_count = layer_count;
3758 texture->level_count = level_count;
3764 texture->resource.pin_sysmem = 1;
3773 WARN(
"Format doesn't support mipmaps generation, "
3774 "ignoring WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS flag.\n");
3793 sub_count = level_count * layer_count;
3794 if (sub_count / layer_count != level_count)
3808 for (
i = 0;
i < sub_count; ++
i)
3816 for (
i = 0;
i < sub_count; ++
i)
3818 struct wined3d_texture_sub_resource *sub_resource;
3820 sub_resource = &
texture->sub_resources[
i];
3823 if (
FAILED(
hr = device_parent->
ops->texture_sub_resource_created(device_parent,
3824 desc->resource_type,
texture,
i, &sub_resource->parent, &sub_resource->parent_ops)))
3826 WARN(
"Failed to create sub-resource parent, hr %#lx.\n",
hr);
3827 sub_resource->parent =
NULL;
3832 TRACE(
"parent %p, parent_ops %p.\n", sub_resource->parent, sub_resource->parent_ops);
3834 TRACE(
"Created sub-resource %u (level %u, layer %u).\n",
3855 struct wined3d_texture *dst_texture,
unsigned int dst_sub_resource_idx,
const RECT *dst_rect,
3856 struct wined3d_texture *src_texture,
unsigned int src_sub_resource_idx,
const RECT *src_rect,
3863 TRACE(
"context %p, dst_texture %p, dst_sub_resource_idx %u, dst_rect %s, src_texture %p, "
3864 "src_sub_resource_idx %u, src_rect %s, flags %#x, fx %p, filter %s.\n",
3886 if (dst_texture->
sub_resources[dst_sub_resource_idx].map_count
3887 || src_texture->
sub_resources[src_sub_resource_idx].map_count)
3889 WARN(
"Sub-resource is busy, returning WINEDDERR_SURFACEBUSY.\n");
3893 if (!src_texture->
resource.format->depth_size != !dst_texture->
resource.format->depth_size
3894 || !src_texture->
resource.format->stencil_size != !dst_texture->
resource.format->stencil_size)
3896 WARN(
"Rejecting depth/stencil blit between incompatible formats.\n");
3902 FIXME(
"Rejecting cross-device blit.\n");
3916 unsigned int sub_resource_idx,
LONG *
x,
LONG *
y)
3918 struct wined3d_overlay_info *overlay;
3920 TRACE(
"texture %p, sub_resource_idx %u, x %p, y %p.\n",
texture, sub_resource_idx,
x,
y);
3926 overlay = &
texture->overlay_info[sub_resource_idx];
3927 if (!overlay->dst_texture)
3929 TRACE(
"Overlay not visible.\n");
3935 *
x = overlay->dst_rect.left;
3936 *
y = overlay->dst_rect.top;
3938 TRACE(
"Returning position %ld, %ld.\n", *
x, *
y);
3944 unsigned int sub_resource_idx,
LONG x,
LONG y)
3946 struct wined3d_overlay_info *overlay;
3949 TRACE(
"texture %p, sub_resource_idx %u, x %ld, y %ld.\n",
texture, sub_resource_idx,
x,
y);
3955 overlay = &
texture->overlay_info[sub_resource_idx];
3956 w = overlay->dst_rect.right - overlay->dst_rect.left;
3957 h = overlay->dst_rect.bottom - overlay->dst_rect.top;
3964 const RECT *src_rect,
struct wined3d_texture *dst_texture,
unsigned int dst_sub_resource_idx,
3967 struct wined3d_overlay_info *overlay;
3968 unsigned int level, dst_level;
3970 TRACE(
"texture %p, sub_resource_idx %u, src_rect %s, dst_texture %p, "
3971 "dst_sub_resource_idx %u, dst_rect %s, flags %#x.\n",
3983 overlay = &
texture->overlay_info[sub_resource_idx];
3987 overlay->src_rect = *src_rect;
3989 SetRect(&overlay->src_rect, 0, 0,
3993 dst_level = dst_sub_resource_idx % dst_texture->
level_count;
3995 overlay->dst_rect = *dst_rect;
3997 SetRect(&overlay->dst_rect, 0, 0,
4001 if (overlay->dst_texture && (overlay->dst_texture != dst_texture
4004 overlay->dst_texture =
NULL;
4010 if (overlay->dst_texture != dst_texture || overlay->dst_sub_resource_idx != dst_sub_resource_idx)
4012 overlay->dst_texture = dst_texture;
4013 overlay->dst_sub_resource_idx = dst_sub_resource_idx;
4022 overlay->dst_texture =
NULL;
4035 TRACE(
"texture %p, sub_resource_idx %u.\n",
texture, sub_resource_idx);
4040 return texture->sub_resources[sub_resource_idx].parent;
4046 TRACE(
"texture %p, sub_resource_idx %u, parent %p.\n",
texture, sub_resource_idx,
parent);
4059 unsigned int level_idx;
4061 TRACE(
"texture %p, sub_resource_idx %u, desc %p.\n",
texture, sub_resource_idx,
desc);
4069 desc->multisample_quality =
resource->multisample_quality;
4074 level_idx = sub_resource_idx %
texture->level_count;
4078 desc->size =
texture->sub_resources[sub_resource_idx].size;
4090 TRACE(
"texture_gl %p, device %p, desc %p, layer_count %u, "
4091 "level_count %u, flags %#x, parent %p, parent_ops %p.\n",
4098 WARN(
"OpenGL implementation does not support array textures.\n");
4102 switch (
desc->resource_type)
4105 if (layer_count > 1)
4118 if (layer_count > 1)
4125 if (layer_count > 1)
4135 WARN(
"OpenGL implementation does not support 3D textures.\n");
4153 texture_gl->
t.flags &= ~WINED3D_TEXTURE_DOWNLOADABLE;
4162 unsigned int sub_count = level_count * layer_count;
4166 TRACE(
"device %p, desc %p, layer_count %u, level_count %u, flags %#x, data %p, "
4167 "parent %p, parent_ops %p, texture %p.\n",
4172 WARN(
"Invalid layer count.\n");
4177 ERR(
"Invalid layer count %u for legacy cubemap.\n", layer_count);
4183 WARN(
"Invalid level count.\n");
4194 WARN(
"Unsupported quality level %u requested for WINED3D_MULTISAMPLE_NON_MASKABLE.\n",
4195 desc->multisample_quality);
4199 && (!(
format->multisample_types & 1u << (
desc->multisample_type - 1))
4202 WARN(
"Unsupported multisample type %u quality %u requested.\n",
desc->multisample_type,
4203 desc->multisample_quality);
4210 for (
i = 0;
i < sub_count; ++
i)
4215 WARN(
"Invalid sub-resource data specified for sub-resource %u.\n",
i);
4230 for (
i = 0;
i < sub_count; ++
i)
4246 struct wined3d_texture_sub_resource *sub_resource;
4247 struct wined3d_dc_info *dc_info;
4249 TRACE(
"texture %p, sub_resource_idx %u, dc %p.\n",
texture, sub_resource_idx,
dc);
4253 WARN(
"Texture does not support GetDC\n");
4270 if (!(dc_info =
texture->dc_info) || !dc_info[sub_resource_idx].dc)
4282 ++
texture->resource.map_count;
4283 ++sub_resource->map_count;
4286 TRACE(
"Returning dc %p.\n", *
dc);
4294 struct wined3d_texture_sub_resource *sub_resource;
4295 struct wined3d_dc_info *dc_info;
4297 TRACE(
"texture %p, sub_resource_idx %u, dc %p.\n",
texture, sub_resource_idx,
dc);
4311 if (!(dc_info =
texture->dc_info) || dc_info[sub_resource_idx].dc !=
dc)
4313 WARN(
"Application tries to release invalid DC %p, sub-resource DC is %p.\n",
4314 dc, dc_info ? dc_info[sub_resource_idx].
dc :
NULL);
4326 --sub_resource->map_count;
4327 if (!--
texture->resource.map_count &&
texture->update_map_binding)
4330 texture->flags &= ~WINED3D_TEXTURE_DC_IN_USE;
4336 unsigned int dst_x,
unsigned int dst_y,
unsigned int dst_z,
struct wined3d_texture *src_texture,
4337 unsigned int src_sub_resource_idx,
const struct wined3d_box *src_box)
4339 unsigned int src_row_pitch, src_slice_pitch;
4340 unsigned int update_w, update_h, update_d;
4341 unsigned int src_level, dst_level;
4345 TRACE(
"dst_texture %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, "
4346 "src_texture %p, src_sub_resource_idx %u, src_box %s.\n",
4347 dst_texture, dst_sub_resource_idx, dst_x, dst_y, dst_z,
4348 src_texture, src_sub_resource_idx,
debug_box(src_box));
4355 update_w = src_box->
right - src_box->
left;
4356 update_h = src_box->
bottom - src_box->
top;
4357 update_d = src_box->
back - src_box->
front;
4358 dst_level = dst_sub_resource_idx % dst_texture->
level_count;
4366 src_level = src_sub_resource_idx % src_texture->
level_count;
4371 src_texture->
resource.format, src_box, src_row_pitch, src_slice_pitch, dst_texture,
4382 struct wined3d_texture *src_texture,
unsigned int src_sub_resource_idx)
4384 unsigned int src_level, dst_level, dst_row_pitch, dst_slice_pitch;
4385 unsigned int dst_location = dst_texture->
resource.map_binding;
4389 unsigned int src_location;
4400 src_level = src_sub_resource_idx % src_texture->
level_count;
4403 dst_level = dst_sub_resource_idx % dst_texture->
level_count;
4406 src_texture->
texture_ops->texture_download_data(
context, src_texture, src_sub_resource_idx, src_location,
4407 &src_box, &
data, dst_texture->
resource.format, 0, 0, 0, dst_row_pitch, dst_slice_pitch);
4418 struct wined3d_texture_sub_resource *sub_resource = &
texture->sub_resources[sub_resource_idx];
4419 struct wined3d_bo *prev_bo = sub_resource->bo;
4421 TRACE(
"texture %p, sub_resource_idx %u, context %p, bo %p.\n",
texture, sub_resource_idx,
context, bo);
4428 bo_user->
valid =
false;
4437 sub_resource->bo = bo;
4442 unsigned int row_pitch,
unsigned int slice_pitch)
4444 unsigned int level = sub_resource_idx %
texture->level_count;
4461 if (!
box->left && !
box->top && !
box->front
4469 &src_box, row_pitch, slice_pitch,
texture, sub_resource_idx,
4497 desc.u.texture.level_idx = 0;
4498 desc.u.texture.level_count =
texture->level_count;
4499 desc.u.texture.layer_idx = 0;
4500 desc.u.texture.layer_count =
texture->layer_count;
4504 ERR(
"Failed to create shader resource view, hr %#lx.\n",
hr);
4514 const struct wined3d_box *src_box,
unsigned int src_row_pitch,
unsigned int src_slice_pitch,
4515 struct wined3d_texture *dst_texture,
unsigned int dst_sub_resource_idx,
unsigned int dst_location,
4516 unsigned int dst_x,
unsigned int dst_y,
unsigned int dst_z)
4518 FIXME(
"Not implemented.\n");
4522 struct wined3d_texture *src_texture,
unsigned int src_sub_resource_idx,
unsigned int src_location,
4525 unsigned int dst_row_pitch,
unsigned int dst_slice_pitch)
4527 FIXME(
"Not implemented.\n");
4534 return texture->sub_resources[sub_resource_idx].user_memory ?
TRUE
4544 TRACE(
"texture %p, sub_resource_idx %u, context %p, location %s.\n",
4574 TRACE(
"texture_no3d %p, device %p, desc %p, layer_count %u, "
4575 "level_count %u, flags %#x, parent %p, parent_ops %p.\n",
4617 vk_info = context_vk->
vk_info;
4619 if (texture_vk->
t.layer_count > 1)
4625 create_info.
flags = 0;
4626 create_info.image = texture_vk->
image.vk_image;
4629 fixup = format_vk->
f.color_fixup;
4676 const struct wined3d_box *src_box,
unsigned int src_row_pitch,
unsigned int src_slice_pitch,
4677 struct wined3d_texture *dst_texture,
unsigned int dst_sub_resource_idx,
unsigned int dst_location,
4678 unsigned int dst_x,
unsigned int dst_y,
unsigned int dst_z)
4682 unsigned int dst_level, dst_row_pitch, dst_slice_pitch;
4683 struct wined3d_texture_sub_resource *sub_resource;
4684 unsigned int src_width, src_height, src_depth;
4688 VkCommandBuffer vk_command_buffer;
4699 TRACE(
"context %p, src_bo_addr %s, src_format %s, src_box %s, src_row_pitch %u, src_slice_pitch %u, "
4700 "dst_texture %p, dst_sub_resource_idx %u, dst_location %s, dst_x %u, dst_y %u, dst_z %u.\n",
4702 src_row_pitch, src_slice_pitch, dst_texture, dst_sub_resource_idx,
4705 if (src_format->
id != dst_texture->
resource.format->id)
4707 FIXME(
"Unhandled format conversion (%s -> %s).\n",
4713 dst_level = dst_sub_resource_idx % dst_texture->
level_count;
4716 src_row_pitch = dst_row_pitch = 0;
4718 src_slice_pitch = dst_slice_pitch = 0;
4728 FIXME(
"Not supported for multisample textures.\n");
4739 sub_resource = &dst_texture_vk->
t.sub_resources[dst_sub_resource_idx];
4740 vk_info = context_vk->
vk_info;
4742 src_width = src_box->
right - src_box->
left;
4743 src_height = src_box->
bottom - src_box->
top;
4744 src_depth = src_box->
back - src_box->
front;
4746 src_offset = src_box->
front * src_slice_pitch
4752 ERR(
"Failed to get command buffer.\n");
4760 unsigned int staging_row_pitch, staging_slice_pitch, staging_size;
4763 &staging_row_pitch, &staging_slice_pitch);
4764 staging_size = staging_slice_pitch * src_depth;
4769 ERR(
"Failed to create staging bo.\n");
4778 ERR(
"Failed to map staging bo.\n");
4784 map_ptr, staging_row_pitch, staging_slice_pitch, src_width, src_height, src_depth);
4787 range.size = staging_size;
4790 src_bo = &staging_bo;
4793 src_row_pitch = staging_row_pitch;
4794 src_slice_pitch = staging_slice_pitch;
4807 vk_barrier.offset = src_bo->
b.buffer_offset + (
size_t)src_bo_addr->
addr;
4808 vk_barrier.size = sub_resource->size;
4810 src_offset += (
size_t)src_bo_addr->
addr;
4821 vk_range.
baseArrayLayer = dst_sub_resource_idx / dst_texture_vk->
t.level_count;
4829 dst_texture_vk->
image.vk_image, &vk_range);
4831 region.bufferOffset = src_bo->
b.buffer_offset + src_offset;
4834 region.bufferImageHeight = (src_slice_pitch / src_row_pitch) * src_format->
block_height;
4836 region.bufferImageHeight = 1;
4841 region.imageOffset.x = dst_x;
4842 region.imageOffset.y = dst_y;
4843 region.imageOffset.z = dst_z;
4844 region.imageExtent.width = src_width;
4845 region.imageExtent.height = src_height;
4846 region.imageExtent.depth = src_depth;
4856 dst_texture_vk->
image.vk_image, &vk_range);
4860 if (src_bo == &staging_bo)
4872 struct wined3d_texture *src_texture,
unsigned int src_sub_resource_idx,
unsigned int src_location,
4875 unsigned int dst_row_pitch,
unsigned int dst_slice_pitch)
4879 unsigned int src_level, src_width, src_height, src_depth;
4880 struct wined3d_texture_sub_resource *sub_resource;
4881 unsigned int src_row_pitch, src_slice_pitch;
4885 VkCommandBuffer vk_command_buffer;
4892 size_t dst_offset = 0;
4895 TRACE(
"context %p, src_texture %p, src_sub_resource_idx %u, src_location %s, src_box %s, dst_bo_addr %s, "
4896 "dst_format %s, dst_x %u, dst_y %u, dst_z %u, dst_row_pitch %u, dst_slice_pitch %u.\n",
4899 dst_x, dst_y, dst_z, dst_row_pitch, dst_slice_pitch);
4907 src_level = src_sub_resource_idx % src_texture->
level_count;
4911 if (src_box->
left || src_box->
top || src_box->
right != src_width || src_box->
bottom != src_height
4912 || src_box->
front || src_box->
back != src_depth)
4920 FIXME(
"Unhandled format conversion (%s -> %s).\n",
4926 if (dst_x || dst_y || dst_z)
4928 FIXME(
"Unhandled destination (%u, %u, %u).\n", dst_x, dst_y, dst_z);
4934 FIXME(
"Not supported for multisample textures.\n");
4947 src_row_pitch = dst_row_pitch = 0;
4949 src_slice_pitch = dst_slice_pitch = 0;
4951 sub_resource = &src_texture_vk->
t.sub_resources[src_sub_resource_idx];
4952 vk_info = context_vk->
vk_info;
4955 ERR(
"Failed to get command buffer.\n");
4967 ERR(
"Failed to create staging bo.\n");
4971 dst_bo = &staging_bo;
4975 region.bufferImageHeight = (src_slice_pitch / src_row_pitch) *
dst_format->block_height;
4977 region.bufferImageHeight = 1;
4981 FIXME(
"Row pitch %u is not a multiple of byte count %u.\n", src_row_pitch,
dst_format->byte_count);
4984 if (src_row_pitch && src_slice_pitch % src_row_pitch)
4986 FIXME(
"Slice pitch %u is not a multiple of row pitch %u.\n", src_slice_pitch, src_row_pitch);
4996 region.bufferImageHeight = (dst_slice_pitch / dst_row_pitch) *
dst_format->block_height;
4998 region.bufferImageHeight = 1;
5002 FIXME(
"Row pitch %u is not a multiple of byte count %u.\n", dst_row_pitch,
dst_format->byte_count);
5005 if (dst_row_pitch && dst_slice_pitch % dst_row_pitch)
5007 FIXME(
"Slice pitch %u is not a multiple of row pitch %u.\n", dst_slice_pitch, dst_row_pitch);
5018 vk_barrier.offset = dst_bo->
b.buffer_offset + (
size_t)dst_bo_addr->
addr;
5019 vk_barrier.size = sub_resource->size;
5031 vk_range.
baseArrayLayer = src_sub_resource_idx / src_texture_vk->
t.level_count;
5039 src_texture_vk->
image.vk_image, &vk_range);
5041 region.bufferOffset = dst_bo->
b.buffer_offset + dst_offset;
5046 region.imageOffset.x = 0;
5047 region.imageOffset.y = 0;
5048 region.imageOffset.z = 0;
5049 region.imageExtent.width = src_width;
5050 region.imageExtent.height = src_height;
5051 region.imageExtent.depth = src_depth;
5061 src_texture_vk->
image.vk_image, &vk_range);
5066 if (dst_bo == &staging_bo)
5076 ERR(
"Failed to map staging bo.\n");
5082 dst_bo_addr->
addr, dst_row_pitch, dst_slice_pitch, src_box->
right - src_box->
left,
5100 bo_stage_flags, 0, 0,
NULL, 1, &vk_barrier, 0,
NULL));
5109 struct wined3d_texture_sub_resource *sub_resource = &texture_vk->
t.sub_resources[sub_resource_idx];
5114 VkCommandBuffer vk_command_buffer;
5125 if (
c->r ||
c->g ||
c->
b ||
c->a)
5126 FIXME(
"Compressed resource %p is cleared to a non-zero color.\n", &texture_vk->
t);
5136 vk_image = texture_vk->
image.vk_image;
5140 ERR(
"Failed to get command buffer.\n");
5147 vk_range.
baseMipLevel = sub_resource_idx % texture_vk->
t.level_count;
5149 vk_range.
baseArrayLayer = sub_resource_idx / texture_vk->
t.level_count;
5161 depth_value.
depth = sub_resource->clear_value.depth;
5162 depth_value.
stencil = sub_resource->clear_value.stencil;
5186 struct wined3d_texture_sub_resource *sub_resource;
5187 unsigned int level, row_pitch, slice_pitch;
5191 sub_resource = &texture_vk->
t.sub_resources[sub_resource_idx];
5208 level = sub_resource_idx % texture_vk->
t.level_count;
5213 &src_box, row_pitch, slice_pitch, &texture_vk->
t, sub_resource_idx,
5222 struct wined3d_texture_sub_resource *sub_resource;
5223 unsigned int level, row_pitch, slice_pitch;
5227 sub_resource = &texture_vk->
t.sub_resources[sub_resource_idx];
5234 level = sub_resource_idx % texture_vk->
t.level_count;
5239 &src_box, &
data, texture_vk->
t.resource.format, 0, 0, 0, row_pitch, slice_pitch);
5249 VkCommandBuffer vk_command_buffer;
5253 unsigned int flags = 0;
5260 ERR(
"Failed to get command buffer.\n");
5322 texture_vk->
t.level_count, texture_vk->
t.layer_count,
flags, &texture_vk->
image))
5342 texture_vk->
image.vk_image, &vk_range);
5346 TRACE(
"Created image 0x%s, memory 0x%s for texture %p.\n",
5355 struct wined3d_texture_sub_resource *sub_resource;
5358 sub_resource = &texture_vk->
t.sub_resources[sub_resource_idx];
5359 if (sub_resource->bo)
5362 if (!(bo =
malloc(
sizeof(*bo))))
5376 sub_resource->bo = &bo->
b;
5377 TRACE(
"Created buffer object %p for texture %p, sub-resource %u.\n", bo, texture_vk, sub_resource_idx);
5387 return texture->sub_resources[sub_resource_idx].user_memory ?
TRUE
5429 unsigned int i, sub_count;
5443 if (texture_vk->
image.vk_image)
5449 for (
i = 0;
i < sub_count; ++
i)
5451 struct wined3d_texture_sub_resource *sub_resource = &
texture->sub_resources[
i];
5453 if (sub_resource->bo)
5459 sub_resource->bo =
NULL;
5488 TRACE(
"texture_vk %p, device %p, desc %p, layer_count %u, "
5489 "level_count %u, flags %#x, parent %p, parent_ops %p.\n",
5530 TRACE(
"texture_vk %p, context_vk %p, bind_mask %s.\n",
5546 else if ((texture_vk->
bind_mask & bind_mask) != bind_mask)
5548 src_bind_mask = texture_vk->
bind_mask & ~WINED3D_READ_ONLY_BIND_MASK;
5556 TRACE(
" %s(%x) -> %s(%x).\n",
5570 texture_vk->
layout, new_layout, texture_vk->
image.vk_image, &vk_range);
5572 texture_vk->
layout = new_layout;
5625 if (clear_rect && (clear_rect->
left > 0 || clear_rect->
top > 0
5640 unsigned int drawable_width, drawable_height;
5647 bool render_offscreen;
5664 if (!context_gl->
valid)
5667 WARN(
"Invalid context, skipping clear.\n");
5670 gl_info = context_gl->
gl_info;
5683 for (
i = 0;
i < rt_count; ++
i)
5705 render_offscreen =
true;
5730 WARN(
"Failed to apply clear state, skipping clear.\n");
5739 gl_info->
gl_ops.gl.p_glStencilMask(~0
u);
5760 for (
i = 0;
i < rt_count; ++
i)
5769 FIXME(
"Not supported on buffer resources.\n");
5780 WARN(
"Clearing multiple sRGB render targets without GL_ARB_framebuffer_sRGB "
5781 "support, this might cause graphical issues.\n");
5784 colour = &colour_srgb;
5789 gl_info->
gl_ops.gl.p_glClearColor(colour->
r, colour->
g, colour->
b, colour->
a);
5796 if (render_offscreen)
5798 gl_info->
gl_ops.gl.p_glScissor(draw_rect->
left, draw_rect->
top,
5803 gl_info->
gl_ops.gl.p_glScissor(draw_rect->
left, drawable_height - draw_rect->
bottom,
5806 gl_info->
gl_ops.gl.p_glClear(clear_mask);
5813 for (
i = 0;
i < rect_count; ++
i)
5818 TRACE(
"clear_rect[%u] %s, current_rect %s.\n",
i,
5825 if (current_rect.
left > current_rect.
right || current_rect.
top > current_rect.
bottom)
5827 TRACE(
"Rectangle with negative dimensions, ignoring.\n");
5831 if (render_offscreen)
5833 gl_info->
gl_ops.gl.p_glScissor(current_rect.
left, current_rect.
top,
5838 gl_info->
gl_ops.gl.p_glScissor(current_rect.
left, drawable_height - current_rect.
bottom,
5841 gl_info->
gl_ops.gl.p_glClear(clear_mask);
5848 gl_info->
gl_ops.gl.p_glFlush();
5867 ||
texture->resource.pin_sysmem;
5874 unsigned int rt_count,
const struct wined3d_fb_state *fb,
unsigned int rect_count,
const RECT *clear_rects,
5878 bool have_identical_size =
TRUE;
5880 unsigned int next_rt_count = 0;
5882 DWORD next_flags = 0;
5887 for (
i = 0;
i < rt_count; ++
i)
5897 flags &= ~WINED3DCLEAR_TARGET;
5898 next_rt_count = rt_count;
5919 for (
i = 0;
i < rt_count; ++
i)
5925 have_identical_size =
false;
5933 have_identical_size =
false;
5936 if (have_identical_size)
5943 for (
i = 0;
i < rt_count; ++
i)
5963 if (next_flags && (
next = blitter->
next))
5964 next->ops->blitter_clear(
next,
device, next_rt_count, fb, rect_count,
5965 clear_rects, draw_rect, next_flags, colour,
depth,
stencil);
5971 unsigned int dst_sub_resource_idx,
DWORD dst_location,
const RECT *dst_rect,
5979 ERR(
"No blitter to handle blit op %#x.\n",
op);
5980 return dst_location;
5983 return next->ops->blitter_blit(
next,
op,
context, src_texture, src_sub_resource_idx, src_location,
5984 src_rect, dst_texture, dst_sub_resource_idx, dst_location, dst_rect, colour_key,
filter,
5999 if (!(blitter =
malloc(
sizeof(*blitter))))
6002 TRACE(
"Created blitter %p.\n", blitter);
6020 unsigned int rt_count,
const struct wined3d_fb_state *fb,
unsigned int rect_count,
const RECT *clear_rects,
6033 unsigned int dst_sub_resource_idx,
DWORD dst_location,
const RECT *dst_rect,
6043 TRACE(
"blitter %p, op %#x, context %p, src_texture %p, src_sub_resource_idx %u, src_location %s, "
6044 "src_rect %s, dst_texture %p, dst_sub_resource_idx %u, dst_location %s, dst_rect %s, "
6045 "colour_key %p, filter %s, resolve_format %p.\n",
6050 src_resource = &src_texture->
resource;
6051 dst_resource = &dst_texture->
resource;
6057 if (dst_resource->
format->depth_size || dst_resource->
format->stencil_size)
6064 src_resource, src_location, dst_resource, dst_location))
6068 ERR(
"No blitter to handle blit op %#x.\n",
op);
6069 return dst_location;
6072 TRACE(
"Forwarding to blitter %p.\n",
next);
6073 return next->ops->blitter_blit(
next,
op,
context, src_texture, src_sub_resource_idx, src_location,
6074 src_rect, dst_texture, dst_sub_resource_idx, dst_location, dst_rect, colour_key,
filter,
6080 TRACE(
"Colour blit.\n");
6082 src_rect, dst_texture, dst_sub_resource_idx, dst_location, dst_rect, resolve_format);
6083 return dst_location;
6088 TRACE(
"Depth/stencil blit.\n");
6090 src_rect, dst_texture, dst_sub_resource_idx, dst_location, dst_rect);
6091 return dst_location;
6094 ERR(
"This blitter does not implement blit op %#x.\n", blit_op);
6095 return dst_location;
6109 if (!(blitter =
malloc(
sizeof(*blitter))))
6112 TRACE(
"Created blitter %p.\n", blitter);
6130 unsigned int rt_count,
const struct wined3d_fb_state *fb,
unsigned int rect_count,
const RECT *clear_rects,
6137 ERR(
"No blitter to handle clear.\n");
6141 TRACE(
"Forwarding to blitter %p.\n",
next);
6149 GLuint src_internal, dst_internal;
6150 bool src_ds, dst_ds;
6152 src_ds = src_texture->
resource.format->depth_size || src_texture->
resource.format->stencil_size;
6153 dst_ds = dst_texture->
resource.format->depth_size || dst_texture->
resource.format->stencil_size;
6154 if (src_ds == dst_ds)
6163 return src_internal == dst_internal;
6169 unsigned int dst_sub_resource_idx,
DWORD dst_location,
const RECT *dst_rect,
6177 unsigned int src_level, src_layer, dst_level, dst_layer;
6179 GLuint src_name, dst_name;
6189 || ((src_texture->
resource.format_attrs | dst_texture->
resource.format_attrs)
6197 ERR(
"No blitter to handle blit op %#x.\n",
op);
6198 return dst_location;
6201 TRACE(
"Forwarding to blitter %p.\n",
next);
6202 return next->ops->blitter_blit(
next,
op,
context, src_texture, src_sub_resource_idx, src_location,
6203 src_rect, dst_texture, dst_sub_resource_idx, dst_location, dst_rect, colour_key,
filter,
6207 TRACE(
"Blit using ARB_copy_image.\n");
6209 src_level = src_sub_resource_idx % src_texture->
level_count;
6210 src_layer = src_sub_resource_idx / src_texture->
level_count;
6212 dst_level = dst_sub_resource_idx % dst_texture->
level_count;
6213 dst_layer = dst_sub_resource_idx / dst_texture->
level_count;
6242 src_rect->
left, src_rect->
top, src_layer, dst_name, dst_texture_gl->
target, dst_level,
6243 dst_rect->
left, dst_rect->
top, dst_layer, src_rect->
right - src_rect->
left,
6269 if (!(blitter =
malloc(
sizeof(*blitter))))
6272 TRACE(
"Created blitter %p.\n", blitter);
6295 unsigned int i, attachment_count, immediate_rt_count = 0,
delay_count = 0;
6303 VkCommandBuffer vk_command_buffer;
6306 VkFramebuffer vk_framebuffer;
6307 VkRenderPass vk_render_pass;
6309 unsigned int layer_count;
6314 TRACE(
"context_vk %p, rt_count %u, fb %p, rect_count %u, clear_rects %p, "
6315 "draw_rect %s, flags %#x, colour %s, depth %.8e, stencil %#x.\n",
6316 context_vk, rt_count, fb, rect_count, clear_rects,
6325 for (
i = 0, attachment_count = 0, layer_count = 1;
i < rt_count; ++
i)
6339 && !colour->
b && !colour->
a)))
6344 texture->sub_resources[
view->sub_resource_idx].clear_value.colour = *colour;
6360 c = &clear_values[attachment_count].
color;
6369 if (!attachment_count)
6370 flags &= ~WINED3DCLEAR_TARGET;
6374 DWORD full_flags = 0;
6380 if (
view->format->depth_size)
6382 if (
view->format->stencil_size)
6418 if (!attachment_count)
6420 TRACE(
"The clear has been delayed until draw time.\n");
6424 TRACE(
"Doing an immediate clear of %u attachments.\n", attachment_count);
6426 TRACE_(d3d_perf)(
"Partial clear: %u immediate, %u delayed.\n", attachment_count,
delay_count);
6431 ERR(
"Failed to get render pass.\n");
6437 ERR(
"Failed to get command buffer.\n");
6444 fb_desc.renderPass = vk_render_pass;
6458 begin_desc.renderPass = vk_render_pass;
6459 begin_desc.framebuffer = vk_framebuffer;
6465 for (
i = 0;
i < rect_count; ++
i)
6472 if (
r.left >=
r.right ||
r.top >=
r.bottom)
6485 for (
i = 0;
i < immediate_rt_count; ++
i)
6495 unsigned int rt_count,
const struct wined3d_fb_state *fb,
unsigned int rect_count,
const RECT *clear_rects,
6501 bool have_identical_size =
true;
6503 unsigned int next_rt_count = 0;
6508 TRACE(
"blitter %p, device %p, rt_count %u, fb %p, rect_count %u, clear_rects %p, "
6509 "draw_rect %s, flags %#x, colour %s, depth %.8e, stencil %#x.\n",
6510 blitter,
device, rt_count, fb, rect_count, clear_rects,
6516 clear_rects = draw_rect;
6521 for (
i = 0;
i < rt_count; ++
i)
6529 flags &= ~WINED3DCLEAR_TARGET;
6530 next_rt_count = rt_count;
6550 for (
i = 0;
i < rt_count; ++
i)
6556 have_identical_size =
false;
6564 have_identical_size =
false;
6567 if (have_identical_size)
6574 for (
i = 0;
i < rt_count; ++
i)
6601 ERR(
"No blitter to handle clear.\n");
6605 TRACE(
"Forwarding to blitter %p.\n",
next);
6606 next->ops->blitter_clear(
next,
device, next_rt_count, fb, rect_count,
6607 clear_rects, draw_rect, next_flags, colour,
depth,
stencil);
6619 TRACE(
"Destination resource does not have GPU access.\n");
6625 TRACE(
"Source resource does not have GPU access.\n");
6633 TRACE(
"Destination fixups are not supported.\n");
6639 TRACE(
"Source fixups are not supported.\n");
6646 || !resolve_format))
6648 TRACE(
"Format conversion not supported.\n");
6655 TRACE(
"Multi-sample destination resource not supported.\n");
6664 TRACE(
"Unsupported blit operation %#x.\n",
op);
6671 TRACE(
"Scaling not supported.\n");
6681 unsigned int dst_sub_resource_idx,
DWORD dst_location,
const RECT *dst_rect,
6691 VkCommandBuffer vk_command_buffer;
6693 unsigned src_sample_count;
6694 bool resolve =
false;
6696 TRACE(
"blitter %p, op %#x, context %p, src_texture %p, src_sub_resource_idx %u, src_location %s, "
6697 "src_rect %s, dst_texture %p, dst_sub_resource_idx %u, dst_location %s, dst_rect %s, "
6698 "colour_key %p, filter %s, resolve format %p.\n",
6708 if (src_sample_count > 1)
6724 ERR(
"Failed to load the source sub-resource.\n");
6731 ERR(
"Failed to prepare the destination sub-resource.\n");
6740 ERR(
"Failed to load the destination sub-resource.\n");
6747 ERR(
"Failed to get command buffer.\n");
6765 src_texture_vk->
image.vk_image, &vk_src_range);
6770 dst_texture_vk->
image.vk_image, &vk_dst_range);
6779 VkImage src_vk_image, dst_vk_image;
6799 switch (src_texture->
resource.type)
6835 src_sample_count, 1, 1, 0, &src_image))
6875 src_vk_image, &vk_range);
6887 src_vk_image = src_texture_vk->
image.vk_image;
6888 resolve_src_layout = src_layout;
6898 if (dst_format_vk->
vk_format != vk_format)
6926 dst_vk_image = dst_texture_vk->
image.vk_image;
6927 resolve_dst_layout = dst_layout;
6938 dst_vk_image, resolve_dst_layout, 1, &resolve_region));
6940 if (dst_vk_image != dst_texture_vk->
image.vk_image)
6946 dst_vk_image, &vk_range);
6967 dst_texture_vk->
image.vk_image, dst_layout, 1, ©_region));
6993 dst_texture_vk->
image.vk_image, dst_layout, 1, &
region));
7000 dst_layout, dst_texture_vk->
layout, dst_texture_vk->
image.vk_image, &vk_dst_range);
7005 src_layout, src_texture_vk->
layout, src_texture_vk->
image.vk_image, &vk_src_range);
7022 dst_layout, dst_texture_vk->
layout, dst_texture_vk->
image.vk_image, &vk_dst_range);
7027 src_layout, src_texture_vk->
layout, src_texture_vk->
image.vk_image, &vk_src_range);
7032 ERR(
"No blitter to handle blit op %#x.\n",
op);
7033 return dst_location;
7036 TRACE(
"Forwarding to blitter %p.\n",
next);
7037 return next->ops->blitter_blit(
next,
op,
context, src_texture, src_sub_resource_idx, src_location,
7038 src_rect, dst_texture, dst_sub_resource_idx, dst_location, dst_rect, colour_key,
filter, resolve_format);
7052 if (!(blitter =
malloc(
sizeof(*blitter))))
7055 TRACE(
"Created blitter %p.\n", blitter);
ios_base &_STLP_CALL internal(ios_base &__s)
COMPILER_DEPENDENT_INT64 INT64
VkAccessFlags vk_access_mask_from_buffer_usage(VkBufferUsageFlags usage)
VkPipelineStageFlags vk_pipeline_stage_mask_from_buffer_usage(VkBufferUsageFlags usage)
#define InterlockedIncrement
#define InterlockedDecrement
static const char * wine_dbgstr_rect(const RECT *prc)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_remove(struct list_entry *entry)
static int list_empty(struct list_entry *head)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
void wined3d_context_gl_destroy_bo(struct wined3d_context_gl *context_gl, struct wined3d_bo_gl *bo)
void wined3d_context_gl_texture_update(struct wined3d_context_gl *context_gl, const struct wined3d_texture_gl *texture_gl)
BOOL wined3d_context_gl_apply_clear_state(struct wined3d_context_gl *context_gl, const struct wined3d_state *state, unsigned int rt_count, const struct wined3d_fb_state *fb)
void context_gl_apply_texture_draw_state(struct wined3d_context_gl *context_gl, struct wined3d_texture *texture, unsigned int sub_resource_idx, unsigned int location)
void wined3d_context_gl_unmap_bo_address(struct wined3d_context_gl *context_gl, const struct wined3d_bo_address *data, unsigned int range_count, const struct wined3d_range *ranges)
void * wined3d_context_gl_map_bo_address(struct wined3d_context_gl *context_gl, const struct wined3d_bo_address *data, size_t size, uint32_t flags)
void wined3d_context_gl_check_fbo_status(const struct wined3d_context_gl *context_gl, GLenum target)
void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLenum target, GLuint name)
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)
void context_gl_resource_released(struct wined3d_device *device, GLuint name, BOOL rb_namespace)
VkRenderPass wined3d_context_vk_get_render_pass(struct wined3d_context_vk *context_vk, const struct wined3d_fb_state *fb, unsigned int rt_count, bool depth_stencil, uint32_t clear_flags)
void wined3d_context_vk_destroy_vk_framebuffer(struct wined3d_context_vk *context_vk, VkFramebuffer vk_framebuffer, uint64_t command_buffer_id)
BOOL wined3d_context_vk_create_bo(struct wined3d_context_vk *context_vk, VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags memory_type, struct wined3d_bo_vk *bo)
void wined3d_context_vk_end_current_render_pass(struct wined3d_context_vk *context_vk)
void wined3d_context_vk_destroy_vk_image_view(struct wined3d_context_vk *context_vk, VkImageView vk_view, uint64_t command_buffer_id)
void wined3d_context_vk_destroy_image(struct wined3d_context_vk *context_vk, struct wined3d_image_vk *image)
VkCommandBuffer wined3d_context_vk_get_command_buffer(struct wined3d_context_vk *context_vk)
void wined3d_context_vk_destroy_bo(struct wined3d_context_vk *context_vk, const struct wined3d_bo_vk *bo)
BOOL wined3d_context_vk_create_image(struct wined3d_context_vk *context_vk, VkImageType vk_image_type, VkImageUsageFlags usage, VkFormat vk_format, unsigned int width, unsigned int height, unsigned int depth, unsigned int sample_count, unsigned int mip_levels, unsigned int layer_count, unsigned int flags, struct wined3d_image_vk *image)
void wined3d_context_vk_image_barrier(struct wined3d_context_vk *context_vk, VkCommandBuffer vk_command_buffer, VkPipelineStageFlags src_stage_mask, VkPipelineStageFlags dst_stage_mask, VkAccessFlags src_access_mask, VkAccessFlags dst_access_mask, VkImageLayout old_layout, VkImageLayout new_layout, VkImage image, const VkImageSubresourceRange *range)
void wined3d_context_vk_submit_command_buffer(struct wined3d_context_vk *context_vk, unsigned int wait_semaphore_count, const VkSemaphore *wait_semaphores, const VkPipelineStageFlags *wait_stages, unsigned int signal_semaphore_count, const VkSemaphore *signal_semaphores)
void wined3d_context_vk_wait_command_buffer(struct wined3d_context_vk *context_vk, uint64_t id)
void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, struct wined3d_texture *texture, unsigned int layer)
void wined3d_device_context_emit_update_sub_resource(struct wined3d_device_context *context, struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, unsigned int slice_pitch)
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
void wined3d_device_context_emit_blt_sub_resource(struct wined3d_device_context *context, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, const struct wined3d_box *dst_box, struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, unsigned int flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
void wined3d_cs_destroy_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
void wined3d_cs_init_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture, WORD flags, const struct wined3d_color_key *color_key)
void context_invalidate_compute_state(struct wined3d_context *context, DWORD state_id)
void context_invalidate_state(struct wined3d_context *context, unsigned int state_id)
void context_restore(struct wined3d_context *context, struct wined3d_texture *texture, unsigned int sub_resource_idx)
void device_invalidate_state(const struct wined3d_device *device, unsigned int state_id)
bool wined3d_device_gl_create_bo(struct wined3d_device_gl *device_gl, struct wined3d_context_gl *context_gl, GLsizeiptr size, GLenum binding, GLenum usage, bool coherent, GLbitfield flags, struct wined3d_bo_gl *bo)
VkPipelineStageFlags vk_pipeline_stage_mask_from_bind_flags(uint32_t bind_flags)
const struct wined3d_format * wined3d_resource_get_decompress_format(const struct wined3d_resource *resource)
VkAccessFlags vk_access_mask_from_bind_flags(uint32_t bind_flags)
HRESULT wined3d_resource_check_box_dimensions(struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box)
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)
unsigned int wined3d_resource_get_sample_count(const struct wined3d_resource *resource)
void * resource_offset_map_pointer(struct wined3d_resource *resource, unsigned int sub_resource_idx, uint8_t *base_memory, const struct wined3d_box *box)
HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device, enum wined3d_resource_type type, const struct wined3d_format *format, enum wined3d_multisample_type multisample_type, unsigned int multisample_quality, uint32_t usage, unsigned int bind_flags, unsigned int access, unsigned int width, unsigned int height, unsigned int depth, unsigned int size, void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops)
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource)
void wined3d_resource_free_sysmem(struct wined3d_resource *resource)
void resource_cleanup(struct wined3d_resource *resource)
BOOL wined3d_resource_prepare_sysmem(struct wined3d_resource *resource)
void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
void resource_unload(struct wined3d_resource *resource)
void texture2d_read_from_framebuffer(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD src_location, DWORD dst_location)
HRESULT CDECL wined3d_texture_get_overlay_position(const struct wined3d_texture *texture, unsigned int sub_resource_idx, LONG *x, LONG *y)
void wined3d_texture_invalidate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, uint32_t location)
static const struct wined3d_blitter_ops fbo_blitter_ops
void *CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
static BOOL wined3d_texture_vk_load_sysmem(struct wined3d_texture_vk *texture_vk, unsigned int sub_resource_idx, struct wined3d_context *context, unsigned int location)
static bool wined3d_texture_gl_clear(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context_gl *context_gl, unsigned int location)
HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC *dc)
static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
HRESULT CDECL wined3d_texture_get_sub_resource_desc(const struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_sub_resource_desc *desc)
HRESULT CDECL wined3d_texture_set_color_key(struct wined3d_texture *texture, uint32_t flags, const struct wined3d_color_key *color_key)
static BOOL wined3d_texture_vk_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, unsigned int location)
static BOOL wined3d_texture_load_renderbuffer(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD dst_location)
static void wined3d_texture_no3d_upload_data(struct wined3d_context *context, const struct wined3d_const_bo_address *src_bo_addr, const struct wined3d_format *src_format, const struct wined3d_box *src_box, unsigned int src_row_pitch, unsigned int src_slice_pitch, struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, unsigned int dst_location, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z)
static const struct wined3d_texture_ops wined3d_texture_no3d_ops
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, uint32_t flags, const struct wined3d_color *colour, float depth, unsigned int stencil)
static DWORD fbo_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 *colour_key, enum wined3d_texture_filter_type filter, const struct wined3d_format *resolve_format)
HRESULT wined3d_texture_gl_init(struct wined3d_texture_gl *texture_gl, struct wined3d_device *device, const struct wined3d_resource_desc *desc, unsigned int layer_count, unsigned int level_count, uint32_t flags, void *parent, const struct wined3d_parent_ops *parent_ops)
static DWORD vk_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 *colour_key, enum wined3d_texture_filter_type filter, const struct wined3d_format *resolve_format)
static void vk_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 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)
static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, void **map_ptr, const struct wined3d_box *box, uint32_t flags)
static BOOL wined3d_texture_gl_load_sysmem(struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, struct wined3d_context_gl *context_gl, DWORD dst_location)
void wined3d_fbo_blitter_create(struct wined3d_blitter **next, const struct wined3d_gl_info *gl_info)
static BOOL wined3d_texture_use_pbo(const struct wined3d_texture *texture, const struct wined3d_d3d_info *d3d_info)
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture)
struct wined3d_swapchain *CDECL wined3d_texture_get_swapchain(struct wined3d_texture *texture)
static bool is_full_clear(const struct wined3d_rendertarget_view *rtv, const RECT *draw_rect, const RECT *clear_rect)
void wined3d_texture_clear_dirty_regions(struct wined3d_texture *texture)
struct wined3d_texture *__cdecl wined3d_texture_from_resource(struct wined3d_resource *resource)
unsigned int CDECL wined3d_texture_get_lod(const struct wined3d_texture *texture)
static BOOL wined3d_texture_load_drawable(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context)
void wined3d_vk_swizzle_from_color_fixup(VkComponentMapping *mapping, struct color_fixup_desc fixup)
void wined3d_texture_gl_set_compatible_renderbuffer(struct wined3d_texture_gl *texture_gl, struct wined3d_context_gl *context_gl, unsigned int level, const struct wined3d_rendertarget_info *rt)
static void wined3d_texture_evict_sysmem(struct wined3d_texture *texture)
static BOOL wined3d_texture_vk_prepare_buffer_object(struct wined3d_texture_vk *texture_vk, unsigned int sub_resource_idx, struct wined3d_context_vk *context_vk)
static void wined3d_texture_gl_download_data_slow_path(struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, struct wined3d_context_gl *context_gl, const struct wined3d_bo_address *data)
static void texture_resource_preload(struct wined3d_resource *resource)
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)
static void wined3d_texture_dirty_region_add(struct wined3d_texture *texture, unsigned int layer, const struct wined3d_box *box)
enum VkImageLayout wined3d_layout_from_bind_mask(const struct wined3d_texture_vk *texture_vk, const uint32_t bind_mask)
static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context_gl *context_gl)
struct wined3d_shader_resource_view *CDECL wined3d_texture_acquire_identity_srv(struct wined3d_texture *texture)
HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, UINT layer, const struct wined3d_box *dirty_region)
HRESULT CDECL wined3d_texture_update_overlay(struct wined3d_texture *texture, unsigned int sub_resource_idx, const RECT *src_rect, struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const RECT *dst_rect, uint32_t flags)
static void wined3d_texture_set_dirty(struct wined3d_texture *texture)
static bool use_ffp_clear(const struct wined3d_texture *texture, unsigned int location)
void wined3d_texture_translate_drawable_coords(const struct wined3d_texture *texture, HWND window, RECT *rect)
void CDECL wined3d_texture_set_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops)
static void wined3d_texture_gl_upload_data(struct wined3d_context *context, const struct wined3d_const_bo_address *src_bo_addr, const struct wined3d_format *src_format, const struct wined3d_box *src_box, unsigned int src_row_pitch, unsigned int src_slice_pitch, struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, unsigned int dst_location, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z)
static DWORD ffp_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 *colour_key, enum wined3d_texture_filter_type filter, const struct wined3d_format *resolve_format)
bool wined3d_texture_validate_sub_resource_idx(const struct wined3d_texture *texture, unsigned int sub_resource_idx)
static BOOL wined3d_texture_gl_load_texture(struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, struct wined3d_context_gl *context_gl, BOOL srgb)
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain)
static void texture2d_depth_blt_fbo(const struct wined3d_device *device, 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)
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
void wined3d_gl_texture_swizzle_from_color_fixup(GLint swizzle[4], struct color_fixup_desc fixup)
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, uint32_t flags, const struct wined3d_color *colour, float depth, unsigned int stencil)
BOOL wined3d_texture_vk_prepare_texture(struct wined3d_texture_vk *texture_vk, struct wined3d_context_vk *context_vk)
static uint32_t wined3d_resource_access_from_location(uint32_t location)
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
static void wined3d_texture_vk_upload_data(struct wined3d_context *context, const struct wined3d_const_bo_address *src_bo_addr, const struct wined3d_format *src_format, const struct wined3d_box *src_box, unsigned int src_row_pitch, unsigned int src_slice_pitch, struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, unsigned int dst_location, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z)
static void wined3d_texture_no3d_download_data(struct wined3d_context *context, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, unsigned int src_location, const struct wined3d_box *src_box, const struct wined3d_bo_address *dst_bo_addr, const struct wined3d_format *dst_format, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, unsigned int dst_row_pitch, unsigned int dst_slice_pitch)
HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, unsigned int sub_resource_idx, void *mem, unsigned int pitch)
void wined3d_texture_cleanup(struct wined3d_texture *texture)
static const struct d3dfmt_alpha_fixup formats_src_alpha_fixup[]
ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture)
static void fbo_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context)
static const struct wined3d_resource_ops texture_resource_ops
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, uint32_t flags, const struct wined3d_color *colour, float depth, unsigned int stencil)
static enum wined3d_format_id wined3d_get_alpha_fixup_format(enum wined3d_format_id format_id, const struct wined3d_format *dst_format)
void wined3d_texture_vk_barrier(struct wined3d_texture_vk *texture_vk, struct wined3d_context_vk *context_vk, uint32_t bind_mask)
void wined3d_texture_gl_bind_and_dirtify(struct wined3d_texture_gl *texture_gl, struct wined3d_context_gl *context_gl, BOOL srgb)
static BOOL wined3d_texture_vk_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, uint32_t location)
void wined3d_texture_sub_resources_destroyed(struct wined3d_texture *texture)
static BOOL wined3d_texture_use_immutable_storage(const struct wined3d_texture *texture, const struct wined3d_gl_info *gl_info)
static void texture_resource_sub_resource_get_map_pitch(struct wined3d_resource *resource, unsigned int sub_resource_idx, unsigned int *row_pitch, unsigned int *slice_pitch)
static void wined3d_texture_gl_allocate_immutable_storage(struct wined3d_texture_gl *texture_gl, GLenum gl_internal_format, const struct wined3d_gl_info *gl_info)
void wined3d_texture_validate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, uint32_t location)
static bool vk_blitter_blit_supported(enum wined3d_blit_op op, const struct wined3d_context *context, const struct wined3d_resource *src_resource, const RECT *src_rect, const struct wined3d_resource *dst_resource, const RECT *dst_rect, const struct wined3d_format *resolve_format)
HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc)
static void wined3d_texture_set_map_binding(struct wined3d_texture *texture, DWORD map_binding)
static void cube_coords_float(const RECT *r, UINT w, UINT h, struct wined3d_rect_f *f)
static ULONG texture_resource_decref(struct wined3d_resource *resource)
static void wined3d_texture_create_dc(void *object)
static DWORD raw_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 *colour_key, enum wined3d_texture_filter_type filter, const struct wined3d_format *resolve_format)
void wined3d_raw_blitter_create(struct wined3d_blitter **next, const struct wined3d_gl_info *gl_info)
static bool blitter_use_cpu_clear(struct wined3d_rendertarget_view *view)
static const struct wined3d_blitter_ops ffp_blitter_ops
static void wined3d_fixup_alpha(const struct wined3d_format *format, const uint8_t *src, unsigned int src_row_pitch, uint8_t *dst, unsigned int dst_row_pitch, unsigned int width, unsigned int height)
HRESULT wined3d_texture_vk_init(struct wined3d_texture_vk *texture_vk, struct wined3d_device *device, const struct wined3d_resource_desc *desc, unsigned int layer_count, unsigned int level_count, uint32_t flags, void *parent, const struct wined3d_parent_ops *parent_ops)
static void gltexture_delete(struct wined3d_device *device, const struct wined3d_gl_info *gl_info, struct gl_texture *tex)
static const struct wined3d_blitter_ops vk_blitter_ops
static BOOL wined3d_texture_gl_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, uint32_t location)
static BOOL wined3d_texture_no3d_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, unsigned int location)
static void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *context, enum wined3d_texture_filter_type filter, 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_format *resolve_format)
static void vk_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context)
BOOL wined3d_texture_can_use_pbo(const struct wined3d_texture *texture, const struct wined3d_d3d_info *d3d_info)
HRESULT wined3d_texture_no3d_init(struct wined3d_texture *texture_no3d, struct wined3d_device *device, const struct wined3d_resource_desc *desc, unsigned int layer_count, unsigned int level_count, uint32_t flags, void *parent, const struct wined3d_parent_ops *parent_ops)
static struct wined3d_texture_sub_resource * wined3d_texture_get_sub_resource(struct wined3d_texture *texture, unsigned int sub_resource_idx)
static void wined3d_texture_destroy_object(void *object)
UINT CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
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)
const VkDescriptorImageInfo * wined3d_texture_vk_get_default_image_info(struct wined3d_texture_vk *texture_vk, struct wined3d_context_vk *context_vk)
BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, unsigned int location)
static void vk_blitter_clear_rendertargets(struct wined3d_context_vk *context_vk, 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)
void texture2d_get_blt_info(const struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, const RECT *rect, struct wined3d_blt_info *info)
static void ffp_blitter_clear_rendertargets(struct wined3d_device *device, unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rect, const RECT *draw_rect, uint32_t flags, const struct wined3d_color *colour, float depth, unsigned int stencil)
static ULONG texture_resource_incref(struct wined3d_resource *resource)
void wined3d_texture_gl_prepare_texture(struct wined3d_texture_gl *texture_gl, struct wined3d_context_gl *context_gl, BOOL srgb)
static void wined3d_texture_gl_download_data(struct wined3d_context *context, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, unsigned int src_location, const struct wined3d_box *src_box, const struct wined3d_bo_address *dst_bo_addr, const struct wined3d_format *dst_format, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, unsigned int dst_row_pitch, unsigned int dst_slice_pitch)
static const struct wined3d_texture_ops wined3d_texture_vk_ops
static void raw_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context)
static HRESULT texture_resource_sub_resource_get_desc(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_sub_resource_desc *desc)
static void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, struct wined3d_bo_address *data)
static void wined3d_texture_no3d_unload_location(struct wined3d_texture *texture, struct wined3d_context *context, unsigned int location)
void wined3d_vk_blitter_create(struct wined3d_blitter **next)
HRESULT CDECL wined3d_device_context_blt(struct wined3d_device_context *context, struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const RECT *dst_rect, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const RECT *src_rect, unsigned int flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
HRESULT CDECL wined3d_texture_set_overlay_position(struct wined3d_texture *texture, unsigned int sub_resource_idx, LONG x, LONG y)
void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl, struct wined3d_context_gl *context_gl, BOOL srgb)
void wined3d_texture_update_sub_resource(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, const struct upload_bo *upload_bo, const struct wined3d_box *box, unsigned int row_pitch, unsigned int slice_pitch)
static void wined3d_texture_gl_upload_bo(const struct wined3d_format *src_format, GLenum target, unsigned int level, unsigned int src_row_pitch, unsigned int src_slice_pitch, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, unsigned int update_w, unsigned int update_h, unsigned int update_d, const BYTE *addr, BOOL srgb, struct wined3d_texture *dst_texture, const struct wined3d_gl_info *gl_info)
static void ffp_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context)
void wined3d_texture_gl_apply_sampler_desc(struct wined3d_texture_gl *texture_gl, const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_context_gl *context_gl)
static BOOL wined3d_texture_gl_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, unsigned int location)
static bool wined3d_texture_vk_clear(struct wined3d_texture_vk *texture_vk, unsigned int sub_resource_idx, struct wined3d_context *context)
static void wined3d_texture_gl_prepare_buffer_object(struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, struct wined3d_context_gl *context_gl)
void wined3d_ffp_blitter_create(struct wined3d_blitter **next, const struct wined3d_gl_info *gl_info)
static void wined3d_texture_gl_prepare_rb(struct wined3d_texture_gl *texture_gl, const struct wined3d_gl_info *gl_info, BOOL multisample)
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)
static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, unsigned int layer_count, unsigned int level_count, uint32_t flags, struct wined3d_device *device, void *parent, const struct wined3d_parent_ops *parent_ops, void *sub_resources, const struct wined3d_texture_ops *texture_ops)
BOOL wined3d_texture_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, uint32_t location)
void wined3d_texture_load(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
unsigned int CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, unsigned int lod)
static const struct wined3d_blitter_ops raw_blitter_ops
static const struct wined3d_texture_ops texture_gl_ops
void wined3d_texture_get_bo_address(const struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_bo_address *data, uint32_t location)
static void wined3d_texture_gl_unload_location(struct wined3d_texture *texture, struct wined3d_context *context, unsigned int location)
static void wined3d_texture_vk_unload_location(struct wined3d_texture *texture, struct wined3d_context *context, unsigned int location)
static void wined3d_texture_force_reload(struct wined3d_texture *texture)
static void wined3d_texture_gl_allocate_mutable_storage(struct wined3d_texture_gl *texture_gl, GLenum gl_internal_format, const struct wined3d_format_gl *format, const struct wined3d_gl_info *gl_info)
static void texture_resource_unload(struct wined3d_resource *resource)
static void wined3d_texture_destroy_dc(void *object)
static void wined3d_texture_set_bo(struct wined3d_texture *texture, unsigned sub_resource_idx, struct wined3d_context *context, struct wined3d_bo *bo)
static BOOL wined3d_texture_vk_load_texture(struct wined3d_texture_vk *texture_vk, unsigned int sub_resource_idx, struct wined3d_context *context)
static void wined3d_texture_vk_download_data(struct wined3d_context *context, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, unsigned int src_location, const struct wined3d_box *src_box, const struct wined3d_bo_address *dst_bo_addr, const struct wined3d_format *dst_format, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, unsigned int dst_row_pitch, unsigned int dst_slice_pitch)
static void wined3d_texture_unload_location(struct wined3d_texture *texture, struct wined3d_context *context, unsigned int location)
void wined3d_texture_vk_make_generic(struct wined3d_texture_vk *texture_vk, struct wined3d_context_vk *context_vk)
static const uint32_t wined3d_texture_sysmem_locations
static bool gl_formats_compatible(struct wined3d_texture *src_texture, DWORD src_location, struct wined3d_texture *dst_texture, DWORD dst_location)
static BOOL wined3d_texture_no3d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, uint32_t location)
#define WINED3D_TEXTURE_DYNAMIC_MAP_THRESHOLD
static void wined3d_texture_cleanup_sync(struct wined3d_texture *texture)
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 * wined3d_debug_bind_flags(uint32_t bind_flags)
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)
UINT wined3d_format_calculate_size(const struct wined3d_format *format, UINT alignment, UINT width, UINT height, UINT depth)
const char * wined3d_debug_resource_access(uint32_t access)
const char * debug_const_bo_address(const struct wined3d_const_bo_address *address)
const char * wined3d_debug_vkresult(VkResult vr)
const char * debug_d3dresourcetype(enum wined3d_resource_type resource_type)
void wined3d_format_copy_data(const struct wined3d_format *format, const uint8_t *src, unsigned int src_row_pitch, unsigned int src_slice_pitch, uint8_t *dst, unsigned int dst_row_pitch, unsigned int dst_slice_pitch, unsigned int w, unsigned int h, unsigned int d)
const struct wined3d_format * wined3d_get_format(const struct wined3d_adapter *adapter, enum wined3d_format_id format_id, unsigned int bind_flags)
BOOL wined3d_array_reserve(void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size)
const char * debug_bo_address(const struct wined3d_bo_address *address)
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)
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)
void wined3d_format_colour_to_vk(const struct wined3d_format *format, const struct wined3d_color *c, VkClearColorValue *retval)
const char * debug_color(const struct wined3d_color *color)
HRESULT CDECL wined3d_shader_resource_view_create(const struct wined3d_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader_resource_view **view)
void wined3d_rendertarget_view_prepare_location(struct wined3d_rendertarget_view *view, struct wined3d_context *context, uint32_t location)
VkImageViewType vk_image_view_type_from_wined3d(enum wined3d_resource_type type, uint32_t flags)
void wined3d_rendertarget_view_load_location(struct wined3d_rendertarget_view *view, struct wined3d_context *context, uint32_t location)
void wined3d_rendertarget_view_validate_location(struct wined3d_rendertarget_view *view, uint32_t location)
void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarget_view *view, const struct wined3d_context *context, unsigned int *width, unsigned int *height)
void wined3d_rendertarget_view_invalidate_location(struct wined3d_rendertarget_view *view, uint32_t location)
void wined3d_shader_resource_view_destroy(struct wined3d_shader_resource_view *view)
ULONG CDECL wined3d_shader_resource_view_decref(struct wined3d_shader_resource_view *view)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#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
static void depth_stencil(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y
#define GL_TEXTURE_MIN_FILTER
#define GL_TEXTURE_BORDER_COLOR
#define GL_TEXTURE_WRAP_R
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)
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
#define GL_TEXTURE_MAX_LEVEL
GLAPI void GLAPIENTRY glGetCompressedTexImage(GLenum target, GLint lod, GLvoid *img)
GLint GLint GLint GLint GLint GLint y
GLAPI void GLAPIENTRY glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
#define GL_COLOR_BUFFER_BIT
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z
#define GL_UNPACK_IMAGE_HEIGHT
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
#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
GLAPI void GLAPIENTRY glCompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data)
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)
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X
#define GL_DEPTH_BUFFER_BIT
#define GL_UNPACK_ROW_LENGTH
#define GL_SKIP_DECODE_EXT
#define GL_DEPTH_TEXTURE_MODE_ARB
GLsizei const GLint * locations
#define GL_COLOR_ATTACHMENT0
#define GL_SCALED_RESOLVE_NICEST_EXT
#define GL_TEXTURE_SRGB_DECODE_EXT
GLdouble GLdouble GLdouble GLdouble top
#define GL_TEXTURE_CUBE_MAP_ARB
GLboolean GLboolean GLboolean b
#define GL_TEXTURE_SWIZZLE_RGBA
#define GL_STENCIL_TEST_TWO_SIDE_EXT
#define GL_PIXEL_PACK_BUFFER
#define GL_TEXTURE_1D_ARRAY
#define GL_SCALED_RESOLVE_FASTEST_EXT
#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY
GLenum const GLvoid * addr
GLenum GLenum GLenum GLenum mapping
#define GL_TEXTURE_2D_MULTISAMPLE
GLenum GLuint GLint GLint layer
#define GL_READ_FRAMEBUFFER
#define GL_TEXTURE_COMPARE_MODE_ARB
#define GL_TEXTURE_2D_ARRAY
#define GL_TEXTURE_LOD_BIAS_EXT
GLubyte GLubyte GLubyte GLubyte w
GLsizeiptr const GLvoid GLenum usage
GLint GLfloat GLint stencil
#define GL_COMPARE_R_TO_TEXTURE_ARB
GLfloat GLfloat GLfloat GLfloat h
#define GL_PIXEL_UNPACK_BUFFER
#define GL_TEXTURE_FILTER_CONTROL_EXT
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 flag
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 location(file, line)
#define memcpy(s1, s2, n)
struct task_struct * current
D3D11_SHADER_VARIABLE_DESC desc
static const char * dst_format
static IHTMLWindow2 * window
static void create_dib(STGMEDIUM *med)
static float(__cdecl *square_half_float)(float x
static unsigned int delay_count
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
BOOL WINAPI SetRectEmpty(_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 __int64 next
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
VkAccessFlags srcAccessMask
VkAccessFlags dstAccessMask
uint32_t srcQueueFamilyIndex
uint32_t dstQueueFamilyIndex
VkImageLayout imageLayout
const VkImageView * pAttachments
VkFramebufferCreateFlags flags
VkImageSubresourceLayers srcSubresource
VkImageSubresourceLayers dstSubresource
VkImageSubresourceLayers dstSubresource
VkImageSubresourceLayers srcSubresource
VkImageAspectFlags aspectMask
VkImageAspectFlags aspectMask
VkImageSubresourceRange subresourceRange
VkComponentMapping components
VkImageViewCreateFlags flags
const VkClearValue * pClearValues
enum wined3d_format_id format_id conv_format_id
struct wined3d_sampler_desc sampler_desc
struct wined3d_const_bo_address addr
struct wined3d_gl_info gl_info
struct wined3d_blitter * next
const struct wined3d_blitter_ops * ops
struct wined3d_bo * buffer_object
enum wined3d_format_id dst_format
void(* convert)(const BYTE *src, unsigned int src_pitch, BYTE *dst, unsigned int dst_pitch, unsigned int width, unsigned int height, const struct wined3d_color_key *colour_key)
struct wined3d_bo * buffer_object
const struct wined3d_gl_info * gl_info
struct wined3d_command_buffer_vk current_command_buffer
const struct wined3d_vk_info * vk_info
unsigned int sub_resource_idx
struct wined3d_d3d_limits limits
uint32_t unconditional_npot
const struct wined3d_device_parent_ops * ops
struct wined3d_vk_info vk_info
struct wined3d_context_vk context_vk
struct wined3d_rendertarget_view * depth_stencil
struct wined3d_rendertarget_view * render_targets[WINED3D_MAX_RENDER_TARGETS]
BOOL supported[WINED3D_GL_EXT_COUNT]
struct opengl_funcs gl_ops
struct wined3d_fbo_ops fbo_ops
GLint wrap_lookup[WINED3D_TADDRESS_MIRROR_ONCE - WINED3D_TADDRESS_WRAP+1]
unsigned int sub_resource_idx
struct wined3d_resource * resource
struct wined3d_resource * resource
const struct wined3d_format * format
unsigned int sub_resource_idx
unsigned int format_attrs
const struct wined3d_parent_ops * parent_ops
enum wined3d_resource_type type
struct wined3d_device * device
const struct wined3d_format * format
struct wined3d_texture ** back_buffers
struct wined3d_texture * front_buffer
const struct wined3d_parent_ops * parent_ops
struct list renderbuffers
const struct wined3d_renderbuffer_entry * current_renderbuffer
struct gl_texture texture_rgb texture_srgb
unsigned int sub_resource_idx
struct wined3d_texture * texture
struct wined3d_image_vk image
VkDescriptorImageInfo default_image_info
enum VkImageLayout layout
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_dirty_regions * dirty_regions
VkClearDepthStencilValue depthStencil
VkFlags VkPipelineStageFlags
@ VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
@ VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
@ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
@ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
@ VK_IMAGE_LAYOUT_UNDEFINED
@ VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
@ VK_IMAGE_LAYOUT_GENERAL
#define VK_REMAINING_MIP_LEVELS
@ VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT
VkFlags VkImageAspectFlags
void VKAPI_CALL vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, VkSubpassContents contents)
VkFlags VkImageUsageFlags
@ VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT
@ VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
@ VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT
void VKAPI_CALL vkCmdEndRenderPass(VkCommandBuffer commandBuffer)
@ VK_IMAGE_USAGE_TRANSFER_DST_BIT
@ VK_IMAGE_USAGE_SAMPLED_BIT
@ VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
@ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
@ VK_IMAGE_USAGE_TRANSFER_SRC_BIT
@ VK_IMAGE_USAGE_STORAGE_BIT
VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFramebuffer *pFramebuffer)
void VKAPI_CALL vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy *pRegions)
void VKAPI_CALL vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy *pRegions)
@ VK_COMPONENT_SWIZZLE_ONE
@ VK_COMPONENT_SWIZZLE_IDENTITY
@ VK_COMPONENT_SWIZZLE_ZERO
void VKAPI_CALL vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue *pColor, uint32_t rangeCount, const VkImageSubresourceRange *pRanges)
void VKAPI_CALL vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy *pRegions)
@ VK_BUFFER_USAGE_TRANSFER_DST_BIT
@ VK_BUFFER_USAGE_TRANSFER_SRC_BIT
VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImageView *pView)
@ VK_ACCESS_HOST_READ_BIT
@ VK_ACCESS_TRANSFER_WRITE_BIT
@ VK_ACCESS_TRANSFER_READ_BIT
void VKAPI_CALL vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve *pRegions)
@ VK_SUBPASS_CONTENTS_INLINE
void VKAPI_CALL vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue *pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange *pRanges)
#define VK_REMAINING_ARRAY_LAYERS
@ VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT
@ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT
@ VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT
@ VK_PIPELINE_STAGE_HOST_BIT
@ VK_PIPELINE_STAGE_TRANSFER_BIT
void VKAPI_CALL vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers)
#define VK_QUEUE_FAMILY_IGNORED
@ VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
@ VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
@ VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
@ VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
#define GL_CLIENT_STORAGE_BIT
#define GL_TEXTURE_MAX_ANISOTROPY
DWORD WINAPI GetCurrentThreadId(void)
NTSTATUS WINAPI D3DKMTDestroyDCFromMemory(const D3DKMT_DESTROYDCFROMMEMORY *desc)
NTSTATUS WINAPI D3DKMTCreateDCFromMemory(D3DKMT_CREATEDCFROMMEMORY *desc)
const struct wined3d_parent_ops wined3d_null_parent_ops
UINT64 adapter_adjust_memory(struct wined3d_adapter *adapter, INT64 amount)
#define WINED3D_STANDARD_MULTISAMPLE_PATTERN
#define WINED3D_CKEY_DST_BLT
#define WINED3DCLEAR_TARGET
#define WINED3D_TEXTURE_CREATE_DISCARD
@ WINED3D_MULTISAMPLE_NON_MASKABLE
@ WINED3D_MULTISAMPLE_NONE
#define WINED3D_MAP_NO_DIRTY_UPDATE
#define WINED3D_CKEY_SRC_OVERLAY
#define WINED3DUSAGE_OWNDC
#define WINED3DUSAGE_LEGACY_CUBEMAP
#define WINEDDERR_OVERLAYNOTVISIBLE
#define WINED3D_RESOURCE_ACCESS_GPU
#define WINED3D_RESOURCE_ACCESS_CPU
@ WINED3D_RTYPE_TEXTURE_2D
@ WINED3D_RTYPE_TEXTURE_1D
@ WINED3D_RTYPE_TEXTURE_3D
#define WINED3D_VIEW_TEXTURE_ARRAY
#define WINED3D_MAX_VIEWPORTS
#define WINED3D_MAX_RENDER_TARGETS
#define WINED3D_BIND_UNORDERED_ACCESS
#define WINED3DERR_NOTAVAILABLE
wined3d_texture_filter_type
#define WINED3D_CKEY_SRC_BLT
#define WINED3D_TEXTURE_CREATE_RECORD_DIRTY_REGIONS
#define WINED3D_VIEW_FORWARD_REFERENCE
#define WINED3DUSAGE_OVERLAY
#define WINED3D_BIND_SHADER_RESOURCE
#define WINED3DUSAGE_VIDMEM_ACCOUNTING
#define WINEDDERR_NOTLOCKED
@ WINED3DFMT_B4G4R4A4_UNORM
@ WINED3DFMT_B8G8R8A8_UNORM
@ WINED3DFMT_B8G8R8X8_UNORM
@ WINED3DFMT_B5G5R5X1_UNORM
@ WINED3DFMT_B5G5R5A1_UNORM
@ WINED3DFMT_B4G4R4X4_UNORM
#define WINED3D_BIND_DEPTH_STENCIL
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 WINED3DUSAGE_MANAGED
#define WINED3D_MAP_DISCARD
#define WINED3D_MAP_WRITE
#define WINED3DUSAGE_SCRATCH
#define WINED3DCLEAR_ZBUFFER
#define WINED3D_CKEY_DST_OVERLAY
#define WINED3D_BIND_RENDER_TARGET
#define WINED3DUSAGE_DYNAMIC
#define WINEDDERR_SURFACEBUSY
#define WINED3DERR_INVALIDCALL
#define WINED3D_TEXTURE_CREATE_GET_DC
#define WINED3D_TEXTURE_CREATE_GET_DC_LENIENT
#define WINED3D_SRGB_READ_WRITE_CONTROL
#define WINEDDERR_NOTAOVERLAYSURFACE
#define WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS
static GLenum wined3d_texture_gl_get_sub_resource_target(const struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx)
@ ARB_TEXTURE_FILTER_ANISOTROPIC
@ EXT_TEXTURE_SRGB_DECODE
@ ARB_TEXTURE_MULTISAMPLE
@ WINED3D_GL_LEGACY_CONTEXT
static GLenum wined3d_gl_mag_filter(enum wined3d_texture_filter_type mag_filter)
static bool wined3d_texture_gl_is_multisample_location(const struct wined3d_texture_gl *texture_gl, uint32_t location)
static void wined3d_context_gl_reference_bo(struct wined3d_context_gl *context_gl, struct wined3d_bo_gl *bo_gl)
static struct gl_texture * wined3d_texture_gl_get_gl_texture(struct wined3d_texture_gl *texture_gl, bool srgb)
static GLuint wined3d_gl_get_internal_format(struct wined3d_resource *resource, const struct wined3d_format_gl *format_gl, bool srgb)
#define WINED3D_QUIRK_FBO_TEX_UPDATE
static GLenum wined3d_gl_min_mip_filter(enum wined3d_texture_filter_type min_filter, enum wined3d_texture_filter_type mip_filter)
static GLuint wined3d_texture_gl_get_texture_name(const struct wined3d_texture_gl *texture_gl, const struct wined3d_context *context, bool srgb)
void WINAPI wined3d_mutex_unlock(void)
void WINAPI wined3d_mutex_lock(void)
#define WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB
static BOOL wined3d_format_is_typeless(const struct wined3d_format *format)
#define STATE_DEPTH_STENCIL
static unsigned int wined3d_texture_get_level_height(const struct wined3d_texture *texture, unsigned int level)
#define UPLOAD_BO_RENAME_ON_UNMAP
#define WINED3D_TEXTURE_GENERATE_MIPMAPS
#define WINED3D_FORMAT_ATTR_HEIGHT_SCALE
static BOOL is_scaling_fixup(struct color_fixup_desc fixup)
#define WINED3D_TEXTURE_GET_DC_LENIENT
#define WINED3D_LOCATION_TEXTURE_SRGB
#define STATE_GRAPHICS_SHADER_RESOURCE_BINDING
#define WINED3D_LOCATION_SYSMEM
#define WINED3D_TEXTURE_DOWNLOADABLE
static void wined3d_cs_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id queue_id)
#define WINED3D_TEXTURE_RGB_ALLOCATED
#define WINED3D_FORMAT_CAP_DECOMPRESS
static unsigned int wined3d_texture_get_level_width(const struct wined3d_texture *texture, unsigned int level)
#define WINED3D_FORMAT_CAP_TEXTURE
#define WINED3D_TEXTURE_RGB_VALID
static void wined3d_resource_wait_idle(const struct wined3d_resource *resource)
#define WINED3D_TEXTURE_COND_NP2
static bool wined3d_texture_is_full_rect(const struct wined3d_texture *texture, unsigned int level, const RECT *r)
#define WINED3D_LOCATION_BUFFER
#define WINED3D_FORMAT_ATTR_BROKEN_PITCH
static BOOL is_complex_fixup(struct color_fixup_desc fixup)
#define WINED3D_LOCATION_RB_RESOLVED
#define WINED3D_FORMAT_ATTR_COMPRESSED
static void context_release(struct wined3d_context *context)
#define RESOURCE_ALIGNMENT
static void wined3d_colour_srgb_from_linear(struct wined3d_color *colour_srgb, const struct wined3d_color *colour)
static BOOL can_use_texture_swizzle(const struct wined3d_d3d_info *d3d_info, const struct wined3d_format *format)
static uint32_t wined3d_mask_from_size(unsigned int size)
#define WINED3D_TEXTURE_SRGB_ALLOCATED
#define WINED3D_TEXTURE_CONVERTED
#define WINED3D_TEXTURE_GET_DC
#define WINED3D_FORMAT_CAP_FBO_ATTACHABLE
static BOOL is_identity_fixup(struct color_fixup_desc fixup)
#define STATE_COMPUTE_SHADER_RESOURCE_BINDING
@ WINED3D_GL_RES_TYPE_TEX_2D
#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_TEXTURE_SRGB_VALID
static BOOL needs_separate_srgb_gl_texture(const struct wined3d_context *context, const struct wined3d_texture *texture)
#define WINED3D_TEXTURE_DC_IN_USE
#define WINED3D_FORMAT_CAP_DEPTH_STENCIL
static BOOL needs_srgb_write(const struct wined3d_d3d_info *d3d_info, const struct wined3d_state *state, const struct wined3d_fb_state *fb)
#define WINED3D_LOCATION_DRAWABLE
#define WINED3D_TEXTURE_DISCARD
#define WINED3D_MAX_DIRTY_REGION_COUNT
#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)
static void wined3d_context_destroy_bo(struct wined3d_context *context, struct wined3d_bo *bo)
#define WINED3D_LOCATION_RB_MULTISAMPLE
#define WINED3D_FORMAT_ATTR_BLOCKS
static struct wined3d_context * context_acquire(struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
@ WINED3D_CS_QUEUE_DEFAULT
static void wined3d_context_copy_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *dst, const struct wined3d_bo_address *src, unsigned int range_count, const struct wined3d_range *ranges, uint32_t map_flags)
#define WINED3D_FORMAT_CAP_GEN_MIPMAP
static unsigned int wined3d_popcount(unsigned int x)
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
@ WINED3D_BLIT_OP_RAW_BLIT
@ WINED3D_BLIT_OP_DEPTH_BLIT
@ WINED3D_BLIT_OP_COLOR_BLIT
#define WINED3D_TEXTURE_IS_SRGB
static unsigned int wined3d_texture_get_level_depth(const struct wined3d_texture *texture, unsigned int level)
static const uint32_t WINED3D_READ_ONLY_BIND_MASK
static void wined3d_context_vk_reference_image(const struct wined3d_context_vk *context_vk, struct wined3d_image_vk *image)
static VkImageAspectFlags vk_aspect_mask_from_format(const struct wined3d_format *format)
static void wined3d_context_vk_reference_texture(const struct wined3d_context_vk *context_vk, struct wined3d_texture_vk *texture_vk)
static void wined3d_context_vk_reference_rendertarget_view(const struct wined3d_context_vk *context_vk, struct wined3d_rendertarget_view_vk *rtv_vk)
static VkImageView wined3d_rendertarget_view_vk_get_image_view(struct wined3d_rendertarget_view_vk *rtv_vk, struct wined3d_context_vk *context_vk)
static void wined3d_context_vk_reference_bo(const struct wined3d_context_vk *context_vk, struct wined3d_bo_vk *bo)
static void wined3d_rendertarget_view_vk_barrier(struct wined3d_rendertarget_view_vk *rtv_vk, struct wined3d_context_vk *context_vk, uint32_t bind_mask)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI DeleteDC(_In_ HDC)