ReactOS 0.4.17-dev-923-g4c9a150
vkd3d_private.h
Go to the documentation of this file.
1/*
2 * Copyright 2016 Józef Kucia for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#ifndef __VKD3D_PRIVATE_H
20#define __VKD3D_PRIVATE_H
21
22#ifndef __MINGW32__
23#define WIDL_C_INLINE_WRAPPERS
24#endif
25#define COBJMACROS
26#define NONAMELESSUNION
27#define VK_NO_PROTOTYPES
28#define CONST_VTABLE
29
30#include "vkd3d_common.h"
31#include "vkd3d_blob.h"
32#include "vkd3d_memory.h"
33#include "vkd3d_utf8.h"
34#include "wine/list.h"
35#include "wine/rbtree.h"
36
37#include "vkd3d.h"
38#include "vkd3d_shader.h"
39
40#include <inttypes.h>
41#include <limits.h>
42#include <stdbool.h>
43
44#define VK_CALL(f) (vk_procs->f)
45
46#define VKD3D_DESCRIPTOR_MAGIC_FREE 0x00000000u
47#define VKD3D_DESCRIPTOR_MAGIC_CBV VKD3D_MAKE_TAG('C', 'B', 'V', 0)
48#define VKD3D_DESCRIPTOR_MAGIC_SRV VKD3D_MAKE_TAG('S', 'R', 'V', 0)
49#define VKD3D_DESCRIPTOR_MAGIC_UAV VKD3D_MAKE_TAG('U', 'A', 'V', 0)
50#define VKD3D_DESCRIPTOR_MAGIC_SAMPLER VKD3D_MAKE_TAG('S', 'M', 'P', 0)
51#define VKD3D_DESCRIPTOR_MAGIC_DSV VKD3D_MAKE_TAG('D', 'S', 'V', 0)
52#define VKD3D_DESCRIPTOR_MAGIC_RTV VKD3D_MAKE_TAG('R', 'T', 'V', 0)
53
54#define VKD3D_MAX_COMPATIBLE_FORMAT_COUNT 6u
55#define VKD3D_MAX_QUEUE_FAMILY_COUNT 3u
56#define VKD3D_MAX_SHADER_EXTENSIONS 5u
57#define VKD3D_MAX_SHADER_STAGES 5u
58#define VKD3D_MAX_VK_SYNC_OBJECTS 4u
59#define VKD3D_MAX_DEVICE_BLOCKED_QUEUES 16u
60#define VKD3D_MAX_DESCRIPTOR_SETS 64u
61/* D3D12 binding tier 3 has a limit of 2048 samplers. */
62#define VKD3D_MAX_DESCRIPTOR_SET_SAMPLERS 2048u
63/* The main limitation here is the simple descriptor pool recycling scheme
64 * requiring each pool to contain all descriptor types used by vkd3d. Limit
65 * this number to prevent excessive pool memory use. */
66#define VKD3D_MAX_VIRTUAL_HEAP_DESCRIPTORS_PER_TYPE (16 * 1024u)
67
69
71struct d3d12_device;
72struct d3d12_resource;
73
75{
79};
80
81#define DECLARE_VK_PFN(name) PFN_##name name;
83{
84#define VK_INSTANCE_PFN DECLARE_VK_PFN
85#define VK_INSTANCE_EXT_PFN DECLARE_VK_PFN
86#include "vulkan_procs.h"
87};
88
90{
91#define VK_INSTANCE_PFN DECLARE_VK_PFN
92#define VK_DEVICE_PFN DECLARE_VK_PFN
93#define VK_DEVICE_EXT_PFN DECLARE_VK_PFN
94#include "vulkan_procs.h"
95};
96#undef DECLARE_VK_PFN
97
101
103{
109};
110
112{
113 /* KHR instance extensions */
115 /* EXT instance extensions */
117
118 /* KHR device extensions */
129 /* EXT device extensions */
146
151
153
156
159
163
165
168
170};
171
173{
176};
177
179{
180 VkInstance vk_instance;
182
187
192
195
196 VkDebugReportCallbackEXT vk_debug_callback;
197
199
200 unsigned int refcount;
201};
202
204{
205#ifndef _WIN32
206 pthread_t pthread;
207#endif
208 void *handle;
209};
210
214
216{
219 union
220 {
221 VkFence vk_fence;
222 VkSemaphore vk_semaphore;
223 } u;
225};
226
228{
233
237
238 void (*wait_for_gpu_fence)(struct vkd3d_fence_worker *worker, const struct vkd3d_waiting_fence *enqueued_fence);
239
242};
243
245{
248 void *ptr;
249};
250
252{
254 void *ptr;
255};
256
258{
260
265
268};
269
271 size_t alignment, uint64_t size, void *ptr);
274
276{
277 unsigned int attachment_count;
282 unsigned int sample_count;
284};
285
287
289{
293};
294
297 const struct vkd3d_render_pass_key *key, VkRenderPass *vk_render_pass);
299
301{
303
304 struct list content;
305};
306
308{
309 struct list entry;
310
312 unsigned int size;
314 union
315 {
318 } u;
319};
320
322{
323 if (data->is_object)
324 IUnknown_Release(data->u.object);
325 list_remove(&data->entry);
327}
328
330{
331 list_init(&store->content);
332
333 vkd3d_mutex_init(&store->mutex);
334
335 return S_OK;
336}
337
338static inline void vkd3d_private_store_destroy(struct vkd3d_private_store *store)
339{
341
343 {
345 }
346
347 vkd3d_mutex_destroy(&store->mutex);
348}
349
350HRESULT vkd3d_get_private_data(struct vkd3d_private_store *store, const GUID *tag, unsigned int *out_size, void *out);
352 const GUID *tag, unsigned int data_size, const void *data);
354
356{
358 union
359 {
360 struct
361 {
362 VkSemaphore vk_semaphore;
363 VkFence vk_fence;
367 } u;
369};
370
371/* ID3D12Fence */
373{
375 unsigned int internal_refcount;
376 unsigned int refcount;
377
379
384
386 {
389 bool *latch;
393
397
400 unsigned int semaphore_count;
401
403
405
407};
408
410 D3D12_FENCE_FLAGS flags, struct d3d12_fence **fence);
411
413 VkSemaphore *timeline_semaphore);
414
415/* ID3D12Heap */
417{
419 unsigned int refcount;
420 unsigned int resource_count;
421
424
426
427 VkDeviceMemory vk_memory;
428 void *map_ptr;
429 unsigned int map_count;
431
433
435};
436
438 const struct d3d12_resource *resource, ID3D12ProtectedResourceSession *protected_session, struct d3d12_heap **heap);
440
441#define VKD3D_RESOURCE_PUBLIC_FLAGS \
442 (VKD3D_RESOURCE_INITIAL_STATE_TRANSITION | VKD3D_RESOURCE_PRESENT_STATE_TRANSITION)
443#define VKD3D_RESOURCE_EXTERNAL 0x00000004
444#define VKD3D_RESOURCE_DEDICATED_HEAP 0x00000008
445#define VKD3D_RESOURCE_LINEAR_TILING 0x00000010
446
448{
449 unsigned int width;
450 unsigned int height;
451 unsigned int depth;
452};
453
455{
456 unsigned int offset;
457 unsigned int count;
459};
460
462{
464 unsigned int total_count;
465 unsigned int standard_mip_count;
467 unsigned int subresource_count;
469};
470
471/* ID3D12Resource */
473{
475 unsigned int refcount;
476 unsigned int internal_refcount;
477
479 const struct vkd3d_format *format;
480
482 union
483 {
484 VkBuffer vk_buffer;
485 VkImage vk_image;
486 } u;
487 unsigned int flags;
488
489 unsigned int map_count;
490
493
496
498
500
502};
503
505{
507}
508
510{
512}
513
514static inline bool d3d12_resource_is_buffer(const struct d3d12_resource *resource)
515{
516 return resource->desc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER;
517}
518
519static inline bool d3d12_resource_is_texture(const struct d3d12_resource *resource)
520{
521 return resource->desc.Dimension != D3D12_RESOURCE_DIMENSION_BUFFER;
522}
523
525{
529};
530
534 UINT *total_tile_count, D3D12_PACKED_MIP_INFO *packed_mip_info, D3D12_TILE_SHAPE *standard_tile_shape,
535 UINT *sub_resource_tiling_count, UINT first_sub_resource_tiling,
536 D3D12_SUBRESOURCE_TILING *sub_resource_tilings);
537
539 const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags,
540 const D3D12_RESOURCE_DESC1 *desc, D3D12_RESOURCE_STATES initial_state,
541 const D3D12_CLEAR_VALUE *optimized_clear_value, ID3D12ProtectedResourceSession *protected_session,
542 struct d3d12_resource **resource);
544 const D3D12_RESOURCE_DESC1 *desc, D3D12_RESOURCE_STATES initial_state,
545 const D3D12_CLEAR_VALUE *optimized_clear_value, struct d3d12_resource **resource);
547 const D3D12_RESOURCE_DESC1 *desc, D3D12_RESOURCE_STATES initial_state,
548 const D3D12_CLEAR_VALUE *optimized_clear_value, struct d3d12_resource **resource);
550
552{
553 memcpy(desc1, desc, sizeof(*desc));
557}
558
560 const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags,
561 VkDeviceMemory *vk_memory, uint32_t *vk_memory_type, VkDeviceSize *vk_memory_size);
563 const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags,
564 const D3D12_RESOURCE_DESC1 *desc, VkBuffer *vk_buffer);
566 const D3D12_RESOURCE_DESC1 *desc, struct vkd3d_resource_allocation_info *allocation_info);
567
569{
573};
574
576{
578 union
579 {
580 VkBufferView vk_buffer_view;
581 VkImageView vk_image_view;
582 VkSampler vk_sampler;
583 } u;
584 VkBufferView vk_counter_view;
585 const struct vkd3d_format *format;
586 union
587 {
588 struct
589 {
593 struct
594 {
596 unsigned int miplevel_idx;
597 unsigned int layer_idx;
598 unsigned int layer_count;
601};
602
604{
606 const struct vkd3d_format *format;
607 unsigned int miplevel_idx;
608 unsigned int miplevel_count;
609 unsigned int layer_idx;
610 unsigned int layer_count;
615};
616
618{
620 unsigned int volatile refcount;
621 void *next;
623};
624
626{
629};
630
631bool vkd3d_create_buffer_view(struct d3d12_device *device, uint32_t magic, VkBuffer vk_buffer,
633bool vkd3d_create_texture_view(struct d3d12_device *device, uint32_t magic, VkImage vk_image,
634 const struct vkd3d_texture_view_desc *desc, struct vkd3d_view **view);
635
637{
640};
641
643{
644 struct
645 {
646 union d3d12_desc_object
647 {
651 void *object;
652 } u;
653 } s;
654 unsigned int index;
655 unsigned int next;
656};
657
658void vkd3d_view_decref(void *view, struct d3d12_device *device);
659
660static inline bool vkd3d_view_incref(void *desc)
661{
662 struct vkd3d_desc_header *h = desc;
663 unsigned int refcount;
664
665 do
666 {
667 refcount = h->refcount;
668 /* Avoid incrementing a freed object. Reading the value is safe because objects are recycled. */
669 if (refcount <= 0)
670 return false;
671 }
672 while (!vkd3d_atomic_compare_exchange_u32(&h->refcount, refcount, refcount + 1));
673
674 return true;
675}
676
677static inline void *d3d12_desc_get_object_ref(const volatile struct d3d12_desc *src, struct d3d12_device *device)
678{
679 void *view;
680
681 /* Some games, e.g. Shadow of the Tomb Raider, GRID 2019, and Horizon Zero Dawn, write descriptors
682 * from multiple threads without synchronisation. This is apparently valid in Windows. */
683 for (;;)
684 {
685 do
686 {
687 if (!(view = src->s.u.object))
688 return NULL;
689 } while (!vkd3d_view_incref(view));
690
691 /* Check if the object is still in src to handle the case where it was
692 * already freed and reused elsewhere when the refcount was incremented. */
693 if (view == src->s.u.object)
694 return view;
695
697 }
698}
699
701{
702 return (struct d3d12_desc *)cpu_handle.ptr;
703}
704
706{
707 return (struct d3d12_desc *)(intptr_t)gpu_handle.ptr;
708}
709
710static inline void d3d12_desc_copy_raw(struct d3d12_desc *dst, const struct d3d12_desc *src)
711{
712 dst->s = src->s;
713}
714
716
717void d3d12_desc_copy(struct d3d12_desc *dst, const struct d3d12_desc *src, struct d3d12_descriptor_heap *dst_heap,
718 struct d3d12_device *device);
725 struct d3d12_resource *resource, struct d3d12_resource *counter_resource,
728void d3d12_desc_write_atomic(struct d3d12_desc *dst, const struct d3d12_desc *src, struct d3d12_device *device);
729
731 D3D12_GPU_VIRTUAL_ADDRESS gpu_address, D3D12_ROOT_PARAMETER_TYPE parameter_type, VkBufferView *vk_buffer_view);
733 const D3D12_STATIC_SAMPLER_DESC *desc, VkSampler *vk_sampler);
734
736{
738 const struct vkd3d_format *format;
740 unsigned int height;
741 unsigned int layer_count;
744};
745
747{
748 return (struct d3d12_rtv_desc *)cpu_handle.ptr;
749}
750
751void d3d12_rtv_desc_create_rtv(struct d3d12_rtv_desc *rtv_desc, struct d3d12_device *device,
753
755{
757 const struct vkd3d_format *format;
759 unsigned int height;
760 unsigned int layer_count;
763};
764
766{
767 return (struct d3d12_dsv_desc *)cpu_handle.ptr;
768}
769
770void d3d12_dsv_desc_create_dsv(struct d3d12_dsv_desc *dsv_desc, struct d3d12_device *device,
772
774{
778
779 /* These are used when mutable descriptors are not available to back
780 * SRV-UAV-CBV descriptor heaps. They must stay at the end of this
781 * enumeration, so that they can be ignored when mutable descriptors are
782 * used. */
788
791
793
796{
799
801}
802
804{
808 unsigned int count;
809 VkDescriptorSetLayout vk_set_layout;
810};
811
813{
814 VkDescriptorSet vk_set;
816};
817
818#ifdef __REACTOS__
819#ifdef _MSC_VER
820# ifdef _WIN64
821# define VKD3D_DESCRIPTOR_HEAP_ALIGN 8
822# else
823# define VKD3D_DESCRIPTOR_HEAP_ALIGN 4
824# endif
825#else
826# define VKD3D_DESCRIPTOR_HEAP_ALIGN sizeof(void *)
827#endif
828#endif
829
830/* ID3D12DescriptorHeap */
832{
834 unsigned int refcount;
836
838
841
843
844 VkDescriptorPool vk_descriptor_pool;
847
848 unsigned int volatile dirty_list_head;
849
850 uint8_t DECLSPEC_ALIGN(VKD3D_DESCRIPTOR_HEAP_ALIGN) descriptors[];
851};
852
854
856{
857 return CONTAINING_RECORD(descriptor - descriptor->index, struct d3d12_descriptor_heap, descriptors);
858}
859
860static inline unsigned int d3d12_desc_heap_range_size(const struct d3d12_desc *descriptor)
861{
863 return heap->desc.NumDescriptors - descriptor->index;
864}
865
867 const D3D12_DESCRIPTOR_HEAP_DESC *desc, struct d3d12_descriptor_heap **descriptor_heap);
868
869/* ID3D12QueryHeap */
871{
873 unsigned int refcount;
874
875 VkQueryPool vk_query_pool;
876
878
880
882};
883
887
888/* A Vulkan query has to be issued at least one time before the result is
889 * available. In D3D12 it is legal to get query results for not issued queries.
890 */
892 unsigned int query_index)
893{
894 unsigned int index = query_index / (sizeof(*heap->availability_mask) * CHAR_BIT);
895 unsigned int shift = query_index % (sizeof(*heap->availability_mask) * CHAR_BIT);
896 return heap->availability_mask[index] & ((uint64_t)1 << shift);
897}
898
900 unsigned int query_index)
901{
902 unsigned int index = query_index / (sizeof(*heap->availability_mask) * CHAR_BIT);
903 unsigned int shift = query_index % (sizeof(*heap->availability_mask) * CHAR_BIT);
904 heap->availability_mask[index] |= (uint64_t)1 << shift;
905}
906
908{
909 unsigned int offset;
910 unsigned int descriptor_count;
911 unsigned int vk_binding_count;
914
917 unsigned int register_space;
918 unsigned int base_register_idx;
919};
920
922{
923 unsigned int range_count;
925};
926
928{
931};
932
934{
936};
937
939{
941 union
942 {
946 } u;
947};
948
950{
951 VkDescriptorSetLayout vk_layout;
952 unsigned int unbounded_offset;
953 unsigned int table_index;
954};
955
956/* ID3D12RootSignature */
958{
960 unsigned int refcount;
961
962 VkPipelineLayout vk_pipeline_layout;
966
968 unsigned int parameter_count;
970
973
975
976 unsigned int binding_count;
977 unsigned int uav_mapping_count;
984
987
989
991 /* Only a single push constant range may include the same stage in Vulkan. */
993
995 VkSampler *static_samplers;
996
998
1000};
1001
1002HRESULT d3d12_root_signature_create(struct d3d12_device *device, const void *bytecode,
1003 size_t bytecode_length, struct d3d12_root_signature **root_signature);
1005
1008
1010{
1013
1019
1023 unsigned int rt_count;
1027 VkRenderPass render_pass;
1028
1033
1037
1039
1041
1043};
1044
1045static inline unsigned int dsv_attachment_mask(const struct d3d12_graphics_pipeline_state *graphics)
1046{
1047 return 1u << graphics->rt_count;
1048}
1049
1051{
1052 VkPipeline vk_pipeline;
1053};
1054
1056{
1057 VkPipelineLayout vk_pipeline_layout;
1058 VkDescriptorSetLayout vk_set_layout;
1060
1062 unsigned int binding_count;
1063};
1064
1065/* ID3D12PipelineState */
1067{
1069 unsigned int refcount;
1070
1071 union
1072 {
1075 } u;
1077
1079
1082
1084};
1085
1087{
1088 return state && state->vk_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE;
1089}
1090
1092{
1093 return state && state->vk_bind_point == VK_PIPELINE_BIND_POINT_GRAPHICS;
1094}
1095
1097{
1099 {
1100 struct d3d12_graphics_pipeline_state *graphics = &state->u.graphics;
1101
1102 return graphics->null_attachment_mask & dsv_attachment_mask(graphics);
1103 }
1104
1105 return false;
1106}
1107
1109{
1119 unsigned int sample_mask;
1129 unsigned int node_mask;
1132};
1133
1141 D3D12_PRIMITIVE_TOPOLOGY topology, const uint32_t *strides, VkFormat dsv_format, VkRenderPass *vk_render_pass);
1143
1145{
1146 VkBuffer vk_buffer;
1147 VkDeviceMemory vk_memory;
1148};
1149
1150/* ID3D12CommandAllocator */
1152{
1154 unsigned int refcount;
1155
1158
1159 VkCommandPool vk_command_pool;
1160
1161 VkDescriptorPool vk_descriptor_pool;
1162
1163 VkDescriptorPool *free_descriptor_pools;
1166
1167 VkRenderPass *passes;
1170
1171 VkFramebuffer *framebuffers;
1174
1175 VkDescriptorPool *descriptor_pools;
1178
1182
1183 VkBufferView *buffer_views;
1186
1190
1191 VkCommandBuffer *command_buffers;
1194
1197
1199};
1200
1203
1205{
1206 union
1207 {
1208 VkBufferView vk_buffer_view;
1209 struct
1210 {
1211 VkBuffer vk_buffer;
1214 } u;
1215};
1216
1218{
1220
1222 /* All descriptor sets at index > 1 are for unbounded d3d12 ranges. Set
1223 * 0 or 1 may be unbounded too. */
1227
1233
1237
1238 /* Needed when VK_KHR_push_descriptor is not available. */
1242};
1243
1245{
1249};
1250
1251/* ID3D12CommandList */
1253{
1255 unsigned int refcount;
1256
1259
1262 VkCommandBuffer vk_command_buffer;
1263
1266
1268
1270 VkImageView dsv;
1271 unsigned int fb_width;
1272 unsigned int fb_height;
1273 unsigned int fb_layer_count;
1275
1279
1280 VkFramebuffer current_framebuffer;
1282 VkRenderPass pso_render_pass;
1285
1287
1290
1293
1296
1298};
1299
1301 UINT node_mask, D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator *allocator_iface,
1302 ID3D12PipelineState *initial_pipeline_state, struct d3d12_command_list **list);
1303
1305{
1306 /* Access to VkQueue must be externally synchronized. */
1308
1309 VkQueue vk_queue;
1310
1313
1317
1318 struct
1319 {
1320 VkSemaphore vk_semaphore;
1325
1327};
1328
1329VkQueue vkd3d_queue_acquire(struct vkd3d_queue *queue);
1331 const VkQueueFamilyProperties *properties, struct vkd3d_queue **queue);
1334
1336{
1342};
1343
1345{
1348};
1349
1351{
1354};
1355
1357{
1358 VkCommandBuffer *buffers;
1359 unsigned int buffer_count;
1360};
1361
1363{
1368 D3D12_TILE_RANGE_FLAGS *range_flags;
1374};
1375
1377{
1384};
1385
1387{
1389 union
1390 {
1396 } u;
1397};
1398
1400{
1402 size_t count;
1403 size_t size;
1404};
1405
1406/* ID3D12CommandQueue */
1408{
1409 ID3D12CommandQueue ID3D12CommandQueue_iface;
1410 unsigned int refcount;
1411
1413
1415
1419
1421
1423
1424 /* These fields are protected by op_mutex. */
1427
1428 /* This field is not protected by op_mutex, but can only be used
1429 * by the thread that set is_flushing; when is_flushing is not
1430 * set, aux_op_queue.count must be zero. */
1432
1434
1436};
1437
1440
1441/* ID3D12CommandSignature */
1443{
1445 unsigned int refcount;
1446 unsigned int internal_refcount;
1447
1449
1451
1453};
1454
1458
1459/* NULL resources */
1461{
1462 VkBuffer vk_buffer;
1463 VkDeviceMemory vk_buffer_memory;
1464
1467
1469 VkDeviceMemory vk_2d_image_memory;
1470
1473};
1474
1476void vkd3d_destroy_null_resources(struct vkd3d_null_resources *null_resources, struct d3d12_device *device);
1477
1479{
1481 unsigned int format_count;
1483};
1484
1486{
1490};
1491
1493{
1494 VkPipeline buffer;
1495 VkPipeline image_1d;
1496 VkPipeline image_1d_array;
1497 VkPipeline image_2d;
1498 VkPipeline image_2d_array;
1499 VkPipeline image_3d;
1500};
1501
1503{
1504 VkDescriptorSetLayout vk_set_layout_buffer;
1505 VkDescriptorSetLayout vk_set_layout_image;
1506
1509
1512};
1513
1516
1518{
1519 void *head;
1520 unsigned int spinlock;
1521};
1522
1524{
1526 unsigned int next_index;
1527 unsigned int free_count;
1528 size_t size;
1529};
1530
1531#define VKD3D_DESCRIPTOR_POOL_COUNT 6
1532
1533/* ID3D12Device */
1535{
1537 unsigned int refcount;
1538
1539 VkDevice vk_device;
1540 VkPhysicalDevice vk_physical_device;
1545
1547
1550
1552 unsigned int vk_pool_count;
1555
1563
1566 VkPipelineCache vk_pipeline_cache;
1567
1569
1576
1578
1585
1589
1591
1594
1596
1598
1604};
1605
1607 const struct vkd3d_device_create_info *create_info, struct d3d12_device **device);
1609bool d3d12_device_is_uma(struct d3d12_device *device, bool *coherent);
1611 const char *message, ...) VKD3D_PRINTF_FUNC(3, 4);
1615
1617{
1618 return ID3D12Device9_QueryInterface(&device->ID3D12Device9_iface, iid, object);
1619}
1620
1622{
1623 return ID3D12Device9_AddRef(&device->ID3D12Device9_iface);
1624}
1625
1627{
1628 return ID3D12Device9_Release(&device->ID3D12Device9_iface);
1629}
1630
1632 D3D12_DESCRIPTOR_HEAP_TYPE descriptor_type)
1633{
1634 return ID3D12Device9_GetDescriptorHandleIncrementSize(&device->ID3D12Device9_iface, descriptor_type);
1635}
1636
1637/* utils */
1639{
1644};
1645
1647{
1655 unsigned int plane_count;
1658};
1659
1660static inline size_t vkd3d_format_get_data_offset(const struct vkd3d_format *format,
1661 unsigned int row_pitch, unsigned int slice_pitch,
1662 unsigned int x, unsigned int y, unsigned int z)
1663{
1664 return z * slice_pitch
1665 + (y / format->block_height) * row_pitch
1666 + (x / format->block_width) * format->byte_count * format->block_byte_count;
1667}
1668
1669static inline bool vkd3d_format_is_compressed(const struct vkd3d_format *format)
1670{
1671 return format->block_byte_count != 1;
1672}
1673
1674void vkd3d_format_copy_data(const struct vkd3d_format *format, const uint8_t *src,
1675 unsigned int src_row_pitch, unsigned int src_slice_pitch, uint8_t *dst, unsigned int dst_row_pitch,
1676 unsigned int dst_slice_pitch, unsigned int w, unsigned int h, unsigned int d);
1677
1678const struct vkd3d_format *vkd3d_get_format(const struct d3d12_device *device,
1681
1684
1686 const struct d3d12_device *device, const D3D12_RESOURCE_DESC1 *desc, DXGI_FORMAT view_format)
1687{
1688 return vkd3d_get_format(device, view_format ? view_format : desc->Format,
1690}
1691
1692static inline bool d3d12_box_is_empty(const D3D12_BOX *box)
1693{
1694 return box->right <= box->left || box->bottom <= box->top || box->back <= box->front;
1695}
1696
1698 unsigned int miplevel_idx)
1699{
1700 return max(1, desc->Width >> miplevel_idx);
1701}
1702
1704 unsigned int miplevel_idx)
1705{
1706 return max(1, desc->Height >> miplevel_idx);
1707}
1708
1710 unsigned int miplevel_idx)
1711{
1712 unsigned int d = desc->Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? 1 : desc->DepthOrArraySize;
1713 return max(1, d >> miplevel_idx);
1714}
1715
1717{
1718 return desc->Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? desc->DepthOrArraySize : 1;
1719}
1720
1722{
1723 return d3d12_resource_desc_get_layer_count(desc) * desc->MipLevels;
1724}
1725
1726static inline unsigned int vkd3d_compute_workgroup_count(unsigned int thread_count, unsigned int workgroup_size)
1727{
1728 return (thread_count + workgroup_size - 1) / workgroup_size;
1729}
1730
1733VkSampleCountFlagBits vk_samples_from_sample_count(unsigned int sample_count);
1734
1735bool is_valid_feature_level(D3D_FEATURE_LEVEL feature_level);
1736
1739
1740HRESULT return_interface(void *iface, REFIID iface_iid, REFIID requested_iid, void **object);
1741
1743const char *debug_d3d12_box(const D3D12_BOX *box);
1744const char *debug_d3d12_shader_component_mapping(unsigned int mapping);
1750
1751static inline void debug_ignored_node_mask(unsigned int mask)
1752{
1753 if (mask && mask != 1)
1754 FIXME("Ignoring node mask 0x%08x.\n", mask);
1755}
1756
1760 const struct vkd3d_vk_global_procs *global_procs, VkInstance instance);
1762 const struct vkd3d_vk_instance_procs *parent_procs, VkDevice device);
1763
1764extern const char vkd3d_build[];
1765
1767
1769 VkDebugReportObjectTypeEXT vk_object_type, const char *name);
1771 VkDebugReportObjectTypeEXT vk_object_type, const WCHAR *name);
1772
1773static inline void vk_prepend_struct(void *header, void *structure)
1774{
1775 VkBaseOutStructure *vk_header = header, *vk_structure = structure;
1776
1777 vk_structure->pNext = vk_header->pNext;
1778 vk_header->pNext = vk_structure;
1779}
1780
1781static inline void vkd3d_prepend_struct(void *header, void *structure)
1782{
1783 struct
1784 {
1785 unsigned int type;
1786 const void *next;
1787 } *vkd3d_header = header, *vkd3d_structure = structure;
1788
1789 VKD3D_ASSERT(!vkd3d_structure->next);
1790 vkd3d_structure->next = vkd3d_header->next;
1791 vkd3d_header->next = vkd3d_structure;
1792}
1793
1794struct vkd3d_shader_cache;
1795
1800 const void *key, size_t key_size, const void *value, size_t value_size);
1802 const void *key, size_t key_size, void *value, size_t *value_size);
1803
1804#endif /* __VKD3D_PRIVATE_H */
_Check_return_ _Ret_maybenull_ _In_ size_t alignment
Definition: align.cpp:48
static int state
Definition: maze.c:121
#define PATH_MAX
Definition: types.h:280
#define index(s, c)
Definition: various.h:29
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
static HANDLE thread
Definition: service.c:33
Definition: list.h:39
D3D12_RESOURCE_STATES
Definition: d3d12.idl:903
const UINT D3D12_VS_INPUT_REGISTER_COUNT
Definition: d3d12.idl:439
D3D12_PRIMITIVE_TOPOLOGY_TYPE
Definition: d3d12.idl:2070
const UINT D3D12_MAX_ROOT_COST
Definition: d3d12.idl:280
D3D12_COMMAND_LIST_TYPE
Definition: d3d12.idl:2188
D3D12_TILE_MAPPING_FLAGS
Definition: d3d12.idl:3014
@ D3D12_RESOURCE_DIMENSION_BUFFER
Definition: d3d12.idl:983
@ D3D12_RESOURCE_DIMENSION_TEXTURE3D
Definition: d3d12.idl:986
@ D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL
Definition: d3d12.idl:1001
D3D12_ROOT_SIGNATURE_FLAGS
Definition: d3d12.idl:1367
D3D12_HEAP_FLAGS
Definition: d3d12.idl:812
const UINT D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT
Definition: d3d12.idl:378
const UINT D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT
Definition: d3d12.idl:265
D3D12_ROOT_PARAMETER_TYPE
Definition: d3d12.idl:1176
D3D12_DESCRIPTOR_HEAP_TYPE
Definition: d3d12.idl:1420
D3D12_COMPARISON_FUNC
Definition: d3d12.idl:1338
@ D3D12_SHADER_VISIBILITY_PIXEL
Definition: d3d12.idl:1191
D3D12_INDEX_BUFFER_STRIP_CUT_VALUE
Definition: d3d12.idl:2059
const UINT D3D12_SO_BUFFER_SLOT_COUNT
Definition: d3d12.idl:383
D3D12_PIPELINE_STATE_FLAGS
Definition: d3d12.idl:2085
UINT64 D3D12_GPU_VIRTUAL_ADDRESS
Definition: d3d12.idl:1443
D3D_FEATURE_LEVEL
Definition: d3dcommon.idl:102
D3D_PRIMITIVE_TOPOLOGY
Definition: d3dcommon.idl:384
#define NULL
Definition: types.h:112
UINT32 uint32_t
Definition: types.h:75
UINT64 uint64_t
Definition: types.h:77
DXGI_FORMAT dxgi_format
Definition: texture.c:51
UINT op
Definition: effect.c:235
static HINSTANCE instance
Definition: main.c:35
content
Definition: atl_ax.c:990
#define CHAR_BIT
Definition: cabinet.h:45
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1971
int intptr_t
Definition: corecrt.h:176
unsigned char uint8_t
Definition: stdint.h:33
DXGI_FORMAT
Definition: dxgiformat.idl:22
static void depth_stencil(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: ffp_gl.c:766
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
const GLdouble * v
Definition: gl.h:2040
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield stages
Definition: glext.h:7620
GLuint address
Definition: glext.h:9393
GLenum src
Definition: glext.h:6340
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
GLuint sampler
Definition: glext.h:7283
GLuint index
Definition: glext.h:6031
GLenum GLint GLuint mask
Definition: glext.h:6028
GLenum GLenum dst
Definition: glext.h:6340
GLbitfield flags
Definition: glext.h:7161
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLdouble GLdouble z
Definition: glext.h:5874
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
unsigned int UINT
Definition: sysinfo.c:13
const char cursor[]
Definition: icontest.c:13
#define S_OK
Definition: intsafe.h:52
uint32_t entry
Definition: isohybrid.c:63
#define d
Definition: ke_i.h:81
static char * program_name
Definition: mkdosfs.c:519
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static PVOID ptr
Definition: dispmode.c:27
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID ULONG out_size
Definition: file.c:72
#define shift
Definition: input.c:3280
static unsigned int WINAPI thread_main(void *args)
Definition: nfs41_daemon.c:84
#define uint64_t
Definition: nsiface.idl:62
short WCHAR
Definition: pedump.c:58
static uint32_t thread_count(IN pnfs_layout_state *state, IN enum pnfs_iomode iomode, IN uint64_t offset, IN uint64_t length)
Definition: pnfs_io.c:137
#define REFIID
Definition: guiddef.h:118
static unsigned __int64 next
Definition: rand_nt.c:6
descriptor
Definition: scsi.h:3997
#define inline
Definition: compat.h:23
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:242
D3D12_MIP_REGION SamplerFeedbackMipRegion
Definition: d3d12.idl:1045
struct VkBaseOutStructure * pNext
Definition: vulkan.h:7431
Definition: palette.c:466
Definition: cache.c:41
struct d3d12_device * device
VkDescriptorPool * descriptor_pools
struct vkd3d_private_store private_store
struct vkd3d_view ** views
VkCommandBuffer * command_buffers
VkCommandPool vk_command_pool
VkDescriptorPool vk_descriptor_pool
D3D12_COMMAND_LIST_TYPE type
VkBufferView * buffer_views
ID3D12CommandAllocator ID3D12CommandAllocator_iface
struct vkd3d_buffer * transfer_buffers
struct d3d12_command_list * current_command_list
VkDescriptorPool * free_descriptor_pools
VkFramebuffer * framebuffers
D3D12_PRIMITIVE_TOPOLOGY primitive_topology
VkFramebuffer current_framebuffer
VkPipeline current_pipeline
VkBuffer so_counter_buffers[D3D12_SO_BUFFER_SLOT_COUNT]
VkQueueFlags vk_queue_flags
unsigned int fb_width
ID3D12GraphicsCommandList6 ID3D12GraphicsCommandList6_iface
unsigned int fb_layer_count
unsigned int refcount
unsigned int descriptor_heap_count
VkCommandBuffer vk_command_buffer
struct vkd3d_private_store private_store
struct vkd3d_pipeline_bindings pipeline_bindings[VKD3D_PIPELINE_BIND_POINT_COUNT]
struct d3d12_device * device
D3D12_COMMAND_LIST_TYPE type
DXGI_FORMAT index_buffer_format
VkRenderPass pso_render_pass
VkDeviceSize so_counter_buffer_offsets[D3D12_SO_BUFFER_SLOT_COUNT]
unsigned int fb_height
uint32_t strides[D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT]
struct d3d12_pipeline_state * state
struct d3d12_descriptor_heap * descriptor_heaps[64]
VkRenderPass current_render_pass
struct d3d12_command_allocator * allocator
VkImageView rtvs[D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT]
struct vkd3d_cs_op_data * ops
struct vkd3d_private_store private_store
D3D12_COMMAND_QUEUE_DESC desc
const struct d3d12_fence * last_waited_fence
ID3D12CommandQueue ID3D12CommandQueue_iface
struct d3d12_command_queue_op_array op_queue
struct vkd3d_mutex op_mutex
unsigned int refcount
struct d3d12_device * device
uint64_t last_waited_fence_value
struct d3d12_command_queue_op_array aux_op_queue
struct vkd3d_queue * vkd3d_queue
struct vkd3d_fence_worker fence_worker
struct d3d12_device * device
unsigned int internal_refcount
struct vkd3d_private_store private_store
ID3D12CommandSignature ID3D12CommandSignature_iface
D3D12_COMMAND_SIGNATURE_DESC desc
unsigned int index
void * object
struct d3d12_desc::@6032 s
struct vkd3d_desc_header * header
union d3d12_desc::@6032::d3d12_desc_object u
struct vkd3d_cbuffer_desc * cb_desc
struct vkd3d_view * view
unsigned int next
struct vkd3d_mutex vk_sets_mutex
D3D12_DESCRIPTOR_HEAP_DESC desc
struct d3d12_descriptor_heap_vk_set vk_descriptor_sets[VKD3D_SET_INDEX_COUNT]
struct vkd3d_private_store private_store
ID3D12DescriptorHeap ID3D12DescriptorHeap_iface
struct d3d12_device * device
unsigned int volatile dirty_list_head
VkDescriptorPool vk_descriptor_pool
uint8_t DECLSPEC_ALIGN(VKD3D_DESCRIPTOR_HEAP_ALIGN) descriptors[]
VkDescriptorSetLayout vk_layout
D3D12_FEATURE_DATA_D3D12_OPTIONS5 feature_options5
struct vkd3d_desc_object_cache view_desc_cache
struct vkd3d_null_resources null_resources
D3D12_FEATURE_DATA_D3D12_OPTIONS feature_options
struct vkd3d_mutex pipeline_cache_mutex
struct vkd3d_uav_clear_state uav_clear_state
HRESULT removed_reason
struct vkd3d_render_pass_cache render_pass_cache
size_t heap_capacity
VkPhysicalDevice vk_physical_device
struct vkd3d_desc_object_cache cbuffer_desc_cache
D3D12_FEATURE_DATA_D3D12_OPTIONS4 feature_options4
struct vkd3d_gpu_va_allocator gpu_va_allocator
unsigned int vk_pool_count
struct vkd3d_private_store private_store
struct vkd3d_mutex worker_mutex
struct vkd3d_mutex blocked_queues_mutex
VkPipelineCache vk_pipeline_cache
struct vkd3d_vk_device_procs vk_procs
VkDevice vk_device
unsigned int queue_family_count
IUnknown * parent
bool worker_should_exit
struct vkd3d_vulkan_info vk_info
unsigned int blocked_queue_count
VkDescriptorPoolSize vk_pool_sizes[VKD3D_DESCRIPTOR_POOL_COUNT]
const struct vkd3d_format * depth_stencil_formats
unsigned int format_compatibility_list_count
struct d3d12_command_queue * blocked_queues[VKD3D_MAX_DEVICE_BLOCKED_QUEUES]
struct vkd3d_vk_descriptor_heap_layout vk_descriptor_heap_layouts[VKD3D_SET_INDEX_COUNT]
D3D12_FEATURE_DATA_D3D12_OPTIONS1 feature_options1
D3D12_FEATURE_DATA_D3D12_OPTIONS2 feature_options2
struct vkd3d_cond worker_cond
uint32_t queue_family_indices[VKD3D_MAX_QUEUE_FAMILY_COUNT]
PFN_vkd3d_signal_event signal_event
struct vkd3d_queue * direct_queue
const struct vkd3d_format_compatibility_list * format_compatibility_lists
struct vkd3d_queue * copy_queue
D3D12_FEATURE_DATA_D3D12_OPTIONS3 feature_options3
ID3D12Device9 ID3D12Device9_iface
struct vkd3d_queue * compute_queue
VkPhysicalDeviceMemoryProperties memory_properties
struct d3d12_descriptor_heap ** heaps
struct vkd3d_instance * vkd3d_instance
unsigned int refcount
VkTimeDomainEXT vk_host_time_domain
enum vkd3d_shader_spirv_environment environment
union vkd3d_thread_handle worker_thread
struct vkd3d_view * view
VkSampleCountFlagBits sample_count
unsigned int height
struct d3d12_resource * resource
const struct vkd3d_format * format
unsigned int layer_count
uint64_t pending_timeline_value
struct vkd3d_signaled_semaphore * semaphores
uint64_t timeline_value
struct vkd3d_cond null_event_cond
unsigned int internal_refcount
struct d3d12_fence::vkd3d_waiting_event * events
D3D12_FENCE_FLAGS flags
size_t event_count
uint64_t value
size_t events_size
ID3D12Fence1 ID3D12Fence1_iface
struct vkd3d_private_store private_store
unsigned int semaphore_count
unsigned int refcount
VkFence old_vk_fences[VKD3D_MAX_VK_SYNC_OBJECTS]
struct d3d12_device * device
VkSemaphore timeline_semaphore
size_t semaphores_size
uint64_t max_pending_value
VkFormat rtv_formats[D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT]
VkPipelineDepthStencilStateCreateInfo ds_desc
D3D12_INDEX_BUFFER_STRIP_CUT_VALUE index_buffer_strip_cut_value
VkPipelineMultisampleStateCreateInfo ms_desc
VkVertexInputAttributeDescription attributes[D3D12_VS_INPUT_REGISTER_COUNT]
VkPipelineRasterizationStateCreateInfo rs_desc
const struct d3d12_root_signature * root_signature
VkVertexInputBindingDivisorDescriptionEXT instance_divisors[D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT]
VkPipelineRasterizationDepthClipStateCreateInfoEXT rs_depth_clip_info
VkVertexInputRate input_rates[D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT]
VkPipelineColorBlendAttachmentState blend_attachments[D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT]
VkPipelineRasterizationStateStreamCreateInfoEXT rs_stream_info
struct vkd3d_private_store private_store
unsigned int map_count
unsigned int refcount
unsigned int resource_count
D3D12_HEAP_DESC desc
void * map_ptr
struct d3d12_device * device
ID3D12Heap ID3D12Heap_iface
VkDeviceMemory vk_memory
uint32_t vk_memory_type
D3D12_STREAM_OUTPUT_DESC stream_output
D3D12_SHADER_BYTECODE hs
D3D12_BLEND_DESC blend_state
D3D12_INPUT_LAYOUT_DESC input_layout
D3D12_DEPTH_STENCIL_DESC1 depth_stencil_state
D3D12_SHADER_BYTECODE cs
D3D12_SHADER_BYTECODE gs
D3D12_VIEW_INSTANCING_DESC view_instancing_desc
D3D12_SHADER_BYTECODE vs
D3D12_SHADER_BYTECODE ps
struct D3D12_RT_FORMAT_ARRAY rtv_formats
D3D12_CACHED_PIPELINE_STATE cached_pso
D3D12_PIPELINE_STATE_FLAGS flags
D3D12_INDEX_BUFFER_STRIP_CUT_VALUE strip_cut_value
DXGI_SAMPLE_DESC sample_desc
D3D12_RASTERIZER_DESC rasterizer_state
D3D12_SHADER_BYTECODE ds
D3D12_PRIMITIVE_TOPOLOGY_TYPE primitive_topology_type
ID3D12RootSignature * root_signature
VkPipelineBindPoint vk_bind_point
struct d3d12_graphics_pipeline_state graphics
struct d3d12_compute_pipeline_state compute
struct vkd3d_private_store private_store
ID3D12PipelineState ID3D12PipelineState_iface
ID3D12RootSignature * implicit_root_signature
union d3d12_pipeline_state::@6034 u
struct d3d12_device * device
struct d3d12_pipeline_uav_counter_state uav_counters
struct vkd3d_shader_uav_counter_binding * bindings
VkDescriptorSetLayout vk_set_layout
VkQueryPool vk_query_pool
unsigned int refcount
uint64_t availability_mask[]
struct d3d12_device * device
struct vkd3d_private_store private_store
ID3D12QueryHeap ID3D12QueryHeap_iface
unsigned int subresource_count
struct vkd3d_subresource_tile_info * subresources
unsigned int standard_mip_count
unsigned int packed_mip_tile_count
ID3D12Resource2 ID3D12Resource2_iface
unsigned int map_count
unsigned int refcount
unsigned int internal_refcount
union d3d12_resource::@6027 u
uint64_t heap_offset
D3D12_RESOURCE_STATES initial_state
struct d3d12_resource_tile_info tiles
struct d3d12_heap * heap
D3D12_GPU_VIRTUAL_ADDRESS gpu_address
struct vkd3d_private_store private_store
const struct vkd3d_format * format
D3D12_RESOURCE_STATES present_state
D3D12_RESOURCE_DESC1 desc
unsigned int flags
VkBuffer vk_buffer
struct d3d12_device * device
VkShaderStageFlags stage_flags
enum vkd3d_shader_descriptor_type type
struct d3d12_root_descriptor_table_range * ranges
struct d3d12_root_descriptor_table descriptor_table
union d3d12_root_parameter::@6033 u
struct d3d12_root_descriptor descriptor
D3D12_ROOT_PARAMETER_TYPE parameter_type
VkPushConstantRange push_constant_ranges[D3D12_SHADER_VISIBILITY_PIXEL+1]
unsigned int static_sampler_count
unsigned int root_constant_count
uint64_t descriptor_table_mask
uint32_t push_descriptor_mask
unsigned int root_descriptor_count
unsigned int push_constant_range_count
struct d3d12_descriptor_set_layout descriptor_set_layouts[VKD3D_MAX_DESCRIPTOR_SETS]
ID3D12RootSignature ID3D12RootSignature_iface
unsigned int descriptor_table_offset
unsigned int uav_mapping_count
unsigned int binding_count
unsigned int parameter_count
struct vkd3d_shader_push_constant_buffer * root_constants
struct d3d12_root_parameter * parameters
struct vkd3d_shader_descriptor_offset * descriptor_offsets
struct vkd3d_shader_descriptor_offset * uav_counter_offsets
VkSampler * static_samplers
unsigned int descriptor_table_count
struct vkd3d_private_store private_store
struct vkd3d_shader_uav_counter_binding * uav_counter_mapping
unsigned int refcount
D3D12_ROOT_SIGNATURE_FLAGS flags
struct vkd3d_shader_resource_binding * descriptor_mapping
struct d3d12_device * device
VkPipelineLayout vk_pipeline_layout
struct vkd3d_view * view
VkSampleCountFlagBits sample_count
unsigned int height
unsigned int layer_count
const struct vkd3d_format * format
struct d3d12_resource * resource
Definition: devices.h:37
Definition: heap.c:86
Definition: copy.c:22
Definition: tftpd.h:60
Definition: module.h:456
Definition: name.c:39
Definition: queue.c:179
Definition: ecma_167.h:138
VkDeviceMemory vk_memory
VkBuffer vk_buffer
VkDescriptorBufferInfo vk_cbv_info
D3D12_TILE_REGION_SIZE region_size
struct d3d12_resource * src_resource
struct d3d12_resource * dst_resource
D3D12_TILE_MAPPING_FLAGS flags
D3D12_TILED_RESOURCE_COORDINATE dst_region_start_coordinate
D3D12_TILED_RESOURCE_COORDINATE src_region_start_coordinate
VkCommandBuffer * buffers
unsigned int buffer_count
struct vkd3d_cs_execute execute
struct vkd3d_cs_signal signal
struct vkd3d_cs_wait wait
struct vkd3d_cs_update_mappings update_mappings
enum vkd3d_cs_op opcode
struct vkd3d_cs_copy_mappings copy_mappings
union vkd3d_cs_op_data::@6038 u
struct d3d12_fence * fence
D3D12_TILE_REGION_SIZE * region_sizes
struct d3d12_resource * resource
D3D12_TILED_RESOURCE_COORDINATE * region_start_coordinates
D3D12_TILE_RANGE_FLAGS * range_flags
D3D12_TILE_MAPPING_FLAGS flags
struct d3d12_heap * heap
struct d3d12_fence * fence
unsigned int volatile refcount
VkDescriptorType vk_descriptor_type
struct desc_object_cache_head heads[16]
unsigned int storage_image_max_descriptors
unsigned int uniform_buffer_max_descriptors
unsigned int storage_buffer_max_descriptors
unsigned int sampled_image_max_descriptors
struct vkd3d_queue * queue
void(* wait_for_gpu_fence)(struct vkd3d_fence_worker *worker, const struct vkd3d_waiting_fence *enqueued_fence)
struct vkd3d_waiting_fence * fences
struct vkd3d_cond cond
struct d3d12_device * device
union vkd3d_thread_handle thread
VkFormat vk_formats[VKD3D_MAX_COMPATIBLE_FORMAT_COUNT]
VkFormat vk_format
size_t block_height
enum vkd3d_format_type type
size_t block_byte_count
DXGI_FORMAT dxgi_format
unsigned int plane_count
VkImageAspectFlags vk_aspect_mask
size_t block_width
D3D12_GPU_VIRTUAL_ADDRESS base
struct vkd3d_gpu_va_slab * free_slab
struct vkd3d_gpu_va_allocation * fallback_allocations
struct vkd3d_gpu_va_slab * slabs
D3D12_GPU_VIRTUAL_ADDRESS fallback_floor
struct vkd3d_vulkan_info vk_info
enum vkd3d_api_version api_version
VkInstance vk_instance
uint32_t vk_api_version
VkDebugReportCallbackEXT vk_debug_callback
struct vkd3d_vk_global_procs vk_global_procs
uint64_t config_flags
PFN_vkd3d_signal_event signal_event
unsigned int refcount
PFN_vkd3d_join_thread join_thread
uint64_t host_ticks_per_second
struct vkd3d_vk_instance_procs vk_procs
PFN_vkd3d_create_thread create_thread
VkDeviceMemory vk_buffer_memory
VkDeviceMemory vk_2d_image_memory
VkDeviceMemory vk_2d_storage_image_memory
VkDeviceMemory vk_storage_buffer_memory
struct vkd3d_push_descriptor push_descriptors[D3D12_MAX_ROOT_COST/2]
const struct d3d12_root_signature * root_signature
struct d3d12_desc * descriptor_tables[D3D12_MAX_ROOT_COST]
uint32_t push_descriptor_active_mask
VkBufferView * vk_uav_counter_views
VkDescriptorSet descriptor_sets[VKD3D_MAX_DESCRIPTOR_SETS]
uint64_t descriptor_table_dirty_mask
uint64_t descriptor_table_active_mask
VkPipelineBindPoint vk_bind_point
union vkd3d_private_data::@6024 u
unsigned int size
struct vkd3d_mutex mutex
struct vkd3d_push_descriptor::@6035::@6036 cbv
VkBufferView vk_buffer_view
union vkd3d_push_descriptor::@6035 u
uint32_t vk_family_index
VkQueue vk_queue
size_t semaphores_size
VkSemaphore vk_semaphore
struct vkd3d_queue::@6037 * semaphores
uint64_t completed_sequence_number
VkSemaphore old_vk_semaphores[VKD3D_MAX_VK_SYNC_OBJECTS]
uint32_t timestamp_bits
uint64_t sequence_number
uint64_t submitted_sequence_number
size_t semaphore_count
VkQueueFlags vk_queue_flags
struct vkd3d_render_pass_entry * render_passes
Definition: state.c:1672
VkRenderPass vk_render_pass
Definition: state.c:1674
unsigned int sample_count
VkFormat vk_formats[D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT+1]
unsigned int attachment_count
VkDeviceSize offset
unsigned int layer_count
struct vkd3d_resource_view::@6029::@6030 buffer
VkImageView vk_image_view
VkBufferView vk_counter_view
struct vkd3d_resource_view::@6029::@6031 texture
enum vkd3d_view_type type
const struct vkd3d_format * format
union vkd3d_resource_view::@6029 info
VkBufferView vk_buffer_view
unsigned int miplevel_idx
unsigned int layer_idx
VkImageViewType vk_view_type
union vkd3d_resource_view::@6028 u
union vkd3d_signaled_semaphore::@6025 u
const struct vkd3d_queue * signalling_queue
struct vkd3d_signaled_semaphore::@6025::@6026 binary
VkImageUsageFlags usage
VkComponentMapping components
const struct vkd3d_format * format
VkImageAspectFlags vk_image_aspect
unsigned int miplevel_count
VkImageViewType view_type
VkClearColorValue colour
VkDescriptorSetLayout vk_set_layout_image
VkDescriptorSetLayout vk_set_layout_buffer
struct vkd3d_uav_clear_pipelines pipelines_uint
VkPipelineLayout vk_pipeline_layout_buffer
struct vkd3d_uav_clear_pipelines pipelines_float
VkPipelineLayout vk_pipeline_layout_image
VkDescriptorSetLayout vk_set_layout
D3D12_DESCRIPTOR_HEAP_TYPE applicable_heap_type
PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties
Definition: vkd3d_private.h:77
PFN_vkCreateInstance vkCreateInstance
Definition: vkd3d_private.h:76
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr
Definition: vkd3d_private.h:78
bool EXT_shader_viewport_index_layer
bool KHR_get_memory_requirements2
VkPhysicalDeviceLimits device_limits
bool vertex_attrib_zero_divisor
bool EXT_shader_stencil_export
VkPhysicalDeviceSparseProperties sparse_properties
bool EXT_fragment_shader_interlock
D3D_FEATURE_LEVEL max_feature_level
bool EXT_texel_buffer_alignment
unsigned int shader_extension_count
bool EXT_vertex_attribute_divisor
bool KHR_get_physical_device_properties2
bool EXT_conditional_rendering
bool EXT_depth_range_unrestricted
struct vkd3d_device_descriptor_limits descriptor_limits
VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT texel_buffer_alignment_properties
bool EXT_shader_demote_to_helper_invocation
enum vkd3d_shader_spirv_extension shader_extensions[VKD3D_MAX_SHADER_EXTENSIONS]
bool KHR_sampler_mirror_clamp_to_edge
bool transform_feedback_queries
bool EXT_calibrated_timestamps
bool EXT_mutable_descriptor_type
unsigned int max_vertex_attrib_divisor
union vkd3d_waiting_fence::@6023 u
struct d3d12_fence * fence
VkSemaphore vk_semaphore
uint64_t queue_sequence_number
#define max(a, b)
Definition: svc.c:63
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
Definition: pdh_main.c:64
void *(* PFN_vkd3d_thread)(void *data)
Definition: vkd3d.h:108
vkd3d_api_version
Definition: vkd3d.h:86
void *(* PFN_vkd3d_create_thread)(PFN_vkd3d_thread thread_main, void *data)
Definition: vkd3d.h:110
HRESULT(* PFN_vkd3d_signal_event)(HANDLE event)
Definition: vkd3d.h:106
HRESULT(* PFN_vkd3d_join_thread)(void *thread)
Definition: vkd3d.h:111
static void vkd3d_mutex_init(struct vkd3d_mutex *lock)
Definition: vkd3d_common.h:560
#define VKD3D_PRINTF_FUNC(fmt, args)
Definition: vkd3d_common.h:114
static void vkd3d_mutex_destroy(struct vkd3d_mutex *lock)
Definition: vkd3d_common.h:596
static bool vkd3d_atomic_compare_exchange_u32(uint32_t volatile *x, uint32_t expected, uint32_t val)
Definition: vkd3d_common.h:487
#define VKD3D_ASSERT(cond)
Definition: vkd3d_common.h:49
static void vkd3d_free(void *ptr)
Definition: vkd3d_memory.h:52
void vkd3d_render_pass_cache_init(struct vkd3d_render_pass_cache *cache)
Definition: state.c:1838
static bool vkd3d_format_is_compressed(const struct vkd3d_format *format)
#define VKD3D_MAX_DESCRIPTOR_SETS
Definition: vkd3d_private.h:60
void vkd3d_queue_destroy(struct vkd3d_queue *queue, struct d3d12_device *device)
Definition: command.c:67
VkSampleCountFlagBits vk_samples_from_dxgi_sample_desc(const DXGI_SAMPLE_DESC *desc)
Definition: resource.c:641
struct d3d12_root_signature * unsafe_impl_from_ID3D12RootSignature(ID3D12RootSignature *iface)
Definition: state.c:193
vkd3d_vk_descriptor_set_index
@ VKD3D_SET_INDEX_MUTABLE
@ VKD3D_SET_INDEX_STORAGE_IMAGE
@ VKD3D_SET_INDEX_UNIFORM_TEXEL_BUFFER
@ VKD3D_SET_INDEX_SAMPLED_IMAGE
@ VKD3D_SET_INDEX_UNIFORM_BUFFER
@ VKD3D_SET_INDEX_STORAGE_TEXEL_BUFFER
@ VKD3D_SET_INDEX_SAMPLER
@ VKD3D_SET_INDEX_UAV_COUNTER
@ VKD3D_SET_INDEX_COUNT
void vkd3d_gpu_va_allocator_free(struct vkd3d_gpu_va_allocator *allocator, D3D12_GPU_VIRTUAL_ADDRESS address)
Definition: device.c:2565
vkd3d_format_type
@ VKD3D_FORMAT_TYPE_SINT
@ VKD3D_FORMAT_TYPE_UINT
@ VKD3D_FORMAT_TYPE_OTHER
@ VKD3D_FORMAT_TYPE_TYPELESS
static void vk_prepend_struct(void *header, void *structure)
static unsigned int d3d12_desc_heap_range_size(const struct d3d12_desc *descriptor)
static void vkd3d_private_store_destroy(struct vkd3d_private_store *store)
static struct d3d12_rtv_desc * d3d12_rtv_desc_from_cpu_handle(D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle)
vkd3d_pipeline_bind_point
@ VKD3D_PIPELINE_BIND_POINT_COUNT
@ VKD3D_PIPELINE_BIND_POINT_GRAPHICS
@ VKD3D_PIPELINE_BIND_POINT_COMPUTE
const char * debug_vk_memory_heap_flags(VkMemoryHeapFlags flags)
Definition: utils.c:728
void d3d12_desc_create_cbv(struct d3d12_desc *descriptor, struct d3d12_device *device, const D3D12_CONSTANT_BUFFER_VIEW_DESC *desc)
Definition: resource.c:3140
HRESULT d3d12_root_signature_create(struct d3d12_device *device, const void *bytecode, size_t bytecode_length, struct d3d12_root_signature **root_signature)
Definition: state.c:1630
VkResult vkd3d_create_timeline_semaphore(const struct d3d12_device *device, uint64_t initial_value, VkSemaphore *timeline_semaphore)
Definition: command.c:1239
static ULONG d3d12_device_release(struct d3d12_device *device)
HRESULT return_interface(void *iface, REFIID iface_iid, REFIID requested_iid, void **object)
Definition: utils.c:628
void d3d12_dsv_desc_create_dsv(struct d3d12_dsv_desc *dsv_desc, struct d3d12_device *device, struct d3d12_resource *resource, const D3D12_DEPTH_STENCIL_VIEW_DESC *desc)
Definition: resource.c:3931
static void d3d12_resource_desc1_from_desc(D3D12_RESOURCE_DESC1 *desc1, const D3D12_RESOURCE_DESC *desc)
static unsigned int d3d12_device_get_descriptor_handle_increment_size(struct d3d12_device *device, D3D12_DESCRIPTOR_HEAP_TYPE descriptor_type)
HRESULT d3d12_reserved_resource_create(struct d3d12_device *device, const D3D12_RESOURCE_DESC1 *desc, D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, struct d3d12_resource **resource)
Definition: resource.c:2240
void d3d12_resource_get_tiling(struct d3d12_device *device, const struct d3d12_resource *resource, UINT *total_tile_count, D3D12_PACKED_MIP_INFO *packed_mip_info, D3D12_TILE_SHAPE *standard_tile_shape, UINT *sub_resource_tiling_count, UINT first_sub_resource_tiling, D3D12_SUBRESOURCE_TILING *sub_resource_tilings)
Definition: resource.c:1085
HRESULT vkd3d_render_pass_cache_find(struct vkd3d_render_pass_cache *cache, struct d3d12_device *device, const struct vkd3d_render_pass_key *key, VkRenderPass *vk_render_pass)
Definition: state.c:1809
HRESULT vkd3d_load_vk_device_procs(struct vkd3d_vk_device_procs *procs, const struct vkd3d_vk_instance_procs *parent_procs, VkDevice device)
Definition: utils.c:857
static enum vkd3d_vk_descriptor_set_index vkd3d_vk_descriptor_set_index_from_vk_descriptor_type(VkDescriptorType type)
static ULONG d3d12_device_add_ref(struct d3d12_device *device)
void d3d12_rtv_desc_create_rtv(struct d3d12_rtv_desc *rtv_desc, struct d3d12_device *device, struct d3d12_resource *resource, const D3D12_RENDER_TARGET_VIEW_DESC *desc)
Definition: resource.c:3835
static unsigned int d3d12_resource_desc_get_sub_resource_count(const D3D12_RESOURCE_DESC1 *desc)
static HRESULT d3d12_device_query_interface(struct d3d12_device *device, REFIID iid, void **object)
static bool d3d12_query_heap_is_result_available(const struct d3d12_query_heap *heap, unsigned int query_index)
void d3d12_desc_copy(struct d3d12_desc *dst, const struct d3d12_desc *src, struct d3d12_descriptor_heap *dst_heap, struct d3d12_device *device)
Definition: resource.c:2723
static bool d3d12_box_is_empty(const D3D12_BOX *box)
uint64_t object_global_serial_id
Definition: resource.c:25
static struct d3d12_resource * impl_from_ID3D12Resource2(ID3D12Resource2 *iface)
int vkd3d_parse_root_signature_v_1_0(const struct vkd3d_shader_code *dxbc, struct vkd3d_shader_versioned_root_signature_desc *desc)
Definition: vkd3d_main.c:170
static unsigned int d3d12_resource_desc_get_width(const D3D12_RESOURCE_DESC1 *desc, unsigned int miplevel_idx)
HRESULT d3d12_heap_create(struct d3d12_device *device, const D3D12_HEAP_DESC *desc, const struct d3d12_resource *resource, ID3D12ProtectedResourceSession *protected_session, struct d3d12_heap **heap)
Definition: resource.c:576
const char * debug_vk_extent_3d(VkExtent3D extent)
Definition: utils.c:696
HRESULT vkd3d_set_private_data(struct vkd3d_private_store *store, const GUID *tag, unsigned int data_size, const void *data)
Definition: utils.c:1033
bool is_valid_resource_state(D3D12_RESOURCE_STATES state)
Definition: utils.c:590
void d3d12_desc_flush_vk_heap_updates_locked(struct d3d12_descriptor_heap *descriptor_heap, struct d3d12_device *device)
Definition: resource.c:2639
static bool d3d12_resource_is_buffer(const struct d3d12_resource *resource)
const char * debug_vk_memory_property_flags(VkMemoryPropertyFlags flags)
Definition: utils.c:745
HRESULT d3d12_pipeline_state_create_graphics(struct d3d12_device *device, const D3D12_GRAPHICS_PIPELINE_STATE_DESC *desc, struct d3d12_pipeline_state **state)
Definition: state.c:3630
HRESULT d3d12_fence_create(struct d3d12_device *device, uint64_t initial_value, D3D12_FENCE_FLAGS flags, struct d3d12_fence **fence)
Definition: command.c:1222
#define VKD3D_MAX_DEVICE_BLOCKED_QUEUES
Definition: vkd3d_private.h:59
void * vkd3d_gpu_va_allocator_dereference(struct vkd3d_gpu_va_allocator *allocator, D3D12_GPU_VIRTUAL_ADDRESS address)
Definition: device.c:2495
const char * debug_d3d12_shader_component_mapping(unsigned int mapping)
Definition: utils.c:682
static bool d3d12_pipeline_state_is_graphics(const struct d3d12_pipeline_state *state)
static void debug_ignored_node_mask(unsigned int mask)
HRESULT vkd3d_load_vk_instance_procs(struct vkd3d_vk_instance_procs *procs, const struct vkd3d_vk_global_procs *global_procs, VkInstance instance)
Definition: utils.c:834
static HRESULT vkd3d_private_store_init(struct vkd3d_private_store *store)
static unsigned int dsv_attachment_mask(const struct d3d12_graphics_pipeline_state *graphics)
#define VKD3D_MAX_SHADER_EXTENSIONS
Definition: vkd3d_private.h:56
static unsigned int d3d12_resource_desc_get_layer_count(const D3D12_RESOURCE_DESC1 *desc)
HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC1 *desc, struct d3d12_device *device)
Definition: resource.c:1850
HRESULT vkd3d_set_private_data_interface(struct vkd3d_private_store *store, const GUID *tag, const IUnknown *object)
Definition: utils.c:1046
VkResult vkd3d_set_vk_object_name_utf8(struct d3d12_device *device, uint64_t vk_object, VkDebugReportObjectTypeEXT vk_object_type, const char *name)
Definition: utils.c:1060
const char vkd3d_build[]
static size_t vkd3d_format_get_data_offset(const struct vkd3d_format *format, unsigned int row_pitch, unsigned int slice_pitch, unsigned int x, unsigned int y, unsigned int z)
void vkd3d_destroy_null_resources(struct vkd3d_null_resources *null_resources, struct d3d12_device *device)
Definition: resource.c:4965
int vkd3d_shader_cache_put(struct vkd3d_shader_cache *cache, const void *key, size_t key_size, const void *value, size_t value_size)
Definition: cache.c:153
void vkd3d_format_copy_data(const struct vkd3d_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)
Definition: utils.c:496
bool is_write_resource_state(D3D12_RESOURCE_STATES state)
Definition: utils.c:575
HRESULT d3d12_command_list_create(struct d3d12_device *device, UINT node_mask, D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator *allocator_iface, ID3D12PipelineState *initial_pipeline_state, struct d3d12_command_list **list)
Definition: command.c:6262
HRESULT hresult_from_vk_result(VkResult vr)
Definition: utils.c:784
static struct d3d12_desc * d3d12_desc_from_cpu_handle(D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle)
static const struct vkd3d_format * vkd3d_format_from_d3d12_resource_desc(const struct d3d12_device *device, const D3D12_RESOURCE_DESC1 *desc, DXGI_FORMAT view_format)
static struct d3d12_desc * d3d12_desc_from_gpu_handle(D3D12_GPU_DESCRIPTOR_HANDLE gpu_handle)
HRESULT vkd3d_load_vk_global_procs(struct vkd3d_vk_global_procs *procs, PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr)
Definition: utils.c:811
HRESULT vkd3d_uav_clear_state_init(struct vkd3d_uav_clear_state *state, struct d3d12_device *device)
Definition: state.c:4068
bool is_valid_feature_level(D3D_FEATURE_LEVEL feature_level)
Definition: utils.c:548
int vkd3d_shader_cache_get(struct vkd3d_shader_cache *cache, const void *key, size_t key_size, void *value, size_t *value_size)
Definition: cache.c:208
VkPipeline d3d12_pipeline_state_get_or_create_pipeline(struct d3d12_pipeline_state *state, D3D12_PRIMITIVE_TOPOLOGY topology, const uint32_t *strides, VkFormat dsv_format, VkRenderPass *vk_render_pass)
Definition: state.c:3827
void vkd3d_view_decref(void *view, struct d3d12_device *device)
Definition: resource.c:2453
HRESULT vkd3d_get_image_allocation_info(struct d3d12_device *device, const D3D12_RESOURCE_DESC1 *desc, struct vkd3d_resource_allocation_info *allocation_info)
Definition: resource.c:942
struct d3d12_heap * unsafe_impl_from_ID3D12Heap(ID3D12Heap *iface)
Definition: resource.c:442
bool vkd3d_create_raw_buffer_view(struct d3d12_device *device, D3D12_GPU_VIRTUAL_ADDRESS gpu_address, D3D12_ROOT_PARAMETER_TYPE parameter_type, VkBufferView *vk_buffer_view)
Definition: resource.c:3613
HRESULT hresult_from_vkd3d_result(int vkd3d_result)
Definition: error.c:21
HRESULT vkd3d_create_buffer(struct d3d12_device *device, const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags, const D3D12_RESOURCE_DESC1 *desc, VkBuffer *vk_buffer)
Definition: resource.c:652
HRESULT d3d12_descriptor_heap_create(struct d3d12_device *device, const D3D12_DESCRIPTOR_HEAP_DESC *desc, struct d3d12_descriptor_heap **descriptor_heap)
Definition: resource.c:4366
struct d3d12_command_signature * unsafe_impl_from_ID3D12CommandSignature(ID3D12CommandSignature *iface)
Definition: command.c:7627
#define VKD3D_MAX_QUEUE_FAMILY_COUNT
Definition: vkd3d_private.h:55
HRESULT d3d12_device_add_descriptor_heap(struct d3d12_device *device, struct d3d12_descriptor_heap *heap)
Definition: device.c:5569
HRESULT d3d12_committed_resource_create(struct d3d12_device *device, const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags, const D3D12_RESOURCE_DESC1 *desc, D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, ID3D12ProtectedResourceSession *protected_session, struct d3d12_resource **resource)
Definition: resource.c:2112
HRESULT vkd3d_create_static_sampler(struct d3d12_device *device, const D3D12_STATIC_SAMPLER_DESC *desc, VkSampler *vk_sampler)
Definition: resource.c:3814
static void vkd3d_private_data_destroy(struct vkd3d_private_data *data)
bool vkd3d_get_program_name(char program_name[PATH_MAX])
Definition: utils.c:931
static bool d3d12_pipeline_state_is_compute(const struct d3d12_pipeline_state *state)
enum vkd3d_vk_descriptor_set_index vk_descriptor_set_index_table[]
Definition: resource.c:4227
D3D12_GPU_VIRTUAL_ADDRESS vkd3d_gpu_va_allocator_allocate(struct vkd3d_gpu_va_allocator *allocator, size_t alignment, uint64_t size, void *ptr)
Definition: device.c:2424
static void * d3d12_desc_get_object_ref(const volatile struct d3d12_desc *src, struct d3d12_device *device)
HRESULT d3d12_command_allocator_create(struct d3d12_device *device, D3D12_COMMAND_LIST_TYPE type, struct d3d12_command_allocator **allocator)
Definition: command.c:1895
#define VKD3D_MAX_SHADER_STAGES
Definition: vkd3d_private.h:57
HRESULT hresult_from_errno(int rc)
Definition: utils.c:768
bool d3d12_resource_is_cpu_accessible(const struct d3d12_resource *resource)
Definition: resource.c:1029
static bool vkd3d_view_incref(void *desc)
const struct vkd3d_format * vkd3d_get_format(const struct d3d12_device *device, DXGI_FORMAT dxgi_format, bool depth_stencil)
Definition: utils.c:442
void vkd3d_uav_clear_state_cleanup(struct vkd3d_uav_clear_state *state, struct d3d12_device *device)
Definition: state.c:4054
static bool d3d12_pipeline_state_has_unknown_dsv_format(struct d3d12_pipeline_state *state)
bool vkd3d_create_buffer_view(struct d3d12_device *device, uint32_t magic, VkBuffer vk_buffer, const struct vkd3d_format *format, VkDeviceSize offset, VkDeviceSize size, struct vkd3d_view **view)
Definition: resource.c:2792
static struct d3d12_resource * impl_from_ID3D12Resource(ID3D12Resource *iface)
void d3d12_desc_create_uav(struct d3d12_desc *descriptor, struct d3d12_device *device, struct d3d12_resource *resource, struct d3d12_resource *counter_resource, const D3D12_UNORDERED_ACCESS_VIEW_DESC *desc)
Definition: resource.c:3589
struct d3d12_pipeline_state * unsafe_impl_from_ID3D12PipelineState(ID3D12PipelineState *iface)
Definition: state.c:2242
void d3d12_device_mark_as_removed(struct d3d12_device *device, HRESULT reason, const char *message,...) VKD3D_PRINTF_FUNC(3
void vkd3d_queue_release(struct vkd3d_queue *queue)
Definition: command.c:101
HRESULT vkd3d_join_thread(struct vkd3d_instance *instance, union vkd3d_thread_handle *thread)
Definition: device.c:5663
HRESULT d3d12_query_heap_create(struct d3d12_device *device, const D3D12_QUERY_HEAP_DESC *desc, struct d3d12_query_heap **heap)
Definition: resource.c:4568
void d3d12_desc_create_srv(struct d3d12_desc *descriptor, struct d3d12_device *device, struct d3d12_resource *resource, const D3D12_SHADER_RESOURCE_VIEW_DESC *desc)
Definition: resource.c:3302
HRESULT vkd3d_init_format_info(struct d3d12_device *device)
Definition: utils.c:401
struct d3d12_resource * unsafe_impl_from_ID3D12Resource(ID3D12Resource *iface)
Definition: resource.c:1770
bool vkd3d_create_texture_view(struct d3d12_device *device, uint32_t magic, VkImage vk_image, const struct vkd3d_texture_view_desc *desc, struct vkd3d_view **view)
Definition: resource.c:3082
unsigned int vkd3d_shader_cache_incref(struct vkd3d_shader_cache *cache)
Definition: cache.c:101
static bool d3d12_resource_is_texture(const struct d3d12_resource *resource)
static unsigned int d3d12_resource_desc_get_height(const D3D12_RESOURCE_DESC1 *desc, unsigned int miplevel_idx)
const char * debug_gpu_handle(D3D12_GPU_DESCRIPTOR_HANDLE handle)
Definition: utils.c:691
vkd3d_view_type
@ VKD3D_VIEW_TYPE_SAMPLER
@ VKD3D_VIEW_TYPE_IMAGE
@ VKD3D_VIEW_TYPE_BUFFER
bool d3d12_device_is_uma(struct d3d12_device *device, bool *coherent)
Definition: device.c:3358
static void d3d12_desc_copy_raw(struct d3d12_desc *dst, const struct d3d12_desc *src)
const char * debug_vk_queue_flags(VkQueueFlags flags)
Definition: utils.c:704
#define VKD3D_MAX_COMPATIBLE_FORMAT_COUNT
Definition: vkd3d_private.h:54
HRESULT vkd3d_set_vk_object_name(struct d3d12_device *device, uint64_t vk_object, VkDebugReportObjectTypeEXT vk_object_type, const WCHAR *name)
Definition: utils.c:1077
struct vkd3d_queue * d3d12_device_get_vkd3d_queue(struct d3d12_device *device, D3D12_COMMAND_LIST_TYPE type)
Definition: command.c:1800
void d3d12_desc_write_atomic(struct d3d12_desc *dst, const struct d3d12_desc *src, struct d3d12_device *device)
Definition: resource.c:2710
HRESULT d3d12_command_queue_create(struct d3d12_device *device, const D3D12_COMMAND_QUEUE_DESC *desc, struct d3d12_command_queue **queue)
Definition: command.c:7464
VkCompareOp vk_compare_op_from_d3d12(D3D12_COMPARISON_FUNC op)
Definition: state.c:2764
HRESULT vkd3d_queue_create(struct d3d12_device *device, uint32_t family_index, const VkQueueFamilyProperties *properties, struct vkd3d_queue **queue)
Definition: command.c:34
const char * debug_d3d12_box(const D3D12_BOX *box)
Definition: utils.c:650
HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources, struct d3d12_device *device)
Definition: resource.c:4846
void vkd3d_cleanup_format_info(struct d3d12_device *device)
Definition: utils.c:414
HRESULT vkd3d_create_thread(struct vkd3d_instance *instance, PFN_vkd3d_thread thread_main, void *data, union vkd3d_thread_handle *thread)
Definition: device.c:5620
const struct vkd3d_format * vkd3d_find_uint_format(const struct d3d12_device *device, DXGI_FORMAT dxgi_format)
Definition: utils.c:465
HRESULT d3d12_pipeline_state_create_compute(struct d3d12_device *device, const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc, struct d3d12_pipeline_state **state)
Definition: state.c:2621
#define VKD3D_MAX_VK_SYNC_OBJECTS
Definition: vkd3d_private.h:58
void d3d12_device_remove_descriptor_heap(struct d3d12_device *device, struct d3d12_descriptor_heap *heap)
Definition: device.c:5586
VkQueue vkd3d_queue_acquire(struct vkd3d_queue *queue)
Definition: command.c:91
void vkd3d_render_pass_cache_cleanup(struct vkd3d_render_pass_cache *cache, struct d3d12_device *device)
Definition: state.c:1845
void struct d3d12_device * unsafe_impl_from_ID3D12Device9(ID3D12Device9 *iface)
Definition: device.c:5398
const char * debug_cpu_handle(D3D12_CPU_DESCRIPTOR_HANDLE handle)
Definition: utils.c:645
static unsigned int d3d12_resource_desc_get_depth(const D3D12_RESOURCE_DESC1 *desc, unsigned int miplevel_idx)
vkd3d_config_flags
@ VKD3D_CONFIG_FLAG_VIRTUAL_HEAPS
@ VKD3D_CONFIG_FLAG_VULKAN_DEBUG
HRESULT d3d12_pipeline_state_create(struct d3d12_device *device, const D3D12_PIPELINE_STATE_STREAM_DESC *desc, struct d3d12_pipeline_state **state)
Definition: state.c:3655
VkSampleCountFlagBits vk_samples_from_sample_count(unsigned int sample_count)
Definition: resource.c:618
struct d3d12_query_heap * unsafe_impl_from_ID3D12QueryHeap(ID3D12QueryHeap *iface)
Definition: resource.c:4560
#define VKD3D_DESCRIPTOR_POOL_COUNT
HRESULT vkd3d_allocate_buffer_memory(struct d3d12_device *device, VkBuffer vk_buffer, const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags, VkDeviceMemory *vk_memory, uint32_t *vk_memory_type, VkDeviceSize *vk_memory_size)
Definition: resource.c:155
void d3d12_desc_create_sampler(struct d3d12_desc *sampler, struct d3d12_device *device, const D3D12_SAMPLER_DESC *desc)
Definition: resource.c:3780
static void vkd3d_prepend_struct(void *header, void *structure)
static void d3d12_query_heap_mark_result_as_available(struct d3d12_query_heap *heap, unsigned int query_index)
HRESULT vkd3d_get_private_data(struct vkd3d_private_store *store, const GUID *tag, unsigned int *out_size, void *out)
Definition: utils.c:994
unsigned int vkd3d_shader_cache_decref(struct vkd3d_shader_cache *cache)
Definition: cache.c:115
HRESULT d3d12_device_create(struct vkd3d_instance *instance, const struct vkd3d_device_create_info *create_info, struct d3d12_device **device)
Definition: device.c:5534
static unsigned int vkd3d_compute_workgroup_count(unsigned int thread_count, unsigned int workgroup_size)
static struct d3d12_dsv_desc * d3d12_dsv_desc_from_cpu_handle(D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle)
vkd3d_cs_op
@ VKD3D_CS_OP_UPDATE_MAPPINGS
@ VKD3D_CS_OP_SIGNAL
@ VKD3D_CS_OP_WAIT
@ VKD3D_CS_OP_EXECUTE
@ VKD3D_CS_OP_COPY_MAPPINGS
HRESULT d3d12_placed_resource_create(struct d3d12_device *device, struct d3d12_heap *heap, uint64_t heap_offset, const D3D12_RESOURCE_DESC1 *desc, D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, struct d3d12_resource **resource)
Definition: resource.c:2216
int vkd3d_shader_open_cache(struct vkd3d_shader_cache **cache)
Definition: cache.c:82
HRESULT d3d12_command_signature_create(struct d3d12_device *device, const D3D12_COMMAND_SIGNATURE_DESC *desc, struct d3d12_command_signature **signature)
Definition: command.c:7635
static struct d3d12_descriptor_heap * d3d12_desc_get_descriptor_heap(const struct d3d12_desc *descriptor)
vkd3d_shader_spirv_extension
vkd3d_shader_descriptor_type
Definition: vkd3d_shader.h:420
vkd3d_shader_spirv_environment
vkd3d_result
Definition: vkd3d_types.h:41
VkFlags VkMemoryPropertyFlags
Definition: vulkan.h:1063
VkFlags VkImageAspectFlags
Definition: vulkan.h:1043
uint32_t VkSampleMask
Definition: vulkan.h:952
VkFlags VkImageUsageFlags
Definition: vulkan.h:1050
VkFlags VkQueueFlags
Definition: vulkan.h:1116
VkTimeDomainKHR
Definition: vulkan.h:6178
VkImageViewType
Definition: vulkan.h:3547
uint64_t VkDeviceSize
Definition: vulkan.h:948
PFN_vkVoidFunction(VKAPI_PTR * PFN_vkGetInstanceProcAddr)(VkInstance, const char *)
Definition: vulkan.h:18143
VkPipelineBindPoint
Definition: vulkan.h:4067
@ VK_PIPELINE_BIND_POINT_GRAPHICS
Definition: vulkan.h:4068
@ VK_PIPELINE_BIND_POINT_COMPUTE
Definition: vulkan.h:4069
VkDebugReportObjectTypeEXT
Definition: vulkan.h:2328
VkFlags VkMemoryHeapFlags
Definition: vulkan.h:1061
VkSampleCountFlagBits
Definition: vulkan.h:4700
VkResult(VKAPI_PTR * PFN_vkCreateInstance)(const VkInstanceCreateInfo *, const VkAllocationCallbacks *, VkInstance *)
Definition: vulkan.h:17981
PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *pName)
VkCompareOp
Definition: vulkan.h:2174
VkLogicOp
Definition: vulkan.h:3710
VkFlags VkShaderStageFlags
Definition: vulkan.h:1134
VkResult(VKAPI_PTR * PFN_vkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *)
Definition: vulkan.h:18061
VkResult
Definition: vulkan.h:4639
VkDescriptorType
Definition: vulkan.h:2463
@ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER
Definition: vulkan.h:2470
VkVertexInputRate
Definition: vulkan.h:6259
VkFormat
Definition: vulkan.h:2815
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
unsigned char BYTE
Definition: xxhash.c:193