ReactOS 0.4.17-dev-966-gf06eace
resource.c
Go to the documentation of this file.
1/*
2 * Copyright 2002-2004 Jason Edmeades
3 * Copyright 2003-2004 Raphael Junqueira
4 * Copyright 2004 Christian Costa
5 * Copyright 2005 Oliver Stieber
6 * Copyright 2009-2010 Henri Verbeet for CodeWeavers
7 * Copyright 2006-2008, 2013 Stefan Dösinger for CodeWeavers
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include "wined3d_private.h"
25#include "wined3d_gl.h"
26#include "wined3d_vk.h"
27
30
31static void resource_check_usage(uint32_t usage, unsigned int access)
32{
33 static const uint32_t handled = WINED3DUSAGE_DYNAMIC
40 | ~WINED3DUSAGE_MASK;
41
42 /* Write-only CPU access is supposed to result in write-combined mappings
43 * being returned. OpenGL doesn't give us explicit control over that, but
44 * the hints and access flags we set for typical access patterns on
45 * dynamic resources should in theory have the same effect on the OpenGL
46 * driver. */
47
48 if (usage & ~handled)
49 FIXME("Unhandled usage flags %#x.\n", usage & ~handled);
51 WARN_(d3d_perf)("WINED3DUSAGE_DYNAMIC used with WINED3D_RESOURCE_ACCESS_MAP_R.\n");
52}
53
56 enum wined3d_multisample_type multisample_type, unsigned int multisample_quality, uint32_t usage,
57 unsigned int bind_flags, unsigned int access, unsigned int width, unsigned int height, unsigned int depth,
58 unsigned int size, void *parent, const struct wined3d_parent_ops *parent_ops,
59 const struct wined3d_resource_ops *resource_ops)
60{
63 unsigned int i;
64
65 static const struct
66 {
68 DWORD cube_usage;
69 enum wined3d_gl_resource_type gl_type;
70 }
71 resource_types[] =
72 {
79 };
80
82
84 {
85 ERR("Trying to create a scratch resource with access flags %s.\n",
88 }
89
91 {
93 {
94 WARN("Bind flags %s are incompatible with resource access %s.\n",
97 }
98
99 /* Dynamic and managed usages are incompatible with GPU writes. */
101 {
102 WARN("Bind flags %s are incompatible with resource usage %s.\n",
105 }
106 }
107
108 if (!size)
109 ERR("Attempting to create a zero-sized resource.\n");
110
111 for (i = 0; i < ARRAY_SIZE(resource_types); ++i)
112 {
113 if (resource_types[i].type != type
114 || resource_types[i].cube_usage != (usage & WINED3DUSAGE_LEGACY_CUBEMAP))
115 continue;
116
117 gl_type = resource_types[i].gl_type;
118 if (base_type == WINED3D_GL_RES_TYPE_COUNT)
119 base_type = gl_type;
120
122 break;
123
124 if ((bind_flags & WINED3D_BIND_RENDER_TARGET)
125 && !(format->caps[gl_type] & WINED3D_FORMAT_CAP_RENDERTARGET))
126 {
127 WARN("Format %s cannot be used for render targets.\n", debug_d3dformat(format->id));
128 continue;
129 }
130 if ((bind_flags & WINED3D_BIND_DEPTH_STENCIL)
131 && !(format->caps[gl_type] & WINED3D_FORMAT_CAP_DEPTH_STENCIL))
132 {
133 WARN("Format %s cannot be used for depth/stencil buffers.\n", debug_d3dformat(format->id));
134 continue;
135 }
136 if ((bind_flags & WINED3D_BIND_SHADER_RESOURCE)
137 && !(format->caps[gl_type] & WINED3D_FORMAT_CAP_TEXTURE))
138 {
139 WARN("Format %s cannot be used for texturing.\n", debug_d3dformat(format->id));
140 continue;
141 }
142 break;
143 }
144
145 if (base_type != WINED3D_GL_RES_TYPE_COUNT && i == ARRAY_SIZE(resource_types))
146 {
148 {
149 /* Needed for proper format information. */
150 gl_type = base_type;
151 }
152 else
153 {
154 WARN("Did not find a suitable GL resource type for resource type %s.\n",
157 }
158 }
159
160 if (base_type != WINED3D_GL_RES_TYPE_COUNT
163 {
164 UINT width_mask = format->block_width - 1;
165 UINT height_mask = format->block_height - 1;
166 if (width & width_mask || height & height_mask)
168 }
169
170 resource->ref = 1;
171 resource->device = device;
172 resource->type = type;
173 resource->gl_type = gl_type;
174 resource->format = format;
175 resource->format_attrs = format->attrs;
176 if (gl_type < WINED3D_GL_RES_TYPE_COUNT)
177 resource->format_caps = format->caps[gl_type];
178 resource->multisample_type = multisample_type;
179 resource->multisample_quality = multisample_quality;
180 resource->usage = usage;
181 resource->bind_flags = bind_flags;
182 if (resource->format_attrs & WINED3D_FORMAT_ATTR_MAPPABLE)
184 resource->access = access;
185 resource->width = width;
186 resource->height = height;
187 resource->depth = depth;
188 resource->size = size;
189 resource->priority = 0;
190 resource->parent = parent;
191 resource->parent_ops = parent_ops;
192 resource->resource_ops = resource_ops;
193 resource->map_binding = WINED3D_LOCATION_SYSMEM;
194 resource->heap_pointer = NULL;
195 resource->heap_memory = NULL;
196
197 /* Check that we have enough video ram left */
199 {
201 {
202 ERR("Out of adapter memory.\n");
204 }
206 }
207
208 if (!(usage & WINED3DUSAGE_CS))
210
211 return WINED3D_OK;
212}
213
214static void wined3d_resource_destroy_object(void *object)
215{
217
218 TRACE("resource %p.\n", resource);
219
222}
223
225{
226 TRACE("Cleaning up resource %p.\n", resource);
227
229 {
230 TRACE("Decrementing device memory pool by %u.\n", resource->size);
231 adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size);
232 }
233
234 if (!(resource->usage & WINED3DUSAGE_CS))
236
239}
240
242{
243 if (resource->map_count)
244 ERR("Resource %p is being unloaded while mapped.\n", resource);
245}
246
248{
249 unsigned int prev;
250
251 if (!(resource->usage & WINED3DUSAGE_MANAGED))
252 {
253 WARN("Called on non-managed resource %p, ignoring.\n", resource);
254 return 0;
255 }
256
257 prev = resource->priority;
258 resource->priority = priority;
259 TRACE("resource %p, new priority %u, returning old priority %u.\n", resource, priority, prev);
260 return prev;
261}
262
264{
265 TRACE("resource %p, returning %u.\n", resource, resource->priority);
266 return resource->priority;
267}
268
270{
271 return resource->parent;
272}
273
275{
276 resource->parent = parent;
277 resource->parent_ops = parent_ops;
278}
279
281{
282 desc->resource_type = resource->type;
283 desc->format = resource->format->id;
284 desc->multisample_type = resource->multisample_type;
285 desc->multisample_quality = resource->multisample_quality;
286 desc->usage = resource->usage;
287 desc->bind_flags = resource->bind_flags;
288 desc->access = resource->access;
289 desc->width = resource->width;
290 desc->height = resource->height;
291 desc->depth = resource->depth;
292 desc->size = resource->size;
293}
294
295HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx,
296 struct wined3d_map_desc *map_desc, const struct wined3d_box *box, uint32_t flags)
297{
298 TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %s, flags %#x.\n",
299 resource, sub_resource_idx, map_desc, debug_box(box), flags);
300
301 return wined3d_device_context_map(&resource->device->cs->c, resource, sub_resource_idx, map_desc, box, flags);
302}
303
304HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
305{
306 TRACE("resource %p, sub_resource_idx %u.\n", resource, sub_resource_idx);
307
308 return wined3d_device_context_unmap(&resource->device->cs->c, resource, sub_resource_idx);
309}
310
312{
314}
315
317{
318 /* Overallocate and add padding to the allocated pointer, to guard against
319 * games (for instance Railroad Tycoon 2) writing before the locked resource
320 * memory pointer.
321 */
322 static const SIZE_T align = RESOURCE_ALIGNMENT;
323 void *mem;
324
325 if (!(mem = calloc(1, resource->size + align)))
326 {
327 ERR("Failed to allocate system memory.\n");
328 return FALSE;
329 }
330
331 resource->heap_memory = (void *)(((ULONG_PTR)mem + align) & ~(RESOURCE_ALIGNMENT - 1));
332 resource->heap_pointer = mem;
333
334 return TRUE;
335}
336
338{
339 if (resource->heap_memory)
340 return TRUE;
341
343}
344
346{
347 if (!resource->heap_memory)
348 return;
349 resource->heap_memory = NULL;
350
351 free(resource->heap_pointer);
352 resource->heap_pointer = NULL;
353}
354
356{
357 uint32_t access = resource->access;
358 GLbitfield flags = 0;
359
360 if (resource->usage & WINED3DUSAGE_DYNAMIC)
363 {
368 }
369
370 return flags;
371}
372
374{
375 GLbitfield ret = 0;
376
377 if (d3d_flags & WINED3D_MAP_WRITE)
378 {
380 if (!bo->b.coherent)
382 }
383 if (d3d_flags & WINED3D_MAP_READ)
385 else
387
388 return ret;
389}
390
392{
393 switch (d3d_flags & (WINED3D_MAP_READ | WINED3D_MAP_WRITE))
394 {
395 case WINED3D_MAP_READ:
396 return GL_READ_ONLY_ARB;
397
399 return GL_WRITE_ONLY_ARB;
400
401 default:
402 return GL_READ_WRITE_ARB;
403 }
404}
405
407{
408 struct wined3d_swapchain *swapchain;
409
410 /* Only 2D texture resources can be onscreen. */
412 return TRUE;
413
414 /* Not on a swapchain - must be offscreen */
415 if (!(swapchain = texture_from_resource(resource)->swapchain))
416 return TRUE;
417
418 /* The front buffer is always onscreen */
419 if (resource == &swapchain->front_buffer->resource)
420 return FALSE;
421
422 return TRUE;
423}
424
426{
427 const struct wined3d_d3d_info *d3d_info = &resource->device->adapter->d3d_info;
428
430 {
431 resource->draw_binding = WINED3D_LOCATION_DRAWABLE;
432 }
433 else if (resource->multisample_type)
434 {
435 resource->draw_binding = d3d_info->multisample_draw_location;
436 }
437 else if (resource->gl_type == WINED3D_GL_RES_TYPE_RB)
438 {
440 }
441 else
442 {
444 }
445}
446
448{
449 const struct wined3d_adapter *adapter = resource->device->adapter;
451 && !(adapter->d3d_info.wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL))
454}
455
457{
458 const struct wined3d_format *format = resource->format;
459
460 /* TODO: NVIDIA expose their Coverage Sample Anti-Aliasing (CSAA)
461 * feature through type == MULTISAMPLE_XX and quality != 0. This could
462 * be mapped to GL_NV_framebuffer_multisample_coverage.
463 *
464 * AMD have a similar feature called Enhanced Quality Anti-Aliasing
465 * (EQAA), but it does not have an equivalent OpenGL extension. */
466
467 /* We advertise as many WINED3D_MULTISAMPLE_NON_MASKABLE quality
468 * levels as the count of advertised multisample types for the texture
469 * format. */
470 if (resource->multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE)
471 {
472 unsigned int i, count = 0;
473
474 for (i = 0; i < sizeof(format->multisample_types) * CHAR_BIT; ++i)
475 {
476 if (format->multisample_types & 1u << i)
477 {
478 if (resource->multisample_quality == count++)
479 break;
480 }
481 }
482 return i + 1;
483 }
484
485 return resource->multisample_type;
486}
487
489 unsigned int sub_resource_idx, const struct wined3d_box *box)
490{
491 const struct wined3d_format *format = resource->format;
493 unsigned int width_mask, height_mask;
494
496
497 if (box->left >= box->right || box->right > desc.width
498 || box->top >= box->bottom || box->bottom > desc.height
499 || box->front >= box->back || box->back > desc.depth)
500 {
501 WARN("Box %s is invalid.\n", debug_box(box));
503 }
504
505 if (resource->format_attrs & WINED3D_FORMAT_ATTR_BLOCKS)
506 {
507 /* This assumes power of two block sizes, but NPOT block sizes would
508 * be silly anyway.
509 *
510 * This also assumes that the format's block depth is 1. */
511 width_mask = format->block_width - 1;
512 height_mask = format->block_height - 1;
513
514 if ((box->left & width_mask) || (box->top & height_mask)
515 || (box->right & width_mask && box->right != desc.width)
516 || (box->bottom & height_mask && box->bottom != desc.height))
517 {
518 WARN("Box %s is misaligned for %ux%u blocks.\n", debug_box(box), format->block_width, format->block_height);
520 }
521 }
522
523 return WINED3D_OK;
524}
525
527{
529
548
549 return flags;
550}
551
553{
555
570
571 return flags;
572}
573
574void *resource_offset_map_pointer(struct wined3d_resource *resource, unsigned int sub_resource_idx,
575 uint8_t *base_memory, const struct wined3d_box *box)
576{
577 const struct wined3d_format *format = resource->format;
578 unsigned int row_pitch, slice_pitch;
579
580 wined3d_resource_get_sub_resource_map_pitch(resource, sub_resource_idx, &row_pitch, &slice_pitch);
581
584 {
585 /* Compressed textures are block based, so calculate the offset of
586 * the block that contains the top-left pixel of the mapped box. */
587 return base_memory
588 + (box->front * slice_pitch)
589 + ((box->top / format->block_height) * row_pitch)
590 + ((box->left / format->block_width) * format->block_byte_count);
591 }
592 else
593 {
594 return base_memory
595 + (box->front * slice_pitch)
596 + (box->top * row_pitch)
597 + (box->left * format->byte_count);
598 }
599}
600
602 const struct wined3d_map_desc *map, const struct wined3d_color *colour,
603 const struct wined3d_box *box, bool full_subresource)
604{
605 const struct wined3d_format *format = resource->format;
606 unsigned int w, h, d, x, y, z, bpp;
607 uint8_t *dst, *dst2;
608 uint32_t c[4];
609
610 /* Fast and simple path for setting everything to zero. The C library's memset is
611 * more sophisticated than our code below. Also this works for block formats, which
612 * we still need to zero-initialize for newly created resources. */
613 if (full_subresource && !colour->r && !colour->g && !colour->b && !colour->a)
614 {
615 memset(map->data, 0, map->slice_pitch * box->back);
616 return;
617 }
618
619 w = box->right - box->left;
620 h = box->bottom - box->top;
621 d = box->back - box->front;
622
623 dst = (uint8_t *)map->data
624 + (box->front * map->slice_pitch)
625 + ((box->top / format->block_height) * map->row_pitch)
626 + ((box->left / format->block_width) * format->block_byte_count);
627
629 bpp = format->byte_count;
630
631 switch (bpp)
632 {
633 case 1:
634 for (x = 0; x < w; ++x)
635 {
636 dst[x] = c[0];
637 }
638 break;
639
640 case 2:
641 for (x = 0; x < w; ++x)
642 {
643 ((uint16_t *)dst)[x] = c[0];
644 }
645 break;
646
647 case 3:
648 {
649 dst2 = dst;
650 for (x = 0; x < w; ++x, dst2 += 3)
651 {
652 dst2[0] = (c[0] ) & 0xff;
653 dst2[1] = (c[0] >> 8) & 0xff;
654 dst2[2] = (c[0] >> 16) & 0xff;
655 }
656 break;
657 }
658 case 4:
659 for (x = 0; x < w; ++x)
660 {
661 ((uint32_t *)dst)[x] = c[0];
662 }
663 break;
664
665 case 8:
666 case 12:
667 case 16:
668 for (x = 0; x < w; ++x)
669 memcpy(((uint8_t *)map->data) + x * bpp, c, bpp);
670 break;
671
672 default:
673 FIXME("Not implemented for bpp %u.\n", bpp);
674 return;
675 }
676
677 dst2 = dst;
678 for (y = 1; y < h; ++y)
679 {
680 dst2 += map->row_pitch;
681 memcpy(dst2, dst, w * bpp);
682 }
683
684 dst2 = dst;
685 for (z = 1; z < d; ++z)
686 {
687 dst2 += map->slice_pitch;
688 memcpy(dst2, dst, w * h * bpp);
689 }
690
691}
COMPILER_DEPENDENT_INT64 INT64
Definition: actypes.h:132
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
Definition: _map.h:48
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
Definition: cs.c:2419
void wined3d_cs_destroy_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
Definition: cs.c:2299
#define free
Definition: debug_ros.c:5
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
UINT32 uint32_t
Definition: types.h:75
void context_resource_released(const struct wined3d_device *device, struct wined3d_resource *resource)
Definition: context.c:32
HRESULT CDECL wined3d_device_context_unmap(struct wined3d_device_context *context, struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: device.c:4627
HRESULT CDECL wined3d_device_context_map(struct wined3d_device_context *context, struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, unsigned int flags)
Definition: device.c:4570
UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device *device)
Definition: device.c:1754
void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource)
Definition: device.c:5340
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource)
Definition: device.c:5358
VkPipelineStageFlags vk_pipeline_stage_mask_from_bind_flags(uint32_t bind_flags)
Definition: resource.c:552
unsigned int CDECL wined3d_resource_set_priority(struct wined3d_resource *resource, unsigned int priority)
Definition: resource.c:247
GLbitfield wined3d_resource_gl_storage_flags(const struct wined3d_resource *resource)
Definition: resource.c:355
const struct wined3d_format * wined3d_resource_get_decompress_format(const struct wined3d_resource *resource)
Definition: resource.c:447
VkAccessFlags vk_access_mask_from_bind_flags(uint32_t bind_flags)
Definition: resource.c:526
static void resource_check_usage(uint32_t usage, unsigned int access)
Definition: resource.c:31
HRESULT wined3d_resource_check_box_dimensions(struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box)
Definition: resource.c:488
unsigned int CDECL wined3d_resource_get_priority(const struct wined3d_resource *resource)
Definition: resource.c:263
static BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource)
Definition: resource.c:316
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)
Definition: resource.c:601
void CDECL wined3d_resource_preload(struct wined3d_resource *resource)
Definition: resource.c:311
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:304
void *CDECL wined3d_resource_get_parent(const struct wined3d_resource *resource)
Definition: resource.c:269
unsigned int wined3d_resource_get_sample_count(const struct wined3d_resource *resource)
Definition: resource.c:456
void * resource_offset_map_pointer(struct wined3d_resource *resource, unsigned int sub_resource_idx, uint8_t *base_memory, const struct wined3d_box *box)
Definition: resource.c:574
void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc)
Definition: resource.c:280
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)
Definition: resource.c:54
GLbitfield wined3d_resource_gl_map_flags(const struct wined3d_bo_gl *bo, DWORD d3d_flags)
Definition: resource.c:373
HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, uint32_t flags)
Definition: resource.c:295
static void wined3d_resource_destroy_object(void *object)
Definition: resource.c:214
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource)
Definition: resource.c:406
void wined3d_resource_free_sysmem(struct wined3d_resource *resource)
Definition: resource.c:345
GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags)
Definition: resource.c:391
void resource_cleanup(struct wined3d_resource *resource)
Definition: resource.c:224
void CDECL wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops)
Definition: resource.c:274
BOOL wined3d_resource_prepare_sysmem(struct wined3d_resource *resource)
Definition: resource.c:337
void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
Definition: resource.c:425
void resource_unload(struct wined3d_resource *resource)
Definition: resource.c:241
const char * debug_d3dusage(uint32_t usage)
Definition: utils.c:4895
const char * wined3d_debug_bind_flags(uint32_t bind_flags)
Definition: utils.c:4845
const char * debug_box(const struct wined3d_box *box)
Definition: utils.c:4552
const char * debug_d3dformat(enum wined3d_format_id format_id)
Definition: utils.c:4605
const char * wined3d_debug_resource_access(uint32_t access)
Definition: utils.c:4828
void wined3d_format_convert_from_float(const struct wined3d_format *format, const struct wined3d_color *color, void *ret)
Definition: utils.c:5817
const char * debug_d3dresourcetype(enum wined3d_resource_type resource_type)
Definition: utils.c:4992
const struct wined3d_format * wined3d_get_format(const struct wined3d_adapter *adapter, enum wined3d_format_id format_id, unsigned int bind_flags)
Definition: utils.c:4428
#define CHAR_BIT
Definition: cabinet.h:45
#define CDECL
Definition: compat.h:29
#define WINE_DECLARE_DEBUG_CHANNEL(x)
Definition: compat.h:45
unsigned short uint16_t
Definition: stdint.h:35
unsigned char uint8_t
Definition: stdint.h:33
return ret
Definition: mutex.c:147
r parent
Definition: btrfs.c:3010
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
return adapter
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
unsigned int GLbitfield
Definition: gl.h:152
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
unsigned int GLenum
Definition: gl.h:150
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLint GLsizei width
Definition: gl.h:1546
#define GL_MAP_READ_BIT
Definition: glext.h:1793
#define GL_WRITE_ONLY_ARB
Definition: glext.h:1501
GLsizeiptr size
Definition: glext.h:5919
#define GL_MAP_FLUSH_EXPLICIT_BIT
Definition: glext.h:1797
const GLubyte * c
Definition: glext.h:8905
#define GL_READ_WRITE_ARB
Definition: glext.h:1502
#define GL_MAP_UNSYNCHRONIZED_BIT
Definition: glext.h:1798
GLenum GLenum dst
Definition: glext.h:6340
GLbitfield flags
Definition: glext.h:7161
#define GL_MAP_WRITE_BIT
Definition: glext.h:1794
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLdouble GLdouble z
Definition: glext.h:5874
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define GL_READ_ONLY_ARB
Definition: glext.h:1500
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
Definition: glfuncs.h:248
unsigned int UINT
Definition: sysinfo.c:13
#define d
Definition: ke_i.h:81
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
static int priority
Definition: timer.c:163
#define calloc
Definition: rosglue.h:14
#define WARN_(ch,...)
Definition: debug.h:157
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
Definition: palette.c:466
Definition: devices.h:37
Definition: mem.c:349
size_t size
Definition: utils.c:170
struct wined3d_bo b
Definition: wined3d_gl.h:415
DWORD multisample_draw_location
const struct wined3d_parent_ops * parent_ops
unsigned int bind_flags
Definition: wined3d.h:1810
struct wined3d_texture * front_buffer
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG_PTR
Definition: typedefs.h:65
VkFlags VkPipelineStageFlags
Definition: vulkan.h:1101
VkFlags VkAccessFlags
Definition: vulkan.h:957
@ VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT
Definition: vulkan.h:1639
@ VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT
Definition: vulkan.h:1631
@ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT
Definition: vulkan.h:1637
@ VK_ACCESS_INDIRECT_COMMAND_READ_BIT
Definition: vulkan.h:1629
@ VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT
Definition: vulkan.h:1638
@ VK_ACCESS_SHADER_WRITE_BIT
Definition: vulkan.h:1635
@ VK_ACCESS_SHADER_READ_BIT
Definition: vulkan.h:1634
@ VK_ACCESS_UNIFORM_READ_BIT
Definition: vulkan.h:1632
@ VK_ACCESS_INDEX_READ_BIT
Definition: vulkan.h:1630
@ VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT
Definition: vulkan.h:1654
@ VK_ACCESS_COLOR_ATTACHMENT_READ_BIT
Definition: vulkan.h:1636
@ VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT
Definition: vulkan.h:4278
@ VK_PIPELINE_STAGE_VERTEX_INPUT_BIT
Definition: vulkan.h:4274
@ VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT
Definition: vulkan.h:4283
@ VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT
Definition: vulkan.h:4279
@ VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
Definition: vulkan.h:4277
@ VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
Definition: vulkan.h:4282
@ VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT
Definition: vulkan.h:4281
@ VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT
Definition: vulkan.h:4273
@ VK_PIPELINE_STAGE_VERTEX_SHADER_BIT
Definition: vulkan.h:4275
@ VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT
Definition: vulkan.h:4276
@ VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT
Definition: vulkan.h:4280
@ VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT
Definition: vulkan.h:4296
#define GL_CLIENT_STORAGE_BIT
Definition: wgl.h:399
UINT64 adapter_adjust_memory(struct wined3d_adapter *adapter, INT64 amount)
Definition: directx.c:158
wined3d_multisample_type
Definition: wined3d.h:572
@ WINED3D_MULTISAMPLE_NON_MASKABLE
Definition: wined3d.h:574
#define WINED3D_OK
Definition: wined3d.h:33
#define WINED3DUSAGE_LEGACY_CUBEMAP
Definition: wined3d.h:934
#define WINED3D_BIND_VERTEX_BUFFER
Definition: wined3d.h:909
#define WINED3D_RESOURCE_ACCESS_GPU
Definition: wined3d.h:51
#define WINED3D_RESOURCE_ACCESS_CPU
Definition: wined3d.h:52
wined3d_resource_type
Definition: wined3d.h:716
@ WINED3D_RTYPE_TEXTURE_2D
Definition: wined3d.h:720
@ WINED3D_RTYPE_TEXTURE_1D
Definition: wined3d.h:719
@ WINED3D_RTYPE_BUFFER
Definition: wined3d.h:718
@ WINED3D_RTYPE_TEXTURE_3D
Definition: wined3d.h:721
#define WINED3D_BIND_UNORDERED_ACCESS
Definition: wined3d.h:916
#define WINED3D_MAP_READ
Definition: wined3d.h:957
#define WINED3DUSAGE_OVERLAY
Definition: wined3d.h:937
#define WINED3D_BIND_SHADER_RESOURCE
Definition: wined3d.h:912
#define WINED3DUSAGE_VIDMEM_ACCOUNTING
Definition: wined3d.h:939
@ WINED3DFMT_B8G8R8A8_UNORM
Definition: wined3d.h:244
@ WINED3DFMT_B8G8R8A8_UNORM_SRGB
Definition: wined3d.h:247
#define WINED3D_BIND_INDIRECT_BUFFER
Definition: wined3d.h:917
#define WINED3D_BIND_DEPTH_STENCIL
Definition: wined3d.h:915
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:53
#define WINED3DUSAGE_MANAGED
Definition: wined3d.h:938
#define WINED3D_MAP_WRITE
Definition: wined3d.h:956
#define WINED3DUSAGE_SCRATCH
Definition: wined3d.h:932
#define WINED3D_BIND_RENDER_TARGET
Definition: wined3d.h:914
#define WINED3DUSAGE_CS
Definition: wined3d.h:933
#define WINED3DUSAGE_DYNAMIC
Definition: wined3d.h:924
#define WINEDDERR_INVALIDRECT
Definition: wined3d.h:48
#define WINED3DERR_INVALIDCALL
Definition: wined3d.h:44
#define WINED3DUSAGE_STATICDECL
Definition: wined3d.h:936
#define WINED3D_BIND_CONSTANT_BUFFER
Definition: wined3d.h:911
#define WINED3D_BIND_STREAM_OUTPUT
Definition: wined3d.h:913
#define WINED3D_SRGB_READ_WRITE_CONTROL
Definition: wined3d.h:1330
#define WINED3DERR_OUTOFVIDEOMEMORY
Definition: wined3d.h:43
#define WINED3D_BIND_INDEX_BUFFER
Definition: wined3d.h:910
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:54
#define WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY
static void wined3d_resource_get_sub_resource_map_pitch(struct wined3d_resource *resource, unsigned int sub_resource_idx, unsigned int *row_pitch, unsigned int *slice_pitch)
#define WINED3D_LOCATION_SYSMEM
#define WINED3D_FORMAT_CAP_TEXTURE
static HRESULT wined3d_resource_get_sub_resource_desc(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_sub_resource_desc *desc)
#define WINED3D_FORMAT_ATTR_BROKEN_PITCH
#define WINED3D_FORMAT_ATTR_MAPPABLE
#define WINED3D_LOCATION_RB_RESOLVED
#define RESOURCE_ALIGNMENT
#define WINED3D_FORMAT_CAP_SRGB_WRITE
wined3d_gl_resource_type
@ WINED3D_GL_RES_TYPE_TEX_3D
@ WINED3D_GL_RES_TYPE_TEX_CUBE
@ WINED3D_GL_RES_TYPE_BUFFER
@ WINED3D_GL_RES_TYPE_TEX_2D
@ WINED3D_GL_RES_TYPE_RB
@ WINED3D_GL_RES_TYPE_TEX_1D
@ WINED3D_GL_RES_TYPE_COUNT
#define WINED3D_LOCATION_TEXTURE_RGB
static size_t align(size_t addr, size_t alignment)
static void wined3d_resource_reference(struct wined3d_resource *resource)
#define WINED3D_FORMAT_CAP_DEPTH_STENCIL
#define WINED3D_LOCATION_DRAWABLE
#define WINED3D_FORMAT_CAP_RENDERTARGET
#define WINED3D_FORMAT_ATTR_BLOCKS
#define WINED3D_FORMAT_CAP_SRGB_READ
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
ULONG bpp[]
Definition: xlate.c:19