ReactOS 0.4.17-dev-923-g4c9a150
device.c
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#include "vkd3d_private.h"
20#include "vkd3d_version.h"
21
22#define VKD3D_MAX_UAV_CLEAR_DESCRIPTORS_PER_TYPE 256u
23
24struct vkd3d_struct
25{
27 const void *next;
28};
29
30#define vkd3d_find_struct(c, t) vkd3d_find_struct_(c, VKD3D_STRUCTURE_TYPE_##t)
31static const void *vkd3d_find_struct_(const struct vkd3d_struct *chain,
33{
34 while (chain)
35 {
36 if (chain->type == type)
37 return chain;
38
39 chain = chain->next;
40 }
41
42 return NULL;
43}
44
46{
47 int major, minor;
48
50 return VK_MAKE_VERSION(major, minor, 0);
51}
52
54{
55 const char *extension_name;
58};
59
60#define VK_EXTENSION(name, member) \
61 {VK_ ## name ## _EXTENSION_NAME, offsetof(struct vkd3d_vulkan_info, member)}
62#define VK_DEBUG_EXTENSION(name, member) \
63 {VK_ ## name ## _EXTENSION_NAME, offsetof(struct vkd3d_vulkan_info, member), true}
64
66{
67 /* KHR extensions */
68 VK_EXTENSION(KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2, KHR_get_physical_device_properties2),
69 /* EXT extensions */
70 VK_DEBUG_EXTENSION(EXT_DEBUG_REPORT, EXT_debug_report),
71};
72
73static const char * const required_device_extensions[] =
74{
77};
78
79/* In general we don't want to enable Vulkan beta extensions, but make an
80 * exception for VK_KHR_portability_subset because we draw no real feature from
81 * it, but it's still useful to be able to develop for MoltenVK without being
82 * spammed with validation errors. */
83#ifndef VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME
84#define VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME "VK_KHR_portability_subset"
85#endif
86
88{
89 /* KHR extensions */
90 VK_EXTENSION(KHR_DEDICATED_ALLOCATION, KHR_dedicated_allocation),
91 VK_EXTENSION(KHR_DRAW_INDIRECT_COUNT, KHR_draw_indirect_count),
92 VK_EXTENSION(KHR_GET_MEMORY_REQUIREMENTS_2, KHR_get_memory_requirements2),
93 VK_EXTENSION(KHR_IMAGE_FORMAT_LIST, KHR_image_format_list),
94 VK_EXTENSION(KHR_MAINTENANCE2, KHR_maintenance2),
95 VK_EXTENSION(KHR_MAINTENANCE3, KHR_maintenance3),
96 VK_EXTENSION(KHR_PORTABILITY_SUBSET, KHR_portability_subset),
97 VK_EXTENSION(KHR_PUSH_DESCRIPTOR, KHR_push_descriptor),
98 VK_EXTENSION(KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE, KHR_sampler_mirror_clamp_to_edge),
99 VK_EXTENSION(KHR_TIMELINE_SEMAPHORE, KHR_timeline_semaphore),
100 /* EXT extensions */
101 VK_EXTENSION(EXT_4444_FORMATS, EXT_4444_formats),
102 VK_EXTENSION(EXT_CALIBRATED_TIMESTAMPS, EXT_calibrated_timestamps),
103 VK_EXTENSION(EXT_CONDITIONAL_RENDERING, EXT_conditional_rendering),
104 VK_DEBUG_EXTENSION(EXT_DEBUG_MARKER, EXT_debug_marker),
105 VK_EXTENSION(EXT_DEPTH_RANGE_UNRESTRICTED, EXT_depth_range_unrestricted),
106 VK_EXTENSION(EXT_DEPTH_CLIP_ENABLE, EXT_depth_clip_enable),
107 VK_EXTENSION(EXT_DESCRIPTOR_INDEXING, EXT_descriptor_indexing),
108 VK_EXTENSION(EXT_FRAGMENT_SHADER_INTERLOCK, EXT_fragment_shader_interlock),
109 VK_EXTENSION(EXT_MUTABLE_DESCRIPTOR_TYPE, EXT_mutable_descriptor_type),
110 VK_EXTENSION(EXT_ROBUSTNESS_2, EXT_robustness2),
111 VK_EXTENSION(EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION, EXT_shader_demote_to_helper_invocation),
112 VK_EXTENSION(EXT_SHADER_STENCIL_EXPORT, EXT_shader_stencil_export),
113 VK_EXTENSION(EXT_SHADER_VIEWPORT_INDEX_LAYER, EXT_shader_viewport_index_layer),
114 VK_EXTENSION(EXT_TEXEL_BUFFER_ALIGNMENT, EXT_texel_buffer_alignment),
115 VK_EXTENSION(EXT_TRANSFORM_FEEDBACK, EXT_transform_feedback),
116 VK_EXTENSION(EXT_VERTEX_ATTRIBUTE_DIVISOR, EXT_vertex_attribute_divisor),
117};
118
120{
121 const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
128 VkResult vr;
129
130 static const VkDescriptorType descriptor_types[] =
131 {
137 };
138
139 if (device->vk_info.EXT_mutable_descriptor_type
141 && device->vk_descriptor_heap_layouts[index].applicable_heap_type == D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV)
142 {
143 device->vk_descriptor_heap_layouts[index].vk_set_layout = VK_NULL_HANDLE;
144 return S_OK;
145 }
146
147 binding.binding = 0;
148 binding.descriptorType = (device->vk_info.EXT_mutable_descriptor_type && index == VKD3D_SET_INDEX_MUTABLE)
149 ? VK_DESCRIPTOR_TYPE_MUTABLE_EXT : device->vk_descriptor_heap_layouts[index].type;
150 binding.descriptorCount = device->vk_descriptor_heap_layouts[index].count;
151 binding.stageFlags = VK_SHADER_STAGE_ALL;
152 binding.pImmutableSamplers = NULL;
153
155 set_desc.pNext = &flags_info;
157 set_desc.bindingCount = 1;
158 set_desc.pBindings = &binding;
159
163
165 flags_info.pNext = NULL;
166 flags_info.bindingCount = 1;
167 flags_info.pBindingFlags = &set_flags;
168
169 if (binding.descriptorType == VK_DESCRIPTOR_TYPE_MUTABLE_EXT)
170 {
171 type_list.descriptorTypeCount = ARRAY_SIZE(descriptor_types);
172 type_list.pDescriptorTypes = descriptor_types;
174 mutable_info.pNext = NULL;
175 mutable_info.mutableDescriptorTypeListCount = 1;
176 mutable_info.pMutableDescriptorTypeLists = &type_list;
177 flags_info.pNext = &mutable_info;
178 }
179
180 if ((vr = VK_CALL(vkCreateDescriptorSetLayout(device->vk_device, &set_desc, NULL,
181 &device->vk_descriptor_heap_layouts[index].vk_set_layout))) < 0)
182 {
183 WARN("Failed to create Vulkan descriptor set layout, vr %d.\n", vr);
184 return hresult_from_vk_result(vr);
185 }
186
187 return S_OK;
188}
189
191{
192 const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
194
195 for (set = 0; set < ARRAY_SIZE(device->vk_descriptor_heap_layouts); ++set)
196 VK_CALL(vkDestroyDescriptorSetLayout(device->vk_device, device->vk_descriptor_heap_layouts[set].vk_set_layout,
197 NULL));
198}
199
201{
202 static const struct vkd3d_vk_descriptor_heap_layout vk_descriptor_heap_layouts[VKD3D_SET_INDEX_COUNT] =
203 {
218 };
219 const struct vkd3d_device_descriptor_limits *limits = &device->vk_info.descriptor_limits;
221 HRESULT hr;
222
223 for (set = 0; set < ARRAY_SIZE(device->vk_descriptor_heap_layouts); ++set)
224 device->vk_descriptor_heap_layouts[set] = vk_descriptor_heap_layouts[set];
225
226 if (!device->use_vk_heaps)
227 return S_OK;
228
229 for (set = 0; set < ARRAY_SIZE(device->vk_descriptor_heap_layouts); ++set)
230 {
231 switch (device->vk_descriptor_heap_layouts[set].type)
232 {
234 device->vk_descriptor_heap_layouts[set].count = limits->uniform_buffer_max_descriptors;
235 break;
238 device->vk_descriptor_heap_layouts[set].count = limits->sampled_image_max_descriptors;
239 break;
242 device->vk_descriptor_heap_layouts[set].count = limits->storage_image_max_descriptors;
243 break;
245 device->vk_descriptor_heap_layouts[set].count = limits->sampler_max_descriptors;
246 break;
247 default:
248 ERR("Unhandled descriptor type %#x.\n", device->vk_descriptor_heap_layouts[set].type);
249 break;
250 }
251
253 {
255 return hr;
256 }
257 }
258
259 return S_OK;
260}
261
262static unsigned int get_spec_version(const VkExtensionProperties *extensions,
263 unsigned int count, const char *extension_name)
264{
265 unsigned int i;
266
267 for (i = 0; i < count; ++i)
268 {
269 if (!strcmp(extensions[i].extensionName, extension_name))
270 return extensions[i].specVersion;
271 }
272 return 0;
273}
274
275static bool is_extension_disabled(const char *extension_name)
276{
277 const char *disabled_extensions;
278
279 if (!(disabled_extensions = getenv("VKD3D_DISABLE_EXTENSIONS")))
280 return false;
281
282 return vkd3d_debug_list_has_member(disabled_extensions, extension_name);
283}
284
285static bool has_extension(const VkExtensionProperties *extensions,
286 unsigned int count, const char *extension_name)
287{
288 unsigned int i;
289
290 for (i = 0; i < count; ++i)
291 {
292 if (!strcmp(extensions[i].extensionName, extension_name))
293 {
294 if (is_extension_disabled(extension_name))
295 {
296 WARN("Extension %s is disabled.\n", debugstr_a(extension_name));
297 return false;
298 }
299 return true;
300 }
301 }
302 return false;
303}
304
305static unsigned int vkd3d_check_extensions(const VkExtensionProperties *extensions, unsigned int count,
306 const char * const *required_extensions, unsigned int required_extension_count,
307 const struct vkd3d_optional_extension_info *optional_extensions, unsigned int optional_extension_count,
308 const char * const *user_extensions, unsigned int user_extension_count,
309 const char * const *optional_user_extensions, unsigned int optional_user_extension_count,
310 bool *user_extension_supported, struct vkd3d_vulkan_info *vulkan_info, const char *extension_type,
311 bool is_debug_enabled)
312{
313 unsigned int extension_count = 0;
314 unsigned int i;
315
316 for (i = 0; i < required_extension_count; ++i)
317 {
318 if (!has_extension(extensions, count, required_extensions[i]))
319 WARN("Required %s extension %s is not supported.\n",
320 extension_type, debugstr_a(required_extensions[i]));
321 ++extension_count;
322 }
323
324 for (i = 0; i < optional_extension_count; ++i)
325 {
326 const char *extension_name = optional_extensions[i].extension_name;
327 ptrdiff_t offset = optional_extensions[i].vulkan_info_offset;
328 bool *supported = (void *)((uintptr_t)vulkan_info + offset);
329
330 if (!is_debug_enabled && optional_extensions[i].is_debug_only)
331 {
332 *supported = false;
333 TRACE("Skipping debug-only extension %s.\n", debugstr_a(extension_name));
334 continue;
335 }
336
337 if ((*supported = has_extension(extensions, count, extension_name)))
338 {
339 TRACE("Found %s extension.\n", debugstr_a(extension_name));
340 ++extension_count;
341 }
342 }
343
344 for (i = 0; i < user_extension_count; ++i)
345 {
346 if (!has_extension(extensions, count, user_extensions[i]))
347 WARN("Required user %s extension %s is not supported.\n",
348 extension_type, debugstr_a(user_extensions[i]));
349 ++extension_count;
350 }
351
352 VKD3D_ASSERT(!optional_user_extension_count || user_extension_supported);
353 for (i = 0; i < optional_user_extension_count; ++i)
354 {
355 if (has_extension(extensions, count, optional_user_extensions[i]))
356 {
357 user_extension_supported[i] = true;
358 ++extension_count;
359 }
360 else
361 {
362 user_extension_supported[i] = false;
363 WARN("Optional user %s extension %s is not supported.\n",
364 extension_type, debugstr_a(optional_user_extensions[i]));
365 }
366 }
367
368 return extension_count;
369}
370
371static unsigned int vkd3d_append_extension(const char *extensions[],
372 unsigned int extension_count, const char *extension_name)
373{
374 unsigned int i;
375
376 /* avoid duplicates */
377 for (i = 0; i < extension_count; ++i)
378 {
379 if (!strcmp(extensions[i], extension_name))
380 return extension_count;
381 }
382
383 extensions[extension_count++] = extension_name;
384 return extension_count;
385}
386
387static unsigned int vkd3d_enable_extensions(const char *extensions[],
388 const char * const *required_extensions, unsigned int required_extension_count,
389 const struct vkd3d_optional_extension_info *optional_extensions, unsigned int optional_extension_count,
390 const char * const *user_extensions, unsigned int user_extension_count,
391 const char * const *optional_user_extensions, unsigned int optional_user_extension_count,
392 bool *user_extension_supported, const struct vkd3d_vulkan_info *vulkan_info)
393{
394 unsigned int extension_count = 0;
395 unsigned int i;
396
397 for (i = 0; i < required_extension_count; ++i)
398 {
399 extensions[extension_count++] = required_extensions[i];
400 }
401 for (i = 0; i < optional_extension_count; ++i)
402 {
403 ptrdiff_t offset = optional_extensions[i].vulkan_info_offset;
404 const bool *supported = (void *)((uintptr_t)vulkan_info + offset);
405
406 if (*supported)
407 extensions[extension_count++] = optional_extensions[i].extension_name;
408 }
409
410 for (i = 0; i < user_extension_count; ++i)
411 {
412 extension_count = vkd3d_append_extension(extensions, extension_count, user_extensions[i]);
413 }
414 VKD3D_ASSERT(!optional_user_extension_count || user_extension_supported);
415 for (i = 0; i < optional_user_extension_count; ++i)
416 {
417 if (!user_extension_supported[i])
418 continue;
419 extension_count = vkd3d_append_extension(extensions, extension_count, optional_user_extensions[i]);
420 }
421
422 return extension_count;
423}
424
426 const struct vkd3d_instance_create_info *create_info,
427 uint32_t *instance_extension_count, bool **user_extension_supported)
428{
429 const struct vkd3d_vk_global_procs *vk_procs = &instance->vk_global_procs;
430 const struct vkd3d_optional_instance_extensions_info *optional_extensions;
431 struct vkd3d_vulkan_info *vulkan_info = &instance->vk_info;
432 VkExtensionProperties *vk_extensions;
434 VkResult vr;
435
436 memset(vulkan_info, 0, sizeof(*vulkan_info));
437 *instance_extension_count = 0;
438
439 if ((vr = vk_procs->vkEnumerateInstanceExtensionProperties(NULL, &count, NULL)) < 0)
440 {
441 ERR("Failed to enumerate instance extensions, vr %d.\n", vr);
442 return hresult_from_vk_result(vr);
443 }
444
445 if (!(vk_extensions = vkd3d_calloc(count, sizeof(*vk_extensions))))
446 return E_OUTOFMEMORY;
447
448 TRACE("Enumerating %u instance extensions.\n", count);
449 if ((vr = vk_procs->vkEnumerateInstanceExtensionProperties(NULL, &count, vk_extensions)) < 0)
450 {
451 ERR("Failed to enumerate instance extensions, vr %d.\n", vr);
452 vkd3d_free(vk_extensions);
453 return hresult_from_vk_result(vr);
454 }
455
456 optional_extensions = vkd3d_find_struct(create_info->next, OPTIONAL_INSTANCE_EXTENSIONS_INFO);
457 if (optional_extensions && optional_extensions->extension_count)
458 {
459 if (!(*user_extension_supported = vkd3d_calloc(optional_extensions->extension_count, sizeof(bool))))
460 {
461 vkd3d_free(vk_extensions);
462 return E_OUTOFMEMORY;
463 }
464 }
465 else
466 {
467 *user_extension_supported = NULL;
468 }
469
470 *instance_extension_count = vkd3d_check_extensions(vk_extensions, count, NULL, 0,
472 create_info->instance_extensions, create_info->instance_extension_count,
473 optional_extensions ? optional_extensions->extensions : NULL,
474 optional_extensions ? optional_extensions->extension_count : 0,
475 *user_extension_supported, vulkan_info, "instance",
477
478 vkd3d_free(vk_extensions);
479 return S_OK;
480}
481
484{
485 HRESULT hr;
486
488 {
489 if (!(instance->libvulkan = vkd3d_dlopen(SONAME_LIBVULKAN)))
490 {
491 ERR("Failed to load libvulkan: %s.\n", vkd3d_dlerror());
492 return E_FAIL;
493 }
494
495 if (!(vkGetInstanceProcAddr = vkd3d_dlsym(instance->libvulkan, "vkGetInstanceProcAddr")))
496 {
497 ERR("Could not load function pointer for vkGetInstanceProcAddr().\n");
498 vkd3d_dlclose(instance->libvulkan);
499 instance->libvulkan = NULL;
500 return E_FAIL;
501 }
502 }
503 else
504 {
505 instance->libvulkan = NULL;
506 }
507
509 {
510 if (instance->libvulkan)
511 vkd3d_dlclose(instance->libvulkan);
512 instance->libvulkan = NULL;
513 return hr;
514 }
515
516 return S_OK;
517}
518
520 VkDebugReportObjectTypeEXT object_type, uint64_t object, size_t location,
521 int32_t message_code, const char *layer_prefix, const char *message, void *user_data)
522{
523 FIXME("%s\n", debugstr_a(message));
524 return VK_FALSE;
525}
526
528{
529 const struct vkd3d_vk_instance_procs *vk_procs = &instance->vk_procs;
531 VkInstance vk_instance = instance->vk_instance;
532 VkDebugReportCallbackEXT callback;
533 VkResult vr;
534
536 callback_info.pNext = NULL;
539 callback_info.pUserData = NULL;
540 if ((vr = VK_CALL(vkCreateDebugReportCallbackEXT(vk_instance, &callback_info, NULL, &callback))) < 0)
541 {
542 WARN("Failed to create debug report callback, vr %d.\n", vr);
543 return;
544 }
545
546 instance->vk_debug_callback = callback;
547}
548
550{
551 {"virtual_heaps", VKD3D_CONFIG_FLAG_VIRTUAL_HEAPS}, /* always use virtual descriptor heaps */
552 {"vk_debug", VKD3D_CONFIG_FLAG_VULKAN_DEBUG}, /* enable Vulkan debug extensions */
553};
554
556{
557 uint64_t config_flags;
558 const char *config;
559
560 config = getenv("VKD3D_CONFIG");
562
563 if (config_flags)
564 TRACE("VKD3D_CONFIG='%s'.\n", config);
565
566 return config_flags;
567}
568
569/* TICKSPERSEC from Wine */
570#define VKD3D_DEFAULT_HOST_TICKS_PER_SECOND 10000000
571
573 const struct vkd3d_instance_create_info *create_info)
574{
575 const struct vkd3d_vk_global_procs *vk_global_procs = &instance->vk_global_procs;
576 const struct vkd3d_optional_instance_extensions_info *optional_extensions;
578 const struct vkd3d_host_time_domain_info *time_domain_info;
580 bool *user_extension_supported = NULL;
581 VkApplicationInfo application_info;
582 VkInstanceCreateInfo instance_info;
583 char application_name[PATH_MAX];
584 uint32_t extension_count;
585 const char **extensions;
586 uint32_t vk_api_version;
587 VkInstance vk_instance;
588 VkResult vr;
589 HRESULT hr;
590
591 TRACE("Build: " PACKAGE_STRING VKD3D_VCS_ID ".\n");
592
593 if (!create_info->pfn_signal_event)
594 {
595 WARN("Invalid signal event function pointer.\n");
596 return E_INVALIDARG;
597 }
598 if (!create_info->pfn_create_thread != !create_info->pfn_join_thread)
599 {
600 WARN("Invalid create/join thread function pointers.\n");
601 return E_INVALIDARG;
602 }
603 if (create_info->wchar_size != 2 && create_info->wchar_size != 4)
604 {
605 WARN("Unexpected WCHAR size %zu.\n", create_info->wchar_size);
606 return E_INVALIDARG;
607 }
608
609 instance->signal_event = create_info->pfn_signal_event;
610 instance->create_thread = create_info->pfn_create_thread;
611 instance->join_thread = create_info->pfn_join_thread;
612 instance->wchar_size = create_info->wchar_size;
613
614 instance->config_flags = vkd3d_init_config_flags();
615
617 {
618 WARN("Failed to initialise Vulkan global procs, hr %s.\n", debugstr_hresult(hr));
619 return hr;
620 }
621
622 if (FAILED(hr = vkd3d_init_instance_caps(instance, create_info,
623 &extension_count, &user_extension_supported)))
624 {
625 if (instance->libvulkan)
626 vkd3d_dlclose(instance->libvulkan);
627 return hr;
628 }
629
630 application_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
631 application_info.pNext = NULL;
632 application_info.pApplicationName = NULL;
633 application_info.applicationVersion = 0;
634 application_info.pEngineName = PACKAGE_NAME;
635 application_info.engineVersion = vkd3d_get_vk_version();
636 application_info.apiVersion = VK_API_VERSION_1_0;
637 instance->api_version = VKD3D_API_VERSION_1_0;
638
639 /* vkEnumerateInstanceVersion was added in Vulkan 1.1, and its absence indicates only 1.0 is supported. */
640 vkEnumerateInstanceVersion = (void *)vk_global_procs->vkGetInstanceProcAddr(NULL, "vkEnumerateInstanceVersion");
641 if (vkEnumerateInstanceVersion && vkEnumerateInstanceVersion(&vk_api_version) >= 0
642 && vk_api_version >= VK_API_VERSION_1_1)
643 {
644 TRACE("Vulkan API version 1.1 is available; requesting it.\n");
645 application_info.apiVersion = VK_API_VERSION_1_1;
646 }
647 instance->vk_api_version = application_info.apiVersion;
648
649 if ((vkd3d_application_info = vkd3d_find_struct(create_info->next, APPLICATION_INFO)))
650 {
653 else if (vkd3d_get_program_name(application_name))
654 application_info.pApplicationName = application_name;
657 {
660 }
662 }
663 else if (vkd3d_get_program_name(application_name))
664 {
665 application_info.pApplicationName = application_name;
666 }
667
668 TRACE("Application: %s.\n", debugstr_a(application_info.pApplicationName));
669 TRACE("vkd3d API version: %u.\n", instance->api_version);
670
671 if (!(extensions = vkd3d_calloc(extension_count, sizeof(*extensions))))
672 {
673 if (instance->libvulkan)
674 vkd3d_dlclose(instance->libvulkan);
675 vkd3d_free(user_extension_supported);
676 return E_OUTOFMEMORY;
677 }
678
679 optional_extensions = vkd3d_find_struct(create_info->next, OPTIONAL_INSTANCE_EXTENSIONS_INFO);
680
682 instance_info.pNext = NULL;
683 instance_info.flags = 0;
684 instance_info.pApplicationInfo = &application_info;
685 instance_info.enabledLayerCount = 0;
686 instance_info.ppEnabledLayerNames = NULL;
687 instance_info.enabledExtensionCount = vkd3d_enable_extensions(extensions, NULL, 0,
689 create_info->instance_extensions, create_info->instance_extension_count,
690 optional_extensions ? optional_extensions->extensions : NULL,
691 optional_extensions ? optional_extensions->extension_count : 0,
692 user_extension_supported, &instance->vk_info);
693 instance_info.ppEnabledExtensionNames = extensions;
694 vkd3d_free(user_extension_supported);
695
696 vr = vk_global_procs->vkCreateInstance(&instance_info, NULL, &vk_instance);
697 vkd3d_free(extensions);
698 if (vr < 0)
699 {
700 WARN("Failed to create Vulkan instance, vr %d.\n", vr);
701 if (instance->libvulkan)
702 vkd3d_dlclose(instance->libvulkan);
703 return hresult_from_vk_result(vr);
704 }
705
706 if (FAILED(hr = vkd3d_load_vk_instance_procs(&instance->vk_procs, vk_global_procs, vk_instance)))
707 {
708 WARN("Failed to load instance procs, hr %s.\n", debugstr_hresult(hr));
709 if (instance->vk_procs.vkDestroyInstance)
710 instance->vk_procs.vkDestroyInstance(vk_instance, NULL);
711 if (instance->libvulkan)
712 vkd3d_dlclose(instance->libvulkan);
713 return hr;
714 }
715
716 if ((time_domain_info = vkd3d_find_struct(create_info->next, HOST_TIME_DOMAIN_INFO)))
717 instance->host_ticks_per_second = time_domain_info->ticks_per_second;
718 else
719 instance->host_ticks_per_second = VKD3D_DEFAULT_HOST_TICKS_PER_SECOND;
720
721 instance->vk_instance = vk_instance;
722
723 TRACE("Created Vulkan instance %p.\n", vk_instance);
724
725 instance->refcount = 1;
726
727 instance->vk_debug_callback = VK_NULL_HANDLE;
728 if (instance->vk_info.EXT_debug_report)
730
731 return S_OK;
732}
733
735 struct vkd3d_instance **instance)
736{
737 struct vkd3d_instance *object;
738 HRESULT hr;
739
740 TRACE("create_info %p, instance %p.\n", create_info, instance);
741
742 if (!create_info || !instance)
743 return E_INVALIDARG;
745 {
746 WARN("Invalid structure type %#x.\n", create_info->type);
747 return E_INVALIDARG;
748 }
749
750 if (!(object = vkd3d_malloc(sizeof(*object))))
751 return E_OUTOFMEMORY;
752
753 if (FAILED(hr = vkd3d_instance_init(object, create_info)))
754 {
755 vkd3d_free(object);
756 return hr;
757 }
758
759 TRACE("Created instance %p.\n", object);
760
761 *instance = object;
762
763 return S_OK;
764}
765
767{
768 const struct vkd3d_vk_instance_procs *vk_procs = &instance->vk_procs;
769 VkInstance vk_instance = instance->vk_instance;
770
771 if (instance->vk_debug_callback)
772 VK_CALL(vkDestroyDebugReportCallbackEXT(vk_instance, instance->vk_debug_callback, NULL));
773
774 VK_CALL(vkDestroyInstance(vk_instance, NULL));
775
776 if (instance->libvulkan)
777 vkd3d_dlclose(instance->libvulkan);
778
780}
781
783{
784 unsigned int refcount = vkd3d_atomic_increment_u32(&instance->refcount);
785
786 TRACE("%p increasing refcount to %u.\n", instance, refcount);
787
788 return refcount;
789}
790
792{
793 unsigned int refcount = vkd3d_atomic_decrement_u32(&instance->refcount);
794
795 TRACE("%p decreasing refcount to %u.\n", instance, refcount);
796
797 if (!refcount)
799
800 return refcount;
801}
802
804{
805 return instance->vk_instance;
806}
807
809{
811}
812
814{
815 /* properties */
822
824
825 /* features */
838
840};
841
843 struct d3d12_device *device)
844{
845 struct vkd3d_vulkan_info *vulkan_info = &device->vk_info;
846
847 info->features2.pNext = NULL;
848
849 if (vulkan_info->EXT_conditional_rendering)
850 vk_prepend_struct(&info->features2, &info->conditional_rendering_features);
851 if (vulkan_info->EXT_depth_clip_enable)
852 vk_prepend_struct(&info->features2, &info->depth_clip_features);
853 if (vulkan_info->EXT_descriptor_indexing)
854 vk_prepend_struct(&info->features2, &info->descriptor_indexing_features);
855 if (vulkan_info->EXT_fragment_shader_interlock)
856 vk_prepend_struct(&info->features2, &info->fragment_shader_interlock_features);
857 if (vulkan_info->EXT_robustness2)
858 vk_prepend_struct(&info->features2, &info->robustness2_features);
860 vk_prepend_struct(&info->features2, &info->demote_features);
861 if (vulkan_info->EXT_texel_buffer_alignment)
862 vk_prepend_struct(&info->features2, &info->texel_buffer_alignment_features);
863 if (vulkan_info->EXT_transform_feedback)
864 vk_prepend_struct(&info->features2, &info->xfb_features);
865 if (vulkan_info->EXT_vertex_attribute_divisor)
866 vk_prepend_struct(&info->features2, &info->vertex_divisor_features);
867 if (vulkan_info->KHR_timeline_semaphore)
868 vk_prepend_struct(&info->features2, &info->timeline_semaphore_features);
869 if (vulkan_info->EXT_mutable_descriptor_type)
870 vk_prepend_struct(&info->features2, &info->mutable_features);
871 if (vulkan_info->EXT_4444_formats)
872 vk_prepend_struct(&info->features2, &info->formats4444_features);
873
874 info->properties2.pNext = NULL;
875
876 if (vulkan_info->KHR_maintenance3)
877 vk_prepend_struct(&info->properties2, &info->maintenance3_properties);
878 if (vulkan_info->EXT_descriptor_indexing)
879 vk_prepend_struct(&info->properties2, &info->descriptor_indexing_properties);
880 if (vulkan_info->EXT_texel_buffer_alignment)
881 vk_prepend_struct(&info->properties2, &info->texel_buffer_alignment_properties);
882 if (vulkan_info->EXT_transform_feedback)
883 vk_prepend_struct(&info->properties2, &info->xfb_properties);
884 if (vulkan_info->EXT_vertex_attribute_divisor)
885 vk_prepend_struct(&info->properties2, &info->vertex_divisor_properties);
887 vk_prepend_struct(&info->properties2, &info->subgroup_properties);
888}
889
891{
892 const struct vkd3d_vk_instance_procs *vk_procs = &device->vkd3d_instance->vk_procs;
893 VkPhysicalDevice physical_device = device->vk_physical_device;
894 struct vkd3d_vulkan_info *vulkan_info = &device->vk_info;
895
896 memset(info, 0, sizeof(*info));
897
902 info->fragment_shader_interlock_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT;
911
915 info->texel_buffer_alignment_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT;
919
921
923 VK_CALL(vkGetPhysicalDeviceFeatures2KHR(physical_device, &info->features2));
924 else
925 VK_CALL(vkGetPhysicalDeviceFeatures(physical_device, &info->features2.features));
926
928 VK_CALL(vkGetPhysicalDeviceProperties2KHR(physical_device, &info->properties2));
929 else
930 VK_CALL(vkGetPhysicalDeviceProperties(physical_device, &info->properties2.properties));
931}
932
934{
935 const uint32_t driver_version = properties->driverVersion;
936 const uint32_t api_version = properties->apiVersion;
937
938 TRACE("Device name: %s.\n", properties->deviceName);
939 TRACE("Vendor ID: %#x, Device ID: %#x.\n", properties->vendorID, properties->deviceID);
940 TRACE("Driver version: %#x (%u.%u.%u, %u.%u.%u.%u).\n", driver_version,
941 VK_VERSION_MAJOR(driver_version), VK_VERSION_MINOR(driver_version), VK_VERSION_PATCH(driver_version),
942 driver_version >> 22, (driver_version >> 14) & 0xff, (driver_version >> 6) & 0xff, driver_version & 0x3f);
943 TRACE("API version: %u.%u.%u.\n",
945}
946
947static void vkd3d_trace_physical_device(VkPhysicalDevice device,
948 const struct vkd3d_physical_device_info *info,
949 const struct vkd3d_vk_instance_procs *vk_procs)
950{
951 VkPhysicalDeviceMemoryProperties memory_properties;
952 VkQueueFamilyProperties *queue_properties;
953 unsigned int i, j;
955
956 vkd3d_trace_physical_device_properties(&info->properties2.properties);
957
959 TRACE("Queue families [%u]:\n", count);
960
961 if (!(queue_properties = vkd3d_calloc(count, sizeof(VkQueueFamilyProperties))))
962 return;
964
965 for (i = 0; i < count; ++i)
966 {
967 TRACE(" Queue family [%u]: flags %s, count %u, timestamp bits %u, image transfer granularity %s.\n",
968 i, debug_vk_queue_flags(queue_properties[i].queueFlags),
969 queue_properties[i].queueCount, queue_properties[i].timestampValidBits,
970 debug_vk_extent_3d(queue_properties[i].minImageTransferGranularity));
971 }
972 vkd3d_free(queue_properties);
973
975 for (i = 0; i < memory_properties.memoryHeapCount; ++i)
976 {
977 const VkMemoryHeap *heap = &memory_properties.memoryHeaps[i];
978 TRACE("Memory heap [%u]: size %#"PRIx64" (%"PRIu64" MiB), flags %s, memory types:\n",
979 i, heap->size, heap->size / 1024 / 1024, debug_vk_memory_heap_flags(heap->flags));
980 for (j = 0; j < memory_properties.memoryTypeCount; ++j)
981 {
982 const VkMemoryType *type = &memory_properties.memoryTypes[j];
983 if (type->heapIndex != i)
984 continue;
985 TRACE(" Memory type [%u]: flags %s.\n", j, debug_vk_memory_property_flags(type->propertyFlags));
986 }
987 }
988}
989
991{
993 const VkPhysicalDeviceLimits *limits = &info->properties2.properties.limits;
994 const VkPhysicalDeviceDescriptorIndexingPropertiesEXT *descriptor_indexing;
996 const VkPhysicalDeviceMaintenance3Properties *maintenance3;
998
999 TRACE("Device limits:\n");
1000 TRACE(" maxImageDimension1D: %u.\n", limits->maxImageDimension1D);
1001 TRACE(" maxImageDimension2D: %u.\n", limits->maxImageDimension2D);
1002 TRACE(" maxImageDimension3D: %u.\n", limits->maxImageDimension3D);
1003 TRACE(" maxImageDimensionCube: %u.\n", limits->maxImageDimensionCube);
1004 TRACE(" maxImageArrayLayers: %u.\n", limits->maxImageArrayLayers);
1005 TRACE(" maxTexelBufferElements: %u.\n", limits->maxTexelBufferElements);
1006 TRACE(" maxUniformBufferRange: %u.\n", limits->maxUniformBufferRange);
1007 TRACE(" maxStorageBufferRange: %u.\n", limits->maxStorageBufferRange);
1008 TRACE(" maxPushConstantsSize: %u.\n", limits->maxPushConstantsSize);
1009 TRACE(" maxMemoryAllocationCount: %u.\n", limits->maxMemoryAllocationCount);
1010 TRACE(" maxSamplerAllocationCount: %u.\n", limits->maxSamplerAllocationCount);
1011 TRACE(" bufferImageGranularity: %#"PRIx64".\n", limits->bufferImageGranularity);
1012 TRACE(" sparseAddressSpaceSize: %#"PRIx64".\n", limits->sparseAddressSpaceSize);
1013 TRACE(" maxBoundDescriptorSets: %u.\n", limits->maxBoundDescriptorSets);
1014 TRACE(" maxPerStageDescriptorSamplers: %u.\n", limits->maxPerStageDescriptorSamplers);
1015 TRACE(" maxPerStageDescriptorUniformBuffers: %u.\n", limits->maxPerStageDescriptorUniformBuffers);
1016 TRACE(" maxPerStageDescriptorStorageBuffers: %u.\n", limits->maxPerStageDescriptorStorageBuffers);
1017 TRACE(" maxPerStageDescriptorSampledImages: %u.\n", limits->maxPerStageDescriptorSampledImages);
1018 TRACE(" maxPerStageDescriptorStorageImages: %u.\n", limits->maxPerStageDescriptorStorageImages);
1019 TRACE(" maxPerStageDescriptorInputAttachments: %u.\n", limits->maxPerStageDescriptorInputAttachments);
1020 TRACE(" maxPerStageResources: %u.\n", limits->maxPerStageResources);
1021 TRACE(" maxDescriptorSetSamplers: %u.\n", limits->maxDescriptorSetSamplers);
1022 TRACE(" maxDescriptorSetUniformBuffers: %u.\n", limits->maxDescriptorSetUniformBuffers);
1023 TRACE(" maxDescriptorSetUniformBuffersDynamic: %u.\n", limits->maxDescriptorSetUniformBuffersDynamic);
1024 TRACE(" maxDescriptorSetStorageBuffers: %u.\n", limits->maxDescriptorSetStorageBuffers);
1025 TRACE(" maxDescriptorSetStorageBuffersDynamic: %u.\n", limits->maxDescriptorSetStorageBuffersDynamic);
1026 TRACE(" maxDescriptorSetSampledImages: %u.\n", limits->maxDescriptorSetSampledImages);
1027 TRACE(" maxDescriptorSetStorageImages: %u.\n", limits->maxDescriptorSetStorageImages);
1028 TRACE(" maxDescriptorSetInputAttachments: %u.\n", limits->maxDescriptorSetInputAttachments);
1029 TRACE(" maxVertexInputAttributes: %u.\n", limits->maxVertexInputAttributes);
1030 TRACE(" maxVertexInputBindings: %u.\n", limits->maxVertexInputBindings);
1031 TRACE(" maxVertexInputAttributeOffset: %u.\n", limits->maxVertexInputAttributeOffset);
1032 TRACE(" maxVertexInputBindingStride: %u.\n", limits->maxVertexInputBindingStride);
1033 TRACE(" maxVertexOutputComponents: %u.\n", limits->maxVertexOutputComponents);
1034 TRACE(" maxTessellationGenerationLevel: %u.\n", limits->maxTessellationGenerationLevel);
1035 TRACE(" maxTessellationPatchSize: %u.\n", limits->maxTessellationPatchSize);
1036 TRACE(" maxTessellationControlPerVertexInputComponents: %u.\n",
1038 TRACE(" maxTessellationControlPerVertexOutputComponents: %u.\n",
1040 TRACE(" maxTessellationControlPerPatchOutputComponents: %u.\n",
1042 TRACE(" maxTessellationControlTotalOutputComponents: %u.\n",
1044 TRACE(" maxTessellationEvaluationInputComponents: %u.\n",
1046 TRACE(" maxTessellationEvaluationOutputComponents: %u.\n",
1048 TRACE(" maxGeometryShaderInvocations: %u.\n", limits->maxGeometryShaderInvocations);
1049 TRACE(" maxGeometryInputComponents: %u.\n", limits->maxGeometryInputComponents);
1050 TRACE(" maxGeometryOutputComponents: %u.\n", limits->maxGeometryOutputComponents);
1051 TRACE(" maxGeometryOutputVertices: %u.\n", limits->maxGeometryOutputVertices);
1052 TRACE(" maxGeometryTotalOutputComponents: %u.\n", limits->maxGeometryTotalOutputComponents);
1053 TRACE(" maxFragmentInputComponents: %u.\n", limits->maxFragmentInputComponents);
1054 TRACE(" maxFragmentOutputAttachments: %u.\n", limits->maxFragmentOutputAttachments);
1055 TRACE(" maxFragmentDualSrcAttachments: %u.\n", limits->maxFragmentDualSrcAttachments);
1056 TRACE(" maxFragmentCombinedOutputResources: %u.\n", limits->maxFragmentCombinedOutputResources);
1057 TRACE(" maxComputeSharedMemorySize: %u.\n", limits->maxComputeSharedMemorySize);
1058 TRACE(" maxComputeWorkGroupCount: %u, %u, %u.\n", limits->maxComputeWorkGroupCount[0],
1059 limits->maxComputeWorkGroupCount[1], limits->maxComputeWorkGroupCount[2]);
1060 TRACE(" maxComputeWorkGroupInvocations: %u.\n", limits->maxComputeWorkGroupInvocations);
1061 TRACE(" maxComputeWorkGroupSize: %u, %u, %u.\n", limits->maxComputeWorkGroupSize[0],
1062 limits->maxComputeWorkGroupSize[1], limits->maxComputeWorkGroupSize[2]);
1063 TRACE(" subPixelPrecisionBits: %u.\n", limits->subPixelPrecisionBits);
1064 TRACE(" subTexelPrecisionBits: %u.\n", limits->subTexelPrecisionBits);
1065 TRACE(" mipmapPrecisionBits: %u.\n", limits->mipmapPrecisionBits);
1066 TRACE(" maxDrawIndexedIndexValue: %u.\n", limits->maxDrawIndexedIndexValue);
1067 TRACE(" maxDrawIndirectCount: %u.\n", limits->maxDrawIndirectCount);
1068 TRACE(" maxSamplerLodBias: %f.\n", limits->maxSamplerLodBias);
1069 TRACE(" maxSamplerAnisotropy: %f.\n", limits->maxSamplerAnisotropy);
1070 TRACE(" maxViewports: %u.\n", limits->maxViewports);
1071 TRACE(" maxViewportDimensions: %u, %u.\n", limits->maxViewportDimensions[0],
1072 limits->maxViewportDimensions[1]);
1073 TRACE(" viewportBoundsRange: %f, %f.\n", limits->viewportBoundsRange[0], limits->viewportBoundsRange[1]);
1074 TRACE(" viewportSubPixelBits: %u.\n", limits->viewportSubPixelBits);
1075 TRACE(" minMemoryMapAlignment: %u.\n", (unsigned int)limits->minMemoryMapAlignment);
1076 TRACE(" minTexelBufferOffsetAlignment: %#"PRIx64".\n", limits->minTexelBufferOffsetAlignment);
1077 TRACE(" minUniformBufferOffsetAlignment: %#"PRIx64".\n", limits->minUniformBufferOffsetAlignment);
1078 TRACE(" minStorageBufferOffsetAlignment: %#"PRIx64".\n", limits->minStorageBufferOffsetAlignment);
1079 TRACE(" minTexelOffset: %d.\n", limits->minTexelOffset);
1080 TRACE(" maxTexelOffset: %u.\n", limits->maxTexelOffset);
1081 TRACE(" minTexelGatherOffset: %d.\n", limits->minTexelGatherOffset);
1082 TRACE(" maxTexelGatherOffset: %u.\n", limits->maxTexelGatherOffset);
1083 TRACE(" minInterpolationOffset: %f.\n", limits->minInterpolationOffset);
1084 TRACE(" maxInterpolationOffset: %f.\n", limits->maxInterpolationOffset);
1085 TRACE(" subPixelInterpolationOffsetBits: %u.\n", limits->subPixelInterpolationOffsetBits);
1086 TRACE(" maxFramebufferWidth: %u.\n", limits->maxFramebufferWidth);
1087 TRACE(" maxFramebufferHeight: %u.\n", limits->maxFramebufferHeight);
1088 TRACE(" maxFramebufferLayers: %u.\n", limits->maxFramebufferLayers);
1089 TRACE(" framebufferColorSampleCounts: %#x.\n", limits->framebufferColorSampleCounts);
1090 TRACE(" framebufferDepthSampleCounts: %#x.\n", limits->framebufferDepthSampleCounts);
1091 TRACE(" framebufferStencilSampleCounts: %#x.\n", limits->framebufferStencilSampleCounts);
1092 TRACE(" framebufferNoAttachmentsSampleCounts: %#x.\n", limits->framebufferNoAttachmentsSampleCounts);
1093 TRACE(" maxColorAttachments: %u.\n", limits->maxColorAttachments);
1094 TRACE(" sampledImageColorSampleCounts: %#x.\n", limits->sampledImageColorSampleCounts);
1095 TRACE(" sampledImageIntegerSampleCounts: %#x.\n", limits->sampledImageIntegerSampleCounts);
1096 TRACE(" sampledImageDepthSampleCounts: %#x.\n", limits->sampledImageDepthSampleCounts);
1097 TRACE(" sampledImageStencilSampleCounts: %#x.\n", limits->sampledImageStencilSampleCounts);
1098 TRACE(" storageImageSampleCounts: %#x.\n", limits->storageImageSampleCounts);
1099 TRACE(" maxSampleMaskWords: %u.\n", limits->maxSampleMaskWords);
1100 TRACE(" timestampComputeAndGraphics: %#x.\n", limits->timestampComputeAndGraphics);
1101 TRACE(" timestampPeriod: %f.\n", limits->timestampPeriod);
1102 TRACE(" maxClipDistances: %u.\n", limits->maxClipDistances);
1103 TRACE(" maxCullDistances: %u.\n", limits->maxCullDistances);
1104 TRACE(" maxCombinedClipAndCullDistances: %u.\n", limits->maxCombinedClipAndCullDistances);
1105 TRACE(" discreteQueuePriorities: %u.\n", limits->discreteQueuePriorities);
1106 TRACE(" pointSizeRange: %f, %f.\n", limits->pointSizeRange[0], limits->pointSizeRange[1]);
1107 TRACE(" lineWidthRange: %f, %f,\n", limits->lineWidthRange[0], limits->lineWidthRange[1]);
1108 TRACE(" pointSizeGranularity: %f.\n", limits->pointSizeGranularity);
1109 TRACE(" lineWidthGranularity: %f.\n", limits->lineWidthGranularity);
1110 TRACE(" strictLines: %#x.\n", limits->strictLines);
1111 TRACE(" standardSampleLocations: %#x.\n", limits->standardSampleLocations);
1112 TRACE(" optimalBufferCopyOffsetAlignment: %#"PRIx64".\n", limits->optimalBufferCopyOffsetAlignment);
1113 TRACE(" optimalBufferCopyRowPitchAlignment: %#"PRIx64".\n", limits->optimalBufferCopyRowPitchAlignment);
1114 TRACE(" nonCoherentAtomSize: %#"PRIx64".\n", limits->nonCoherentAtomSize);
1115
1116 descriptor_indexing = &info->descriptor_indexing_properties;
1117 TRACE(" VkPhysicalDeviceDescriptorIndexingPropertiesEXT:\n");
1118
1119 TRACE(" maxUpdateAfterBindDescriptorsInAllPools: %u.\n",
1120 descriptor_indexing->maxUpdateAfterBindDescriptorsInAllPools);
1121
1122 TRACE(" shaderUniformBufferArrayNonUniformIndexingNative: %#x.\n",
1124 TRACE(" shaderSampledImageArrayNonUniformIndexingNative: %#x.\n",
1126 TRACE(" shaderStorageBufferArrayNonUniformIndexingNative: %#x.\n",
1128 TRACE(" shaderStorageImageArrayNonUniformIndexingNative: %#x.\n",
1130 TRACE(" shaderInputAttachmentArrayNonUniformIndexingNative: %#x.\n",
1132
1133 TRACE(" robustBufferAccessUpdateAfterBind: %#x.\n",
1134 descriptor_indexing->robustBufferAccessUpdateAfterBind);
1135 TRACE(" quadDivergentImplicitLod: %#x.\n",
1136 descriptor_indexing->quadDivergentImplicitLod);
1137
1138 TRACE(" maxPerStageDescriptorUpdateAfterBindSamplers: %u.\n",
1140 TRACE(" maxPerStageDescriptorUpdateAfterBindUniformBuffers: %u.\n",
1142 TRACE(" maxPerStageDescriptorUpdateAfterBindStorageBuffers: %u.\n",
1144 TRACE(" maxPerStageDescriptorUpdateAfterBindSampledImages: %u.\n",
1146 TRACE(" maxPerStageDescriptorUpdateAfterBindStorageImages: %u.\n",
1148 TRACE(" maxPerStageDescriptorUpdateAfterBindInputAttachments: %u.\n",
1150 TRACE(" maxPerStageUpdateAfterBindResources: %u.\n",
1151 descriptor_indexing->maxPerStageUpdateAfterBindResources);
1152
1153 TRACE(" maxDescriptorSetUpdateAfterBindSamplers: %u.\n",
1154 descriptor_indexing->maxDescriptorSetUpdateAfterBindSamplers);
1155 TRACE(" maxDescriptorSetUpdateAfterBindUniformBuffers: %u.\n",
1157 TRACE(" maxDescriptorSetUpdateAfterBindUniformBuffersDynamic: %u.\n",
1159 TRACE(" maxDescriptorSetUpdateAfterBindStorageBuffers: %u.\n",
1161 TRACE(" maxDescriptorSetUpdateAfterBindStorageBuffersDynamic: %u.\n",
1163 TRACE(" maxDescriptorSetUpdateAfterBindSampledImages: %u.\n",
1165 TRACE(" maxDescriptorSetUpdateAfterBindStorageImages: %u.\n",
1167 TRACE(" maxDescriptorSetUpdateAfterBindInputAttachments: %u.\n",
1169
1170 maintenance3 = &info->maintenance3_properties;
1171 TRACE(" VkPhysicalDeviceMaintenance3Properties:\n");
1172 TRACE(" maxPerSetDescriptors: %u.\n", maintenance3->maxPerSetDescriptors);
1173 TRACE(" maxMemoryAllocationSize: %#"PRIx64".\n", maintenance3->maxMemoryAllocationSize);
1174
1175 buffer_alignment = &info->texel_buffer_alignment_properties;
1176 TRACE(" VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT:\n");
1177 TRACE(" storageTexelBufferOffsetAlignmentBytes: %#"PRIx64".\n",
1178 buffer_alignment->storageTexelBufferOffsetAlignmentBytes);
1179 TRACE(" storageTexelBufferOffsetSingleTexelAlignment: %#x.\n",
1181 TRACE(" uniformTexelBufferOffsetAlignmentBytes: %#"PRIx64".\n",
1182 buffer_alignment->uniformTexelBufferOffsetAlignmentBytes);
1183 TRACE(" uniformTexelBufferOffsetSingleTexelAlignment: %#x.\n",
1185
1186 xfb = &info->xfb_properties;
1187 TRACE(" VkPhysicalDeviceTransformFeedbackPropertiesEXT:\n");
1188 TRACE(" maxTransformFeedbackStreams: %u.\n", xfb->maxTransformFeedbackStreams);
1189 TRACE(" maxTransformFeedbackBuffers: %u.\n", xfb->maxTransformFeedbackBuffers);
1190 TRACE(" maxTransformFeedbackBufferSize: %#"PRIx64".\n", xfb->maxTransformFeedbackBufferSize);
1191 TRACE(" maxTransformFeedbackStreamDataSize: %u.\n", xfb->maxTransformFeedbackStreamDataSize);
1192 TRACE(" maxTransformFeedbackBufferDataSize: %u.\n", xfb->maxTransformFeedbackBufferDataSize);
1193 TRACE(" maxTransformFeedbackBufferDataStride: %u.\n", xfb->maxTransformFeedbackBufferDataStride);
1194 TRACE(" transformFeedbackQueries: %#x.\n", xfb->transformFeedbackQueries);
1195 TRACE(" transformFeedbackStreamsLinesTriangles: %#x.\n", xfb->transformFeedbackStreamsLinesTriangles);
1196 TRACE(" transformFeedbackRasterizationStreamSelect: %#x.\n", xfb->transformFeedbackRasterizationStreamSelect);
1197 TRACE(" transformFeedbackDraw: %x.\n", xfb->transformFeedbackDraw);
1198
1199 divisor_properties = &info->vertex_divisor_properties;
1200 TRACE(" VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT:\n");
1201 TRACE(" maxVertexAttribDivisor: %u.\n", divisor_properties->maxVertexAttribDivisor);
1202}
1203
1205{
1206 const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *fragment_shader_interlock_features;
1207 const VkPhysicalDeviceConditionalRenderingFeaturesEXT *conditional_rendering_features;
1209 const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *buffer_alignment_features;
1211 const VkPhysicalDeviceDescriptorIndexingFeaturesEXT *descriptor_indexing;
1212 const VkPhysicalDeviceDepthClipEnableFeaturesEXT *depth_clip_features;
1213 const VkPhysicalDeviceFeatures *features = &info->features2.features;
1215
1216 TRACE("Device features:\n");
1217 TRACE(" robustBufferAccess: %#x.\n", features->robustBufferAccess);
1218 TRACE(" fullDrawIndexUint32: %#x.\n", features->fullDrawIndexUint32);
1219 TRACE(" imageCubeArray: %#x.\n", features->imageCubeArray);
1220 TRACE(" independentBlend: %#x.\n", features->independentBlend);
1221 TRACE(" geometryShader: %#x.\n", features->geometryShader);
1222 TRACE(" tessellationShader: %#x.\n", features->tessellationShader);
1223 TRACE(" sampleRateShading: %#x.\n", features->sampleRateShading);
1224 TRACE(" dualSrcBlend: %#x.\n", features->dualSrcBlend);
1225 TRACE(" logicOp: %#x.\n", features->logicOp);
1226 TRACE(" multiDrawIndirect: %#x.\n", features->multiDrawIndirect);
1227 TRACE(" drawIndirectFirstInstance: %#x.\n", features->drawIndirectFirstInstance);
1228 TRACE(" depthClamp: %#x.\n", features->depthClamp);
1229 TRACE(" depthBiasClamp: %#x.\n", features->depthBiasClamp);
1230 TRACE(" fillModeNonSolid: %#x.\n", features->fillModeNonSolid);
1231 TRACE(" depthBounds: %#x.\n", features->depthBounds);
1232 TRACE(" wideLines: %#x.\n", features->wideLines);
1233 TRACE(" largePoints: %#x.\n", features->largePoints);
1234 TRACE(" alphaToOne: %#x.\n", features->alphaToOne);
1235 TRACE(" multiViewport: %#x.\n", features->multiViewport);
1236 TRACE(" samplerAnisotropy: %#x.\n", features->samplerAnisotropy);
1237 TRACE(" textureCompressionETC2: %#x.\n", features->textureCompressionETC2);
1238 TRACE(" textureCompressionASTC_LDR: %#x.\n", features->textureCompressionASTC_LDR);
1239 TRACE(" textureCompressionBC: %#x.\n", features->textureCompressionBC);
1240 TRACE(" occlusionQueryPrecise: %#x.\n", features->occlusionQueryPrecise);
1241 TRACE(" pipelineStatisticsQuery: %#x.\n", features->pipelineStatisticsQuery);
1242 TRACE(" vertexOipelineStoresAndAtomics: %#x.\n", features->vertexPipelineStoresAndAtomics);
1243 TRACE(" fragmentStoresAndAtomics: %#x.\n", features->fragmentStoresAndAtomics);
1244 TRACE(" shaderTessellationAndGeometryPointSize: %#x.\n", features->shaderTessellationAndGeometryPointSize);
1245 TRACE(" shaderImageGatherExtended: %#x.\n", features->shaderImageGatherExtended);
1246 TRACE(" shaderStorageImageExtendedFormats: %#x.\n", features->shaderStorageImageExtendedFormats);
1247 TRACE(" shaderStorageImageMultisample: %#x.\n", features->shaderStorageImageMultisample);
1248 TRACE(" shaderStorageImageReadWithoutFormat: %#x.\n", features->shaderStorageImageReadWithoutFormat);
1249 TRACE(" shaderStorageImageWriteWithoutFormat: %#x.\n", features->shaderStorageImageWriteWithoutFormat);
1250 TRACE(" shaderUniformBufferArrayDynamicIndexing: %#x.\n", features->shaderUniformBufferArrayDynamicIndexing);
1251 TRACE(" shaderSampledImageArrayDynamicIndexing: %#x.\n", features->shaderSampledImageArrayDynamicIndexing);
1252 TRACE(" shaderStorageBufferArrayDynamicIndexing: %#x.\n", features->shaderStorageBufferArrayDynamicIndexing);
1253 TRACE(" shaderStorageImageArrayDynamicIndexing: %#x.\n", features->shaderStorageImageArrayDynamicIndexing);
1254 TRACE(" shaderClipDistance: %#x.\n", features->shaderClipDistance);
1255 TRACE(" shaderCullDistance: %#x.\n", features->shaderCullDistance);
1256 TRACE(" shaderFloat64: %#x.\n", features->shaderFloat64);
1257 TRACE(" shaderInt64: %#x.\n", features->shaderInt64);
1258 TRACE(" shaderInt16: %#x.\n", features->shaderInt16);
1259 TRACE(" shaderResourceResidency: %#x.\n", features->shaderResourceResidency);
1260 TRACE(" shaderResourceMinLod: %#x.\n", features->shaderResourceMinLod);
1261 TRACE(" sparseBinding: %#x.\n", features->sparseBinding);
1262 TRACE(" sparseResidencyBuffer: %#x.\n", features->sparseResidencyBuffer);
1263 TRACE(" sparseResidencyImage2D: %#x.\n", features->sparseResidencyImage2D);
1264 TRACE(" sparseResidencyImage3D: %#x.\n", features->sparseResidencyImage3D);
1265 TRACE(" sparseResidency2Samples: %#x.\n", features->sparseResidency2Samples);
1266 TRACE(" sparseResidency4Samples: %#x.\n", features->sparseResidency4Samples);
1267 TRACE(" sparseResidency8Samples: %#x.\n", features->sparseResidency8Samples);
1268 TRACE(" sparseResidency16Samples: %#x.\n", features->sparseResidency16Samples);
1269 TRACE(" sparseResidencyAliased: %#x.\n", features->sparseResidencyAliased);
1270 TRACE(" variableMultisampleRate: %#x.\n", features->variableMultisampleRate);
1271 TRACE(" inheritedQueries: %#x.\n", features->inheritedQueries);
1272
1273 descriptor_indexing = &info->descriptor_indexing_features;
1274 TRACE(" VkPhysicalDeviceDescriptorIndexingFeaturesEXT:\n");
1275
1276 TRACE(" shaderInputAttachmentArrayDynamicIndexing: %#x.\n",
1277 descriptor_indexing->shaderInputAttachmentArrayDynamicIndexing);
1278 TRACE(" shaderUniformTexelBufferArrayDynamicIndexing: %#x.\n",
1280 TRACE(" shaderStorageTexelBufferArrayDynamicIndexing: %#x.\n",
1282
1283 TRACE(" shaderUniformBufferArrayNonUniformIndexing: %#x.\n",
1284 descriptor_indexing->shaderUniformBufferArrayNonUniformIndexing);
1285 TRACE(" shaderSampledImageArrayNonUniformIndexing: %#x.\n",
1286 descriptor_indexing->shaderSampledImageArrayNonUniformIndexing);
1287 TRACE(" shaderStorageBufferArrayNonUniformIndexing: %#x.\n",
1288 descriptor_indexing->shaderStorageBufferArrayNonUniformIndexing);
1289 TRACE(" shaderStorageImageArrayNonUniformIndexing: %#x.\n",
1290 descriptor_indexing->shaderStorageImageArrayNonUniformIndexing);
1291 TRACE(" shaderInputAttachmentArrayNonUniformIndexing: %#x.\n",
1293 TRACE(" shaderUniformTexelBufferArrayNonUniformIndexing: %#x.\n",
1295 TRACE(" shaderStorageTexelBufferArrayNonUniformIndexing: %#x.\n",
1297
1298 TRACE(" descriptorBindingUniformBufferUpdateAfterBind: %#x.\n",
1300 TRACE(" descriptorBindingSampledImageUpdateAfterBind: %#x.\n",
1302 TRACE(" descriptorBindingStorageImageUpdateAfterBind: %#x.\n",
1304 TRACE(" descriptorBindingStorageBufferUpdateAfterBind: %#x.\n",
1306 TRACE(" descriptorBindingUniformTexelBufferUpdateAfterBind: %#x.\n",
1308 TRACE(" descriptorBindingStorageTexelBufferUpdateAfterBind: %#x.\n",
1310
1311 TRACE(" descriptorBindingUpdateUnusedWhilePending: %#x.\n",
1312 descriptor_indexing->descriptorBindingUpdateUnusedWhilePending);
1313 TRACE(" descriptorBindingPartiallyBound: %#x.\n",
1314 descriptor_indexing->descriptorBindingPartiallyBound);
1315 TRACE(" descriptorBindingVariableDescriptorCount: %#x.\n",
1316 descriptor_indexing->descriptorBindingVariableDescriptorCount);
1317 TRACE(" runtimeDescriptorArray: %#x.\n",
1318 descriptor_indexing->runtimeDescriptorArray);
1319
1320 conditional_rendering_features = &info->conditional_rendering_features;
1321 TRACE(" VkPhysicalDeviceConditionalRenderingFeaturesEXT:\n");
1322 TRACE(" conditionalRendering: %#x.\n", conditional_rendering_features->conditionalRendering);
1323
1324 depth_clip_features = &info->depth_clip_features;
1325 TRACE(" VkPhysicalDeviceDepthClipEnableFeaturesEXT:\n");
1326 TRACE(" depthClipEnable: %#x.\n", depth_clip_features->depthClipEnable);
1327
1328 fragment_shader_interlock_features = &info->fragment_shader_interlock_features;
1329 TRACE(" VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT:\n");
1330 TRACE(" fragmentShaderSampleInterlock: %#x.\n",
1331 fragment_shader_interlock_features->fragmentShaderSampleInterlock);
1332 TRACE(" fragmentShaderPixelInterlock: %#x.\n",
1333 fragment_shader_interlock_features->fragmentShaderPixelInterlock);
1334 TRACE(" fragmentShaderShadingRateInterlock: %#x.\n",
1335 fragment_shader_interlock_features->fragmentShaderShadingRateInterlock);
1336
1337 demote_features = &info->demote_features;
1338 TRACE(" VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT:\n");
1339 TRACE(" shaderDemoteToHelperInvocation: %#x.\n", demote_features->shaderDemoteToHelperInvocation);
1340
1341 buffer_alignment_features = &info->texel_buffer_alignment_features;
1342 TRACE(" VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT:\n");
1343 TRACE(" texelBufferAlignment: %#x.\n", buffer_alignment_features->texelBufferAlignment);
1344
1345 xfb = &info->xfb_features;
1346 TRACE(" VkPhysicalDeviceTransformFeedbackFeaturesEXT:\n");
1347 TRACE(" transformFeedback: %#x.\n", xfb->transformFeedback);
1348 TRACE(" geometryStreams: %#x.\n", xfb->geometryStreams);
1349
1350 divisor_features = &info->vertex_divisor_features;
1351 TRACE(" VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT:\n");
1352 TRACE(" vertexAttributeInstanceRateDivisor: %#x.\n",
1353 divisor_features->vertexAttributeInstanceRateDivisor);
1354 TRACE(" vertexAttributeInstanceRateZeroDivisor: %#x.\n",
1355 divisor_features->vertexAttributeInstanceRateZeroDivisor);
1356}
1357
1359 const VkPhysicalDeviceFeatures *features,
1360 const D3D12_FEATURE_DATA_D3D12_OPTIONS *d3d12_options)
1361{
1362 bool have_11_0 = true;
1363
1364#define CHECK_MIN_REQUIREMENT(name, value) \
1365 if (vk_info->device_limits.name < value) \
1366 WARN(#name " does not meet feature level 11_0 requirements.\n");
1367#define CHECK_MAX_REQUIREMENT(name, value) \
1368 if (vk_info->device_limits.name > value) \
1369 WARN(#name " does not meet feature level 11_0 requirements.\n");
1370#define CHECK_FEATURE(name) \
1371 if (!features->name) \
1372 { \
1373 WARN(#name " is not supported.\n"); \
1374 have_11_0 = false; \
1375 }
1376
1378 WARN("Timestamps are not supported on all graphics and compute queues.\n");
1379
1380 CHECK_MIN_REQUIREMENT(maxPushConstantsSize, D3D12_MAX_ROOT_COST * sizeof(uint32_t));
1381 CHECK_MIN_REQUIREMENT(maxComputeSharedMemorySize, D3D12_CS_TGSM_REGISTER_COUNT * sizeof(uint32_t));
1382
1383 CHECK_MAX_REQUIREMENT(viewportBoundsRange[0], D3D12_VIEWPORT_BOUNDS_MIN);
1384 CHECK_MIN_REQUIREMENT(viewportBoundsRange[1], D3D12_VIEWPORT_BOUNDS_MAX);
1385 CHECK_MIN_REQUIREMENT(viewportSubPixelBits, 8);
1386
1387 CHECK_MIN_REQUIREMENT(maxPerStageDescriptorUniformBuffers,
1389
1390 CHECK_FEATURE(depthBiasClamp);
1391 CHECK_FEATURE(depthClamp);
1392 CHECK_FEATURE(drawIndirectFirstInstance);
1393 CHECK_FEATURE(dualSrcBlend);
1394 CHECK_FEATURE(fragmentStoresAndAtomics);
1395 CHECK_FEATURE(fullDrawIndexUint32);
1396 CHECK_FEATURE(geometryShader);
1397 CHECK_FEATURE(imageCubeArray);
1398 CHECK_FEATURE(independentBlend);
1399 CHECK_FEATURE(multiDrawIndirect);
1400 CHECK_FEATURE(multiViewport);
1401 CHECK_FEATURE(occlusionQueryPrecise);
1402 CHECK_FEATURE(pipelineStatisticsQuery);
1403 CHECK_FEATURE(samplerAnisotropy);
1404 CHECK_FEATURE(sampleRateShading);
1405 CHECK_FEATURE(shaderClipDistance);
1406 CHECK_FEATURE(shaderCullDistance);
1407 CHECK_FEATURE(shaderImageGatherExtended);
1408 CHECK_FEATURE(shaderStorageImageWriteWithoutFormat);
1409 CHECK_FEATURE(tessellationShader);
1410
1411 if (!vk_info->EXT_depth_clip_enable)
1412 WARN("Depth clip enable is not supported.\n");
1413 if (!vk_info->EXT_transform_feedback)
1414 WARN("Stream output is not supported.\n");
1415
1416 if (!vk_info->EXT_vertex_attribute_divisor)
1417 WARN("Vertex attribute instance rate divisor is not supported.\n");
1418 else if (!vk_info->vertex_attrib_zero_divisor)
1419 WARN("Vertex attribute instance rate zero divisor is not supported.\n");
1420
1421#undef CHECK_MIN_REQUIREMENT
1422#undef CHECK_MAX_REQUIREMENT
1423#undef CHECK_FEATURE
1424
1426
1427 if (have_11_0
1428 && d3d12_options->OutputMergerLogicOp
1433
1434 /* TODO: MinMaxFiltering */
1438 && d3d12_options->TypedUAVLoadAdditionalFormats)
1440
1442 && d3d12_options->ROVsSupported
1445
1446 TRACE("Max feature level: %#x.\n", vk_info->max_feature_level);
1447}
1448
1451{
1457}
1458
1461{
1462 const unsigned int root_provision = D3D12_MAX_ROOT_COST / 2;
1463 unsigned int srv_divisor = 1, uav_divisor = 1;
1464
1465 /* The total number of populated sampled image or storage image descriptors never exceeds the size of
1466 * one set (or two sets if every UAV has a counter), but the total size of bound layouts will exceed
1467 * device limits if each set size is maxDescriptorSet*, because of the D3D12 buffer + image allowance
1468 * (and UAV counters). Breaking limits for layouts seems to work with RADV and Nvidia drivers at
1469 * least, but let's try to stay within them if limits are high enough. */
1470 if (properties->maxDescriptorSetUpdateAfterBindSampledImages >= (1u << 21))
1471 {
1472 srv_divisor = 2;
1473 uav_divisor = properties->maxDescriptorSetUpdateAfterBindSampledImages >= (3u << 20) ? 3 : 2;
1474 }
1475
1477 properties->maxPerStageDescriptorUpdateAfterBindUniformBuffers - root_provision);
1479 properties->maxPerStageDescriptorUpdateAfterBindSampledImages / srv_divisor - root_provision);
1481 properties->maxPerStageDescriptorUpdateAfterBindStorageBuffers - root_provision);
1483 properties->maxPerStageDescriptorUpdateAfterBindStorageImages / uav_divisor - root_provision);
1485 properties->maxPerStageDescriptorUpdateAfterBindSamplers - root_provision);
1487}
1488
1490{
1491 const struct vkd3d_vk_instance_procs *vk_procs = &device->vkd3d_instance->vk_procs;
1492 const struct vkd3d_format *format;
1493 VkFormatProperties properties;
1494 unsigned int i;
1495
1496 static const DXGI_FORMAT additional_formats[] =
1497 {
1513 };
1514
1515 for (i = 0; i < ARRAY_SIZE(additional_formats); ++i)
1516 {
1517 format = vkd3d_get_format(device, additional_formats[i], false);
1519
1520 VK_CALL(vkGetPhysicalDeviceFormatProperties(device->vk_physical_device, format->vk_format, &properties));
1522 return false;
1523 }
1524
1525 return true;
1526}
1527
1529 const struct vkd3d_device_create_info *create_info, VkExtensionProperties **vk_extensions,
1530 uint32_t *vk_extension_count, uint32_t *device_extension_count, bool **user_extension_supported)
1531{
1532 const struct vkd3d_vk_instance_procs *vk_procs = &device->vkd3d_instance->vk_procs;
1533 const struct vkd3d_optional_device_extensions_info *optional_extensions;
1534 VkPhysicalDevice physical_device = device->vk_physical_device;
1535 struct vkd3d_vulkan_info *vulkan_info = &device->vk_info;
1536 VkResult vr;
1537
1538 *device_extension_count = 0;
1539
1540 if ((vr = VK_CALL(vkEnumerateDeviceExtensionProperties(physical_device, NULL, vk_extension_count, NULL))) < 0)
1541 {
1542 ERR("Failed to enumerate device extensions, vr %d.\n", vr);
1543 return hresult_from_vk_result(vr);
1544 }
1545
1546 if (!(*vk_extensions = vkd3d_calloc(*vk_extension_count, sizeof(**vk_extensions))))
1547 return E_OUTOFMEMORY;
1548
1549 TRACE("Enumerating %u device extensions.\n", *vk_extension_count);
1550 if ((vr = VK_CALL(vkEnumerateDeviceExtensionProperties(physical_device, NULL, vk_extension_count, *vk_extensions))) < 0)
1551 {
1552 ERR("Failed to enumerate device extensions, vr %d.\n", vr);
1553 vkd3d_free(*vk_extensions);
1554 return hresult_from_vk_result(vr);
1555 }
1556
1557 optional_extensions = vkd3d_find_struct(create_info->next, OPTIONAL_DEVICE_EXTENSIONS_INFO);
1558 if (optional_extensions && optional_extensions->extension_count)
1559 {
1560 if (!(*user_extension_supported = vkd3d_calloc(optional_extensions->extension_count, sizeof(bool))))
1561 {
1562 vkd3d_free(*vk_extensions);
1563 return E_OUTOFMEMORY;
1564 }
1565 }
1566 else
1567 {
1568 *user_extension_supported = NULL;
1569 }
1570
1571 *device_extension_count = vkd3d_check_extensions(*vk_extensions, *vk_extension_count,
1574 create_info->device_extensions, create_info->device_extension_count,
1575 optional_extensions ? optional_extensions->extensions : NULL,
1576 optional_extensions ? optional_extensions->extension_count : 0,
1577 *user_extension_supported, vulkan_info, "device",
1578 device->vkd3d_instance->config_flags & VKD3D_CONFIG_FLAG_VULKAN_DEBUG);
1579
1580 return S_OK;
1581}
1582
1584{
1585 const char *caps_override, *p;
1586
1587 static const struct override_value
1588 {
1589 const char *str;
1591 }
1592 feature_level_override_values[] =
1593 {
1594 {"11.0", D3D_FEATURE_LEVEL_11_0},
1595 {"11.1", D3D_FEATURE_LEVEL_11_1},
1596 {"12.0", D3D_FEATURE_LEVEL_12_0},
1597 {"12.1", D3D_FEATURE_LEVEL_12_1},
1598 {"12.2", D3D_FEATURE_LEVEL_12_2},
1599 },
1600 resource_binding_tier_override_values[] =
1601 {
1605 };
1606 static const struct override_field
1607 {
1608 const char *name;
1609 size_t offset;
1610 const struct override_value *values;
1611 size_t value_count;
1612 }
1613 override_fields[] =
1614 {
1615 {
1616 "feature_level",
1617 offsetof(struct d3d12_device, vk_info.max_feature_level),
1618 feature_level_override_values,
1619 ARRAY_SIZE(feature_level_override_values)
1620 },
1621 {
1622 "resource_binding_tier",
1623 offsetof(struct d3d12_device, feature_options.ResourceBindingTier),
1624 resource_binding_tier_override_values,
1625 ARRAY_SIZE(resource_binding_tier_override_values)
1626 },
1627 };
1628
1629 if (!(caps_override = getenv("VKD3D_CAPS_OVERRIDE")))
1630 return;
1631
1632 p = caps_override;
1633 for (;;)
1634 {
1635 size_t i;
1636
1637 for (i = 0; i < ARRAY_SIZE(override_fields); ++i)
1638 {
1639 const struct override_field *field = &override_fields[i];
1640 size_t len = strlen(field->name);
1641
1642 if (strncmp(p, field->name, len) == 0 && p[len] == '=')
1643 {
1644 size_t j;
1645
1646 p += len + 1;
1647
1648 for (j = 0; j < field->value_count; ++j)
1649 {
1650 const struct override_value *value = &field->values[j];
1651 size_t value_len = strlen(value->str);
1652
1653 if (strncmp(p, value->str, value_len) == 0
1654 && (p[value_len] == '\0' || p[value_len] == ','))
1655 {
1656 memcpy(&((uint8_t *)device)[field->offset], (uint8_t *)&value->value, sizeof(value->value));
1657
1658 p += value_len;
1659 if (p[0] == '\0')
1660 {
1661 TRACE("Overriding caps with: %s\n", caps_override);
1662 return;
1663 }
1664 p += 1;
1665
1666 break;
1667 }
1668 }
1669
1670 if (j == field->value_count)
1671 {
1672 WARN("Cannot parse the override caps string: %s\n", caps_override);
1673 return;
1674 }
1675
1676 break;
1677 }
1678 }
1679
1680 if (i == ARRAY_SIZE(override_fields))
1681 {
1682 WARN("Cannot parse the override caps string: %s\n", caps_override);
1683 return;
1684 }
1685 }
1686}
1687
1689 const struct vkd3d_device_create_info *create_info,
1690 struct vkd3d_physical_device_info *physical_device_info,
1691 uint32_t *device_extension_count, bool **user_extension_supported)
1692{
1693 const VkPhysicalDeviceSubgroupProperties *subgroup_properties = &physical_device_info->subgroup_properties;
1694 const struct vkd3d_vk_instance_procs *vk_procs = &device->vkd3d_instance->vk_procs;
1695 VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *fragment_shader_interlock;
1697 VkPhysicalDevice physical_device = device->vk_physical_device;
1698 struct vkd3d_vulkan_info *vulkan_info = &device->vk_info;
1699 VkExtensionProperties *vk_extensions = NULL;
1700 VkPhysicalDeviceFeatures *features;
1701 uint32_t vk_extension_count;
1702 HRESULT hr;
1703
1704 /* SHUFFLE is required to implement WaveReadLaneAt with dynamically uniform index before SPIR-V 1.5 / Vulkan 1.2. */
1705 static const VkSubgroupFeatureFlags required_subgroup_features = VK_SUBGROUP_FEATURE_ARITHMETIC_BIT
1711
1713
1714 if (FAILED(hr = vkd3d_check_device_extensions(device, create_info, &vk_extensions, &vk_extension_count,
1715 device_extension_count, user_extension_supported)))
1716 return hr;
1717
1718 vkd3d_physical_device_info_init(physical_device_info, device);
1719
1720 vkd3d_trace_physical_device(physical_device, physical_device_info, vk_procs);
1721 vkd3d_trace_physical_device_features(physical_device_info);
1722 vkd3d_trace_physical_device_limits(physical_device_info);
1723
1724 features = &physical_device_info->features2.features;
1725
1726 if (!features->sparseResidencyBuffer || !features->sparseResidencyImage2D)
1727 {
1728 features->sparseResidencyBuffer = VK_FALSE;
1729 features->sparseResidencyImage2D = VK_FALSE;
1730 physical_device_info->properties2.properties.sparseProperties.residencyNonResidentStrict = VK_FALSE;
1731 }
1732
1733 vulkan_info->device_limits = physical_device_info->properties2.properties.limits;
1734 vulkan_info->sparse_properties = physical_device_info->properties2.properties.sparseProperties;
1735 vulkan_info->geometry_shaders = physical_device_info->features2.features.geometryShader;
1736 vulkan_info->tessellation_shaders = physical_device_info->features2.features.tessellationShader;
1737 vulkan_info->sparse_binding = features->sparseBinding;
1738 vulkan_info->sparse_residency_3d = features->sparseResidencyImage3D;
1740 vulkan_info->transform_feedback_queries = physical_device_info->xfb_properties.transformFeedbackQueries;
1742 vulkan_info->max_vertex_attrib_divisor = max(physical_device_info->vertex_divisor_properties.maxVertexAttribDivisor, 1);
1743
1744 device->feature_options.DoublePrecisionFloatShaderOps = features->shaderFloat64;
1745 device->feature_options.OutputMergerLogicOp = features->logicOp;
1746 /* SPV_KHR_16bit_storage */
1747 device->feature_options.MinPrecisionSupport = D3D12_SHADER_MIN_PRECISION_SUPPORT_NONE;
1748
1749 if (!features->sparseBinding)
1750 device->feature_options.TiledResourcesTier = D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED;
1751 else if (!device->vk_info.sparse_properties.residencyNonResidentStrict)
1752 device->feature_options.TiledResourcesTier = D3D12_TILED_RESOURCES_TIER_1;
1753 else if (!features->sparseResidencyImage3D)
1754 device->feature_options.TiledResourcesTier = D3D12_TILED_RESOURCES_TIER_2;
1755 else
1756 device->feature_options.TiledResourcesTier = D3D12_TILED_RESOURCES_TIER_3;
1757
1758 /* FIXME: Implement tiled resources. */
1759 if (device->feature_options.TiledResourcesTier)
1760 {
1761 WARN("Tiled resources are not implemented yet.\n");
1762 device->feature_options.TiledResourcesTier = D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED;
1763 }
1764
1765 if (device->vk_info.device_limits.maxPerStageDescriptorSamplers <= 16)
1766 device->feature_options.ResourceBindingTier = D3D12_RESOURCE_BINDING_TIER_1;
1767 else if (device->vk_info.device_limits.maxPerStageDescriptorUniformBuffers <= 14)
1768 device->feature_options.ResourceBindingTier = D3D12_RESOURCE_BINDING_TIER_2;
1769 else
1770 device->feature_options.ResourceBindingTier = D3D12_RESOURCE_BINDING_TIER_3;
1771
1772 device->feature_options.TypedUAVLoadAdditionalFormats = features->shaderStorageImageReadWithoutFormat
1774 /* GL_INTEL_conservative_rasterization, no Vulkan equivalent. */
1775 device->feature_options.ConservativeRasterizationTier = D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED;
1776 device->feature_options.MaxGPUVirtualAddressBitsPerResource = 40; /* FIXME */
1777 device->feature_options.StandardSwizzle64KBSupported = FALSE;
1778 device->feature_options.CrossNodeSharingTier = D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED;
1779 device->feature_options.CrossAdapterRowMajorTextureSupported = FALSE;
1780 device->feature_options.ResourceHeapTier = D3D12_RESOURCE_HEAP_TIER_2;
1781
1782 /* Shader Model 6 support. */
1783 device->feature_options1.WaveOps = subgroup_properties->subgroupSize >= 4
1784 && (subgroup_properties->supportedOperations & required_subgroup_features) == required_subgroup_features
1785 && (subgroup_properties->supportedStages & required_stages) == required_stages;
1786 device->feature_options1.WaveLaneCountMin = subgroup_properties->subgroupSize;
1787 device->feature_options1.WaveLaneCountMax = subgroup_properties->subgroupSize;
1788 device->feature_options1.TotalLaneCount = 32 * subgroup_properties->subgroupSize; /* approx. */
1789 device->feature_options1.ExpandedComputeResourceStates = TRUE;
1790 device->feature_options1.Int64ShaderOps = features->shaderInt64;
1791
1792 device->feature_options2.DepthBoundsTestSupported = features->depthBounds;
1793 /* d3d12_command_list_SetSamplePositions() is not implemented. */
1794 device->feature_options2.ProgrammableSamplePositionsTier = D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED;
1795
1796 device->feature_options3.CopyQueueTimestampQueriesSupported = FALSE;
1797 device->feature_options3.CastingFullyTypedFormatSupported = FALSE;
1798 device->feature_options3.WriteBufferImmediateSupportFlags = D3D12_COMMAND_LIST_SUPPORT_FLAG_NONE;
1799 device->feature_options3.ViewInstancingTier = D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED;
1800 device->feature_options3.BarycentricsSupported = FALSE;
1801
1802 device->feature_options4.MSAA64KBAlignedTextureSupported = FALSE;
1803 device->feature_options4.SharedResourceCompatibilityTier = D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0;
1804 /* An SM 6.2 feature. This would require features->shaderInt16 and
1805 * VK_KHR_shader_float16_int8. */
1806 device->feature_options4.Native16BitShaderOpsSupported = FALSE;
1807
1808 device->feature_options5.SRVOnlyTiledResourceTier3 = FALSE;
1809 device->feature_options5.RenderPassesTier = D3D12_RENDER_PASS_TIER_0;
1810 device->feature_options5.RaytracingTier = D3D12_RAYTRACING_TIER_NOT_SUPPORTED;
1811
1812 fragment_shader_interlock = &physical_device_info->fragment_shader_interlock_features;
1813 if (!fragment_shader_interlock->fragmentShaderSampleInterlock
1814 || !fragment_shader_interlock->fragmentShaderPixelInterlock)
1815 vulkan_info->EXT_fragment_shader_interlock = false;
1816 device->feature_options.ROVsSupported = vulkan_info->EXT_fragment_shader_interlock;
1817
1818 if (!physical_device_info->conditional_rendering_features.conditionalRendering)
1819 vulkan_info->EXT_conditional_rendering = false;
1820 if (!physical_device_info->depth_clip_features.depthClipEnable)
1821 vulkan_info->EXT_depth_clip_enable = false;
1822 if (!physical_device_info->robustness2_features.nullDescriptor)
1823 vulkan_info->EXT_robustness2 = false;
1824 if (!physical_device_info->demote_features.shaderDemoteToHelperInvocation)
1825 vulkan_info->EXT_shader_demote_to_helper_invocation = false;
1826 if (!physical_device_info->texel_buffer_alignment_features.texelBufferAlignment)
1827 vulkan_info->EXT_texel_buffer_alignment = false;
1828 if (!physical_device_info->mutable_features.mutableDescriptorType)
1829 vulkan_info->EXT_mutable_descriptor_type = false;
1830 if (!physical_device_info->timeline_semaphore_features.timelineSemaphore)
1831 vulkan_info->KHR_timeline_semaphore = false;
1832
1833 physical_device_info->formats4444_features.formatA4B4G4R4 = VK_FALSE;
1834
1835 vulkan_info->texel_buffer_alignment_properties = physical_device_info->texel_buffer_alignment_properties;
1836
1837 if (get_spec_version(vk_extensions, vk_extension_count, VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME) >= 3)
1838 {
1840 divisor_features = &physical_device_info->vertex_divisor_features;
1841 if (!divisor_features->vertexAttributeInstanceRateDivisor)
1842 vulkan_info->EXT_vertex_attribute_divisor = false;
1844 }
1845 else
1846 {
1847 vulkan_info->vertex_attrib_zero_divisor = false;
1848 }
1849
1850 vkd3d_free(vk_extensions);
1851
1852 device->feature_options.PSSpecifiedStencilRefSupported = vulkan_info->EXT_shader_stencil_export;
1853 device->feature_options.VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation =
1855
1856 vkd3d_init_feature_level(vulkan_info, features, &device->feature_options);
1857
1859
1860 if (vulkan_info->max_feature_level < create_info->minimum_feature_level)
1861 {
1862 WARN("Feature level %#x is not supported.\n", create_info->minimum_feature_level);
1863 vkd3d_free(*user_extension_supported);
1864 *user_extension_supported = NULL;
1865 return E_INVALIDARG;
1866 }
1867
1868 /* Shader extensions. */
1870 {
1871 vulkan_info->shader_extension_count = 1;
1873 }
1874
1875 if (vulkan_info->EXT_descriptor_indexing)
1876 vulkan_info->shader_extensions[vulkan_info->shader_extension_count++]
1878
1879 if (vulkan_info->EXT_fragment_shader_interlock)
1880 vulkan_info->shader_extensions[vulkan_info->shader_extension_count++]
1882
1883 if (vulkan_info->EXT_shader_stencil_export)
1884 vulkan_info->shader_extensions[vulkan_info->shader_extension_count++]
1886
1887 if (vulkan_info->EXT_shader_viewport_index_layer)
1888 vulkan_info->shader_extensions[vulkan_info->shader_extension_count++]
1890
1891 /* Disable unused Vulkan features. */
1893
1894 descriptor_indexing = &physical_device_info->descriptor_indexing_features;
1897
1898 /* We do not use storage buffers currently. */
1902
1903 if (vulkan_info->EXT_descriptor_indexing && descriptor_indexing
1904 && (descriptor_indexing->descriptorBindingUniformBufferUpdateAfterBind
1905 || descriptor_indexing->descriptorBindingStorageBufferUpdateAfterBind
1909 {
1910 WARN("Disabling robust buffer access for the update after bind feature.\n");
1911 features->robustBufferAccess = VK_FALSE;
1912 physical_device_info->robustness2_features.robustBufferAccess2 = VK_FALSE;
1913 }
1914
1915 /* Select descriptor heap implementation. Forcing virtual heaps may be useful if
1916 * a client allocates descriptor heaps too large for the Vulkan device, or the
1917 * root signature cost exceeds the available push constant size. Virtual heaps
1918 * use only enough descriptors for the descriptor tables of the currently bound
1919 * root signature, and don't require a 32-bit push constant for each table. */
1920 device->use_vk_heaps = vulkan_info->EXT_descriptor_indexing
1921 && !(device->vkd3d_instance->config_flags & VKD3D_CONFIG_FLAG_VIRTUAL_HEAPS)
1922 && descriptor_indexing->descriptorBindingUniformBufferUpdateAfterBind
1923 && descriptor_indexing->descriptorBindingSampledImageUpdateAfterBind
1924 && descriptor_indexing->descriptorBindingStorageImageUpdateAfterBind
1927
1928 if (device->use_vk_heaps && device->vk_info.KHR_push_descriptor)
1929 {
1930 /* VKD3D_SET_INDEX_COUNT for the Vulkan heaps, one for the push
1931 * descriptors set and one for the static samplers set. */
1932 unsigned int descriptor_set_count = VKD3D_SET_INDEX_COUNT + 2;
1933
1934 /* A mutable descriptor set can replace all those that should otherwise
1935 * back the SRV-UAV-CBV descriptor heap. */
1936 if (device->vk_info.EXT_mutable_descriptor_type)
1937 descriptor_set_count -= VKD3D_SET_INDEX_COUNT - (VKD3D_SET_INDEX_MUTABLE + 1);
1938
1939 /* For many Vulkan implementations maxBoundDescriptorSets == 8; also,
1940 * if mutable descriptors are not available the descriptor set count
1941 * will be 9; so saving a descriptor set is going to be often
1942 * significant. */
1943 if (descriptor_set_count > device->vk_info.device_limits.maxBoundDescriptorSets)
1944 {
1945 WARN("Disabling VK_KHR_push_descriptor to save a descriptor set.\n");
1946 device->vk_info.KHR_push_descriptor = VK_FALSE;
1947 }
1948 }
1949
1950 if (device->use_vk_heaps)
1952 &physical_device_info->descriptor_indexing_properties);
1953 else
1955 &physical_device_info->properties2.properties.limits);
1956
1957 TRACE("Device %p: using %s descriptor heaps, with%s descriptor indexing, "
1958 "with%s push descriptors, with%s mutable descriptors\n",
1959 device, device->use_vk_heaps ? "Vulkan" : "virtual",
1960 device->vk_info.EXT_descriptor_indexing ? "" : "out",
1961 device->vk_info.KHR_push_descriptor ? "" : "out",
1962 device->vk_info.EXT_mutable_descriptor_type ? "" : "out");
1963
1965
1966 return S_OK;
1967}
1968
1970 unsigned int device_index, VkPhysicalDevice *selected_device)
1971{
1972 VkPhysicalDevice dgpu_device = VK_NULL_HANDLE, igpu_device = VK_NULL_HANDLE;
1973 const struct vkd3d_vk_instance_procs *vk_procs = &instance->vk_procs;
1974 VkInstance vk_instance = instance->vk_instance;
1975 VkPhysicalDeviceProperties device_properties;
1976 VkPhysicalDevice device = VK_NULL_HANDLE;
1977 VkPhysicalDevice *physical_devices;
1979 unsigned int i;
1980 VkResult vr;
1981
1982 count = 0;
1983 if ((vr = VK_CALL(vkEnumeratePhysicalDevices(vk_instance, &count, NULL))) < 0)
1984 {
1985 ERR("Failed to enumerate physical devices, vr %d.\n", vr);
1986 return hresult_from_vk_result(vr);
1987 }
1988 if (!count)
1989 {
1990 ERR("No physical device available.\n");
1991 return E_FAIL;
1992 }
1993 if (!(physical_devices = vkd3d_calloc(count, sizeof(*physical_devices))))
1994 return E_OUTOFMEMORY;
1995
1996 TRACE("Enumerating %u physical device(s).\n", count);
1997 if ((vr = VK_CALL(vkEnumeratePhysicalDevices(vk_instance, &count, physical_devices))) < 0)
1998 {
1999 ERR("Failed to enumerate physical devices, vr %d.\n", vr);
2000 vkd3d_free(physical_devices);
2001 return hresult_from_vk_result(vr);
2002 }
2003
2004 if (device_index != ~0u && device_index >= count)
2005 WARN("Device index %u is out of range.\n", device_index);
2006
2007 for (i = 0; i < count; ++i)
2008 {
2009 VK_CALL(vkGetPhysicalDeviceProperties(physical_devices[i], &device_properties));
2010 vkd3d_trace_physical_device_properties(&device_properties);
2011
2012 if (i == device_index)
2013 device = physical_devices[i];
2014
2015 if (device_properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU && !dgpu_device)
2016 dgpu_device = physical_devices[i];
2017 else if (device_properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU && !igpu_device)
2018 igpu_device = physical_devices[i];
2019 }
2020
2021 if (!device)
2022 device = dgpu_device ? dgpu_device : igpu_device;
2023 if (!device)
2024 device = physical_devices[0];
2025
2026 vkd3d_free(physical_devices);
2027
2028 VK_CALL(vkGetPhysicalDeviceProperties(device, &device_properties));
2029 TRACE("Using device: %s, %#x:%#x.\n", device_properties.deviceName,
2030 device_properties.vendorID, device_properties.deviceID);
2031
2032 *selected_device = device;
2033
2034 return S_OK;
2035}
2036
2037/* Vulkan queues */
2039{
2043
2045};
2046
2048{
2051
2052 unsigned int vk_family_count;
2054};
2055
2057{
2058 if (device->direct_queue)
2059 vkd3d_queue_destroy(device->direct_queue, device);
2060 if (device->compute_queue && device->compute_queue != device->direct_queue)
2061 vkd3d_queue_destroy(device->compute_queue, device);
2062 if (device->copy_queue && device->copy_queue != device->direct_queue
2063 && device->copy_queue != device->compute_queue)
2064 vkd3d_queue_destroy(device->copy_queue, device);
2065
2066 device->direct_queue = NULL;
2067 device->compute_queue = NULL;
2068 device->copy_queue = NULL;
2069}
2070
2072 const struct vkd3d_device_queue_info *queue_info)
2073{
2074 uint32_t transfer_family_index = queue_info->family_index[VKD3D_QUEUE_FAMILY_TRANSFER];
2075 uint32_t compute_family_index = queue_info->family_index[VKD3D_QUEUE_FAMILY_COMPUTE];
2076 uint32_t direct_family_index = queue_info->family_index[VKD3D_QUEUE_FAMILY_DIRECT];
2077 HRESULT hr;
2078
2079 device->direct_queue = NULL;
2080 device->compute_queue = NULL;
2081 device->copy_queue = NULL;
2082
2083 device->queue_family_count = 0;
2084 memset(device->queue_family_indices, 0, sizeof(device->queue_family_indices));
2085
2086 if (SUCCEEDED((hr = vkd3d_queue_create(device, direct_family_index,
2087 &queue_info->vk_properties[VKD3D_QUEUE_FAMILY_DIRECT], &device->direct_queue))))
2088 device->queue_family_indices[device->queue_family_count++] = direct_family_index;
2089 else
2090 goto out_destroy_queues;
2091
2092 if (compute_family_index == direct_family_index)
2093 device->compute_queue = device->direct_queue;
2094 else if (SUCCEEDED(hr = vkd3d_queue_create(device, compute_family_index,
2095 &queue_info->vk_properties[VKD3D_QUEUE_FAMILY_COMPUTE], &device->compute_queue)))
2096 device->queue_family_indices[device->queue_family_count++] = compute_family_index;
2097 else
2098 goto out_destroy_queues;
2099
2100 if (transfer_family_index == direct_family_index)
2101 device->copy_queue = device->direct_queue;
2102 else if (transfer_family_index == compute_family_index)
2103 device->copy_queue = device->compute_queue;
2104 else if (SUCCEEDED(hr = vkd3d_queue_create(device, transfer_family_index,
2105 &queue_info->vk_properties[VKD3D_QUEUE_FAMILY_TRANSFER], &device->copy_queue)))
2106 device->queue_family_indices[device->queue_family_count++] = transfer_family_index;
2107 else
2108 goto out_destroy_queues;
2109
2110 device->feature_options3.CopyQueueTimestampQueriesSupported = !!device->copy_queue->timestamp_bits;
2111
2112 return S_OK;
2113
2114out_destroy_queues:
2116 return hr;
2117}
2118
2119static float queue_priorities[] = {1.0f};
2120
2122 VkPhysicalDevice physical_device, struct vkd3d_device_queue_info *info)
2123{
2124 const struct vkd3d_vk_instance_procs *vk_procs = &vkd3d_instance->vk_procs;
2125 VkQueueFamilyProperties *queue_properties = NULL;
2126 VkDeviceQueueCreateInfo *queue_info = NULL;
2127 unsigned int i;
2129
2130 memset(info, 0, sizeof(*info));
2131 for (i = 0; i < ARRAY_SIZE(info->family_index); ++i)
2132 info->family_index[i] = ~0u;
2133
2135 if (!(queue_properties = vkd3d_calloc(count, sizeof(*queue_properties))))
2136 return E_OUTOFMEMORY;
2137 VK_CALL(vkGetPhysicalDeviceQueueFamilyProperties(physical_device, &count, queue_properties));
2138
2139 for (i = 0; i < count; ++i)
2140 {
2141 enum vkd3d_queue_family vkd3d_family = VKD3D_QUEUE_FAMILY_COUNT;
2142
2143 if ((queue_properties[i].queueFlags & (VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT))
2145 {
2146 vkd3d_family = VKD3D_QUEUE_FAMILY_DIRECT;
2147 }
2148 if ((queue_properties[i].queueFlags & (VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT))
2150 {
2151 vkd3d_family = VKD3D_QUEUE_FAMILY_COMPUTE;
2152 }
2153 if ((queue_properties[i].queueFlags & ~VK_QUEUE_SPARSE_BINDING_BIT) == VK_QUEUE_TRANSFER_BIT)
2154 {
2155 vkd3d_family = VKD3D_QUEUE_FAMILY_TRANSFER;
2156 }
2157
2158 if (vkd3d_family == VKD3D_QUEUE_FAMILY_COUNT)
2159 continue;
2160
2161 info->family_index[vkd3d_family] = i;
2162 info->vk_properties[vkd3d_family] = queue_properties[i];
2163 queue_info = &info->vk_queue_create_info[vkd3d_family];
2164
2166 queue_info->pNext = NULL;
2167 queue_info->flags = 0;
2168 queue_info->queueFamilyIndex = i;
2169 queue_info->queueCount = 1; /* FIXME: Use multiple queues. */
2170 queue_info->pQueuePriorities = queue_priorities;
2171 }
2172
2173 vkd3d_free(queue_properties);
2174
2175 if (info->family_index[VKD3D_QUEUE_FAMILY_DIRECT] == ~0u)
2176 {
2177 FIXME("Could not find a suitable queue family for a direct command queue.\n");
2178 return E_FAIL;
2179 }
2180
2181 /* No compute-only queue family, reuse the direct queue family with graphics and compute. */
2182 if (info->family_index[VKD3D_QUEUE_FAMILY_COMPUTE] == ~0u)
2183 {
2184 info->family_index[VKD3D_QUEUE_FAMILY_COMPUTE] = info->family_index[VKD3D_QUEUE_FAMILY_DIRECT];
2185 info->vk_properties[VKD3D_QUEUE_FAMILY_COMPUTE] = info->vk_properties[VKD3D_QUEUE_FAMILY_DIRECT];
2186 }
2187 if (info->family_index[VKD3D_QUEUE_FAMILY_TRANSFER] == ~0u)
2188 {
2189 info->family_index[VKD3D_QUEUE_FAMILY_TRANSFER] = info->family_index[VKD3D_QUEUE_FAMILY_DIRECT];
2190 info->vk_properties[VKD3D_QUEUE_FAMILY_TRANSFER] = info->vk_properties[VKD3D_QUEUE_FAMILY_DIRECT];
2191 }
2192
2193 /* Compact the array. */
2194 info->vk_family_count = 1;
2195 for (i = info->vk_family_count; i < ARRAY_SIZE(info->vk_queue_create_info); ++i)
2196 {
2197 if (info->vk_queue_create_info[i].queueCount)
2198 info->vk_queue_create_info[info->vk_family_count++] = info->vk_queue_create_info[i];
2199 }
2200
2201 return S_OK;
2202}
2203
2204/* The 4 MiB alignment requirement for MSAA resources was lowered to 64KB on
2205 * hardware that supports it. This is distinct from the small MSAA requirement
2206 * which applies to resources of a total size of 4 MiB or less. */
2208{
2210 D3D12_RESOURCE_DESC1 resource_desc;
2211
2212 memset(&resource_desc, 0, sizeof(resource_desc));
2213 resource_desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
2214 resource_desc.Width = 1024;
2215 resource_desc.Height = 1025;
2216 resource_desc.DepthOrArraySize = 1;
2217 resource_desc.MipLevels = 1;
2218 resource_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
2219 resource_desc.SampleDesc.Count = 4;
2220 resource_desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
2221
2222 /* FIXME: in some cases Vulkan requires 0x20000 or more for non-MSAA
2223 * resources, which must have 0x10000 in their description, so we might
2224 * reasonably return true here for 0x20000 or 0x40000. */
2225 return SUCCEEDED(vkd3d_get_image_allocation_info(device, &resource_desc, &info))
2226 && info.alignment <= 0x10000;
2227}
2228
2230 const struct vkd3d_device_create_info *create_info)
2231{
2232 const struct vkd3d_vk_instance_procs *vk_procs = &device->vkd3d_instance->vk_procs;
2233 const struct vkd3d_optional_device_extensions_info *optional_extensions;
2234 struct vkd3d_physical_device_info physical_device_info;
2235 struct vkd3d_device_queue_info device_queue_info;
2236 bool *user_extension_supported = NULL;
2237 VkPhysicalDevice physical_device;
2239 unsigned int device_index;
2240 uint32_t extension_count;
2241 const char **extensions;
2242 VkDevice vk_device;
2243 VkResult vr;
2244 HRESULT hr;
2245
2246 TRACE("device %p, create_info %p.\n", device, create_info);
2247
2248 physical_device = create_info->vk_physical_device;
2249 device_index = vkd3d_env_var_as_uint("VKD3D_VULKAN_DEVICE", ~0u);
2250 if ((!physical_device || device_index != ~0u)
2251 && FAILED(hr = vkd3d_select_physical_device(device->vkd3d_instance, device_index, &physical_device)))
2252 return hr;
2253
2254 device->vk_physical_device = physical_device;
2255
2256 if (FAILED(hr = vkd3d_select_queues(device->vkd3d_instance, physical_device, &device_queue_info)))
2257 return hr;
2258
2259 TRACE("Using queue family %u for direct command queues.\n",
2260 device_queue_info.family_index[VKD3D_QUEUE_FAMILY_DIRECT]);
2261 TRACE("Using queue family %u for compute command queues.\n",
2262 device_queue_info.family_index[VKD3D_QUEUE_FAMILY_COMPUTE]);
2263 TRACE("Using queue family %u for copy command queues.\n",
2264 device_queue_info.family_index[VKD3D_QUEUE_FAMILY_TRANSFER]);
2265
2266 VK_CALL(vkGetPhysicalDeviceMemoryProperties(physical_device, &device->memory_properties));
2267
2268 if (FAILED(hr = vkd3d_init_device_caps(device, create_info, &physical_device_info,
2269 &extension_count, &user_extension_supported)))
2270 return hr;
2271
2272 if (!(extensions = vkd3d_calloc(extension_count, sizeof(*extensions))))
2273 {
2274 vkd3d_free(user_extension_supported);
2275 return E_OUTOFMEMORY;
2276 }
2277
2278 optional_extensions = vkd3d_find_struct(create_info->next, OPTIONAL_DEVICE_EXTENSIONS_INFO);
2279
2280 /* Create device */
2282 device_info.pNext = physical_device_info.features2.pNext;
2283 device_info.flags = 0;
2284 device_info.queueCreateInfoCount = device_queue_info.vk_family_count;
2285 device_info.pQueueCreateInfos = device_queue_info.vk_queue_create_info;
2286 device_info.enabledLayerCount = 0;
2287 device_info.ppEnabledLayerNames = NULL;
2288 device_info.enabledExtensionCount = vkd3d_enable_extensions(extensions,
2291 create_info->device_extensions, create_info->device_extension_count,
2292 optional_extensions ? optional_extensions->extensions : NULL,
2293 optional_extensions ? optional_extensions->extension_count : 0,
2294 user_extension_supported, &device->vk_info);
2295 device_info.ppEnabledExtensionNames = extensions;
2296 device_info.pEnabledFeatures = &physical_device_info.features2.features;
2297 vkd3d_free(user_extension_supported);
2298
2299 vr = VK_CALL(vkCreateDevice(physical_device, &device_info, NULL, &vk_device));
2300 vkd3d_free(extensions);
2301 if (vr < 0)
2302 {
2303 WARN("Failed to create Vulkan device, vr %d.\n", vr);
2304 return hresult_from_vk_result(vr);
2305 }
2306
2307 if (FAILED(hr = vkd3d_load_vk_device_procs(&device->vk_procs, vk_procs, vk_device)))
2308 {
2309 ERR("Failed to load device procs, hr %s.\n", debugstr_hresult(hr));
2310 if (device->vk_procs.vkDestroyDevice)
2311 device->vk_procs.vkDestroyDevice(vk_device, NULL);
2312 return hr;
2313 }
2314
2315 device->vk_device = vk_device;
2316
2317 if (FAILED(hr = d3d12_device_create_vkd3d_queues(device, &device_queue_info)))
2318 {
2319 ERR("Failed to create queues, hr %s.\n", debugstr_hresult(hr));
2320 device->vk_procs.vkDestroyDevice(vk_device, NULL);
2321 return hr;
2322 }
2323
2324 device->feature_options4.MSAA64KBAlignedTextureSupported = d3d12_is_64k_msaa_supported(device);
2325
2326 TRACE("Created Vulkan device %p.\n", vk_device);
2327
2328 return hr;
2329}
2330
2332{
2333 const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
2334 VkPipelineCacheCreateInfo cache_info;
2335 VkResult vr;
2336
2337 vkd3d_mutex_init(&device->pipeline_cache_mutex);
2338
2340 cache_info.pNext = NULL;
2341 cache_info.flags = 0;
2342 cache_info.initialDataSize = 0;
2343 cache_info.pInitialData = NULL;
2344 if ((vr = VK_CALL(vkCreatePipelineCache(device->vk_device, &cache_info, NULL,
2345 &device->vk_pipeline_cache))) < 0)
2346 {
2347 ERR("Failed to create Vulkan pipeline cache, vr %d.\n", vr);
2348 device->vk_pipeline_cache = VK_NULL_HANDLE;
2349 }
2350
2351 return S_OK;
2352}
2353
2355{
2356 const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
2357
2358 if (device->vk_pipeline_cache)
2359 VK_CALL(vkDestroyPipelineCache(device->vk_device, device->vk_pipeline_cache, NULL));
2360
2361 vkd3d_mutex_destroy(&device->pipeline_cache_mutex);
2362}
2363
2364#define VKD3D_VA_FALLBACK_BASE 0x8000000000000000ull
2365#define VKD3D_VA_SLAB_BASE 0x0000001000000000ull
2366#define VKD3D_VA_SLAB_SIZE_SHIFT 32
2367#define VKD3D_VA_SLAB_SIZE (1ull << VKD3D_VA_SLAB_SIZE_SHIFT)
2368#define VKD3D_VA_SLAB_COUNT (64 * 1024)
2369
2371 uint64_t aligned_size, void *ptr)
2372{
2373 struct vkd3d_gpu_va_slab *slab;
2375 unsigned slab_idx;
2376
2377 slab = allocator->free_slab;
2378 allocator->free_slab = slab->ptr;
2379 slab->size = aligned_size;
2380 slab->ptr = ptr;
2381
2382 /* It is critical that the multiplication happens in 64-bit to not
2383 * overflow. */
2384 slab_idx = slab - allocator->slabs;
2386
2387 TRACE("Allocated address %#"PRIx64", slab %u, size %"PRIu64".\n", address, slab_idx, aligned_size);
2388
2389 return address;
2390}
2391
2393 size_t alignment, uint64_t aligned_size, void *ptr)
2394{
2395 struct vkd3d_gpu_va_allocation *allocation;
2397
2398 base = allocator->fallback_floor;
2399 ceiling = ~(D3D12_GPU_VIRTUAL_ADDRESS)0;
2400 ceiling -= alignment - 1;
2401 if (aligned_size > ceiling || ceiling - aligned_size < base)
2402 return 0;
2403
2405
2406 if (!vkd3d_array_reserve((void **)&allocator->fallback_allocations, &allocator->fallback_allocations_size,
2407 allocator->fallback_allocation_count + 1, sizeof(*allocator->fallback_allocations)))
2408 return 0;
2409
2410 allocation = &allocator->fallback_allocations[allocator->fallback_allocation_count++];
2411 allocation->base = base;
2412 allocation->size = aligned_size;
2413 allocation->ptr = ptr;
2414
2415 /* This pointer is bumped and never lowered on a free. However, this will
2416 * only fail once we have exhausted 63 bits of address space. */
2417 allocator->fallback_floor = base + aligned_size;
2418
2419 TRACE("Allocated address %#"PRIx64", size %"PRIu64".\n", base, aligned_size);
2420
2421 return base;
2422}
2423
2425 size_t alignment, uint64_t size, void *ptr)
2426{
2428
2429 if (size > ~(uint64_t)0 - (alignment - 1))
2430 return 0;
2432
2433 vkd3d_mutex_lock(&allocator->mutex);
2434
2435 if (size <= VKD3D_VA_SLAB_SIZE && allocator->free_slab)
2437 else
2439
2441
2442 return address;
2443}
2444
2447{
2448 const struct vkd3d_gpu_va_slab *slab;
2449 D3D12_GPU_VIRTUAL_ADDRESS base_offset;
2450 unsigned int slab_idx;
2451
2452 base_offset = address - VKD3D_VA_SLAB_BASE;
2453 slab_idx = base_offset >> VKD3D_VA_SLAB_SIZE_SHIFT;
2454
2455 if (slab_idx >= VKD3D_VA_SLAB_COUNT)
2456 {
2457 ERR("Invalid slab index %u for address %#"PRIx64".\n", slab_idx, address);
2458 return NULL;
2459 }
2460
2461 slab = &allocator->slabs[slab_idx];
2462 base_offset -= slab_idx * VKD3D_VA_SLAB_SIZE;
2463 if (base_offset >= slab->size)
2464 {
2465 ERR("Address %#"PRIx64" is %#"PRIx64" bytes into slab %u of size %"PRIu64".\n",
2466 address, base_offset, slab_idx, slab->size);
2467 return NULL;
2468 }
2469 return slab->ptr;
2470}
2471
2472static int vkd3d_gpu_va_allocation_compare(const void *k, const void *e)
2473{
2474 const struct vkd3d_gpu_va_allocation *allocation = e;
2476
2477 if (*address < allocation->base)
2478 return -1;
2479 if (*address - allocation->base >= allocation->size)
2480 return 1;
2481 return 0;
2482}
2483
2486{
2487 struct vkd3d_gpu_va_allocation *allocation;
2488
2489 allocation = bsearch(&address, allocator->fallback_allocations, allocator->fallback_allocation_count,
2490 sizeof(*allocation), vkd3d_gpu_va_allocation_compare);
2491
2492 return allocation ? allocation->ptr : NULL;
2493}
2494
2497{
2498 void *ret;
2499
2500 /* If we land in the non-fallback region, dereferencing VA is lock-less.
2501 * The base pointer is immutable, and the only way we can have a data race
2502 * is if some other thread is poking into the
2503 * slab_mem_allocation[base_index] block. This can only happen if someone
2504 * is trying to free the entry while we're dereferencing it, which would
2505 * be a serious application bug. */
2508
2509 /* Slow fallback. */
2510 vkd3d_mutex_lock(&allocator->mutex);
2511
2513
2515
2516 return ret;
2517}
2518
2521{
2522 D3D12_GPU_VIRTUAL_ADDRESS base_offset;
2523 struct vkd3d_gpu_va_slab *slab;
2524 unsigned int slab_idx;
2525
2526 base_offset = address - VKD3D_VA_SLAB_BASE;
2527 slab_idx = base_offset >> VKD3D_VA_SLAB_SIZE_SHIFT;
2528
2529 if (slab_idx >= VKD3D_VA_SLAB_COUNT)
2530 {
2531 ERR("Invalid slab index %u for address %#"PRIx64".\n", slab_idx, address);
2532 return;
2533 }
2534
2535 TRACE("Freeing address %#"PRIx64", slab %u.\n", address, slab_idx);
2536
2537 slab = &allocator->slabs[slab_idx];
2538 slab->size = 0;
2539 slab->ptr = allocator->free_slab;
2540 allocator->free_slab = slab;
2541}
2542
2545{
2546 struct vkd3d_gpu_va_allocation *allocation;
2547 unsigned int index;
2548
2549 allocation = bsearch(&address, allocator->fallback_allocations, allocator->fallback_allocation_count,
2550 sizeof(*allocation), vkd3d_gpu_va_allocation_compare);
2551
2552 if (!allocation || allocation->base != address)
2553 {
2554 ERR("Address %#"PRIx64" does not match any allocation.\n", address);
2555 return;
2556 }
2557
2558 index = allocation - allocator->fallback_allocations;
2559 --allocator->fallback_allocation_count;
2560 if (index != allocator->fallback_allocation_count)
2561 memmove(&allocator->fallback_allocations[index], &allocator->fallback_allocations[index + 1],
2562 (allocator->fallback_allocation_count - index) * sizeof(*allocation));
2563}
2564
2566{
2567 vkd3d_mutex_lock(&allocator->mutex);
2568
2570 {
2573 return;
2574 }
2575
2577
2579}
2580
2582{
2583 unsigned int i;
2584
2585 memset(allocator, 0, sizeof(*allocator));
2586 allocator->fallback_floor = VKD3D_VA_FALLBACK_BASE;
2587
2588 /* To remain lock-less, we cannot grow the slabs array after the fact. If
2589 * we commit to a maximum number of allocations here, we can dereference
2590 * without taking a lock as the base pointer never changes. We would be
2591 * able to grow more seamlessly using an array of pointers, but that would
2592 * make dereferencing slightly less efficient. */
2593 if (!(allocator->slabs = vkd3d_calloc(VKD3D_VA_SLAB_COUNT, sizeof(*allocator->slabs))))
2594 return false;
2595
2596 /* Mark all slabs as free. */
2597 allocator->free_slab = &allocator->slabs[0];
2598 for (i = 0; i < VKD3D_VA_SLAB_COUNT - 1; ++i)
2599 {
2600 allocator->slabs[i].ptr = &allocator->slabs[i + 1];
2601 }
2602
2603 vkd3d_mutex_init(&allocator->mutex);
2604
2605 return true;
2606}
2607
2609{
2610 vkd3d_mutex_lock(&allocator->mutex);
2611 vkd3d_free(allocator->slabs);
2612 vkd3d_free(allocator->fallback_allocations);
2615}
2616
2618{
2619 unsigned int i;
2620
2621 for (i = 0; i < count; ++i)
2622 if (domains[i] == domain)
2623 return true;
2624
2625 return false;
2626}
2627
2629{
2630 static const VkTimeDomainEXT host_time_domains[] =
2631 {
2632 /* In order of preference */
2636
2637 };
2638 const struct vkd3d_vk_instance_procs *vk_procs = &device->vkd3d_instance->vk_procs;
2639 VkTimeDomainEXT domains[8];
2640 unsigned int i;
2642 VkResult vr;
2643
2644 device->vk_host_time_domain = -1;
2645
2646 if (!device->vk_info.EXT_calibrated_timestamps)
2647 return;
2648
2649 count = ARRAY_SIZE(domains);
2651 &count, domains))) != VK_SUCCESS && vr != VK_INCOMPLETE)
2652 {
2653 WARN("Failed to get calibrated time domains, vr %d.\n", vr);
2654 return;
2655 }
2656
2657 if (vr == VK_INCOMPLETE)
2658 FIXME("Calibrated time domain list is incomplete.\n");
2659
2661 {
2662 WARN("Device time domain not found. Calibrated timestamps will not be available.\n");
2663 return;
2664 }
2665
2666 for (i = 0; i < ARRAY_SIZE(host_time_domains); ++i)
2667 {
2668 if (!have_vk_time_domain(domains, count, host_time_domains[i]))
2669 continue;
2670 device->vk_host_time_domain = host_time_domains[i];
2671 break;
2672 }
2673 if (device->vk_host_time_domain == -1)
2674 WARN("Found no acceptable host time domain. Calibrated timestamps will not be available.\n");
2675}
2676
2678{
2679 const struct vkd3d_device_descriptor_limits *limits = &device->vk_info.descriptor_limits;
2680 VkDescriptorPoolSize *pool_sizes = device->vk_pool_sizes;
2681
2682 if (device->use_vk_heaps)
2683 {
2685 pool_sizes[0].descriptorCount = min(limits->storage_image_max_descriptors,
2687 pool_sizes[1].type = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
2688 pool_sizes[1].descriptorCount = pool_sizes[0].descriptorCount;
2689 pool_sizes[2].type = VK_DESCRIPTOR_TYPE_SAMPLER;
2691 device->vk_pool_count = 3;
2692 return;
2693 }
2694
2695 VKD3D_ASSERT(ARRAY_SIZE(device->vk_pool_sizes) >= 6);
2697 pool_sizes[0].descriptorCount = min(limits->uniform_buffer_max_descriptors,
2700 pool_sizes[1].descriptorCount = min(limits->sampled_image_max_descriptors,
2702 pool_sizes[2].type = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE;
2703 pool_sizes[2].descriptorCount = pool_sizes[1].descriptorCount;
2705 pool_sizes[3].descriptorCount = min(limits->storage_image_max_descriptors,
2707 pool_sizes[4].type = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
2708 pool_sizes[4].descriptorCount = pool_sizes[3].descriptorCount;
2709 pool_sizes[5].type = VK_DESCRIPTOR_TYPE_SAMPLER;
2710 pool_sizes[5].descriptorCount = min(limits->sampler_max_descriptors,
2712 device->vk_pool_count = 6;
2713};
2714
2716{
2717 memset(cache, 0, sizeof(*cache));
2718 cache->size = size;
2719}
2720
2722{
2723 union d3d12_desc_object u;
2724 unsigned int i;
2725 void *next;
2726
2727 for (i = 0; i < ARRAY_SIZE(cache->heads); ++i)
2728 {
2729 for (u.object = cache->heads[i].head; u.object; u.object = next)
2730 {
2731 next = u.header->next;
2732 vkd3d_free(u.object);
2733 }
2734 }
2735}
2736
2737/* ID3D12ShaderCacheSession */
2739{
2740 ID3D12ShaderCacheSession ID3D12ShaderCacheSession_iface;
2741 unsigned int refcount;
2742
2744
2749};
2750
2753
2754static inline struct d3d12_cache_session *impl_from_ID3D12ShaderCacheSession(ID3D12ShaderCacheSession *iface)
2755{
2757}
2758
2759static HRESULT STDMETHODCALLTYPE d3d12_cache_session_QueryInterface(ID3D12ShaderCacheSession *iface,
2760 REFIID iid, void **object)
2761{
2762 TRACE("iface %p, iid %s, object %p.\n", iface, debugstr_guid(iid), object);
2763
2764 if (!object)
2765 {
2766 WARN("Output pointer is NULL, returning E_POINTER.\n");
2767 return E_POINTER;
2768 }
2769
2770 if (IsEqualGUID(iid, &IID_ID3D12ShaderCacheSession)
2771 || IsEqualGUID(iid, &IID_ID3D12DeviceChild)
2772 || IsEqualGUID(iid, &IID_ID3D12Object)
2773 || IsEqualGUID(iid, &IID_IUnknown))
2774 {
2775 ID3D12ShaderCacheSession_AddRef(iface);
2776 *object = iface;
2777 return S_OK;
2778 }
2779
2780 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
2781
2782 *object = NULL;
2783 return E_NOINTERFACE;
2784}
2785
2786static ULONG STDMETHODCALLTYPE d3d12_cache_session_AddRef(ID3D12ShaderCacheSession *iface)
2787{
2789 unsigned int refcount = vkd3d_atomic_increment_u32(&session->refcount);
2790
2791 TRACE("%p increasing refcount to %u.\n", session, refcount);
2792
2793 return refcount;
2794}
2795
2797{
2798 struct d3d12_device *device = session->device;
2799
2800 TRACE("Destroying cache session %p.\n", session);
2801
2803 list_remove(&session->cache_list_entry);
2805
2807 vkd3d_private_store_destroy(&session->private_store);
2809
2811}
2812
2813static ULONG STDMETHODCALLTYPE d3d12_cache_session_Release(ID3D12ShaderCacheSession *iface)
2814{
2816 unsigned int refcount = vkd3d_atomic_decrement_u32(&session->refcount);
2817
2818 TRACE("%p decreasing refcount to %u.\n", session, refcount);
2819
2820 if (!refcount)
2822
2823 return refcount;
2824}
2825
2826static HRESULT STDMETHODCALLTYPE d3d12_cache_session_GetPrivateData(ID3D12ShaderCacheSession *iface,
2827 REFGUID guid, UINT *data_size, void *data)
2828{
2830
2831 TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
2832
2833 return vkd3d_get_private_data(&session->private_store, guid, data_size, data);
2834}
2835
2836static HRESULT STDMETHODCALLTYPE d3d12_cache_session_SetPrivateData(ID3D12ShaderCacheSession *iface,
2837 REFGUID guid, UINT data_size, const void *data)
2838{
2840
2841 TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
2842
2843 return vkd3d_set_private_data(&session->private_store, guid, data_size, data);
2844}
2845
2847 ID3D12ShaderCacheSession *iface, REFGUID guid, const IUnknown *data)
2848{
2850
2851 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
2852
2853 return vkd3d_set_private_data_interface(&session->private_store, guid, data);
2854}
2855
2856static HRESULT STDMETHODCALLTYPE d3d12_cache_session_SetName(ID3D12ShaderCacheSession *iface,
2857 const WCHAR *name)
2858{
2860
2861 TRACE("iface %p, name %s.\n", iface, debugstr_w(name, session->device->wchar_size));
2862
2863 return name ? S_OK : E_INVALIDARG;
2864}
2865
2866static HRESULT STDMETHODCALLTYPE d3d12_cache_session_GetDevice(ID3D12ShaderCacheSession *iface,
2867 REFIID iid, void **device)
2868{
2870
2871 TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
2872
2873 return d3d12_device_query_interface(session->device, iid, device);
2874}
2875
2876static HRESULT STDMETHODCALLTYPE d3d12_cache_session_FindValue(ID3D12ShaderCacheSession *iface,
2877 const void *key, UINT key_size, void *value, UINT *value_size)
2878{
2880 enum vkd3d_result ret;
2881 size_t size;
2882
2883 TRACE("iface %p, key %p, key_size %#x, value %p, value_size %p.\n",
2884 iface, key, key_size, value, value_size);
2885
2886 if (!value_size)
2887 {
2888 WARN("value_size is NULL, returning E_INVALIDARG.\n");
2889 return E_INVALIDARG;
2890 }
2891
2892 size = *value_size;
2893 ret = vkd3d_shader_cache_get(session->cache, key, key_size, value, &size);
2894 *value_size = size;
2895
2897}
2898
2899static HRESULT STDMETHODCALLTYPE d3d12_cache_session_StoreValue(ID3D12ShaderCacheSession *iface,
2900 const void *key, UINT key_size, const void *value, UINT value_size)
2901{
2903 enum vkd3d_result ret;
2904
2905 TRACE("iface %p, key %p, key_size %#x, value %p, value_size %u.\n",
2906 iface, key, key_size, value, value_size);
2907
2908 if (!key || !key_size || !value || !value_size)
2909 {
2910 WARN("Invalid input parameters, returning E_INVALIDARG.\n");
2911 return E_INVALIDARG;
2912 }
2913
2914 ret = vkd3d_shader_cache_put(session->cache, key, key_size, value, value_size);
2916}
2917
2918static void STDMETHODCALLTYPE d3d12_cache_session_SetDeleteOnDestroy(ID3D12ShaderCacheSession *iface)
2919{
2920 FIXME("iface %p stub!\n", iface);
2921}
2922
2924 ID3D12ShaderCacheSession *iface, D3D12_SHADER_CACHE_SESSION_DESC *desc)
2925{
2927
2928 TRACE("iface %p.\n", iface);
2929 *desc = session->desc;
2930 return desc;
2931}
2932
2933static const struct ID3D12ShaderCacheSessionVtbl d3d12_cache_session_vtbl =
2934{
2935 /* IUnknown methods */
2939 /* ID3D12Object methods */
2944 /* ID3D12DeviceChild methods */
2946 /* ID3D12ShaderCacheSession methods */
2951};
2952
2955{
2956 struct d3d12_cache_session *i;
2957 enum vkd3d_result ret;
2958 HRESULT hr;
2959
2960 session->ID3D12ShaderCacheSession_iface.lpVtbl = &d3d12_cache_session_vtbl;
2961 session->refcount = 1;
2962 session->desc = *desc;
2963 session->cache = NULL;
2964
2965 if (!session->desc.MaximumValueFileSizeBytes)
2966 session->desc.MaximumValueFileSizeBytes = 128 * 1024 * 1024;
2967 if (!session->desc.MaximumInMemoryCacheSizeBytes)
2968 session->desc.MaximumInMemoryCacheSizeBytes = 1024 * 1024;
2969 if (!session->desc.MaximumInMemoryCacheEntries)
2970 session->desc.MaximumInMemoryCacheEntries = 128;
2971
2972 if (FAILED(hr = vkd3d_private_store_init(&session->private_store)))
2973 return hr;
2974
2976
2977 /* We expect the number of open caches to be small. */
2979 {
2980 if (!memcmp(&i->desc.Identifier, &desc->Identifier, sizeof(desc->Identifier)))
2981 {
2982 TRACE("Found an existing cache %p from session %p.\n", i->cache, i);
2983 if (desc->Version == i->desc.Version)
2984 {
2985 session->desc = i->desc;
2986 vkd3d_shader_cache_incref(session->cache = i->cache);
2987 break;
2988 }
2989 else
2990 {
2991 WARN("version mismatch: Existing %"PRIu64" new %"PRIu64".\n",
2992 i->desc.Version, desc->Version);
2994 goto error;
2995 }
2996 }
2997 }
2998
2999 if (!session->cache)
3000 {
3001 if (session->desc.Mode == D3D12_SHADER_CACHE_MODE_DISK)
3002 FIXME("Disk caches are not yet implemented.\n");
3003
3005 if (ret)
3006 {
3007 WARN("Failed to open shader cache.\n");
3009 goto error;
3010 }
3011 }
3012
3013 /* Add it to the list even if we reused an existing cache. The other session might be destroyed,
3014 * but the cache stays alive and can be opened a third time. */
3015 list_add_tail(&cache_list, &session->cache_list_entry);
3017
3019 return S_OK;
3020
3021error:
3022 vkd3d_private_store_destroy(&session->private_store);
3024 return hr;
3025}
3026
3027/* ID3D12Device */
3029{
3030 return CONTAINING_RECORD(iface, struct d3d12_device, ID3D12Device9_iface);
3031}
3032
3034 REFIID riid, void **object)
3035{
3036 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
3037
3038 if (IsEqualGUID(riid, &IID_ID3D12Device9)
3039 || IsEqualGUID(riid, &IID_ID3D12Device8)
3040 || IsEqualGUID(riid, &IID_ID3D12Device7)
3041 || IsEqualGUID(riid, &IID_ID3D12Device6)
3042 || IsEqualGUID(riid, &IID_ID3D12Device5)
3043 || IsEqualGUID(riid, &IID_ID3D12Device4)
3044 || IsEqualGUID(riid, &IID_ID3D12Device3)
3045 || IsEqualGUID(riid, &IID_ID3D12Device2)
3046 || IsEqualGUID(riid, &IID_ID3D12Device1)
3047 || IsEqualGUID(riid, &IID_ID3D12Device)
3048 || IsEqualGUID(riid, &IID_ID3D12Object)
3050 {
3051 ID3D12Device9_AddRef(iface);
3052 *object = iface;
3053 return S_OK;
3054 }
3055
3056 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
3057
3058 *object = NULL;
3059 return E_NOINTERFACE;
3060}
3061
3063{
3065 unsigned int refcount = vkd3d_atomic_increment_u32(&device->refcount);
3066
3067 TRACE("%p increasing refcount to %u.\n", device, refcount);
3068
3069 return refcount;
3070}
3071
3073{
3074 HRESULT hr;
3075
3076 TRACE("device %p.\n", device);
3077
3078 vkd3d_mutex_lock(&device->worker_mutex);
3079
3080 device->worker_should_exit = true;
3081 vkd3d_cond_signal(&device->worker_cond);
3082
3083 vkd3d_mutex_unlock(&device->worker_mutex);
3084
3085 if (FAILED(hr = vkd3d_join_thread(device->vkd3d_instance, &device->worker_thread)))
3086 return hr;
3087
3088 vkd3d_mutex_destroy(&device->worker_mutex);
3089 vkd3d_cond_destroy(&device->worker_cond);
3090
3091 return S_OK;
3092}
3093
3095{
3097 unsigned int refcount = vkd3d_atomic_decrement_u32(&device->refcount);
3098
3099 TRACE("%p decreasing refcount to %u.\n", device, refcount);
3100
3101 if (!refcount)
3102 {
3103 const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
3104
3105 vkd3d_mutex_destroy(&device->blocked_queues_mutex);
3106
3107 vkd3d_private_store_destroy(&device->private_store);
3108
3111 vkd3d_uav_clear_state_cleanup(&device->uav_clear_state, device);
3112 vkd3d_destroy_null_resources(&device->null_resources, device);
3113 vkd3d_gpu_va_allocator_cleanup(&device->gpu_va_allocator);
3114 vkd3d_render_pass_cache_cleanup(&device->render_pass_cache, device);
3117 vkd3d_desc_object_cache_cleanup(&device->view_desc_cache);
3118 vkd3d_desc_object_cache_cleanup(&device->cbuffer_desc_cache);
3119 if (device->use_vk_heaps)
3121 vkd3d_free(device->heaps);
3122 VK_CALL(vkDestroyDevice(device->vk_device, NULL));
3123 if (device->parent)
3124 IUnknown_Release(device->parent);
3125 vkd3d_instance_decref(device->vkd3d_instance);
3126
3128 }
3129
3130 return refcount;
3131}
3132
3134 REFGUID guid, UINT *data_size, void *data)
3135{
3137
3138 TRACE("iface %p, guid %s, data_size %p, data %p.\n",
3139 iface, debugstr_guid(guid), data_size, data);
3140
3141 return vkd3d_get_private_data(&device->private_store, guid, data_size, data);
3142}
3143
3145 REFGUID guid, UINT data_size, const void *data)
3146{
3148
3149 TRACE("iface %p, guid %s, data_size %u, data %p.\n",
3150 iface, debugstr_guid(guid), data_size, data);
3151
3152 return vkd3d_set_private_data(&device->private_store, guid, data_size, data);
3153}
3154
3156 REFGUID guid, const IUnknown *data)
3157{
3159
3160 TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
3161
3162 return vkd3d_set_private_data_interface(&device->private_store, guid, data);
3163}
3164
3166{
3168
3169 TRACE("iface %p, name %s.\n", iface, debugstr_w(name, device->wchar_size));
3170
3173}
3174
3176{
3177 TRACE("iface %p.\n", iface);
3178
3179 return 1;
3180}
3181
3183 const D3D12_COMMAND_QUEUE_DESC *desc, REFIID riid, void **command_queue)
3184{
3187 HRESULT hr;
3188
3189 TRACE("iface %p, desc %p, riid %s, command_queue %p.\n",
3190 iface, desc, debugstr_guid(riid), command_queue);
3191
3193 return hr;
3194
3195 return return_interface(&object->ID3D12CommandQueue_iface, &IID_ID3D12CommandQueue,
3196 riid, command_queue);
3197}
3198
3200 D3D12_COMMAND_LIST_TYPE type, REFIID riid, void **command_allocator)
3201{
3204 HRESULT hr;
3205
3206 TRACE("iface %p, type %#x, riid %s, command_allocator %p.\n",
3207 iface, type, debugstr_guid(riid), command_allocator);
3208
3210 return hr;
3211
3212 return return_interface(&object->ID3D12CommandAllocator_iface, &IID_ID3D12CommandAllocator,
3213 riid, command_allocator);
3214}
3215
3217 const D3D12_GRAPHICS_PIPELINE_STATE_DESC *desc, REFIID riid, void **pipeline_state)
3218{
3221 HRESULT hr;
3222
3223 TRACE("iface %p, desc %p, riid %s, pipeline_state %p.\n",
3224 iface, desc, debugstr_guid(riid), pipeline_state);
3225
3227 return hr;
3228
3229 return return_interface(&object->ID3D12PipelineState_iface,
3230 &IID_ID3D12PipelineState, riid, pipeline_state);
3231}
3232
3234 const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc, REFIID riid, void **pipeline_state)
3235{
3238 HRESULT hr;
3239
3240 TRACE("iface %p, desc %p, riid %s, pipeline_state %p.\n",
3241 iface, desc, debugstr_guid(riid), pipeline_state);
3242
3244 return hr;
3245
3246 return return_interface(&object->ID3D12PipelineState_iface,
3247 &IID_ID3D12PipelineState, riid, pipeline_state);
3248}
3249
3251 UINT node_mask, D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator *command_allocator,
3252 ID3D12PipelineState *initial_pipeline_state, REFIID riid, void **command_list)
3253{
3255 struct d3d12_command_list *object;
3256 HRESULT hr;
3257
3258 TRACE("iface %p, node_mask 0x%08x, type %#x, command_allocator %p, "
3259 "initial_pipeline_state %p, riid %s, command_list %p.\n",
3260 iface, node_mask, type, command_allocator,
3261 initial_pipeline_state, debugstr_guid(riid), command_list);
3262
3263 if (FAILED(hr = d3d12_command_list_create(device, node_mask, type, command_allocator,
3264 initial_pipeline_state, &object)))
3265 return hr;
3266
3267 return return_interface(&object->ID3D12GraphicsCommandList6_iface,
3268 &IID_ID3D12GraphicsCommandList6, riid, command_list);
3269}
3270
3271/* Direct3D feature levels restrict which formats can be optionally supported. */
3273{
3274 static const D3D12_FEATURE_DATA_FORMAT_SUPPORT blacklisted_format_features[] =
3275 {
3280 };
3281 unsigned int i;
3282
3283 for (i = 0; i < ARRAY_SIZE(blacklisted_format_features); ++i)
3284 {
3285 if (blacklisted_format_features[i].Format == format_support->Format)
3286 {
3287 format_support->Support1 &= ~blacklisted_format_features[i].Support1;
3288 format_support->Support2 &= ~blacklisted_format_features[i].Support2;
3289 break;
3290 }
3291 }
3292}
3293
3296{
3297 const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
3298 VkImageFormatProperties vk_properties;
3299 const struct vkd3d_format *format;
3300 VkSampleCountFlagBits vk_samples;
3301 VkImageUsageFlags vk_usage = 0;
3302 VkResult vr;
3303
3304 TRACE("Format %#x, sample count %u, flags %#x.\n", data->Format, data->SampleCount, data->Flags);
3305
3306 data->NumQualityLevels = 0;
3307
3308 if (!(vk_samples = vk_samples_from_sample_count(data->SampleCount)))
3309 WARN("Invalid sample count %u.\n", data->SampleCount);
3310 if (!data->SampleCount)
3311 return E_FAIL;
3312
3313 if (data->SampleCount == 1)
3314 {
3315 data->NumQualityLevels = 1;
3316 goto done;
3317 }
3318
3319 if (data->Format == DXGI_FORMAT_UNKNOWN)
3320 goto done;
3321
3322 if (!(format = vkd3d_get_format(device, data->Format, false)))
3323 format = vkd3d_get_format(device, data->Format, true);
3324 if (!format)
3325 {
3326 FIXME("Unhandled format %#x.\n", data->Format);
3327 return E_INVALIDARG;
3328 }
3329 if (data->Flags)
3330 FIXME("Ignoring flags %#x.\n", data->Flags);
3331
3332 if (format->vk_aspect_mask & VK_IMAGE_ASPECT_COLOR_BIT)
3334 else
3336
3338 format->vk_format, VK_IMAGE_TYPE_2D, VK_IMAGE_TILING_OPTIMAL, vk_usage, 0, &vk_properties));
3340 {
3341 WARN("Format %#x is not supported.\n", format->dxgi_format);
3342 goto done;
3343 }
3344 if (vr < 0)
3345 {
3346 ERR("Failed to get image format properties, vr %d.\n", vr);
3347 return hresult_from_vk_result(vr);
3348 }
3349
3350 if (vk_properties.sampleCounts & vk_samples)
3351 data->NumQualityLevels = 1;
3352
3353done:
3354 TRACE("Returning %u quality levels.\n", data->NumQualityLevels);
3355 return S_OK;
3356}
3357
3358bool d3d12_device_is_uma(struct d3d12_device *device, bool *coherent)
3359{
3360 unsigned int i;
3361
3362 if (coherent)
3363 *coherent = true;
3364
3365 for (i = 0; i < device->memory_properties.memoryTypeCount; ++i)
3366 {
3367 if (!(device->memory_properties.memoryTypes[i].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT))
3368 return false;
3369 if (coherent && !(device->memory_properties.memoryTypes[i].propertyFlags
3371 *coherent = false;
3372 }
3373
3374 return true;
3375}
3376
3378 D3D12_FEATURE feature, void *feature_data, UINT feature_data_size)
3379{
3381
3382 TRACE("iface %p, feature %#x, feature_data %p, feature_data_size %u.\n",
3383 iface, feature, feature_data, feature_data_size);
3384
3385 switch (feature)
3386 {
3388 {
3389 D3D12_FEATURE_DATA_D3D12_OPTIONS *data = feature_data;
3390
3391 if (feature_data_size != sizeof(*data))
3392 {
3393 WARN("Invalid size %u.\n", feature_data_size);
3394 return E_INVALIDARG;
3395 }
3396
3397 *data = device->feature_options;
3398
3399 TRACE("Double precision shader ops %#x.\n", data->DoublePrecisionFloatShaderOps);
3400 TRACE("Output merger logic op %#x.\n", data->OutputMergerLogicOp);
3401 TRACE("Shader min precision support %#x.\n", data->MinPrecisionSupport);
3402 TRACE("Tiled resources tier %#x.\n", data->TiledResourcesTier);
3403 TRACE("Resource binding tier %#x.\n", data->ResourceBindingTier);
3404 TRACE("PS specified stencil ref %#x.\n", data->PSSpecifiedStencilRefSupported);
3405 TRACE("Typed UAV load and additional formats %#x.\n", data->TypedUAVLoadAdditionalFormats);
3406 TRACE("ROV %#x.\n", data->ROVsSupported);
3407 TRACE("Conservative rasterization tier %#x.\n", data->ConservativeRasterizationTier);
3408 TRACE("Max GPU virtual address bits per resource %u.\n", data->MaxGPUVirtualAddressBitsPerResource);
3409 TRACE("Standard swizzle 64KB %#x.\n", data->StandardSwizzle64KBSupported);
3410 TRACE("Cross-node sharing tier %#x.\n", data->CrossNodeSharingTier);
3411 TRACE("Cross-adapter row-major texture %#x.\n", data->CrossAdapterRowMajorTextureSupported);
3412 TRACE("VP and RT array index from any shader without GS emulation %#x.\n",
3413 data->VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation);
3414 TRACE("Resource heap tier %#x.\n", data->ResourceHeapTier);
3415 return S_OK;
3416 }
3417
3419 {
3420 D3D12_FEATURE_DATA_ARCHITECTURE *data = feature_data;
3421 bool coherent;
3422
3423 if (feature_data_size != sizeof(*data))
3424 {
3425 WARN("Invalid size %u.\n", feature_data_size);
3426 return E_INVALIDARG;
3427 }
3428
3429 if (data->NodeIndex)
3430 {
3431 FIXME("Multi-adapter not supported.\n");
3432 return E_INVALIDARG;
3433 }
3434
3435 WARN("Assuming device does not support tile based rendering.\n");
3436 data->TileBasedRenderer = FALSE;
3437
3438 data->UMA = d3d12_device_is_uma(device, &coherent);
3439 data->CacheCoherentUMA = data->UMA && coherent;
3440
3441 TRACE("Tile based renderer %#x, UMA %#x, cache coherent UMA %#x.\n",
3442 data->TileBasedRenderer, data->UMA, data->CacheCoherentUMA);
3443 return S_OK;
3444 }
3445
3447 {
3448 struct vkd3d_vulkan_info *vulkan_info = &device->vk_info;
3450 unsigned int i;
3451
3452 if (feature_data_size != sizeof(*data))
3453 {
3454 WARN("Invalid size %u.\n", feature_data_size);
3455 return E_INVALIDARG;
3456 }
3457 if (!data->NumFeatureLevels)
3458 return E_INVALIDARG;
3459
3460 data->MaxSupportedFeatureLevel = 0;
3461 for (i = 0; i < data->NumFeatureLevels; ++i)
3462 {
3463 D3D_FEATURE_LEVEL fl = data->pFeatureLevelsRequested[i];
3464 if (data->MaxSupportedFeatureLevel < fl && fl <= vulkan_info->max_feature_level)
3465 data->MaxSupportedFeatureLevel = fl;
3466 }
3467
3468 TRACE("Max supported feature level %#x.\n", data->MaxSupportedFeatureLevel);
3469 return S_OK;
3470 }
3471
3473 {
3474 const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
3476 VkFormatFeatureFlagBits image_features;
3477 const struct vkd3d_format *format;
3478 VkFormatProperties properties;
3479
3480 if (feature_data_size != sizeof(*data))
3481 {
3482 WARN("Invalid size %u.\n", feature_data_size);
3483 return E_INVALIDARG;
3484 }
3485
3486 data->Support1 = D3D12_FORMAT_SUPPORT1_NONE;
3487 data->Support2 = D3D12_FORMAT_SUPPORT2_NONE;
3488 if (!(format = vkd3d_get_format(device, data->Format, false)))
3489 format = vkd3d_get_format(device, data->Format, true);
3490 if (!format)
3491 {
3492 FIXME("Unhandled format %#x.\n", data->Format);
3493 return E_INVALIDARG;
3494 }
3495
3496 VK_CALL(vkGetPhysicalDeviceFormatProperties(device->vk_physical_device, format->vk_format, &properties));
3497 image_features = properties.linearTilingFeatures | properties.optimalTilingFeatures;
3498
3499 if (properties.bufferFeatures)
3503 if (data->Format == DXGI_FORMAT_R16_UINT || data->Format == DXGI_FORMAT_R32_UINT)
3505 if (image_features)
3508 if (image_features & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT)
3509 {
3513 {
3516 }
3517 if (format->vk_aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT)
3520 }
3521 if (image_features & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)
3527 if (image_features & VK_FORMAT_FEATURE_BLIT_SRC_BIT)
3529 if (image_features & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT)
3530 {
3532 if (device->vk_info.uav_read_without_format)
3534 /* We effectively require shaderStorageImageWriteWithoutFormat,
3535 * so we can just report UAV_TYPED_STORE unconditionally. */
3537 }
3538
3539 if (image_features & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT)
3546
3548
3549 TRACE("Format %#x, support1 %#x, support2 %#x.\n", data->Format, data->Support1, data->Support2);
3550 return S_OK;
3551 }
3552
3554 {
3556
3557 if (feature_data_size != sizeof(*data))
3558 {
3559 WARN("Invalid size %u.\n", feature_data_size);
3560 return E_INVALIDARG;
3561 }
3562
3564 }
3565
3567 {
3568 D3D12_FEATURE_DATA_FORMAT_INFO *data = feature_data;
3569 const struct vkd3d_format *format;
3570
3571 if (feature_data_size != sizeof(*data))
3572 {
3573 WARN("Invalid size %u.\n", feature_data_size);
3574 return E_INVALIDARG;
3575 }
3576
3577 if (data->Format == DXGI_FORMAT_UNKNOWN)
3578 {
3579 data->PlaneCount = 1;
3580 return S_OK;
3581 }
3582
3583 if (!(format = vkd3d_get_format(device, data->Format, false)))
3584 format = vkd3d_get_format(device, data->Format, true);
3585 if (!format)
3586 {
3587 FIXME("Unhandled format %#x.\n", data->Format);
3588 return E_INVALIDARG;
3589 }
3590
3591 data->PlaneCount = format->plane_count;
3592
3593 TRACE("Format %#x, plane count %"PRIu8".\n", data->Format, data->PlaneCount);
3594 return S_OK;
3595 }
3596
3598 {
3599 const D3D12_FEATURE_DATA_D3D12_OPTIONS *options = &device->feature_options;
3601
3602 if (feature_data_size != sizeof(*data))
3603 {
3604 WARN("Invalid size %u.\n", feature_data_size);
3605 return E_INVALIDARG;
3606 }
3607
3608 data->MaxGPUVirtualAddressBitsPerResource = options->MaxGPUVirtualAddressBitsPerResource;
3609 data->MaxGPUVirtualAddressBitsPerProcess = options->MaxGPUVirtualAddressBitsPerResource;
3610
3611 TRACE("Max GPU virtual address bits per resource %u, Max GPU virtual address bits per process %u.\n",
3612 data->MaxGPUVirtualAddressBitsPerResource, data->MaxGPUVirtualAddressBitsPerProcess);
3613 return S_OK;
3614 }
3615
3617 {
3618 D3D12_FEATURE_DATA_SHADER_MODEL *data = feature_data;
3619
3620 if (feature_data_size != sizeof(*data))
3621 {
3622 WARN("Invalid size %u.\n", feature_data_size);
3623 return E_INVALIDARG;
3624 }
3625
3626 if (data->HighestShaderModel != D3D_SHADER_MODEL_5_1
3627 && (data->HighestShaderModel < D3D_SHADER_MODEL_6_0
3628 || data->HighestShaderModel > D3D_HIGHEST_SHADER_MODEL))
3629 {
3630 WARN("Unknown shader model %#x.\n", data->HighestShaderModel);
3631 return E_INVALIDARG;
3632 }
3633
3634 TRACE("Request shader model %#x.\n", data->HighestShaderModel);
3635
3636#ifdef VKD3D_SHADER_UNSUPPORTED_DXIL
3637 data->HighestShaderModel = min(data->HighestShaderModel, D3D_SHADER_MODEL_6_0);
3638#else
3639 data->HighestShaderModel = min(data->HighestShaderModel, D3D_SHADER_MODEL_5_1);
3640#endif
3641
3642 TRACE("Shader model %#x.\n", data->HighestShaderModel);
3643 return S_OK;
3644 }
3645
3647 {
3649
3650 if (feature_data_size != sizeof(*data))
3651 {
3652 WARN("Invalid size %u.\n", feature_data_size);
3653 return E_INVALIDARG;
3654 }
3655
3656 *data = device->feature_options1;
3657
3658 TRACE("Wave ops %#x.\n", data->WaveOps);
3659 TRACE("Min wave lane count %#x.\n", data->WaveLaneCountMin);
3660 TRACE("Max wave lane count %#x.\n", data->WaveLaneCountMax);
3661 TRACE("Total lane count %#x.\n", data->TotalLaneCount);
3662 TRACE("Expanded compute resource states %#x.\n", data->ExpandedComputeResourceStates);
3663 TRACE("Int64 shader ops %#x.\n", data->Int64ShaderOps);
3664 return S_OK;
3665 }
3666
3668 {
3670
3671 if (feature_data_size != sizeof(*data))
3672 {
3673 WARN("Invalid size %u.\n", feature_data_size);
3674 return E_INVALIDARG;
3675 }
3676
3677 TRACE("Root signature requested %#x.\n", data->HighestVersion);
3678 data->HighestVersion = min(data->HighestVersion, D3D_ROOT_SIGNATURE_VERSION_1_1);
3679 if (device->vkd3d_instance->api_version < VKD3D_API_VERSION_1_2)
3680 data->HighestVersion = min(data->HighestVersion, D3D_ROOT_SIGNATURE_VERSION_1_0);
3681
3682 TRACE("Root signature version %#x.\n", data->HighestVersion);
3683 return S_OK;
3684 }
3685
3687 {
3688 D3D12_FEATURE_DATA_ARCHITECTURE1 *data = feature_data;
3689 bool coherent;
3690
3691 if (feature_data_size != sizeof(*data))
3692 {
3693 WARN("Invalid size %u.\n", feature_data_size);
3694 return E_INVALIDARG;
3695 }
3696
3697 if (data->NodeIndex)
3698 {
3699 FIXME("Multi-adapter not supported.\n");
3700 return E_INVALIDARG;
3701 }
3702
3703 WARN("Assuming device does not support tile based rendering.\n");
3704 data->TileBasedRenderer = FALSE;
3705
3706 data->UMA = d3d12_device_is_uma(device, &coherent);
3707 data->CacheCoherentUMA = data->UMA && coherent;
3708
3709 WARN("Assuming device does not have an isolated memory management unit.\n");
3710 data->IsolatedMMU = FALSE;
3711
3712 TRACE("Tile based renderer %#x, UMA %#x, cache coherent UMA %#x, isolated MMU %#x.\n",
3713 data->TileBasedRenderer, data->UMA, data->CacheCoherentUMA, data->IsolatedMMU);
3714 return S_OK;
3715 }
3716
3718 {
3720
3721 if (feature_data_size != sizeof(*data))
3722 {
3723 WARN("Invalid size %u.\n", feature_data_size);
3724 return E_INVALIDARG;
3725 }
3726
3727 *data = device->feature_options2;
3728
3729 TRACE("Depth bounds test %#x.\n", data->DepthBoundsTestSupported);
3730 TRACE("Programmable sample positions tier %#x.\n", data->ProgrammableSamplePositionsTier);
3731 return S_OK;
3732 }
3733
3735 {
3736 D3D12_FEATURE_DATA_SHADER_CACHE *data = feature_data;
3737
3738 if (feature_data_size != sizeof(*data))
3739 {
3740 WARN("Invalid size %u.\n", feature_data_size);
3741 return E_INVALIDARG;
3742 }
3743
3744 /* FIXME: The d3d12 documentation states that
3745 * D3D12_SHADER_CACHE_SUPPORT_SINGLE_PSO is always supported, but
3746 * the CachedPSO field of D3D12_GRAPHICS_PIPELINE_STATE_DESC is
3747 * ignored and GetCachedBlob() is a stub. */
3748 data->SupportFlags = D3D12_SHADER_CACHE_SUPPORT_NONE;
3749
3750 TRACE("Shader cache support %#x.\n", data->SupportFlags);
3751 return S_OK;
3752 }
3753
3755 {
3757
3758 if (feature_data_size != sizeof(*data))
3759 {
3760 WARN("Invalid size %u.\n", feature_data_size);
3761 return E_INVALIDARG;
3762 }
3763
3764 switch (data->CommandListType)
3765 {
3769 data->PriorityForTypeIsSupported = FALSE;
3770 TRACE("Command list type %#x, priority %u, supported %#x.\n",
3771 data->CommandListType, data->Priority, data->PriorityForTypeIsSupported);
3772 return S_OK;
3773
3774 default:
3775 FIXME("Unhandled command list type %#x.\n", data->CommandListType);
3776 return E_INVALIDARG;
3777 }
3778 }
3779
3781 {
3783
3784 if (feature_data_size != sizeof(*data))
3785 {
3786 WARN("Invalid size %u.\n", feature_data_size);
3787 return E_INVALIDARG;
3788 }
3789
3790 *data = device->feature_options3;
3791
3792 TRACE("Copy queue timestamp queries %#x.\n", data->CopyQueueTimestampQueriesSupported);
3793 TRACE("Casting fully typed format %#x.\n", data->CastingFullyTypedFormatSupported);
3794 TRACE("Write buffer immediate %#x.\n", data->WriteBufferImmediateSupportFlags);
3795 TRACE("View instancing tier %#x.\n", data->ViewInstancingTier);
3796 TRACE("Barycentrics %#x.\n", data->BarycentricsSupported);
3797 return S_OK;
3798 }
3799
3801 {
3803
3804 if (feature_data_size != sizeof(*data))
3805 {
3806 WARN("Invalid size %u.\n", feature_data_size);
3807 return E_INVALIDARG;
3808 }
3809
3810 data->Supported = FALSE;
3811
3812 TRACE("Existing heaps %#x.\n", data->Supported);
3813 return S_OK;
3814 }
3815
3817 {
3819
3820 if (feature_data_size != sizeof(*data))
3821 {
3822 WARN("Invalid size %u.\n", feature_data_size);
3823 return E_INVALIDARG;
3824 }
3825
3826 *data = device->feature_options4;
3827
3828 TRACE("64 KiB aligned MSAA textures %#x.\n", data->MSAA64KBAlignedTextureSupported);
3829 TRACE("Shared resource compatibility tier %#x.\n", data->SharedResourceCompatibilityTier);
3830 TRACE("Native 16-bit shader ops %#x.\n", data->Native16BitShaderOpsSupported);
3831 return S_OK;
3832 }
3833
3835 {
3836 D3D12_FEATURE_DATA_SERIALIZATION *data = feature_data;
3837
3838 if (feature_data_size != sizeof(*data))
3839 {
3840 WARN("Invalid size %u.\n", feature_data_size);
3841 return E_INVALIDARG;
3842 }
3843
3844 if (data->NodeIndex)
3845 {
3846 FIXME("Multi-adapter not supported.\n");
3847 return E_INVALIDARG;
3848 }
3849
3850 data->HeapSerializationTier = D3D12_HEAP_SERIALIZATION_TIER_0;
3851
3852 TRACE("Heap serialisation tier %#x.\n", data->HeapSerializationTier);
3853 return S_OK;
3854 }
3855
3857 {
3858 D3D12_FEATURE_DATA_CROSS_NODE *data = feature_data;
3859
3860 if (feature_data_size != sizeof(*data))
3861 {
3862 WARN("Invalid size %u.\n", feature_data_size);
3863 return E_INVALIDARG;
3864 }
3865
3866 data->SharingTier = device->feature_options.CrossNodeSharingTier;
3867 data->AtomicShaderInstructions = FALSE;
3868
3869 TRACE("Cross node sharing tier %#x.\n", data->SharingTier);
3870 TRACE("Cross node shader atomics %#x.\n", data->AtomicShaderInstructions);
3871 return S_OK;
3872 }
3873
3875 {
3877
3878 if (feature_data_size != sizeof(*data))
3879 {
3880 WARN("Invalid size %u.\n", feature_data_size);
3881 return E_INVALIDARG;
3882 }
3883
3884 *data = device->feature_options5;
3885
3886 TRACE("SRV tiled resource tier 3 only %#x.\n", data->SRVOnlyTiledResourceTier3);
3887 TRACE("Render pass tier %#x.\n", data->RenderPassesTier);
3888 TRACE("Ray tracing tier %#x.\n", data->RaytracingTier);
3889 return S_OK;
3890 }
3891
3893 {
3895
3896 if (feature_data_size != sizeof(*data))
3897 {
3898 WARN("Invalid size %u.\n", feature_data_size);
3899 return E_INVALIDARG;
3900 }
3901
3902 data->AdditionalShadingRatesSupported = FALSE;
3903 data->PerPrimitiveShadingRateSupportedWithViewportIndexing = FALSE;
3904 data->VariableShadingRateTier = D3D12_VARIABLE_SHADING_RATE_TIER_NOT_SUPPORTED;
3905 data->ShadingRateImageTileSize = 0;
3906 data->BackgroundProcessingSupported = FALSE;
3907
3908 TRACE("Additional shading rates support %#x.\n", data->AdditionalShadingRatesSupported);
3909 TRACE("Per-primitive shading rates with viewport indexing %#x.\n",
3910 data->PerPrimitiveShadingRateSupportedWithViewportIndexing);
3911 TRACE("Variable shading rate tier %#x.\n", data->VariableShadingRateTier);
3912 TRACE("Shading rate image tile size %#x.\n", data->ShadingRateImageTileSize);
3913 TRACE("Background processing support %#x.\n", data->BackgroundProcessingSupported);
3914 return S_OK;
3915 }
3916
3918 {
3920
3921 if (feature_data_size != sizeof(*data))
3922 {
3923 WARN("Invalid size %u.\n", feature_data_size);
3924 return E_INVALIDARG;
3925 }
3926
3928 data->SamplerFeedbackTier = D3D12_SAMPLER_FEEDBACK_TIER_NOT_SUPPORTED;
3929
3930 TRACE("Mesh shading tier %#x.\n", data->MeshShaderTier);
3931 TRACE("Sampler feedback tier %#x.\n", data->SamplerFeedbackTier);
3932 return S_OK;
3933 }
3934
3936 {
3938
3939 if (feature_data_size != sizeof(*data))
3940 {
3941 WARN("Invalid size %u.\n", feature_data_size);
3942 return E_INVALIDARG;
3943 }
3944
3945 /* Vulkan does not restrict block texture alignment. */
3946 data->UnalignedBlockTexturesSupported = TRUE;
3947
3948 TRACE("Unaligned block texture support %#x.\n", data->UnalignedBlockTexturesSupported);
3949 return S_OK;
3950 }
3951
3953 {
3955
3956 if (feature_data_size != sizeof(*data))
3957 {
3958 WARN("Invalid size %u.\n", feature_data_size);
3959 return E_INVALIDARG;
3960 }
3961
3962 data->MeshShaderPipelineStatsSupported = FALSE;
3963 data->MeshShaderSupportsFullRangeRenderTargetArrayIndex = FALSE;
3964 data->AtomicInt64OnTypedResourceSupported = FALSE;
3965 data->AtomicInt64OnGroupSharedSupported = FALSE;
3966 data->DerivativesInMeshAndAmplificationShadersSupported = FALSE;
3968
3969 TRACE("Mesh shader pipeline stats support %#x.\n", data->MeshShaderPipelineStatsSupported);
3970 TRACE("Mesh shader RT array index full range %#x.\n", data->MeshShaderSupportsFullRangeRenderTargetArrayIndex);
3971 TRACE("Atomic int64 on typed resource %#x.\n", data->AtomicInt64OnTypedResourceSupported);
3972 TRACE("Atomic int64 on group shared mem %#x.\n", data->AtomicInt64OnGroupSharedSupported);
3973 TRACE("Derivatives in mesh and amp shaders %#x.\n", data->DerivativesInMeshAndAmplificationShadersSupported);
3974 TRACE("Wave MMA tier %#x.\n", data->WaveMMATier);
3975 return S_OK;
3976 }
3977
3979 {
3981
3982 if (feature_data_size != sizeof(*data))
3983 {
3984 WARN("Invalid size %u.\n", feature_data_size);
3985 return E_INVALIDARG;
3986 }
3987
3988 data->VariableRateShadingSumCombinerSupported = FALSE;
3989 data->MeshShaderPerPrimitiveShadingRateSupported = FALSE;
3990
3991 TRACE("Variable rate shading sum combiner %#x.\n", data->VariableRateShadingSumCombinerSupported);
3992 TRACE("Mesh shader per primitive shading rate %#x.\n", data->MeshShaderPerPrimitiveShadingRateSupported);
3993 return S_OK;
3994 }
3995
3997 {
3999
4000 if (feature_data_size != sizeof(*data))
4001 {
4002 WARN("Invalid size %u.\n", feature_data_size);
4003 return E_INVALIDARG;
4004 }
4005
4006 data->AtomicInt64OnDescriptorHeapResourceSupported = FALSE;
4007
4008 TRACE("Atomic int64 on descriptor heap resource %#x.\n", data->AtomicInt64OnDescriptorHeapResourceSupported);
4009 return S_OK;
4010 }
4011
4013 {
4015
4016 if (feature_data_size != sizeof(*data))
4017 {
4018 WARN("Invalid size %u.\n", feature_data_size);
4019 return E_INVALIDARG;
4020 }
4021
4022 data->MSPrimitivesPipelineStatisticIncludesCulledPrimitives = D3D12_TRI_STATE_UNKNOWN;
4023 data->EnhancedBarriersSupported = FALSE;
4024 data->RelaxedFormatCastingSupported = FALSE;
4025
4026 TRACE("Mesh shader primitives pipeline stats include cull primitives %#x.\n",
4027 data->MSPrimitivesPipelineStatisticIncludesCulledPrimitives);
4028 TRACE("Enhanced barriers %#x.\n", data->EnhancedBarriersSupported);
4029 TRACE("Relaxed format casting %#x.\n", data->RelaxedFormatCastingSupported);
4030 return S_OK;
4031 }
4032
4034 {
4036
4037 if (feature_data_size != sizeof(*data))
4038 {
4039 WARN("Invalid size %u.\n", feature_data_size);
4040 return E_INVALIDARG;
4041 }
4042
4043 data->UnrestrictedBufferTextureCopyPitchSupported = FALSE;
4044 data->UnrestrictedVertexElementAlignmentSupported = FALSE;
4045 data->InvertedViewportHeightFlipsYSupported = FALSE;
4046 data->InvertedViewportDepthFlipsZSupported = FALSE;
4047 data->TextureCopyBetweenDimensionsSupported = FALSE;
4048 data->AlphaBlendFactorSupported = FALSE;
4049
4050 TRACE("Unrestricted buffer-texture copy pitch %#x.\n", data->UnrestrictedBufferTextureCopyPitchSupported);
4051 TRACE("Unrestricted vertex element alignment %#x.\n", data->UnrestrictedVertexElementAlignmentSupported);
4052 TRACE("Inverted viewport height flips Y %#x.\n", data->InvertedViewportHeightFlipsYSupported);
4053 TRACE("Inverted viewport depth flips Z %#x.\n", data->InvertedViewportDepthFlipsZSupported);
4054 TRACE("Texture copy between dimensions %#x.\n", data->TextureCopyBetweenDimensionsSupported);
4055 TRACE("Alpha blend factor support %#x.\n", data->AlphaBlendFactorSupported);
4056 return S_OK;
4057 }
4058
4060 {
4062
4063 if (feature_data_size != sizeof(*data))
4064 {
4065 WARN("Invalid size %u.\n", feature_data_size);
4066 }
4067
4068 data->AdvancedTextureOpsSupported = FALSE;
4069 data->WriteableMSAATexturesSupported = FALSE;
4070 data->IndependentFrontAndBackStencilRefMaskSupported = FALSE;
4071
4072 TRACE("Advanced texture ops %#x.\n", data->AdvancedTextureOpsSupported);
4073 TRACE("Writeable MSAA textures %#x.\n", data->WriteableMSAATexturesSupported);
4074 TRACE("Independent front and back stencil ref mask %#x.\n", data->IndependentFrontAndBackStencilRefMaskSupported);
4075 return S_OK;
4076 }
4077
4079 {
4081
4082 if (feature_data_size != sizeof(*data))
4083 {
4084 WARN("Invalid size %u.\n", feature_data_size);
4085 }
4086
4087 data->TriangleFanSupported = FALSE;
4088 data->DynamicIndexBufferStripCutSupported = FALSE;
4089
4090 TRACE("Triangle fan %#x.\n", data->TriangleFanSupported);
4091 TRACE("Dynamic index buffer strip cut %#x.\n", data->DynamicIndexBufferStripCutSupported);
4092 return S_OK;
4093 }
4094
4096 {
4098
4099 if (feature_data_size != sizeof(*data))
4100 {
4101 WARN("Invalid size %u.\n", feature_data_size);
4102 }
4103
4104 data->DynamicDepthBiasSupported = FALSE;
4105 data->GPUUploadHeapSupported = FALSE;
4106
4107 TRACE("Dynamic depth bias %#x.\n", data->DynamicDepthBiasSupported);
4108 TRACE("GPU upload heap %#x.\n", data->GPUUploadHeapSupported);
4109 return S_OK;
4110 }
4111
4113 {
4115
4116 if (feature_data_size != sizeof(*data))
4117 {
4118 WARN("Invalid size %u.\n", feature_data_size);
4119 }
4120
4121 data->NonNormalizedCoordinateSamplersSupported = FALSE;
4122 data->ManualWriteTrackingResourceSupported = FALSE;
4123
4124 TRACE("Non-normalized coordinate samplers %#x.\n", data->NonNormalizedCoordinateSamplersSupported);
4125 TRACE("Manual write tracking resource %#x.\n", data->ManualWriteTrackingResourceSupported);
4126 return S_OK;
4127 }
4128
4130 {
4132
4133 if (feature_data_size != sizeof(*data))
4134 {
4135 WARN("Invalid size %u.\n", feature_data_size);
4136 }
4137
4138 data->RenderPassesValid = FALSE;
4139
4140 TRACE("Render passes valid %#x.\n", data->RenderPassesValid);
4141 return S_OK;
4142 }
4143
4144 default:
4145 FIXME("Unhandled feature %#x.\n", feature);
4146 return E_NOTIMPL;
4147 }
4148}
4149
4151 const D3D12_DESCRIPTOR_HEAP_DESC *desc, REFIID riid, void **descriptor_heap)
4152{
4155 HRESULT hr;
4156
4157 TRACE("iface %p, desc %p, riid %s, descriptor_heap %p.\n",
4158 iface, desc, debugstr_guid(riid), descriptor_heap);
4159
4161 return hr;
4162
4163 return return_interface(&object->ID3D12DescriptorHeap_iface,
4164 &IID_ID3D12DescriptorHeap, riid, descriptor_heap);
4165}
4166
4168 D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type)
4169{
4170 TRACE("iface %p, descriptor_heap_type %#x.\n", iface, descriptor_heap_type);
4171
4172 switch (descriptor_heap_type)
4173 {
4176 return sizeof(struct d3d12_desc);
4177
4179 return sizeof(struct d3d12_rtv_desc);
4180
4182 return sizeof(struct d3d12_dsv_desc);
4183
4184 default:
4185 FIXME("Unhandled type %#x.\n", descriptor_heap_type);
4186 return 0;
4187 }
4188}
4189
4191 UINT node_mask, const void *bytecode, SIZE_T bytecode_length,
4192 REFIID riid, void **root_signature)
4193{
4196 HRESULT hr;
4197
4198 TRACE("iface %p, node_mask 0x%08x, bytecode %p, bytecode_length %"PRIuPTR", riid %s, root_signature %p.\n",
4199 iface, node_mask, bytecode, (uintptr_t)bytecode_length, debugstr_guid(riid), root_signature);
4200
4201 debug_ignored_node_mask(node_mask);
4202
4203 if (FAILED(hr = d3d12_root_signature_create(device, bytecode, bytecode_length, &object)))
4204 return hr;
4205
4206 return return_interface(&object->ID3D12RootSignature_iface,
4207 &IID_ID3D12RootSignature, riid, root_signature);
4208}
4209
4212{
4214 struct d3d12_desc tmp = {0};
4215
4216 TRACE("iface %p, desc %p, descriptor %s.\n", iface, desc, debug_cpu_handle(descriptor));
4217
4220}
4221
4225{
4227 struct d3d12_desc tmp = {0};
4228
4229 TRACE("iface %p, resource %p, desc %p, descriptor %s.\n",
4231
4234}
4235
4237 ID3D12Resource *resource, ID3D12Resource *counter_resource,
4239{
4241 struct d3d12_desc tmp = {0};
4242
4243 TRACE("iface %p, resource %p, counter_resource %p, desc %p, descriptor %s.\n",
4244 iface, resource, counter_resource, desc, debug_cpu_handle(descriptor));
4245
4247 unsafe_impl_from_ID3D12Resource(counter_resource), desc);
4249}
4250
4254{
4255 TRACE("iface %p, resource %p, desc %p, descriptor %s.\n",
4257
4260}
4261
4265{
4266 TRACE("iface %p, resource %p, desc %p, descriptor %s.\n",
4268
4271}
4272
4275{
4277 struct d3d12_desc tmp = {0};
4278
4279 TRACE("iface %p, desc %p, descriptor %s.\n", iface, desc, debug_cpu_handle(descriptor));
4280
4283}
4284
4286 UINT dst_descriptor_range_count, const D3D12_CPU_DESCRIPTOR_HANDLE *dst_descriptor_range_offsets,
4287 const UINT *dst_descriptor_range_sizes,
4288 UINT src_descriptor_range_count, const D3D12_CPU_DESCRIPTOR_HANDLE *src_descriptor_range_offsets,
4289 const UINT *src_descriptor_range_sizes,
4290 D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type)
4291{
4293 unsigned int dst_range_idx, dst_idx, src_range_idx, src_idx;
4294 unsigned int dst_range_size, src_range_size;
4295 struct d3d12_descriptor_heap *dst_heap;
4296 const struct d3d12_desc *src;
4297 struct d3d12_desc *dst;
4298
4299 TRACE("iface %p, dst_descriptor_range_count %u, dst_descriptor_range_offsets %p, "
4300 "dst_descriptor_range_sizes %p, src_descriptor_range_count %u, "
4301 "src_descriptor_range_offsets %p, src_descriptor_range_sizes %p, "
4302 "descriptor_heap_type %#x.\n",
4303 iface, dst_descriptor_range_count, dst_descriptor_range_offsets,
4304 dst_descriptor_range_sizes, src_descriptor_range_count, src_descriptor_range_offsets,
4305 src_descriptor_range_sizes, descriptor_heap_type);
4306
4307 if (descriptor_heap_type != D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV
4308 && descriptor_heap_type != D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER)
4309 {
4310 FIXME("Unhandled descriptor heap type %#x.\n", descriptor_heap_type);
4311 return;
4312 }
4313
4314 if (!dst_descriptor_range_count)
4315 return;
4316
4317 dst_range_idx = dst_idx = 0;
4318 src_range_idx = src_idx = 0;
4319 while (dst_range_idx < dst_descriptor_range_count && src_range_idx < src_descriptor_range_count)
4320 {
4321 dst_range_size = dst_descriptor_range_sizes ? dst_descriptor_range_sizes[dst_range_idx] : 1;
4322 src_range_size = src_descriptor_range_sizes ? src_descriptor_range_sizes[src_range_idx] : 1;
4323
4324 dst = d3d12_desc_from_cpu_handle(dst_descriptor_range_offsets[dst_range_idx]);
4326 src = d3d12_desc_from_cpu_handle(src_descriptor_range_offsets[src_range_idx]);
4327
4328 for (; dst_idx < dst_range_size && src_idx < src_range_size; ++dst_idx, ++src_idx)
4329 {
4330 if (dst[dst_idx].s.u.object == src[src_idx].s.u.object)
4331 continue;
4332 d3d12_desc_copy(&dst[dst_idx], &src[src_idx], dst_heap, device);
4333 }
4334
4335 if (dst_idx >= dst_range_size)
4336 {
4337 ++dst_range_idx;
4338 dst_idx = 0;
4339 }
4340 if (src_idx >= src_range_size)
4341 {
4342 ++src_range_idx;
4343 src_idx = 0;
4344 }
4345 }
4346}
4347
4349 UINT descriptor_count, const D3D12_CPU_DESCRIPTOR_HANDLE dst_descriptor_range_offset,
4350 const D3D12_CPU_DESCRIPTOR_HANDLE src_descriptor_range_offset,
4351 D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type)
4352{
4353 TRACE("iface %p, descriptor_count %u, dst_descriptor_range_offset %s, "
4354 "src_descriptor_range_offset %s, descriptor_heap_type %#x.\n",
4355 iface, descriptor_count, debug_cpu_handle(dst_descriptor_range_offset),
4356 debug_cpu_handle(src_descriptor_range_offset), descriptor_heap_type);
4357
4358 d3d12_device_CopyDescriptors(iface, 1, &dst_descriptor_range_offset, &descriptor_count,
4359 1, &src_descriptor_range_offset, &descriptor_count, descriptor_heap_type);
4360}
4361
4364{
4365 result->Offset = info->offset;
4366 result->Alignment = info->alignment;
4367 result->SizeInBytes = info->size_in_bytes;
4368}
4369
4371 D3D12_RESOURCE_ALLOCATION_INFO1 *infos1, unsigned int count, const D3D12_RESOURCE_DESC1 *resource_descs,
4373{
4376 uint64_t requested_alignment;
4377 unsigned int i;
4378
4379 result->Alignment = 0;
4380 result->SizeInBytes = 0;
4381
4382 info.offset = 0;
4383
4384 for (i = 0; i < count; ++i)
4385 {
4386 desc = &resource_descs[i];
4387
4389 {
4390 WARN("Invalid resource desc.\n");
4391 goto invalid;
4392 }
4393
4394 if (desc->Dimension == D3D12_RESOURCE_DIMENSION_BUFFER)
4395 {
4397 info.offset = align(info.offset, info.alignment);
4399 }
4400 else
4401 {
4403 {
4404 WARN("Failed to get allocation info for texture.\n");
4405 goto invalid;
4406 }
4407
4408 requested_alignment = desc->Alignment
4410 info.alignment = max(info.alignment, requested_alignment);
4411 info.size_in_bytes = align(info.size_in_bytes, info.alignment);
4412
4413 /* Pad by the maximum heap offset increase which may be needed to align to a higher
4414 * Vulkan requirement an offset supplied by the calling application. This allows
4415 * us to return the standard D3D12 alignment and adjust resource placement later. */
4416 if (info.alignment > requested_alignment)
4417 {
4418 info.size_in_bytes += info.alignment - requested_alignment;
4419 info.alignment = requested_alignment;
4420 }
4421
4422 info.offset = align(info.offset, info.alignment);
4423 }
4424
4425 if (infos1)
4427
4428 info.offset += info.size_in_bytes;
4429
4430 result->Alignment = max(result->Alignment, info.alignment);
4431 result->SizeInBytes = info.offset;
4432 }
4433
4434 return;
4435
4436invalid:
4437 result->SizeInBytes = UINT64_MAX;
4438
4439 /* FIXME: Should we support D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT for small MSAA resources? */
4440 if (desc->SampleDesc.Count != 1)
4442 else
4444
4445 TRACE("Alignment %#"PRIx64".\n", result->Alignment);
4446}
4447
4449 D3D12_RESOURCE_ALLOCATION_INFO1 *infos1, unsigned int count, const D3D12_RESOURCE_DESC *resource_descs,
4451{
4452 /* Avoid spurious compiler warning for uninitialized use. */
4453 D3D12_RESOURCE_DESC1 resource_descs1[4] = {0};
4454 D3D12_RESOURCE_DESC1 *descs1;
4455 unsigned int i;
4456
4457 if (count <= ARRAY_SIZE(resource_descs1))
4458 {
4459 descs1 = resource_descs1;
4460 }
4461 else if (!(descs1 = vkd3d_calloc(count, sizeof(*descs1))))
4462 {
4463 ERR("Failed to allocate %u resource descriptions.\n", count);
4464 result->SizeInBytes = UINT64_MAX;
4466 return;
4467 }
4468
4469 for (i = 0; i < count; ++i)
4470 d3d12_resource_desc1_from_desc(&descs1[i], &resource_descs[i]);
4471
4473
4474 if (descs1 != resource_descs1)
4475 vkd3d_free(descs1);
4476}
4477
4480 UINT count, const D3D12_RESOURCE_DESC *resource_descs)
4481{
4483
4484 TRACE("iface %p, info %p, visible_mask 0x%08x, count %u, resource_descs %p.\n",
4485 iface, info, visible_mask, count, resource_descs);
4486
4487 debug_ignored_node_mask(visible_mask);
4488
4490
4491 return info;
4492}
4493
4495 D3D12_HEAP_PROPERTIES *heap_properties, UINT node_mask, D3D12_HEAP_TYPE heap_type)
4496{
4498 bool coherent;
4499
4500 TRACE("iface %p, heap_properties %p, node_mask 0x%08x, heap_type %#x.\n",
4501 iface, heap_properties, node_mask, heap_type);
4502
4503 debug_ignored_node_mask(node_mask);
4504
4505 heap_properties->Type = D3D12_HEAP_TYPE_CUSTOM;
4506
4507 switch (heap_type)
4508 {
4513 break;
4514
4516 heap_properties->CPUPageProperty = d3d12_device_is_uma(device, &coherent) && coherent
4518 heap_properties->MemoryPoolPreference = D3D12_MEMORY_POOL_L0;
4519 break;
4520
4523 heap_properties->MemoryPoolPreference = D3D12_MEMORY_POOL_L0;
4524 break;
4525
4526 default:
4527 FIXME("Unhandled heap type %#x.\n", heap_type);
4528 break;
4529 };
4530
4531 heap_properties->CreationNodeMask = 1;
4532 heap_properties->VisibleNodeMask = 1;
4533
4534 return heap_properties;
4535}
4536
4538 const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags,
4539 const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,
4540 const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource)
4541{
4543 D3D12_RESOURCE_DESC1 resource_desc;
4544 struct d3d12_resource *object;
4545 HRESULT hr;
4546
4547 TRACE("iface %p, heap_properties %p, heap_flags %#x, desc %p, initial_state %#x, "
4548 "optimized_clear_value %p, iid %s, resource %p.\n",
4549 iface, heap_properties, heap_flags, desc, initial_state,
4550 optimized_clear_value, debugstr_guid(iid), resource);
4551
4552 d3d12_resource_desc1_from_desc(&resource_desc, desc);
4553
4554 if (FAILED(hr = d3d12_committed_resource_create(device, heap_properties, heap_flags,
4555 &resource_desc, initial_state, optimized_clear_value, NULL, &object)))
4556 {
4557 *resource = NULL;
4558 return hr;
4559 }
4560
4561 return return_interface(&object->ID3D12Resource2_iface, &IID_ID3D12Resource2, iid, resource);
4562}
4563
4565 const D3D12_HEAP_DESC *desc, REFIID iid, void **heap)
4566{
4568 struct d3d12_heap *object;
4569 HRESULT hr;
4570
4571 TRACE("iface %p, desc %p, iid %s, heap %p.\n",
4572 iface, desc, debugstr_guid(iid), heap);
4573
4574 if (FAILED(hr = d3d12_heap_create(device, desc, NULL, NULL, &object)))
4575 {
4576 *heap = NULL;
4577 return hr;
4578 }
4579
4580 return return_interface(&object->ID3D12Heap_iface, &IID_ID3D12Heap, iid, heap);
4581}
4582
4584 ID3D12Heap *heap, UINT64 heap_offset,
4585 const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,
4586 const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource)
4587{
4589 D3D12_RESOURCE_DESC1 resource_desc;
4590 struct d3d12_heap *heap_object;
4591 struct d3d12_resource *object;
4592 HRESULT hr;
4593
4594 TRACE("iface %p, heap %p, heap_offset %#"PRIx64", desc %p, initial_state %#x, "
4595 "optimized_clear_value %p, iid %s, resource %p.\n",
4597 optimized_clear_value, debugstr_guid(iid), resource);
4598
4599 heap_object = unsafe_impl_from_ID3D12Heap(heap);
4600 d3d12_resource_desc1_from_desc(&resource_desc, desc);
4601
4603 &resource_desc, initial_state, optimized_clear_value, &object)))
4604 return hr;
4605
4606 return return_interface(&object->ID3D12Resource2_iface, &IID_ID3D12Resource2, iid, resource);
4607}
4608
4611 const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource)
4612{
4614 D3D12_RESOURCE_DESC1 resource_desc;
4615 struct d3d12_resource *object;
4616 HRESULT hr;
4617
4618 TRACE("iface %p, desc %p, initial_state %#x, optimized_clear_value %p, iid %s, resource %p.\n",
4619 iface, desc, initial_state, optimized_clear_value, debugstr_guid(iid), resource);
4620
4621 d3d12_resource_desc1_from_desc(&resource_desc, desc);
4622
4624 &resource_desc, initial_state, optimized_clear_value, &object)))
4625 return hr;
4626
4627 return return_interface(&object->ID3D12Resource2_iface, &IID_ID3D12Resource2, iid, resource);
4628}
4629
4632 const WCHAR *name, HANDLE *handle)
4633{
4635
4636 FIXME("iface %p, object %p, attributes %p, access %#x, name %s, handle %p stub!\n",
4637 iface, object, attributes, (uint32_t)access, debugstr_w(name, device->wchar_size), handle);
4638
4639 return E_NOTIMPL;
4640}
4641
4643 HANDLE handle, REFIID riid, void **object)
4644{
4645 FIXME("iface %p, handle %p, riid %s, object %p stub!\n",
4646 iface, handle, debugstr_guid(riid), object);
4647
4648 return E_NOTIMPL;
4649}
4650
4652 const WCHAR *name, DWORD access, HANDLE *handle)
4653{
4655
4656 FIXME("iface %p, name %s, access %#x, handle %p stub!\n",
4657 iface, debugstr_w(name, device->wchar_size), (uint32_t)access, handle);
4658
4659 return E_NOTIMPL;
4660}
4661
4664{
4665 ID3D12Fence *fence;
4666 HRESULT hr;
4667
4668 TRACE("iface %p, object_count %u, objects %p.\n", iface, object_count, objects);
4669
4670 if (FAILED(hr = ID3D12Device9_CreateFence(iface, 0, 0, &IID_ID3D12Fence, (void **)&fence)))
4671 return hr;
4672
4673 hr = ID3D12Device9_EnqueueMakeResident(iface, 0, object_count, objects, fence, 1);
4674 if (SUCCEEDED(hr))
4675 ID3D12Fence_SetEventOnCompletion(fence, 1, NULL);
4676 ID3D12Fence_Release(fence);
4677 return hr;
4678}
4679
4682{
4683 FIXME_ONCE("iface %p, object_count %u, objects %p stub!\n",
4684 iface, object_count, objects);
4685
4686 return S_OK;
4687}
4688
4690 UINT64 initial_value, D3D12_FENCE_FLAGS flags, REFIID riid, void **fence)
4691{
4693 struct d3d12_fence *object;
4694 HRESULT hr;
4695
4696 TRACE("iface %p, initial_value %#"PRIx64", flags %#x, riid %s, fence %p.\n",
4697 iface, initial_value, flags, debugstr_guid(riid), fence);
4698
4699 if (FAILED(hr = d3d12_fence_create(device, initial_value, flags, &object)))
4700 return hr;
4701
4702 return return_interface(&object->ID3D12Fence1_iface, &IID_ID3D12Fence1, riid, fence);
4703}
4704
4706{
4708
4709 TRACE("iface %p.\n", iface);
4710
4711 return device->removed_reason;
4712}
4713
4715 const D3D12_RESOURCE_DESC1 *desc, unsigned int first_sub_resource, unsigned int sub_resource_count,
4716 uint64_t base_offset, D3D12_PLACED_SUBRESOURCE_FOOTPRINT *layouts, UINT *row_counts,
4717 UINT64 *row_sizes, UINT64 *total_bytes)
4718{
4719 unsigned int i, sub_resource_idx, miplevel_idx, row_count, row_size, row_pitch;
4720 unsigned int width, height, depth, plane_count, sub_resources_per_plane;
4721 const struct vkd3d_format *format;
4723
4724 if (layouts)
4725 memset(layouts, 0xff, sizeof(*layouts) * sub_resource_count);
4726 if (row_counts)
4727 memset(row_counts, 0xff, sizeof(*row_counts) * sub_resource_count);
4728 if (row_sizes)
4729 memset(row_sizes, 0xff, sizeof(*row_sizes) * sub_resource_count);
4730 if (total_bytes)
4731 *total_bytes = ~(uint64_t)0;
4732
4734 {
4735 WARN("Invalid format %#x.\n", desc->Format);
4736 return;
4737 }
4738
4740 {
4741 WARN("Invalid resource desc.\n");
4742 return;
4743 }
4744
4745 plane_count = ((format->vk_aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT)
4746 && (format->vk_aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT)) ? 2 : 1;
4747 sub_resources_per_plane = d3d12_resource_desc_get_sub_resource_count(desc);
4748
4749 if (!vkd3d_bound_range(first_sub_resource, sub_resource_count, sub_resources_per_plane * plane_count))
4750 {
4751 WARN("Invalid sub-resource range %u-%u for resource.\n", first_sub_resource, sub_resource_count);
4752 return;
4753 }
4754
4755 offset = 0;
4756 total = 0;
4757 for (i = 0; i < sub_resource_count; ++i)
4758 {
4759 sub_resource_idx = (first_sub_resource + i) % sub_resources_per_plane;
4760 miplevel_idx = sub_resource_idx % desc->MipLevels;
4761 width = align(d3d12_resource_desc_get_width(desc, miplevel_idx), format->block_width);
4762 height = align(d3d12_resource_desc_get_height(desc, miplevel_idx), format->block_height);
4763 depth = d3d12_resource_desc_get_depth(desc, miplevel_idx);
4764 row_count = height / format->block_height;
4765 row_size = (width / format->block_width) * format->byte_count * format->block_byte_count;
4766 row_pitch = align(row_size, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT);
4767
4768 if (layouts)
4769 {
4770 layouts[i].Offset = base_offset + offset;
4771 layouts[i].Footprint.Format = desc->Format;
4772 layouts[i].Footprint.Width = width;
4773 layouts[i].Footprint.Height = height;
4774 layouts[i].Footprint.Depth = depth;
4775 layouts[i].Footprint.RowPitch = row_pitch;
4776 }
4777 if (row_counts)
4778 row_counts[i] = row_count;
4779 if (row_sizes)
4780 row_sizes[i] = row_size;
4781
4782 size = max(0, row_count - 1) * row_pitch + row_size;
4784
4785 total = offset + size;
4787 }
4788 if (total_bytes)
4789 *total_bytes = total;
4790}
4791
4793 const D3D12_RESOURCE_DESC *desc, UINT first_sub_resource, UINT sub_resource_count,
4794 UINT64 base_offset, D3D12_PLACED_SUBRESOURCE_FOOTPRINT *layouts,
4795 UINT *row_counts, UINT64 *row_sizes, UINT64 *total_bytes)
4796{
4798 D3D12_RESOURCE_DESC1 resource_desc;
4799
4800 TRACE("iface %p, desc %p, first_sub_resource %u, sub_resource_count %u, base_offset %#"PRIx64", "
4801 "layouts %p, row_counts %p, row_sizes %p, total_bytes %p.\n",
4802 iface, desc, first_sub_resource, sub_resource_count, base_offset,
4803 layouts, row_counts, row_sizes, total_bytes);
4804
4805 d3d12_resource_desc1_from_desc(&resource_desc, desc);
4806
4807 d3d12_device_get_copyable_footprints(device, &resource_desc, first_sub_resource, sub_resource_count,
4808 base_offset, layouts, row_counts, row_sizes, total_bytes);
4809}
4810
4812 const D3D12_QUERY_HEAP_DESC *desc, REFIID iid, void **heap)
4813{
4815 struct d3d12_query_heap *object;
4816 HRESULT hr;
4817
4818 TRACE("iface %p, desc %p, iid %s, heap %p.\n",
4819 iface, desc, debugstr_guid(iid), heap);
4820
4821 if (FAILED(hr = d3d12_query_heap_create(device, desc, &object)))
4822 return hr;
4823
4824 return return_interface(&object->ID3D12QueryHeap_iface, &IID_ID3D12QueryHeap, iid, heap);
4825}
4826
4828{
4829 FIXME("iface %p, enable %#x stub!\n", iface, enable);
4830
4831 return E_NOTIMPL;
4832}
4833
4836 REFIID iid, void **command_signature)
4837{
4840 HRESULT hr;
4841
4842 TRACE("iface %p, desc %p, root_signature %p, iid %s, command_signature %p.\n",
4843 iface, desc, root_signature, debugstr_guid(iid), command_signature);
4844
4846 return hr;
4847
4848 return return_interface(&object->ID3D12CommandSignature_iface,
4849 &IID_ID3D12CommandSignature, iid, command_signature);
4850}
4851
4853 ID3D12Resource *resource, UINT *total_tile_count,
4854 D3D12_PACKED_MIP_INFO *packed_mip_info, D3D12_TILE_SHAPE *standard_tile_shape,
4855 UINT *sub_resource_tiling_count, UINT first_sub_resource_tiling,
4856 D3D12_SUBRESOURCE_TILING *sub_resource_tilings)
4857{
4858 const struct d3d12_resource *resource_impl = impl_from_ID3D12Resource(resource);
4860
4861 TRACE("iface %p, resource %p, total_tile_count %p, packed_mip_info %p, "
4862 "standard_title_shape %p, sub_resource_tiling_count %p, "
4863 "first_sub_resource_tiling %u, sub_resource_tilings %p.\n",
4864 iface, resource, total_tile_count, packed_mip_info, standard_tile_shape,
4865 sub_resource_tiling_count, first_sub_resource_tiling,
4866 sub_resource_tilings);
4867
4868 d3d12_resource_get_tiling(device, resource_impl, total_tile_count, packed_mip_info, standard_tile_shape,
4869 sub_resource_tiling_count, first_sub_resource_tiling, sub_resource_tilings);
4870}
4871
4873{
4875
4876 TRACE("iface %p, luid %p.\n", iface, luid);
4877
4878 *luid = device->adapter_luid;
4879
4880 return luid;
4881}
4882
4884 const void *blob, SIZE_T blob_size, REFIID iid, void **lib)
4885{
4886 FIXME("iface %p, blob %p, blob_size %"PRIuPTR", iid %s, lib %p stub!\n",
4887 iface, blob, (uintptr_t)blob_size, debugstr_guid(iid), lib);
4888
4890}
4891
4893 ID3D12Fence *const *fences, const UINT64 *values, UINT fence_count,
4895{
4896 FIXME("iface %p, fences %p, values %p, fence_count %u, flags %#x, event %p stub!\n",
4897 iface, fences, values, fence_count, flags, event);
4898
4899 return E_NOTIMPL;
4900}
4901
4904{
4905 FIXME_ONCE("iface %p, object_count %u, objects %p, priorities %p stub!\n", iface, object_count, objects, priorities);
4906
4907 return S_OK;
4908}
4909
4911 const D3D12_PIPELINE_STATE_STREAM_DESC *desc, REFIID iid, void **pipeline_state)
4912{
4915 HRESULT hr;
4916
4917 TRACE("iface %p, desc %p, iid %s, pipeline_state %p.\n", iface, desc, debugstr_guid(iid), pipeline_state);
4918
4920 return hr;
4921
4922 return return_interface(&object->ID3D12PipelineState_iface, &IID_ID3D12PipelineState, iid, pipeline_state);
4923}
4924
4926 const void *address, REFIID iid, void **heap)
4927{
4928 FIXME("iface %p, address %p, iid %s, heap %p stub!\n", iface, address, debugstr_guid(iid), heap);
4929
4930 return E_NOTIMPL;
4931}
4932
4934 HANDLE file_mapping, REFIID iid, void **heap)
4935{
4936 FIXME("iface %p, file_mapping %p, iid %s, heap %p stub!\n", iface, file_mapping, debugstr_guid(iid), heap);
4937
4938 return E_NOTIMPL;
4939}
4940
4943 ID3D12Fence *fence, UINT64 fence_value)
4944{
4945 FIXME_ONCE("iface %p, flags %#x, num_objects %u, objects %p, fence %p, fence_value %#"PRIx64" stub!\n",
4946 iface, flags, num_objects, objects, fence, fence_value);
4947
4948 ID3D12Fence_Signal(fence, fence_value);
4949 return S_OK;
4950}
4951
4954 REFIID iid, void **command_list)
4955{
4956 FIXME("iface %p, node_mask 0x%08x, type %#x, flags %#x, iid %s, command_list %p stub!\n",
4957 iface, node_mask, type, flags, debugstr_guid(iid), command_list);
4958
4959 return E_NOTIMPL;
4960}
4961
4964{
4965 FIXME("iface %p, desc %p, iid %s, session %p stub!\n", iface, desc, debugstr_guid(iid), session);
4966
4967 return E_NOTIMPL;
4968}
4969
4971 const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags,
4972 const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,
4973 const D3D12_CLEAR_VALUE *optimized_clear_value,
4974 ID3D12ProtectedResourceSession *protected_session, REFIID iid, void **resource)
4975{
4977 D3D12_RESOURCE_DESC1 resource_desc;
4978 struct d3d12_resource *object;
4979 HRESULT hr;
4980
4981 TRACE("iface %p, heap_properties %p, heap_flags %#x, desc %p, initial_state %#x, "
4982 "optimized_clear_value %p, protected_session %p, iid %s, resource %p.\n",
4983 iface, heap_properties, heap_flags, desc, initial_state,
4984 optimized_clear_value, protected_session, debugstr_guid(iid), resource);
4985
4986 d3d12_resource_desc1_from_desc(&resource_desc, desc);
4987
4988 if (FAILED(hr = d3d12_committed_resource_create(device, heap_properties, heap_flags,
4989 &resource_desc, initial_state, optimized_clear_value, protected_session, &object)))
4990 {
4991 *resource = NULL;
4992 return hr;
4993 }
4994
4995 return return_interface(&object->ID3D12Resource2_iface, &IID_ID3D12Resource2, iid, resource);
4996}
4997
4999 const D3D12_HEAP_DESC *desc, ID3D12ProtectedResourceSession *protected_session,
5000 REFIID iid, void **heap)
5001{
5003 struct d3d12_heap *object;
5004 HRESULT hr;
5005
5006 TRACE("iface %p, desc %p, protected_session %p, iid %s, heap %p.\n",
5007 iface, desc, protected_session, debugstr_guid(iid), heap);
5008
5009 if (FAILED(hr = d3d12_heap_create(device, desc, NULL, protected_session, &object)))
5010 {
5011 *heap = NULL;
5012 return hr;
5013 }
5014
5015 return return_interface(&object->ID3D12Heap_iface, &IID_ID3D12Heap, iid, heap);
5016}
5017
5019 const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,
5020 const D3D12_CLEAR_VALUE *optimized_clear_value,
5021 ID3D12ProtectedResourceSession *protected_session, REFIID iid, void **resource)
5022{
5023 FIXME("iface %p, desc %p, initial_state %#x, optimized_clear_value %p, "
5024 "protected_session %p, iid %s, resource %p stub!\n",
5025 iface, desc, initial_state, optimized_clear_value, protected_session,
5026 debugstr_guid(iid), resource);
5027
5028 return E_NOTIMPL;
5029}
5030
5033 UINT count, const D3D12_RESOURCE_DESC *resource_descs,
5035{
5037
5038 TRACE("iface %p, info %p, visible_mask 0x%08x, count %u, resource_descs %p, info1 %p.\n",
5039 iface, info, visible_mask, count, resource_descs, info1);
5040
5041 debug_ignored_node_mask(visible_mask);
5042
5044
5045 return info;
5046}
5047
5049 ID3D12LifetimeOwner *owner, REFIID iid, void **tracker)
5050{
5051 FIXME("iface %p, owner %p, iid %s, tracker %p stub!\n", iface, owner, debugstr_guid(iid), tracker);
5052
5053 return E_NOTIMPL;
5054}
5055
5057{
5058 FIXME("iface %p stub!\n", iface);
5059}
5060
5062 UINT *num_meta_commands, D3D12_META_COMMAND_DESC *command_desc)
5063{
5064 FIXME("iface %p, num_meta_commands %p, command_desc %p stub!\n", iface,
5065 num_meta_commands, command_desc);
5066
5067 return E_NOTIMPL;
5068}
5069
5072 UINT *size_in_bytes, UINT *parameter_count,
5073 D3D12_META_COMMAND_PARAMETER_DESC *parameter_desc)
5074{
5075 FIXME("iface %p, command_id %s, stage %u, size_in_bytes %p, "
5076 "parameter_count %p, parameter_desc %p stub!\n", iface,
5077 debugstr_guid(command_id), stage, size_in_bytes, parameter_count, parameter_desc);
5078
5079 return E_NOTIMPL;
5080}
5081
5083 REFGUID command_id, UINT node_mask, const void *parameters_data,
5084 SIZE_T data_size_in_bytes, REFIID iid, void **meta_command)
5085{
5086 FIXME("iface %p, command_id %s, node_mask %#x, parameters_data %p, "
5087 "data_size_in_bytes %"PRIuPTR", iid %s, meta_command %p stub!\n", iface,
5088 debugstr_guid(command_id), node_mask, parameters_data,
5089 (uintptr_t)data_size_in_bytes, debugstr_guid(iid), meta_command);
5090
5091 return E_NOTIMPL;
5092}
5093
5095 const D3D12_STATE_OBJECT_DESC *desc, REFIID iid, void **state_object)
5096{
5097 FIXME("iface %p, desc %p, iid %s, state_object %p stub!\n", iface, desc, debugstr_guid(iid), state_object);
5098
5099 return E_NOTIMPL;
5100}
5101
5105{
5106 FIXME("iface %p, desc %p, info %p stub!\n", iface, desc, info);
5107}
5108
5111{
5112 FIXME("iface %p, data_type %u, identifier %p stub!\n", iface, data_type, identifier);
5113
5115}
5116
5119 BOOL *further_measurements_desired)
5120{
5121 FIXME("iface %p, mode %#x, action %#x, event %p, further_measurements_desired %p stub!\n",
5122 iface, mode, action, event, further_measurements_desired);
5123
5124 return E_NOTIMPL;
5125}
5126
5127
5129 const D3D12_STATE_OBJECT_DESC *addition, ID3D12StateObject *state_object_to_grow_from,
5130 REFIID riid, void **new_state_object)
5131{
5132 FIXME("iface %p, addition %p, state_object_to_grow_from %p, riid %s, new_state_object %p stub!\n",
5133 iface, addition, state_object_to_grow_from, debugstr_guid(riid), new_state_object);
5134
5135 return E_NOTIMPL;
5136}
5137
5140{
5141 FIXME("iface %p, desc %p, riid %s, session %p stub!\n", iface, desc, debugstr_guid(riid), session);
5142
5143 return E_NOTIMPL;
5144}
5145
5148 const D3D12_RESOURCE_DESC1 *resource_descs, D3D12_RESOURCE_ALLOCATION_INFO1 *info1)
5149{
5151
5152 TRACE("iface %p, info %p, visible_mask 0x%08x, count %u, resource_descs %p, info1 %p.\n",
5153 iface, info, visible_mask, count, resource_descs, info1);
5154
5155 debug_ignored_node_mask(visible_mask);
5156
5158
5159 return info;
5160}
5161
5163 const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags, const D3D12_RESOURCE_DESC1 *desc,
5164 D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value,
5165 ID3D12ProtectedResourceSession *protected_session, REFIID iid, void **resource)
5166{
5168 struct d3d12_resource *object;
5169 HRESULT hr;
5170
5171 TRACE("iface %p, heap_properties %p, heap_flags %#x, desc %p, initial_state %#x, "
5172 "optimized_clear_value %p, protected_session %p, iid %s, resource %p.\n",
5173 iface, heap_properties, heap_flags, desc, initial_state,
5174 optimized_clear_value, protected_session, debugstr_guid(iid), resource);
5175
5176 if (FAILED(hr = d3d12_committed_resource_create(device, heap_properties, heap_flags,
5177 desc, initial_state, optimized_clear_value, protected_session, &object)))
5178 {
5179 *resource = NULL;
5180 return hr;
5181 }
5182
5183 return return_interface(&object->ID3D12Resource2_iface, &IID_ID3D12Resource2, iid, resource);
5184}
5185
5187 ID3D12Heap *heap, UINT64 heap_offset, const D3D12_RESOURCE_DESC1 *resource_desc,
5188 D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value,
5189 REFIID iid, void **resource)
5190{
5192 struct d3d12_heap *heap_object;
5193 struct d3d12_resource *object;
5194 HRESULT hr;
5195
5196 TRACE("iface %p, heap %p, heap_offset %#"PRIx64", desc %p, initial_state %#x, "
5197 "optimized_clear_value %p, iid %s, resource %p.\n",
5198 iface, heap, heap_offset, resource_desc, initial_state,
5199 optimized_clear_value, debugstr_guid(iid), resource);
5200
5201 heap_object = unsafe_impl_from_ID3D12Heap(heap);
5202
5204 resource_desc, initial_state, optimized_clear_value, &object)))
5205 return hr;
5206
5207 return return_interface(&object->ID3D12Resource2_iface, &IID_ID3D12Resource2, iid, resource);
5208}
5209
5211 ID3D12Resource *target_resource, ID3D12Resource *feedback_resource, D3D12_CPU_DESCRIPTOR_HANDLE descriptor)
5212{
5213 FIXME("iface %p, target_resource %p, feedback_resource %p, descriptor %s stub!\n",
5214 iface, target_resource, feedback_resource, debug_cpu_handle(descriptor));
5215}
5216
5218 const D3D12_RESOURCE_DESC1 *desc, UINT first_sub_resource, UINT sub_resource_count,
5219 UINT64 base_offset, D3D12_PLACED_SUBRESOURCE_FOOTPRINT *layouts, UINT *row_counts,
5220 UINT64 *row_sizes, UINT64 *total_bytes)
5221{
5223
5224 TRACE("iface %p, desc %p, first_sub_resource %u, sub_resource_count %u, base_offset %#"PRIx64", "
5225 "layouts %p, row_counts %p, row_sizes %p, total_bytes %p.\n",
5226 iface, desc, first_sub_resource, sub_resource_count, base_offset,
5227 layouts, row_counts, row_sizes, total_bytes);
5228
5229 d3d12_device_get_copyable_footprints(device, desc, first_sub_resource, sub_resource_count,
5230 base_offset, layouts, row_counts, row_sizes, total_bytes);
5231}
5232
5235{
5238 static const GUID guid_null = {0};
5239 HRESULT hr;
5240
5241 static const UINT valid_flags = D3D12_SHADER_CACHE_FLAG_DRIVER_VERSIONED
5243
5244 TRACE("iface %p, desc %p, iid %s, session %p.\n", iface, desc, debugstr_guid(iid), session);
5245
5246 if (!desc || !memcmp(&desc->Identifier, &guid_null, sizeof(desc->Identifier)))
5247 {
5248 WARN("No description or identifier, returning E_INVALIDARG.\n");
5249 return E_INVALIDARG;
5250 }
5251 if (desc->MaximumValueFileSizeBytes > 1024 * 1024 * 1024)
5252 {
5253 WARN("Requested size is larger than 1GiB, returning E_INVALIDARG.\n");
5254 return E_INVALIDARG;
5255 }
5256 if (desc->Flags & ~valid_flags)
5257 {
5258 WARN("Invalid flags %#x, returning E_INVALIDARG.\n", desc->Flags);
5259 return E_INVALIDARG;
5260 }
5261 if (desc->Mode != D3D12_SHADER_CACHE_MODE_MEMORY && desc->Mode != D3D12_SHADER_CACHE_MODE_DISK)
5262 {
5263 WARN("Invalid mode %#x, returning E_INVALIDARG.\n", desc->Mode);
5264 return E_INVALIDARG;
5265 }
5266 if (!session)
5267 {
5268 WARN("No output pointer, returning S_FALSE.\n");
5269 return S_FALSE;
5270 }
5271 *session = NULL;
5272
5273 if (!(object = vkd3d_malloc(sizeof(*object))))
5274 return E_OUTOFMEMORY;
5275
5276 if (FAILED(hr = d3d12_cache_session_init(object, device, desc)))
5277 {
5278 vkd3d_free(object);
5279 return hr;
5280 }
5281
5282 hr = ID3D12ShaderCacheSession_QueryInterface(&object->ID3D12ShaderCacheSession_iface, iid,
5283 session);
5284 ID3D12ShaderCacheSession_Release(&object->ID3D12ShaderCacheSession_iface);
5285 return hr;
5286}
5287
5290{
5291 FIXME("iface %p, kinds %#x control %#x stub!\n", iface, kinds, control);
5292
5293 return E_NOTIMPL;
5294}
5295
5297 const D3D12_COMMAND_QUEUE_DESC *desc, REFIID creator_id, REFIID iid,
5298 void **command_queue)
5299{
5300 FIXME("iface %p, desc %p, creator %s, iid %s, queue %p stub!\n", iface, desc,
5301 debugstr_guid(creator_id), debugstr_guid(iid), command_queue);
5302
5303 return E_NOTIMPL;
5304}
5305
5306static const struct ID3D12Device9Vtbl d3d12_device_vtbl =
5307{
5308 /* IUnknown methods */
5312 /* ID3D12Object methods */
5317 /* ID3D12Device methods */
5355 /* ID3D12Device1 methods */
5359 /* ID3D12Device2 methods */
5361 /* ID3D12Device3 methods */
5365 /* ID3D12Device4 methods */
5372 /* ID3D12Device5 methods */
5381 /* ID3D12Device6 methods */
5383 /* ID3D12Device7 methods */
5386 /* ID3D12Device8 methods */
5392 /* ID3D12Device9 methods */
5396};
5397
5399{
5400 if (!iface)
5401 return NULL;
5402 VKD3D_ASSERT(iface->lpVtbl == &d3d12_device_vtbl);
5403 return impl_from_ID3D12Device9(iface);
5404}
5405
5406static void *device_worker_main(void *arg)
5407{
5409 struct d3d12_device *device = arg;
5410 size_t i;
5411
5412 vkd3d_set_thread_name("device_worker");
5413
5414 vkd3d_mutex_lock(&device->worker_mutex);
5415
5416 while (!device->worker_should_exit)
5417 {
5418 for (i = 0; i < device->heap_count; ++i)
5419 {
5420 /* Descriptor updates are not written to Vulkan descriptor sets until a command list
5421 * is submitted to a queue, while the client is free to write d3d12 descriptors earlier,
5422 * from any thread. This causes a delay right before command list execution, so
5423 * handling these updates in a worker thread can speed up execution significantly. */
5424 heap = device->heaps[i];
5425 if (heap->dirty_list_head == UINT_MAX)
5426 continue;
5427 vkd3d_mutex_lock(&heap->vk_sets_mutex);
5429 vkd3d_mutex_unlock(&heap->vk_sets_mutex);
5430 }
5431
5432 vkd3d_cond_wait(&device->worker_cond, &device->worker_mutex);
5433 }
5434
5435 vkd3d_mutex_unlock(&device->worker_mutex);
5436
5437 return NULL;
5438}
5439
5441 struct vkd3d_instance *instance, const struct vkd3d_device_create_info *create_info)
5442{
5443 const struct vkd3d_vk_device_procs *vk_procs;
5444 HRESULT hr;
5445
5446 device->ID3D12Device9_iface.lpVtbl = &d3d12_device_vtbl;
5447 device->refcount = 1;
5448
5449 vkd3d_instance_incref(device->vkd3d_instance = instance);
5450 device->vk_info = instance->vk_info;
5451 device->signal_event = instance->signal_event;
5452 device->wchar_size = instance->wchar_size;
5453 device->environment = (instance->vk_api_version >= VK_API_VERSION_1_1)
5455
5456 device->adapter_luid = create_info->adapter_luid;
5457 device->removed_reason = S_OK;
5458
5459 device->vk_device = VK_NULL_HANDLE;
5460
5461 device->heaps = NULL;
5462 device->heap_capacity = 0;
5463 device->heap_count = 0;
5464 memset(&device->worker_thread, 0, sizeof(device->worker_thread));
5465 device->worker_should_exit = false;
5466 vkd3d_mutex_init(&device->worker_mutex);
5467 vkd3d_cond_init(&device->worker_cond);
5468
5469 if (FAILED(hr = vkd3d_create_vk_device(device, create_info)))
5470 goto out_free_instance;
5471
5473 goto out_free_vk_resources;
5474
5475 if (FAILED(hr = vkd3d_private_store_init(&device->private_store)))
5476 goto out_free_pipeline_cache;
5477
5479 goto out_free_private_store;
5480
5481 if (FAILED(hr = vkd3d_init_null_resources(&device->null_resources, device)))
5482 goto out_cleanup_format_info;
5483
5484 if (FAILED(hr = vkd3d_uav_clear_state_init(&device->uav_clear_state, device)))
5485 goto out_destroy_null_resources;
5486
5488 goto out_cleanup_uav_clear_state;
5489
5490 if (device->use_vk_heaps && FAILED(hr = vkd3d_create_thread(device->vkd3d_instance,
5491 device_worker_main, device, &device->worker_thread)))
5492 {
5493 WARN("Failed to create worker thread, hr %s.\n", debugstr_hresult(hr));
5494 goto out_cleanup_descriptor_heap_layouts;
5495 }
5496
5497 vkd3d_render_pass_cache_init(&device->render_pass_cache);
5498 vkd3d_gpu_va_allocator_init(&device->gpu_va_allocator);
5500
5501 device->blocked_queue_count = 0;
5502 vkd3d_mutex_init(&device->blocked_queues_mutex);
5503
5504 vkd3d_desc_object_cache_init(&device->view_desc_cache, sizeof(struct vkd3d_view));
5505 vkd3d_desc_object_cache_init(&device->cbuffer_desc_cache, sizeof(struct vkd3d_cbuffer_desc));
5506
5508
5509 if ((device->parent = create_info->parent))
5510 IUnknown_AddRef(device->parent);
5511
5512 return S_OK;
5513
5514out_cleanup_descriptor_heap_layouts:
5516out_cleanup_uav_clear_state:
5517 vkd3d_uav_clear_state_cleanup(&device->uav_clear_state, device);
5518out_destroy_null_resources:
5519 vkd3d_destroy_null_resources(&device->null_resources, device);
5520out_cleanup_format_info:
5522out_free_private_store:
5523 vkd3d_private_store_destroy(&device->private_store);
5524out_free_pipeline_cache:
5526out_free_vk_resources:
5527 vk_procs = &device->vk_procs;
5528 VK_CALL(vkDestroyDevice(device->vk_device, NULL));
5529out_free_instance:
5530 vkd3d_instance_decref(device->vkd3d_instance);
5531 return hr;
5532}
5533
5535 const struct vkd3d_device_create_info *create_info, struct d3d12_device **device)
5536{
5537 struct d3d12_device *object;
5538 HRESULT hr;
5539
5540 if (!(object = vkd3d_malloc(sizeof(*object))))
5541 return E_OUTOFMEMORY;
5542
5543 if (FAILED(hr = d3d12_device_init(object, instance, create_info)))
5544 {
5545 vkd3d_free(object);
5546 return hr;
5547 }
5548
5549 TRACE("Created device %p.\n", object);
5550
5551 *device = object;
5552
5553 return S_OK;
5554}
5555
5557 const char *message, ...)
5558{
5559 va_list args;
5560
5562 WARN("Device %p is lost (reason %s, \"%s\").\n",
5564 va_end(args);
5565
5566 device->removed_reason = reason;
5567}
5568
5570{
5571 vkd3d_mutex_lock(&device->worker_mutex);
5572
5573 if (!vkd3d_array_reserve((void **)&device->heaps, &device->heap_capacity, device->heap_count + 1,
5574 sizeof(*device->heaps)))
5575 {
5576 vkd3d_mutex_unlock(&device->worker_mutex);
5577 return E_OUTOFMEMORY;
5578 }
5579 device->heaps[device->heap_count++] = heap;
5580
5581 vkd3d_mutex_unlock(&device->worker_mutex);
5582
5583 return S_OK;
5584}
5585
5587{
5588 size_t i;
5589
5590 vkd3d_mutex_lock(&device->worker_mutex);
5591
5592 for (i = 0; i < device->heap_count; ++i)
5593 {
5594 if (device->heaps[i] == heap)
5595 {
5596 device->heaps[i] = device->heaps[--device->heap_count];
5597 break;
5598 }
5599 }
5600
5601 vkd3d_mutex_unlock(&device->worker_mutex);
5602}
5603
5604#ifdef _WIN32
5605struct thread_data
5606{
5607 PFN_vkd3d_thread main_pfn;
5608 void *data;
5609};
5610
5611static DWORD WINAPI call_thread_main(void *data)
5612{
5613 struct thread_data *thread_data = data;
5614 thread_data->main_pfn(thread_data->data);
5616 return 0;
5617}
5618#endif
5619
5622{
5623 HRESULT hr = S_OK;
5624
5625 if (instance->create_thread)
5626 {
5627 if (!(thread->handle = instance->create_thread(thread_main, data)))
5628 {
5629 ERR("Failed to create thread.\n");
5630 hr = E_FAIL;
5631 }
5632 }
5633 else
5634 {
5635#ifdef _WIN32
5636 struct thread_data *thread_data;
5637
5638 if (!(thread_data = vkd3d_malloc(sizeof(*thread_data))))
5639 return E_OUTOFMEMORY;
5640
5641 thread_data->main_pfn = thread_main;
5643 if (!(thread->handle = CreateThread(NULL, 0, call_thread_main, thread_data, 0, NULL)))
5644 {
5645 ERR("Failed to create thread, error %lu.\n", GetLastError());
5647 hr = E_FAIL;
5648 }
5649#else
5650 int rc;
5651
5652 if ((rc = pthread_create(&thread->pthread, NULL, thread_main, data)))
5653 {
5654 ERR("Failed to create thread, error %d.\n", rc);
5655 hr = hresult_from_errno(rc);
5656 }
5657#endif
5658 }
5659
5660 return hr;
5661}
5662
5664{
5665 HRESULT hr = S_OK;
5666 int rc;
5667
5668 if (instance->join_thread)
5669 {
5670 if (FAILED(hr = instance->join_thread(thread->handle)))
5671 ERR("Failed to join thread, hr %s.\n", debugstr_hresult(hr));
5672 }
5673 else
5674 {
5675#ifdef _WIN32
5676 if ((rc = WaitForSingleObject(thread->handle, INFINITE)) != WAIT_OBJECT_0)
5677 {
5678 ERR("Failed to wait for thread, ret %#x.\n", rc);
5679 hr = E_FAIL;
5680 }
5681 CloseHandle(thread->handle);
5682#else
5683 if ((rc = pthread_join(thread->pthread, NULL)))
5684 {
5685 ERR("Failed to join thread, error %d.\n", rc);
5686 hr = hresult_from_errno(rc);
5687 }
5688#endif
5689 }
5690
5691 return hr;
5692}
5693
5695{
5697
5698 return d3d12_device->parent;
5699}
5700
5702{
5704
5705 return d3d12_device->vk_device;
5706}
5707
5709{
5711
5713}
5714
5716{
5718
5720}
COMPILER_DEPENDENT_UINT64 UINT64
Definition: actypes.h:131
_Check_return_ _Ret_maybenull_ _In_ size_t alignment
Definition: align.cpp:48
#define PATH_MAX
Definition: types.h:280
#define index(s, c)
Definition: various.h:29
#define ARRAY_SIZE(A)
Definition: main.h:20
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
static HANDLE thread
Definition: service.c:33
const GUID IID_IUnknown
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
Definition: list.h:39
Definition: _set.h:50
void vkd3d_queue_destroy(struct vkd3d_queue *queue, struct d3d12_device *device)
Definition: command.c:67
HRESULT d3d12_fence_create(struct d3d12_device *device, uint64_t initial_value, D3D12_FENCE_FLAGS flags, struct d3d12_fence **fence)
Definition: command.c:1222
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 d3d12_command_allocator_create(struct d3d12_device *device, D3D12_COMMAND_LIST_TYPE type, struct d3d12_command_allocator **allocator)
Definition: command.c:1895
HRESULT d3d12_command_queue_create(struct d3d12_device *device, const D3D12_COMMAND_QUEUE_DESC *desc, struct d3d12_command_queue **queue)
Definition: command.c:7464
HRESULT vkd3d_queue_create(struct d3d12_device *device, uint32_t family_index, const VkQueueFamilyProperties *properties, struct vkd3d_queue **queue)
Definition: command.c:34
HRESULT d3d12_command_signature_create(struct d3d12_device *device, const D3D12_COMMAND_SIGNATURE_DESC *desc, struct d3d12_command_signature **signature)
Definition: command.c:7635
const INT D3D12_VIEWPORT_BOUNDS_MIN
Definition: d3d12.idl:436
D3D12_SERIALIZED_DATA_TYPE
Definition: d3d12.idl:3930
@ D3D12_HEAP_SERIALIZATION_TIER_0
Definition: d3d12.idl:618
D3D12_MULTIPLE_FENCE_WAIT_FLAGS
Definition: d3d12.idl:2536
const UINT D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT
Definition: d3d12.idl:40
@ D3D12_FORMAT_SUPPORT1_TEXTURE1D
Definition: d3d12.idl:509
@ D3D12_FORMAT_SUPPORT1_IA_INDEX_BUFFER
Definition: d3d12.idl:507
@ D3D12_FORMAT_SUPPORT1_TEXTURECUBE
Definition: d3d12.idl:512
@ D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_COMPARISON
Definition: d3d12.idl:515
@ D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RENDERTARGET
Definition: d3d12.idl:524
@ D3D12_FORMAT_SUPPORT1_RENDER_TARGET
Definition: d3d12.idl:518
@ D3D12_FORMAT_SUPPORT1_MULTISAMPLE_LOAD
Definition: d3d12.idl:525
@ D3D12_FORMAT_SUPPORT1_SHADER_GATHER_COMPARISON
Definition: d3d12.idl:529
@ D3D12_FORMAT_SUPPORT1_BLENDABLE
Definition: d3d12.idl:519
@ D3D12_FORMAT_SUPPORT1_BUFFER
Definition: d3d12.idl:505
@ D3D12_FORMAT_SUPPORT1_MIP
Definition: d3d12.idl:517
@ D3D12_FORMAT_SUPPORT1_IA_VERTEX_BUFFER
Definition: d3d12.idl:506
@ D3D12_FORMAT_SUPPORT1_NONE
Definition: d3d12.idl:504
@ D3D12_FORMAT_SUPPORT1_TEXTURE3D
Definition: d3d12.idl:511
@ D3D12_FORMAT_SUPPORT1_SHADER_GATHER
Definition: d3d12.idl:526
@ D3D12_FORMAT_SUPPORT1_TEXTURE2D
Definition: d3d12.idl:510
@ D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW
Definition: d3d12.idl:528
@ D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL
Definition: d3d12.idl:520
@ D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE
Definition: d3d12.idl:514
@ D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RESOLVE
Definition: d3d12.idl:521
@ D3D12_FORMAT_SUPPORT1_SHADER_LOAD
Definition: d3d12.idl:513
D3D12_RESOURCE_STATES
Definition: d3d12.idl:903
@ D3D_SHADER_MODEL_6_0
Definition: d3d12.idl:2255
@ D3D_SHADER_MODEL_5_1
Definition: d3d12.idl:2254
@ D3D_HIGHEST_SHADER_MODEL
Definition: d3d12.idl:2263
@ D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0
Definition: d3d12.idl:605
@ D3D_ROOT_SIGNATURE_VERSION_1_0
Definition: d3d12.idl:1405
@ D3D_ROOT_SIGNATURE_VERSION_1_1
Definition: d3d12.idl:1406
@ D3D12_RAYTRACING_TIER_NOT_SUPPORTED
Definition: d3d12.idl:631
@ D3D12_SHADER_CACHE_FLAG_USE_WORKING_DIR
Definition: d3d12.idl:4703
@ D3D12_SHADER_CACHE_FLAG_DRIVER_VERSIONED
Definition: d3d12.idl:4702
@ D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED
Definition: d3d12.idl:466
@ D3D12_TILED_RESOURCES_TIER_1
Definition: d3d12.idl:467
@ D3D12_TILED_RESOURCES_TIER_2
Definition: d3d12.idl:468
@ D3D12_TILED_RESOURCES_TIER_3
Definition: d3d12.idl:469
const UINT D3D12_UAV_SLOT_COUNT
Definition: d3d12.idl:424
D3D12_META_COMMAND_PARAMETER_STAGE
Definition: d3d12.idl:3568
@ D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED
Definition: d3d12.idl:481
@ D3D12_CONSERVATIVE_RASTERIZATION_TIER_1
Definition: d3d12.idl:482
@ D3D12_SHADER_MIN_PRECISION_SUPPORT_NONE
Definition: d3d12.idl:458
const UINT D3D12_MAX_ROOT_COST
Definition: d3d12.idl:280
@ D3D12_WAVE_MMA_TIER_NOT_SUPPORTED
Definition: d3d12.idl:2400
D3D12_COMMAND_LIST_TYPE
Definition: d3d12.idl:2188
@ D3D12_COMMAND_LIST_TYPE_COPY
Definition: d3d12.idl:2192
@ D3D12_COMMAND_LIST_TYPE_DIRECT
Definition: d3d12.idl:2189
@ D3D12_COMMAND_LIST_TYPE_COMPUTE
Definition: d3d12.idl:2191
@ D3D12_MEMORY_POOL_L1
Definition: d3d12.idl:799
@ D3D12_MEMORY_POOL_L0
Definition: d3d12.idl:798
const UINT D3D12_CS_TGSM_REGISTER_COUNT
Definition: d3d12.idl:109
@ D3D12_RESOURCE_DIMENSION_BUFFER
Definition: d3d12.idl:983
@ D3D12_RESOURCE_DIMENSION_TEXTURE2D
Definition: d3d12.idl:985
@ D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET
Definition: d3d12.idl:1000
const UINT D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT
Definition: d3d12.idl:140
@ D3D12_VARIABLE_SHADING_RATE_TIER_NOT_SUPPORTED
Definition: d3d12.idl:2350
const UINT D3D12_VIEWPORT_BOUNDS_MAX
Definition: d3d12.idl:435
D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS
Definition: d3d12.idl:3935
@ D3D12_DRIVER_MATCHING_IDENTIFIER_UNRECOGNIZED
Definition: d3d12.idl:3938
const UINT D3D12_TEXTURE_DATA_PITCH_ALIGNMENT
Definition: d3d12.idl:419
D3D12_COMMAND_LIST_FLAGS
Definition: d3d12.idl:3444
const UINT D3D12_MAX_LIVE_STATIC_SAMPLERS
Definition: d3d12.idl:276
D3D12_HEAP_FLAGS
Definition: d3d12.idl:812
@ D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED
Definition: d3d12.idl:564
@ D3D12_TRI_STATE_UNKNOWN
Definition: d3d12.idl:2427
@ D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE
Definition: d3d12.idl:543
@ D3D12_FORMAT_SUPPORT2_NONE
Definition: d3d12.idl:539
@ D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_OR_MAX
Definition: d3d12.idl:544
@ D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_OR_COMPARE_EXCHANGE
Definition: d3d12.idl:542
@ D3D12_FORMAT_SUPPORT2_UAV_TYPED_LOAD
Definition: d3d12.idl:546
@ D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE
Definition: d3d12.idl:547
@ D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS
Definition: d3d12.idl:541
@ D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_OR_MAX
Definition: d3d12.idl:545
@ D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_ADD
Definition: d3d12.idl:540
@ D3D12_RENDER_PASS_TIER_0
Definition: d3d12.idl:624
@ D3D12_CPU_PAGE_PROPERTY_WRITE_BACK
Definition: d3d12.idl:792
@ D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE
Definition: d3d12.idl:791
@ D3D12_CPU_PAGE_PROPERTY_NOT_AVAILABLE
Definition: d3d12.idl:790
@ D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED
Definition: d3d12.idl:597
@ D3D12_SAMPLER_FEEDBACK_TIER_NOT_SUPPORTED
Definition: d3d12.idl:2372
D3D12_MEASUREMENTS_ACTION
Definition: d3d12.idl:4385
const UINT D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT
Definition: d3d12.idl:420
D3D12_DESCRIPTOR_HEAP_TYPE
Definition: d3d12.idl:1420
@ D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV
Definition: d3d12.idl:1421
@ D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER
Definition: d3d12.idl:1422
@ D3D12_DESCRIPTOR_HEAP_TYPE_RTV
Definition: d3d12.idl:1423
@ D3D12_DESCRIPTOR_HEAP_TYPE_DSV
Definition: d3d12.idl:1424
@ D3D12_RESOURCE_BINDING_TIER_3
Definition: d3d12.idl:476
@ D3D12_RESOURCE_BINDING_TIER_1
Definition: d3d12.idl:474
@ D3D12_RESOURCE_BINDING_TIER_2
Definition: d3d12.idl:475
@ D3D12_MESH_SHADER_TIER_NOT_SUPPORTED
Definition: d3d12.idl:2366
D3D12_SHADER_CACHE_CONTROL_FLAGS
Definition: d3d12.idl:4918
@ D3D12_SHADER_CACHE_SUPPORT_NONE
Definition: d3d12.idl:571
@ D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED
Definition: d3d12.idl:489
const UINT D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT
Definition: d3d12.idl:138
@ D3D12_COMMAND_LIST_SUPPORT_FLAG_NONE
Definition: d3d12.idl:584
D3D12_HEAP_TYPE
Definition: d3d12.idl:780
@ D3D12_HEAP_TYPE_DEFAULT
Definition: d3d12.idl:781
@ D3D12_HEAP_TYPE_READBACK
Definition: d3d12.idl:783
@ D3D12_HEAP_TYPE_UPLOAD
Definition: d3d12.idl:782
@ D3D12_HEAP_TYPE_CUSTOM
Definition: d3d12.idl:784
D3D12_RESIDENCY_FLAGS
Definition: d3d12.idl:637
@ D3D12_RESOURCE_HEAP_TIER_2
Definition: d3d12.idl:499
D3D12_RESIDENCY_PRIORITY
Definition: d3d12.idl:2544
D3D12_FEATURE
Definition: d3d12.idl:2480
@ D3D12_FEATURE_D3D12_OPTIONS9
Definition: d3d12.idl:2509
@ D3D12_FEATURE_D3D12_OPTIONS8
Definition: d3d12.idl:2508
@ D3D12_FEATURE_FORMAT_SUPPORT
Definition: d3d12.idl:2484
@ D3D12_FEATURE_FEATURE_LEVELS
Definition: d3d12.idl:2483
@ D3D12_FEATURE_FORMAT_INFO
Definition: d3d12.idl:2486
@ D3D12_FEATURE_D3D12_OPTIONS16
Definition: d3d12.idl:2516
@ D3D12_FEATURE_D3D12_OPTIONS18
Definition: d3d12.idl:2518
@ D3D12_FEATURE_D3D12_OPTIONS
Definition: d3d12.idl:2481
@ D3D12_FEATURE_D3D12_OPTIONS2
Definition: d3d12.idl:2493
@ D3D12_FEATURE_SHADER_CACHE
Definition: d3d12.idl:2494
@ D3D12_FEATURE_SHADER_MODEL
Definition: d3d12.idl:2488
@ D3D12_FEATURE_EXISTING_HEAPS
Definition: d3d12.idl:2497
@ D3D12_FEATURE_D3D12_OPTIONS3
Definition: d3d12.idl:2496
@ D3D12_FEATURE_ARCHITECTURE
Definition: d3d12.idl:2482
@ D3D12_FEATURE_D3D12_OPTIONS6
Definition: d3d12.idl:2503
@ D3D12_FEATURE_COMMAND_QUEUE_PRIORITY
Definition: d3d12.idl:2495
@ D3D12_FEATURE_D3D12_OPTIONS7
Definition: d3d12.idl:2505
@ D3D12_FEATURE_D3D12_OPTIONS13
Definition: d3d12.idl:2513
@ D3D12_FEATURE_ARCHITECTURE1
Definition: d3d12.idl:2492
@ D3D12_FEATURE_D3D12_OPTIONS11
Definition: d3d12.idl:2511
@ D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS
Definition: d3d12.idl:2485
@ D3D12_FEATURE_D3D12_OPTIONS15
Definition: d3d12.idl:2515
@ D3D12_FEATURE_D3D12_OPTIONS4
Definition: d3d12.idl:2498
@ D3D12_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT
Definition: d3d12.idl:2487
@ D3D12_FEATURE_D3D12_OPTIONS12
Definition: d3d12.idl:2512
@ D3D12_FEATURE_ROOT_SIGNATURE
Definition: d3d12.idl:2491
@ D3D12_FEATURE_D3D12_OPTIONS17
Definition: d3d12.idl:2517
@ D3D12_FEATURE_D3D12_OPTIONS1
Definition: d3d12.idl:2489
@ D3D12_FEATURE_CROSS_NODE
Definition: d3d12.idl:2500
@ D3D12_FEATURE_SERIALIZATION
Definition: d3d12.idl:2499
@ D3D12_FEATURE_D3D12_OPTIONS5
Definition: d3d12.idl:2501
@ D3D12_FEATURE_D3D12_OPTIONS10
Definition: d3d12.idl:2510
@ D3D12_FEATURE_D3D12_OPTIONS14
Definition: d3d12.idl:2514
UINT64 D3D12_GPU_VIRTUAL_ADDRESS
Definition: d3d12.idl:1443
D3D_FEATURE_LEVEL
Definition: d3dcommon.idl:102
@ D3D_FEATURE_LEVEL_12_2
Definition: d3dcommon.idl:113
@ D3D_FEATURE_LEVEL_12_1
Definition: d3dcommon.idl:112
@ D3D_FEATURE_LEVEL_12_0
Definition: d3dcommon.idl:111
@ D3D_FEATURE_LEVEL_11_0
Definition: d3dcommon.idl:109
@ D3D_FEATURE_LEVEL_11_1
Definition: d3dcommon.idl:110
static HRESULT hresult_from_vkd3d_result(int vkd3d_result)
Definition: compiler.c:30
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
struct config_s config
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
INT32 int32_t
Definition: types.h:71
UINT32 uint32_t
Definition: types.h:75
UINT64 uint64_t
Definition: types.h:77
static HINSTANCE instance
Definition: main.c:35
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1971
#define CloseHandle
Definition: compat.h:739
static API_VERSION api_version
Definition: dbghelp.c:832
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
GUID guid
Definition: version.c:147
static void * user_data
Definition: metahost.c:106
char *CDECL getenv(const char *name)
Definition: environ.c:227
unsigned int uintptr_t
Definition: corecrt.h:185
int ptrdiff_t
Definition: corecrt.h:194
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
#define PRIu8
Definition: inttypes.h:82
#define PRIuPTR
Definition: inttypes.h:226
#define PRIx64
Definition: inttypes.h:29
#define PRIu64
Definition: inttypes.h:28
#define UINT_MAX
Definition: limits.h:27
#define va_end(v)
Definition: stdarg.h:28
#define va_start(v, l)
Definition: stdarg.h:26
#define UINT64_MAX
Definition: stdint.h:86
unsigned char uint8_t
Definition: stdint.h:33
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3324
_ACRTIMP int __cdecl strncmp(const char *, const char *, size_t)
Definition: string.c:3335
char * va_list
Definition: vadefs.h:50
return ret
Definition: mutex.c:147
action
Definition: namespace.c:707
#define INFINITE
Definition: serial.h:102
static HRESULT hresult_from_vk_result(VkResult vr)
Definition: swapchain.c:1114
DXGI_FORMAT
Definition: dxgiformat.idl:22
@ DXGI_FORMAT_R16_UINT
Definition: dxgiformat.idl:80
@ DXGI_FORMAT_B8G8R8A8_UNORM
Definition: dxgiformat.idl:110
@ DXGI_FORMAT_R32G32B32A32_SINT
Definition: dxgiformat.idl:27
@ DXGI_FORMAT_R32G32B32A32_UINT
Definition: dxgiformat.idl:26
@ DXGI_FORMAT_B8G8R8A8_TYPELESS
Definition: dxgiformat.idl:113
@ DXGI_FORMAT_UNKNOWN
Definition: dxgiformat.idl:23
@ DXGI_FORMAT_R16_SINT
Definition: dxgiformat.idl:82
@ DXGI_FORMAT_R16G16B16A16_UINT
Definition: dxgiformat.idl:35
@ DXGI_FORMAT_R8G8B8A8_SINT
Definition: dxgiformat.idl:55
@ DXGI_FORMAT_R8G8B8A8_UINT
Definition: dxgiformat.idl:53
@ DXGI_FORMAT_R16G16B16A16_FLOAT
Definition: dxgiformat.idl:33
@ DXGI_FORMAT_R8_UNORM
Definition: dxgiformat.idl:84
@ DXGI_FORMAT_R8G8B8A8_UNORM
Definition: dxgiformat.idl:51
@ DXGI_FORMAT_R16_FLOAT
Definition: dxgiformat.idl:77
@ DXGI_FORMAT_R8_SINT
Definition: dxgiformat.idl:87
@ DXGI_FORMAT_R32_UINT
Definition: dxgiformat.idl:65
@ DXGI_FORMAT_R32G32B32A32_FLOAT
Definition: dxgiformat.idl:25
@ DXGI_FORMAT_R16G16B16A16_SINT
Definition: dxgiformat.idl:37
@ DXGI_FORMAT_R8_UINT
Definition: dxgiformat.idl:85
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
size_t total
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
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
GLdouble s
Definition: gl.h:2039
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei width
Definition: gl.h:1546
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 index
Definition: glext.h:6031
GLenum mode
Definition: glext.h:6217
GLenum GLenum dst
Definition: glext.h:6340
GLboolean GLenum GLenum GLvoid * values
Definition: glext.h:5666
GLbitfield flags
Definition: glext.h:7161
const GLuint * fences
Definition: glext.h:9249
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
GLuint64EXT * result
Definition: glext.h:11304
GLfloat GLfloat p
Definition: glext.h:8902
GLboolean enable
Definition: glext.h:11120
const GLuint const GLclampf * priorities
Definition: glext.h:8103
GLenum GLsizei len
Definition: glext.h:6722
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
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
enum wined3d_data_type data_type
Definition: glsl_shader.c:71
unsigned int UINT
Definition: sysinfo.c:13
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define e
Definition: ke_i.h:82
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
if(dx< 0)
Definition: linetemp.h:194
#define error(str)
Definition: mkdosfs.c:1605
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static const CLSID * objects[]
Definition: apphelp.c:112
static PVOID ptr
Definition: dispmode.c:27
static IPrintDialogCallback callback
Definition: printdlg.c:325
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
UINT blob_size
Definition: effect.c:1153
static RPC_BINDING_HANDLE binding
Definition: server.c:166
INTERNETFEATURELIST feature
Definition: misc.c:1807
DWORD set_flags
Definition: misc.c:1973
#define PACKAGE_NAME
Definition: config.h:826
#define PACKAGE_STRING
Definition: config.h:829
#define min(a, b)
Definition: monoChain.cc:55
int k
Definition: mpi.c:3369
long object_count
Definition: nc_alloc.cpp:37
static unsigned int WINAPI thread_main(void *args)
Definition: nfs41_daemon.c:84
#define uint64_t
Definition: nsiface.idl:62
static HANDLE ACCESS_MASK ULONG attributes
Definition: om.c:94
short WCHAR
Definition: pedump.c:58
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
static unsigned __int64 next
Definition: rand_nt.c:6
const WCHAR * str
#define offsetof(TYPE, MEMBER)
descriptor
Definition: scsi.h:3997
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:236
#define memset(x, y, z)
Definition: compat.h:39
#define SONAME_LIBVULKAN
Definition: config.h:10
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
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
unsigned int vkd3d_shader_cache_incref(struct vkd3d_shader_cache *cache)
Definition: cache.c:101
unsigned int vkd3d_shader_cache_decref(struct vkd3d_shader_cache *cache)
Definition: cache.c:115
int vkd3d_shader_open_cache(struct vkd3d_shader_cache **cache)
Definition: cache.c:82
#define vkd3d_find_struct(c, t)
Definition: device.c:30
void d3d12_device_mark_as_removed(struct d3d12_device *device, HRESULT reason, const char *message,...)
Definition: device.c:5556
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap1(ID3D12Device9 *iface, const D3D12_HEAP_DESC *desc, ID3D12ProtectedResourceSession *protected_session, REFIID iid, void **heap)
Definition: device.c:4998
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateQueryHeap(ID3D12Device9 *iface, const D3D12_QUERY_HEAP_DESC *desc, REFIID iid, void **heap)
Definition: device.c:4811
static const struct vkd3d_debug_option vkd3d_config_options[]
Definition: device.c:549
static uint32_t vkd3d_get_vk_version(void)
Definition: device.c:45
static UINT STDMETHODCALLTYPE d3d12_device_GetDescriptorHandleIncrementSize(ID3D12Device9 *iface, D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type)
Definition: device.c:4167
static void * vkd3d_gpu_va_allocator_dereference_fallback(struct vkd3d_gpu_va_allocator *allocator, D3D12_GPU_VIRTUAL_ADDRESS address)
Definition: device.c:2484
void vkd3d_gpu_va_allocator_free(struct vkd3d_gpu_va_allocator *allocator, D3D12_GPU_VIRTUAL_ADDRESS address)
Definition: device.c:2565
static ULONG STDMETHODCALLTYPE d3d12_cache_session_AddRef(ID3D12ShaderCacheSession *iface)
Definition: device.c:2786
static HRESULT device_worker_stop(struct d3d12_device *device)
Definition: device.c:3072
static const char *const required_device_extensions[]
Definition: device.c:73
#define VKD3D_VA_FALLBACK_BASE
Definition: device.c:2364
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandAllocator(ID3D12Device9 *iface, D3D12_COMMAND_LIST_TYPE type, REFIID riid, void **command_allocator)
Definition: device.c:3199
vkd3d_queue_family
Definition: device.c:2039
@ VKD3D_QUEUE_FAMILY_DIRECT
Definition: device.c:2040
@ VKD3D_QUEUE_FAMILY_COUNT
Definition: device.c:2044
@ VKD3D_QUEUE_FAMILY_COMPUTE
Definition: device.c:2041
@ VKD3D_QUEUE_FAMILY_TRANSFER
Definition: device.c:2042
#define CHECK_FEATURE(name)
static void STDMETHODCALLTYPE d3d12_device_CreateShaderResourceView(ID3D12Device9 *iface, ID3D12Resource *resource, const D3D12_SHADER_RESOURCE_VIEW_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor)
Definition: device.c:4222
static void vkd3d_init_feature_level(struct vkd3d_vulkan_info *vk_info, const VkPhysicalDeviceFeatures *features, const D3D12_FEATURE_DATA_D3D12_OPTIONS *d3d12_options)
Definition: device.c:1358
VkPhysicalDevice vkd3d_get_vk_physical_device(ID3D12Device *device)
Definition: device.c:5708
static void d3d12_resource_allocation_info1_from_vkd3d(D3D12_RESOURCE_ALLOCATION_INFO1 *result, const struct vkd3d_resource_allocation_info *info)
Definition: device.c:4362
static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(ID3D12Device9 *iface, D3D12_FEATURE feature, void *feature_data, UINT feature_data_size)
Definition: device.c:3377
static D3D12_GPU_VIRTUAL_ADDRESS vkd3d_gpu_va_allocator_allocate_fallback(struct vkd3d_gpu_va_allocator *allocator, size_t alignment, uint64_t aligned_size, void *ptr)
Definition: device.c:2392
static D3D12_HEAP_PROPERTIES *STDMETHODCALLTYPE d3d12_device_GetCustomHeapProperties(ID3D12Device9 *iface, D3D12_HEAP_PROPERTIES *heap_properties, UINT node_mask, D3D12_HEAP_TYPE heap_type)
Definition: device.c:4494
static bool has_extension(const VkExtensionProperties *extensions, unsigned int count, const char *extension_name)
Definition: device.c:285
static HRESULT STDMETHODCALLTYPE d3d12_device_SetBackgroundProcessingMode(ID3D12Device9 *iface, D3D12_BACKGROUND_PROCESSING_MODE mode, D3D12_MEASUREMENTS_ACTION action, HANDLE event, BOOL *further_measurements_desired)
Definition: device.c:5117
static HRESULT vkd3d_check_device_extensions(struct d3d12_device *device, const struct vkd3d_device_create_info *create_info, VkExtensionProperties **vk_extensions, uint32_t *vk_extension_count, uint32_t *device_extension_count, bool **user_extension_supported)
Definition: device.c:1528
static void d3d12_device_destroy_vkd3d_queues(struct d3d12_device *device)
Definition: device.c:2056
static D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS STDMETHODCALLTYPE d3d12_device_CheckDriverMatchingIdentifier(ID3D12Device9 *iface, D3D12_SERIALIZED_DATA_TYPE data_type, const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *identifier)
Definition: device.c:5109
static void vkd3d_destroy_instance(struct vkd3d_instance *instance)
Definition: device.c:766
static void * device_worker_main(void *arg)
Definition: device.c:5406
static const struct ID3D12ShaderCacheSessionVtbl d3d12_cache_session_vtbl
Definition: device.c:2933
static HRESULT STDMETHODCALLTYPE d3d12_device_SetStablePowerState(ID3D12Device9 *iface, BOOL enable)
Definition: device.c:4827
static D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE d3d12_device_GetResourceAllocationInfo1(ID3D12Device9 *iface, D3D12_RESOURCE_ALLOCATION_INFO *info, UINT visible_mask, UINT count, const D3D12_RESOURCE_DESC *resource_descs, D3D12_RESOURCE_ALLOCATION_INFO1 *info1)
Definition: device.c:5031
static void vkd3d_vk_descriptor_heap_layouts_cleanup(struct d3d12_device *device)
Definition: device.c:190
static HRESULT vkd3d_vk_descriptor_heap_layouts_init(struct d3d12_device *device)
Definition: device.c:200
static HRESULT vkd3d_instance_init(struct vkd3d_instance *instance, const struct vkd3d_instance_create_info *create_info)
Definition: device.c:572
static struct vkd3d_mutex cache_list_mutex
Definition: device.c:2751
static unsigned int vkd3d_append_extension(const char *extensions[], unsigned int extension_count, const char *extension_name)
Definition: device.c:371
static HRESULT STDMETHODCALLTYPE d3d12_device_SetName(ID3D12Device9 *iface, const WCHAR *name)
Definition: device.c:3165
static void d3d12_cache_session_destroy(struct d3d12_cache_session *session)
Definition: device.c:2796
static HRESULT vkd3d_init_vk_global_procs(struct vkd3d_instance *instance, PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr)
Definition: device.c:482
static void STDMETHODCALLTYPE d3d12_device_GetCopyableFootprints1(ID3D12Device9 *iface, const D3D12_RESOURCE_DESC1 *desc, UINT first_sub_resource, UINT sub_resource_count, UINT64 base_offset, D3D12_PLACED_SUBRESOURCE_FOOTPRINT *layouts, UINT *row_counts, UINT64 *row_sizes, UINT64 *total_bytes)
Definition: device.c:5217
static HRESULT STDMETHODCALLTYPE d3d12_device_SetEventOnMultipleFenceCompletion(ID3D12Device9 *iface, ID3D12Fence *const *fences, const UINT64 *values, UINT fence_count, D3D12_MULTIPLE_FENCE_WAIT_FLAGS flags, HANDLE event)
Definition: device.c:4892
static HRESULT d3d12_device_check_multisample_quality_levels(struct d3d12_device *device, D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS *data)
Definition: device.c:3294
static struct d3d12_cache_session * impl_from_ID3D12ShaderCacheSession(ID3D12ShaderCacheSession *iface)
Definition: device.c:2754
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateProtectedResourceSession(ID3D12Device9 *iface, const D3D12_PROTECTED_RESOURCE_SESSION_DESC *desc, REFIID iid, void **session)
Definition: device.c:4962
static void vkd3d_trace_physical_device_properties(const VkPhysicalDeviceProperties *properties)
Definition: device.c:933
static HRESULT STDMETHODCALLTYPE d3d12_cache_session_SetPrivateData(ID3D12ShaderCacheSession *iface, REFGUID guid, UINT data_size, const void *data)
Definition: device.c:2836
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateGraphicsPipelineState(ID3D12Device9 *iface, const D3D12_GRAPHICS_PIPELINE_STATE_DESC *desc, REFIID riid, void **pipeline_state)
Definition: device.c:3216
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap(ID3D12Device9 *iface, const D3D12_HEAP_DESC *desc, REFIID iid, void **heap)
Definition: device.c:4564
static void STDMETHODCALLTYPE d3d12_device_CreateRenderTargetView(ID3D12Device9 *iface, ID3D12Resource *resource, const D3D12_RENDER_TARGET_VIEW_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor)
Definition: device.c:4251
static void vkd3d_desc_object_cache_init(struct vkd3d_desc_object_cache *cache, size_t size)
Definition: device.c:2715
static HRESULT STDMETHODCALLTYPE d3d12_device_Evict(ID3D12Device9 *iface, UINT object_count, ID3D12Pageable *const *objects)
Definition: device.c:4680
static unsigned int vkd3d_check_extensions(const VkExtensionProperties *extensions, unsigned int count, const char *const *required_extensions, unsigned int required_extension_count, const struct vkd3d_optional_extension_info *optional_extensions, unsigned int optional_extension_count, const char *const *user_extensions, unsigned int user_extension_count, const char *const *optional_user_extensions, unsigned int optional_user_extension_count, bool *user_extension_supported, struct vkd3d_vulkan_info *vulkan_info, const char *extension_type, bool is_debug_enabled)
Definition: device.c:305
static ULONG STDMETHODCALLTYPE d3d12_device_Release(ID3D12Device9 *iface)
Definition: device.c:3094
static void * vkd3d_gpu_va_allocator_dereference_slab(struct vkd3d_gpu_va_allocator *allocator, D3D12_GPU_VIRTUAL_ADDRESS address)
Definition: device.c:2445
static void d3d12_device_get_resource_allocation_info(struct d3d12_device *device, D3D12_RESOURCE_ALLOCATION_INFO1 *infos1, unsigned int count, const D3D12_RESOURCE_DESC *resource_descs, D3D12_RESOURCE_ALLOCATION_INFO *result)
Definition: device.c:4448
static HRESULT STDMETHODCALLTYPE d3d12_cache_session_FindValue(ID3D12ShaderCacheSession *iface, const void *key, UINT key_size, void *value, UINT *value_size)
Definition: device.c:2876
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandList(ID3D12Device9 *iface, UINT node_mask, D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator *command_allocator, ID3D12PipelineState *initial_pipeline_state, REFIID riid, void **command_list)
Definition: device.c:3250
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateReservedResource1(ID3D12Device9 *iface, const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, ID3D12ProtectedResourceSession *protected_session, REFIID iid, void **resource)
Definition: device.c:5018
void * vkd3d_gpu_va_allocator_dereference(struct vkd3d_gpu_va_allocator *allocator, D3D12_GPU_VIRTUAL_ADDRESS address)
Definition: device.c:2495
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateStateObject(ID3D12Device9 *iface, const D3D12_STATE_OBJECT_DESC *desc, REFIID iid, void **state_object)
Definition: device.c:5094
VkInstance vkd3d_instance_get_vk_instance(struct vkd3d_instance *instance)
Definition: device.c:803
#define VKD3D_VA_SLAB_BASE
Definition: device.c:2365
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateDescriptorHeap(ID3D12Device9 *iface, const D3D12_DESCRIPTOR_HEAP_DESC *desc, REFIID riid, void **descriptor_heap)
Definition: device.c:4150
static bool d3d12_device_environment_is_vulkan_min_1_1(struct d3d12_device *device)
Definition: device.c:808
static HRESULT STDMETHODCALLTYPE d3d12_device_AddToStateObject(ID3D12Device9 *iface, const D3D12_STATE_OBJECT_DESC *addition, ID3D12StateObject *state_object_to_grow_from, REFIID riid, void **new_state_object)
Definition: device.c:5128
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource1(ID3D12Device9 *iface, const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags, const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, ID3D12ProtectedResourceSession *protected_session, REFIID iid, void **resource)
Definition: device.c:4970
static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateData(ID3D12Device9 *iface, REFGUID guid, UINT data_size, const void *data)
Definition: device.c:3144
#define VKD3D_VA_SLAB_COUNT
Definition: device.c:2368
static HRESULT STDMETHODCALLTYPE d3d12_device_EnqueueMakeResident(ID3D12Device9 *iface, D3D12_RESIDENCY_FLAGS flags, UINT num_objects, ID3D12Pageable *const *objects, ID3D12Fence *fence, UINT64 fence_value)
Definition: device.c:4941
static HRESULT STDMETHODCALLTYPE d3d12_device_SetResidencyPriority(ID3D12Device9 *iface, UINT object_count, ID3D12Pageable *const *objects, const D3D12_RESIDENCY_PRIORITY *priorities)
Definition: device.c:4902
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource(ID3D12Device9 *iface, const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags, const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource)
Definition: device.c:4537
static void device_init_descriptor_pool_sizes(struct d3d12_device *device)
Definition: device.c:2677
ULONG vkd3d_instance_decref(struct vkd3d_instance *instance)
Definition: device.c:791
static UINT STDMETHODCALLTYPE d3d12_device_GetNodeCount(ID3D12Device9 *iface)
Definition: device.c:3175
#define CHECK_MIN_REQUIREMENT(name, value)
#define VKD3D_MAX_UAV_CLEAR_DESCRIPTORS_PER_TYPE
Definition: device.c:22
static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePipelineState(ID3D12Device9 *iface, const D3D12_PIPELINE_STATE_STREAM_DESC *desc, REFIID iid, void **pipeline_state)
Definition: device.c:4910
struct vkd3d_instance * vkd3d_instance_from_device(ID3D12Device *device)
Definition: device.c:5715
static D3D12_GPU_VIRTUAL_ADDRESS vkd3d_gpu_va_allocator_allocate_slab(struct vkd3d_gpu_va_allocator *allocator, uint64_t aligned_size, void *ptr)
Definition: device.c:2370
static HRESULT d3d12_device_init_pipeline_cache(struct d3d12_device *device)
Definition: device.c:2331
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateComputePipelineState(ID3D12Device9 *iface, const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc, REFIID riid, void **pipeline_state)
Definition: device.c:3233
static HRESULT STDMETHODCALLTYPE d3d12_cache_session_GetDevice(ID3D12ShaderCacheSession *iface, REFIID iid, void **device)
Definition: device.c:2866
static void STDMETHODCALLTYPE d3d12_device_CreateSamplerFeedbackUnorderedAccessView(ID3D12Device9 *iface, ID3D12Resource *target_resource, ID3D12Resource *feedback_resource, D3D12_CPU_DESCRIPTOR_HANDLE descriptor)
Definition: device.c:5210
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateFence(ID3D12Device9 *iface, UINT64 initial_value, D3D12_FENCE_FLAGS flags, REFIID riid, void **fence)
Definition: device.c:4689
static void STDMETHODCALLTYPE d3d12_device_CopyDescriptors(ID3D12Device9 *iface, UINT dst_descriptor_range_count, const D3D12_CPU_DESCRIPTOR_HANDLE *dst_descriptor_range_offsets, const UINT *dst_descriptor_range_sizes, UINT src_descriptor_range_count, const D3D12_CPU_DESCRIPTOR_HANDLE *src_descriptor_range_offsets, const UINT *src_descriptor_range_sizes, D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type)
Definition: device.c:4285
static HRESULT vkd3d_select_physical_device(struct vkd3d_instance *instance, unsigned int device_index, VkPhysicalDevice *selected_device)
Definition: device.c:1969
static HRESULT STDMETHODCALLTYPE d3d12_device_OpenSharedHandle(ID3D12Device9 *iface, HANDLE handle, REFIID riid, void **object)
Definition: device.c:4642
#define VKD3D_VA_SLAB_SIZE
Definition: device.c:2367
static void STDMETHODCALLTYPE d3d12_device_CreateUnorderedAccessView(ID3D12Device9 *iface, ID3D12Resource *resource, ID3D12Resource *counter_resource, const D3D12_UNORDERED_ACCESS_VIEW_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor)
Definition: device.c:4236
static void vkd3d_chain_physical_device_info_structures(struct vkd3d_physical_device_info *info, struct d3d12_device *device)
Definition: device.c:842
static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePipelineLibrary(ID3D12Device9 *iface, const void *blob, SIZE_T blob_size, REFIID iid, void **lib)
Definition: device.c:4883
static void STDMETHODCALLTYPE d3d12_device_CreateConstantBufferView(ID3D12Device9 *iface, const D3D12_CONSTANT_BUFFER_VIEW_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor)
Definition: device.c:4210
static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromFileMapping(ID3D12Device9 *iface, HANDLE file_mapping, REFIID iid, void **heap)
Definition: device.c:4933
static HRESULT d3d12_device_init(struct d3d12_device *device, struct vkd3d_instance *instance, const struct vkd3d_device_create_info *create_info)
Definition: device.c:5440
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandList1(ID3D12Device9 *iface, UINT node_mask, D3D12_COMMAND_LIST_TYPE type, D3D12_COMMAND_LIST_FLAGS flags, REFIID iid, void **command_list)
Definition: device.c:4952
static bool d3d12_is_64k_msaa_supported(struct d3d12_device *device)
Definition: device.c:2207
static D3D12_SHADER_CACHE_SESSION_DESC *STDMETHODCALLTYPE d3d12_cache_session_GetDesc(ID3D12ShaderCacheSession *iface, D3D12_SHADER_CACHE_SESSION_DESC *desc)
Definition: device.c:2923
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateProtectedResourceSession1(ID3D12Device9 *iface, const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *desc, REFIID riid, void **session)
Definition: device.c:5138
HRESULT d3d12_device_add_descriptor_heap(struct d3d12_device *device, struct d3d12_descriptor_heap *heap)
Definition: device.c:5569
static void vkd3d_gpu_va_allocator_cleanup(struct vkd3d_gpu_va_allocator *allocator)
Definition: device.c:2608
static struct d3d12_device * impl_from_ID3D12Device9(ID3D12Device9 *iface)
Definition: device.c:3028
static void vkd3d_override_caps(struct d3d12_device *device)
Definition: device.c:1583
static HRESULT STDMETHODCALLTYPE d3d12_cache_session_StoreValue(ID3D12ShaderCacheSession *iface, const void *key, UINT key_size, const void *value, UINT value_size)
Definition: device.c:2899
static D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE d3d12_device_GetResourceAllocationInfo(ID3D12Device9 *iface, D3D12_RESOURCE_ALLOCATION_INFO *info, UINT visible_mask, UINT count, const D3D12_RESOURCE_DESC *resource_descs)
Definition: device.c:4478
static HRESULT STDMETHODCALLTYPE d3d12_cache_session_QueryInterface(ID3D12ShaderCacheSession *iface, REFIID iid, void **object)
Definition: device.c:2759
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateMetaCommand(ID3D12Device9 *iface, REFGUID command_id, UINT node_mask, const void *parameters_data, SIZE_T data_size_in_bytes, REFIID iid, void **meta_command)
Definition: device.c:5082
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 HRESULT vkd3d_create_vk_descriptor_heap_layout(struct d3d12_device *device, unsigned int index)
Definition: device.c:119
static HRESULT STDMETHODCALLTYPE d3d12_device_GetDeviceRemovedReason(ID3D12Device9 *iface)
Definition: device.c:4705
static void STDMETHODCALLTYPE d3d12_device_GetRaytracingAccelerationStructurePrebuildInfo(ID3D12Device9 *iface, const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *desc, D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *info)
Definition: device.c:5102
static HRESULT vkd3d_init_instance_caps(struct vkd3d_instance *instance, const struct vkd3d_instance_create_info *create_info, uint32_t *instance_extension_count, bool **user_extension_supported)
Definition: device.c:425
static const struct vkd3d_optional_extension_info optional_instance_extensions[]
Definition: device.c:65
#define CHECK_MAX_REQUIREMENT(name, value)
static HRESULT STDMETHODCALLTYPE d3d12_device_MakeResident(ID3D12Device9 *iface, UINT object_count, ID3D12Pageable *const *objects)
Definition: device.c:4662
VkDevice vkd3d_get_vk_device(ID3D12Device *device)
Definition: device.c:5701
static ULONG STDMETHODCALLTYPE d3d12_cache_session_Release(ID3D12ShaderCacheSession *iface)
Definition: device.c:2813
static void vkd3d_trace_physical_device(VkPhysicalDevice device, const struct vkd3d_physical_device_info *info, const struct vkd3d_vk_instance_procs *vk_procs)
Definition: device.c:947
static VkBool32 VKAPI_PTR vkd3d_debug_report_callback(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT object_type, uint64_t object, size_t location, int32_t message_code, const char *layer_prefix, const char *message, void *user_data)
Definition: device.c:519
static int vkd3d_gpu_va_allocation_compare(const void *k, const void *e)
Definition: device.c:2472
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandQueue1(ID3D12Device9 *iface, const D3D12_COMMAND_QUEUE_DESC *desc, REFIID creator_id, REFIID iid, void **command_queue)
Definition: device.c:5296
static void vkd3d_trace_physical_device_limits(const struct vkd3d_physical_device_info *info)
Definition: device.c:990
static const void * vkd3d_find_struct_(const struct vkd3d_struct *chain, enum vkd3d_structure_type type)
Definition: device.c:31
struct d3d12_device * unsafe_impl_from_ID3D12Device9(ID3D12Device9 *iface)
Definition: device.c:5398
static HRESULT vkd3d_create_vk_device(struct d3d12_device *device, const struct vkd3d_device_create_info *create_info)
Definition: device.c:2229
static void vkd3d_init_debug_report(struct vkd3d_instance *instance)
Definition: device.c:527
static void vkd3d_gpu_va_allocator_free_slab(struct vkd3d_gpu_va_allocator *allocator, D3D12_GPU_VIRTUAL_ADDRESS address)
Definition: device.c:2519
static ULONG STDMETHODCALLTYPE d3d12_device_AddRef(ID3D12Device9 *iface)
Definition: device.c:3062
static HRESULT STDMETHODCALLTYPE d3d12_cache_session_SetName(ID3D12ShaderCacheSession *iface, const WCHAR *name)
Definition: device.c:2856
static void vkd3d_restrict_format_support_for_feature_level(D3D12_FEATURE_DATA_FORMAT_SUPPORT *format_support)
Definition: device.c:3272
static void d3d12_device_get_copyable_footprints(struct d3d12_device *device, const D3D12_RESOURCE_DESC1 *desc, unsigned int first_sub_resource, unsigned int sub_resource_count, uint64_t base_offset, D3D12_PLACED_SUBRESOURCE_FOOTPRINT *layouts, UINT *row_counts, UINT64 *row_sizes, UINT64 *total_bytes)
Definition: device.c:4714
static HRESULT vkd3d_select_queues(const struct vkd3d_instance *vkd3d_instance, VkPhysicalDevice physical_device, struct vkd3d_device_queue_info *info)
Definition: device.c:2121
static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommandParameters(ID3D12Device9 *iface, REFGUID command_id, D3D12_META_COMMAND_PARAMETER_STAGE stage, UINT *size_in_bytes, UINT *parameter_count, D3D12_META_COMMAND_PARAMETER_DESC *parameter_desc)
Definition: device.c:5070
static void STDMETHODCALLTYPE d3d12_device_CreateDepthStencilView(ID3D12Device9 *iface, ID3D12Resource *resource, const D3D12_DEPTH_STENCIL_VIEW_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor)
Definition: device.c:4262
static unsigned int get_spec_version(const VkExtensionProperties *extensions, unsigned int count, const char *extension_name)
Definition: device.c:262
static void STDMETHODCALLTYPE d3d12_device_GetCopyableFootprints(ID3D12Device9 *iface, const D3D12_RESOURCE_DESC *desc, UINT first_sub_resource, UINT sub_resource_count, UINT64 base_offset, D3D12_PLACED_SUBRESOURCE_FOOTPRINT *layouts, UINT *row_counts, UINT64 *row_sizes, UINT64 *total_bytes)
Definition: device.c:4792
static bool is_extension_disabled(const char *extension_name)
Definition: device.c:275
static void vkd3d_physical_device_info_init(struct vkd3d_physical_device_info *info, struct d3d12_device *device)
Definition: device.c:890
static HRESULT STDMETHODCALLTYPE d3d12_device_ShaderCacheControl(ID3D12Device9 *iface, D3D12_SHADER_CACHE_KIND_FLAGS kinds, D3D12_SHADER_CACHE_CONTROL_FLAGS control)
Definition: device.c:5288
HRESULT vkd3d_create_instance(const struct vkd3d_instance_create_info *create_info, struct vkd3d_instance **instance)
Definition: device.c:734
HRESULT vkd3d_join_thread(struct vkd3d_instance *instance, union vkd3d_thread_handle *thread)
Definition: device.c:5663
static void STDMETHODCALLTYPE d3d12_device_CopyDescriptorsSimple(ID3D12Device9 *iface, UINT descriptor_count, const D3D12_CPU_DESCRIPTOR_HANDLE dst_descriptor_range_offset, const D3D12_CPU_DESCRIPTOR_HANDLE src_descriptor_range_offset, D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type)
Definition: device.c:4348
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandQueue(ID3D12Device9 *iface, const D3D12_COMMAND_QUEUE_DESC *desc, REFIID riid, void **command_queue)
Definition: device.c:3182
static void STDMETHODCALLTYPE d3d12_cache_session_SetDeleteOnDestroy(ID3D12ShaderCacheSession *iface)
Definition: device.c:2918
static struct list cache_list
Definition: device.c:2752
static bool d3d12_device_supports_typed_uav_load_additional_formats(const struct d3d12_device *device)
Definition: device.c:1489
static uint64_t vkd3d_init_config_flags(void)
Definition: device.c:555
static void vkd3d_trace_physical_device_features(const struct vkd3d_physical_device_info *info)
Definition: device.c:1204
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateLifetimeTracker(ID3D12Device9 *iface, ID3D12LifetimeOwner *owner, REFIID iid, void **tracker)
Definition: device.c:5048
static bool have_vk_time_domain(VkTimeDomainEXT *domains, unsigned int count, VkTimeDomainEXT domain)
Definition: device.c:2617
static void d3d12_device_destroy_pipeline_cache(struct d3d12_device *device)
Definition: device.c:2354
static float queue_priorities[]
Definition: device.c:2119
static void vkd3d_desc_object_cache_cleanup(struct vkd3d_desc_object_cache *cache)
Definition: device.c:2721
static const struct vkd3d_optional_extension_info optional_device_extensions[]
Definition: device.c:87
static void vkd3d_time_domains_init(struct d3d12_device *device)
Definition: device.c:2628
static const struct ID3D12Device9Vtbl d3d12_device_vtbl
Definition: device.c:5306
#define VKD3D_VA_SLAB_SIZE_SHIFT
Definition: device.c:2366
bool d3d12_device_is_uma(struct d3d12_device *device, bool *coherent)
Definition: device.c:3358
static HRESULT STDMETHODCALLTYPE d3d12_cache_session_GetPrivateData(ID3D12ShaderCacheSession *iface, REFGUID guid, UINT *data_size, void *data)
Definition: device.c:2826
static LUID *STDMETHODCALLTYPE d3d12_device_GetAdapterLuid(ID3D12Device9 *iface, LUID *luid)
Definition: device.c:4872
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateRootSignature(ID3D12Device9 *iface, UINT node_mask, const void *bytecode, SIZE_T bytecode_length, REFIID riid, void **root_signature)
Definition: device.c:4190
ULONG vkd3d_instance_incref(struct vkd3d_instance *instance)
Definition: device.c:782
static HRESULT STDMETHODCALLTYPE d3d12_device_OpenSharedHandleByName(ID3D12Device9 *iface, const WCHAR *name, DWORD access, HANDLE *handle)
Definition: device.c:4651
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource2(ID3D12Device9 *iface, 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, REFIID iid, void **resource)
Definition: device.c:5162
static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateDataInterface(ID3D12Device9 *iface, REFGUID guid, const IUnknown *data)
Definition: device.c:3155
static unsigned int vkd3d_enable_extensions(const char *extensions[], const char *const *required_extensions, unsigned int required_extension_count, const struct vkd3d_optional_extension_info *optional_extensions, unsigned int optional_extension_count, const char *const *user_extensions, unsigned int user_extension_count, const char *const *optional_user_extensions, unsigned int optional_user_extension_count, bool *user_extension_supported, const struct vkd3d_vulkan_info *vulkan_info)
Definition: device.c:387
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandSignature(ID3D12Device9 *iface, const D3D12_COMMAND_SIGNATURE_DESC *desc, ID3D12RootSignature *root_signature, REFIID iid, void **command_signature)
Definition: device.c:4834
static void vkd3d_device_descriptor_limits_init(struct vkd3d_device_descriptor_limits *limits, const VkPhysicalDeviceLimits *device_limits)
Definition: device.c:1449
static void STDMETHODCALLTYPE d3d12_device_CreateSampler(ID3D12Device9 *iface, const D3D12_SAMPLER_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor)
Definition: device.c:4273
static void d3d12_device_get_resource1_allocation_info(struct d3d12_device *device, D3D12_RESOURCE_ALLOCATION_INFO1 *infos1, unsigned int count, const D3D12_RESOURCE_DESC1 *resource_descs, D3D12_RESOURCE_ALLOCATION_INFO *result)
Definition: device.c:4370
HRESULT vkd3d_create_thread(struct vkd3d_instance *instance, PFN_vkd3d_thread thread_main, void *data, union vkd3d_thread_handle *thread)
Definition: device.c:5620
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateShaderCacheSession(ID3D12Device9 *iface, const D3D12_SHADER_CACHE_SESSION_DESC *desc, REFIID iid, void **session)
Definition: device.c:5233
static HRESULT d3d12_cache_session_init(struct d3d12_cache_session *session, struct d3d12_device *device, const D3D12_SHADER_CACHE_SESSION_DESC *desc)
Definition: device.c:2953
static void vkd3d_gpu_va_allocator_free_fallback(struct vkd3d_gpu_va_allocator *allocator, D3D12_GPU_VIRTUAL_ADDRESS address)
Definition: device.c:2543
static HRESULT STDMETHODCALLTYPE d3d12_device_GetPrivateData(ID3D12Device9 *iface, REFGUID guid, UINT *data_size, void *data)
Definition: device.c:3133
void d3d12_device_remove_descriptor_heap(struct d3d12_device *device, struct d3d12_descriptor_heap *heap)
Definition: device.c:5586
static void STDMETHODCALLTYPE d3d12_device_GetResourceTiling(ID3D12Device9 *iface, ID3D12Resource *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: device.c:4852
static HRESULT vkd3d_init_device_caps(struct d3d12_device *device, const struct vkd3d_device_create_info *create_info, struct vkd3d_physical_device_info *physical_device_info, uint32_t *device_extension_count, bool **user_extension_supported)
Definition: device.c:1688
static HRESULT STDMETHODCALLTYPE d3d12_cache_session_SetPrivateDataInterface(ID3D12ShaderCacheSession *iface, REFGUID guid, const IUnknown *data)
Definition: device.c:2846
static HRESULT d3d12_device_create_vkd3d_queues(struct d3d12_device *device, const struct vkd3d_device_queue_info *queue_info)
Definition: device.c:2071
#define VK_EXTENSION(name, member)
Definition: device.c:60
static void STDMETHODCALLTYPE d3d12_device_RemoveDevice(ID3D12Device9 *iface)
Definition: device.c:5056
IUnknown * vkd3d_get_device_parent(ID3D12Device *device)
Definition: device.c:5694
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateSharedHandle(ID3D12Device9 *iface, ID3D12DeviceChild *object, const SECURITY_ATTRIBUTES *attributes, DWORD access, const WCHAR *name, HANDLE *handle)
Definition: device.c:4630
static HRESULT STDMETHODCALLTYPE d3d12_device_CreateReservedResource(ID3D12Device9 *iface, const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource)
Definition: device.c:4609
static D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE d3d12_device_GetResourceAllocationInfo2(ID3D12Device9 *iface, D3D12_RESOURCE_ALLOCATION_INFO *info, UINT visible_mask, UINT count, const D3D12_RESOURCE_DESC1 *resource_descs, D3D12_RESOURCE_ALLOCATION_INFO1 *info1)
Definition: device.c:5146
static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommands(ID3D12Device9 *iface, UINT *num_meta_commands, D3D12_META_COMMAND_DESC *command_desc)
Definition: device.c:5061
static HRESULT STDMETHODCALLTYPE d3d12_device_QueryInterface(ID3D12Device9 *iface, REFIID riid, void **object)
Definition: device.c:3033
static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromAddress(ID3D12Device9 *iface, const void *address, REFIID iid, void **heap)
Definition: device.c:4925
#define VKD3D_DEFAULT_HOST_TICKS_PER_SECOND
Definition: device.c:570
static bool vkd3d_gpu_va_allocator_init(struct vkd3d_gpu_va_allocator *allocator)
Definition: device.c:2581
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 HRESULT STDMETHODCALLTYPE d3d12_device_CreatePlacedResource(ID3D12Device9 *iface, ID3D12Heap *heap, UINT64 heap_offset, const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource)
Definition: device.c:4583
#define VK_DEBUG_EXTENSION(name, member)
Definition: device.c:62
static void vkd3d_device_vk_heaps_descriptor_limits_init(struct vkd3d_device_descriptor_limits *limits, const VkPhysicalDeviceDescriptorIndexingPropertiesEXT *properties)
Definition: device.c:1459
static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePlacedResource1(ID3D12Device9 *iface, ID3D12Heap *heap, UINT64 heap_offset, const D3D12_RESOURCE_DESC1 *resource_desc, D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource)
Definition: device.c:5186
void d3d12_desc_create_cbv(struct d3d12_desc *descriptor, struct d3d12_device *device, const D3D12_CONSTANT_BUFFER_VIEW_DESC *desc)
Definition: resource.c:3140
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
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_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
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
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
void d3d12_desc_flush_vk_heap_updates_locked(struct d3d12_descriptor_heap *descriptor_heap, struct d3d12_device *device)
Definition: resource.c:2639
HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC1 *desc, struct d3d12_device *device)
Definition: resource.c:1850
void vkd3d_destroy_null_resources(struct vkd3d_null_resources *null_resources, struct d3d12_device *device)
Definition: resource.c:4965
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 *subresource_tiling_count, UINT first_subresource_tiling, D3D12_SUBRESOURCE_TILING *subresource_tilings)
Definition: resource.c:1085
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
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
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
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
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
struct d3d12_resource * unsafe_impl_from_ID3D12Resource(ID3D12Resource *iface)
Definition: resource.c:1770
void d3d12_desc_write_atomic(struct d3d12_desc *dst, const struct d3d12_desc *src, struct d3d12_device *device)
Definition: resource.c:2710
HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources, struct d3d12_device *device)
Definition: resource.c:4846
VkSampleCountFlagBits vk_samples_from_sample_count(unsigned int sample_count)
Definition: resource.c:618
void d3d12_desc_create_sampler(struct d3d12_desc *sampler, struct d3d12_device *device, const D3D12_SAMPLER_DESC *desc)
Definition: resource.c:3780
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
void vkd3d_render_pass_cache_init(struct vkd3d_render_pass_cache *cache)
Definition: state.c:1838
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
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 vkd3d_uav_clear_state_init(struct vkd3d_uav_clear_state *state, struct d3d12_device *device)
Definition: state.c:4068
void vkd3d_uav_clear_state_cleanup(struct vkd3d_uav_clear_state *state, struct d3d12_device *device)
Definition: state.c:4054
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
void vkd3d_render_pass_cache_cleanup(struct vkd3d_render_pass_cache *cache, struct d3d12_device *device)
Definition: state.c:1845
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
const char * debug_vk_memory_heap_flags(VkMemoryHeapFlags flags)
Definition: utils.c:728
HRESULT return_interface(void *iface, REFIID iface_iid, REFIID requested_iid, void **object)
Definition: utils.c:628
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
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
const char * debug_vk_memory_property_flags(VkMemoryPropertyFlags flags)
Definition: utils.c:745
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
HRESULT vkd3d_set_private_data_interface(struct vkd3d_private_store *store, const GUID *tag, const IUnknown *object)
Definition: utils.c:1046
HRESULT vkd3d_load_vk_global_procs(struct vkd3d_vk_global_procs *procs, PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr)
Definition: utils.c:811
bool vkd3d_get_program_name(char program_name[PATH_MAX])
Definition: utils.c:931
HRESULT hresult_from_errno(int rc)
Definition: utils.c:768
const struct vkd3d_format * vkd3d_get_format(const struct d3d12_device *device, DXGI_FORMAT dxgi_format, bool depth_stencil)
Definition: utils.c:442
HRESULT vkd3d_init_format_info(struct d3d12_device *device)
Definition: utils.c:401
const char * debug_vk_queue_flags(VkQueueFlags flags)
Definition: utils.c:704
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
void vkd3d_cleanup_format_info(struct d3d12_device *device)
Definition: utils.c:414
const char * debug_cpu_handle(D3D12_CPU_DESCRIPTOR_HANDLE handle)
Definition: utils.c:645
HRESULT vkd3d_get_private_data(struct vkd3d_private_store *store, const GUID *tag, unsigned int *out_size, void *out)
Definition: utils.c:994
#define args
Definition: format.c:66
#define minor(rdev)
Definition: propsheet.cpp:929
#define major(rdev)
Definition: propsheet.cpp:928
#define TRACE(s)
Definition: solgame.cpp:4
D3D12_RESOURCE_BINDING_TIER ResourceBindingTier
Definition: d3d12.idl:744
D3D12_TILED_RESOURCES_TIER TiledResourcesTier
Definition: d3d12.idl:743
D3D12_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier
Definition: d3d12.idl:748
D3D12_FORMAT_SUPPORT2 Support2
Definition: d3d12.idl:761
D3D12_FORMAT_SUPPORT1 Support1
Definition: d3d12.idl:760
D3D12_CPU_PAGE_PROPERTY CPUPageProperty
Definition: d3d12.idl:805
D3D12_HEAP_TYPE Type
Definition: d3d12.idl:804
D3D12_MEMORY_POOL MemoryPoolPreference
Definition: d3d12.idl:806
D3D12_SUBRESOURCE_FOOTPRINT Footprint
Definition: d3d12.idl:1082
uint32_t engineVersion
Definition: vulkan.h:7346
const char * pApplicationName
Definition: vulkan.h:7343
const void * pNext
Definition: vulkan.h:7342
VkStructureType sType
Definition: vulkan.h:7341
uint32_t apiVersion
Definition: vulkan.h:7347
const char * pEngineName
Definition: vulkan.h:7345
uint32_t applicationVersion
Definition: vulkan.h:7344
uint32_t descriptorCount
Definition: vulkan.h:8280
VkDescriptorType type
Definition: vulkan.h:8279
const VkDescriptorBindingFlags * pBindingFlags
Definition: vulkan.h:8314
const VkDescriptorSetLayoutBinding * pBindings
Definition: vulkan.h:8324
VkDescriptorSetLayoutCreateFlags flags
Definition: vulkan.h:8322
uint32_t queueFamilyIndex
Definition: vulkan.h:8544
VkDeviceQueueCreateFlags flags
Definition: vulkan.h:8543
const float * pQueuePriorities
Definition: vulkan.h:8546
VkStructureType sType
Definition: vulkan.h:8541
const void * pNext
Definition: vulkan.h:8542
uint32_t specVersion
Definition: vulkan.h:8661
VkFormatFeatureFlags linearTilingFeatures
Definition: vulkan.h:8745
VkFormatFeatureFlags optimalTilingFeatures
Definition: vulkan.h:8746
VkFormatFeatureFlags bufferFeatures
Definition: vulkan.h:8747
VkSampleCountFlags sampleCounts
Definition: vulkan.h:9003
const char *const * ppEnabledExtensionNames
Definition: vulkan.h:9251
VkStructureType sType
Definition: vulkan.h:9244
uint32_t enabledExtensionCount
Definition: vulkan.h:9250
const void * pNext
Definition: vulkan.h:9245
const VkApplicationInfo * pApplicationInfo
Definition: vulkan.h:9247
const char *const * ppEnabledLayerNames
Definition: vulkan.h:9249
uint32_t enabledLayerCount
Definition: vulkan.h:9248
VkInstanceCreateFlags flags
Definition: vulkan.h:9246
const VkMutableDescriptorTypeListEXT * pMutableDescriptorTypeLists
Definition: vulkan.h:16542
const VkDescriptorType * pDescriptorTypes
Definition: vulkan.h:9567
VkPhysicalDeviceFeatures features
Definition: vulkan.h:10624
VkBool32 samplerAnisotropy
Definition: vulkan.h:10582
VkBool32 shaderStorageBufferArrayDynamicIndexing
Definition: vulkan.h:10598
VkBool32 shaderCullDistance
Definition: vulkan.h:10601
VkBool32 shaderClipDistance
Definition: vulkan.h:10600
VkBool32 vertexPipelineStoresAndAtomics
Definition: vulkan.h:10588
VkBool32 shaderResourceMinLod
Definition: vulkan.h:10606
VkBool32 sampleRateShading
Definition: vulkan.h:10569
VkBool32 sparseResidency2Samples
Definition: vulkan.h:10611
VkBool32 textureCompressionASTC_LDR
Definition: vulkan.h:10584
VkBool32 shaderStorageImageMultisample
Definition: vulkan.h:10593
VkBool32 variableMultisampleRate
Definition: vulkan.h:10616
VkBool32 sparseResidency16Samples
Definition: vulkan.h:10614
VkBool32 multiDrawIndirect
Definition: vulkan.h:10572
VkBool32 tessellationShader
Definition: vulkan.h:10568
VkBool32 shaderSampledImageArrayDynamicIndexing
Definition: vulkan.h:10597
VkBool32 shaderResourceResidency
Definition: vulkan.h:10605
VkBool32 sparseResidency4Samples
Definition: vulkan.h:10612
VkBool32 shaderStorageImageWriteWithoutFormat
Definition: vulkan.h:10595
VkBool32 robustBufferAccess
Definition: vulkan.h:10563
VkBool32 drawIndirectFirstInstance
Definition: vulkan.h:10573
VkBool32 shaderStorageImageArrayDynamicIndexing
Definition: vulkan.h:10599
VkBool32 sparseResidencyImage2D
Definition: vulkan.h:10609
VkBool32 fragmentStoresAndAtomics
Definition: vulkan.h:10589
VkBool32 textureCompressionBC
Definition: vulkan.h:10585
VkBool32 textureCompressionETC2
Definition: vulkan.h:10583
VkBool32 fullDrawIndexUint32
Definition: vulkan.h:10564
VkBool32 shaderStorageImageExtendedFormats
Definition: vulkan.h:10592
VkBool32 occlusionQueryPrecise
Definition: vulkan.h:10586
VkBool32 sparseResidencyImage3D
Definition: vulkan.h:10610
VkBool32 shaderTessellationAndGeometryPointSize
Definition: vulkan.h:10590
VkBool32 shaderStorageImageReadWithoutFormat
Definition: vulkan.h:10594
VkBool32 shaderUniformBufferArrayDynamicIndexing
Definition: vulkan.h:10596
VkBool32 shaderImageGatherExtended
Definition: vulkan.h:10591
VkBool32 pipelineStatisticsQuery
Definition: vulkan.h:10587
VkBool32 sparseResidencyAliased
Definition: vulkan.h:10615
VkBool32 sparseResidency8Samples
Definition: vulkan.h:10613
VkBool32 sparseResidencyBuffer
Definition: vulkan.h:10608
uint32_t maxTessellationPatchSize
Definition: vulkan.h:11097
uint32_t maxFramebufferLayers
Definition: vulkan.h:11141
uint32_t maxUniformBufferRange
Definition: vulkan.h:11068
uint32_t discreteQueuePriorities
Definition: vulkan.h:11158
uint32_t maxViewportDimensions[2]
Definition: vulkan.h:11125
uint32_t maxDescriptorSetSamplers
Definition: vulkan.h:11083
VkSampleCountFlags sampledImageIntegerSampleCounts
Definition: vulkan.h:11148
uint32_t viewportSubPixelBits
Definition: vulkan.h:11127
uint32_t subTexelPrecisionBits
Definition: vulkan.h:11118
uint32_t maxFramebufferHeight
Definition: vulkan.h:11140
uint32_t subPixelInterpolationOffsetBits
Definition: vulkan.h:11138
uint32_t maxFragmentCombinedOutputResources
Definition: vulkan.h:11112
int32_t minTexelGatherOffset
Definition: vulkan.h:11134
VkSampleCountFlags sampledImageColorSampleCounts
Definition: vulkan.h:11147
uint32_t maxTessellationControlPerVertexInputComponents
Definition: vulkan.h:11098
uint32_t maxDescriptorSetStorageBuffers
Definition: vulkan.h:11086
VkBool32 timestampComputeAndGraphics
Definition: vulkan.h:11153
uint32_t maxCombinedClipAndCullDistances
Definition: vulkan.h:11157
uint32_t maxGeometryOutputVertices
Definition: vulkan.h:11107
uint32_t maxPushConstantsSize
Definition: vulkan.h:11070
uint32_t maxVertexOutputComponents
Definition: vulkan.h:11095
uint32_t maxDrawIndexedIndexValue
Definition: vulkan.h:11120
size_t minMemoryMapAlignment
Definition: vulkan.h:11128
uint32_t maxStorageBufferRange
Definition: vulkan.h:11069
uint32_t mipmapPrecisionBits
Definition: vulkan.h:11119
uint32_t maxImageDimension2D
Definition: vulkan.h:11063
uint32_t maxCullDistances
Definition: vulkan.h:11156
uint32_t maxVertexInputBindings
Definition: vulkan.h:11092
uint32_t maxVertexInputAttributeOffset
Definition: vulkan.h:11093
uint32_t maxClipDistances
Definition: vulkan.h:11155
uint32_t maxDescriptorSetUniformBuffersDynamic
Definition: vulkan.h:11085
uint32_t maxImageDimensionCube
Definition: vulkan.h:11065
uint32_t maxTexelOffset
Definition: vulkan.h:11133
uint32_t maxFragmentInputComponents
Definition: vulkan.h:11109
uint32_t maxImageDimension1D
Definition: vulkan.h:11062
float viewportBoundsRange[2]
Definition: vulkan.h:11126
VkBool32 standardSampleLocations
Definition: vulkan.h:11164
uint32_t maxSamplerAllocationCount
Definition: vulkan.h:11072
uint32_t maxPerStageDescriptorInputAttachments
Definition: vulkan.h:11081
uint32_t maxPerStageDescriptorStorageBuffers
Definition: vulkan.h:11078
uint32_t maxDescriptorSetStorageImages
Definition: vulkan.h:11089
uint32_t maxComputeWorkGroupSize[3]
Definition: vulkan.h:11116
uint32_t maxComputeWorkGroupInvocations
Definition: vulkan.h:11115
VkSampleCountFlags framebufferColorSampleCounts
Definition: vulkan.h:11142
uint32_t maxTexelGatherOffset
Definition: vulkan.h:11135
uint32_t maxImageDimension3D
Definition: vulkan.h:11064
uint32_t maxImageArrayLayers
Definition: vulkan.h:11066
uint32_t maxMemoryAllocationCount
Definition: vulkan.h:11071
uint32_t maxDescriptorSetStorageBuffersDynamic
Definition: vulkan.h:11087
uint32_t maxFramebufferWidth
Definition: vulkan.h:11139
uint32_t maxDescriptorSetInputAttachments
Definition: vulkan.h:11090
uint32_t maxTexelBufferElements
Definition: vulkan.h:11067
VkSampleCountFlags storageImageSampleCounts
Definition: vulkan.h:11151
uint32_t maxPerStageDescriptorStorageImages
Definition: vulkan.h:11080
uint32_t maxGeometryShaderInvocations
Definition: vulkan.h:11104
uint32_t maxBoundDescriptorSets
Definition: vulkan.h:11075
VkSampleCountFlags framebufferStencilSampleCounts
Definition: vulkan.h:11144
uint32_t maxTessellationControlPerPatchOutputComponents
Definition: vulkan.h:11100
uint32_t maxTessellationEvaluationOutputComponents
Definition: vulkan.h:11103
uint32_t maxGeometryOutputComponents
Definition: vulkan.h:11106
float maxInterpolationOffset
Definition: vulkan.h:11137
uint32_t maxPerStageDescriptorSamplers
Definition: vulkan.h:11076
uint32_t maxTessellationControlTotalOutputComponents
Definition: vulkan.h:11101
uint32_t maxTessellationControlPerVertexOutputComponents
Definition: vulkan.h:11099
uint32_t maxPerStageDescriptorUniformBuffers
Definition: vulkan.h:11077
uint32_t maxTessellationEvaluationInputComponents
Definition: vulkan.h:11102
uint32_t maxComputeWorkGroupCount[3]
Definition: vulkan.h:11114
uint32_t maxGeometryTotalOutputComponents
Definition: vulkan.h:11108
float minInterpolationOffset
Definition: vulkan.h:11136
uint32_t maxVertexInputBindingStride
Definition: vulkan.h:11094
VkSampleCountFlags sampledImageStencilSampleCounts
Definition: vulkan.h:11150
uint32_t maxDrawIndirectCount
Definition: vulkan.h:11121
uint32_t maxColorAttachments
Definition: vulkan.h:11146
uint32_t maxComputeSharedMemorySize
Definition: vulkan.h:11113
uint32_t maxFragmentOutputAttachments
Definition: vulkan.h:11110
VkSampleCountFlags sampledImageDepthSampleCounts
Definition: vulkan.h:11149
uint32_t maxPerStageDescriptorSampledImages
Definition: vulkan.h:11079
uint32_t maxDescriptorSetSampledImages
Definition: vulkan.h:11088
uint32_t maxDescriptorSetUniformBuffers
Definition: vulkan.h:11084
uint32_t maxGeometryInputComponents
Definition: vulkan.h:11105
float pointSizeRange[2]
Definition: vulkan.h:11159
VkSampleCountFlags framebufferNoAttachmentsSampleCounts
Definition: vulkan.h:11145
uint32_t maxPerStageResources
Definition: vulkan.h:11082
VkSampleCountFlags framebufferDepthSampleCounts
Definition: vulkan.h:11143
uint32_t subPixelPrecisionBits
Definition: vulkan.h:11117
uint32_t maxSampleMaskWords
Definition: vulkan.h:11152
uint32_t maxFragmentDualSrcAttachments
Definition: vulkan.h:11111
uint32_t maxTessellationGenerationLevel
Definition: vulkan.h:11096
uint32_t maxVertexInputAttributes
Definition: vulkan.h:11091
float lineWidthRange[2]
Definition: vulkan.h:11160
VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES]
Definition: vulkan.h:11320
VkPhysicalDeviceType deviceType
Definition: vulkan.h:16574
char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]
Definition: vulkan.h:16575
VkSubgroupFeatureFlags supportedOperations
Definition: vulkan.h:12387
VkShaderStageFlags supportedStages
Definition: vulkan.h:12386
VkPipelineCacheCreateFlags flags
Definition: vulkan.h:13011
const void * pInitialData
Definition: vulkan.h:13013
VkStructureType sType
Definition: vulkan.h:13009
Definition: scsiwmi.h:51
Definition: match.c:390
Definition: image.c:229
Definition: cache.c:41
Definition: dialog.c:52
ID3D12ShaderCacheSession ID3D12ShaderCacheSession_iface
Definition: device.c:2740
struct list cache_list_entry
Definition: device.c:2743
struct vkd3d_shader_cache * cache
Definition: device.c:2748
struct d3d12_device * device
Definition: device.c:2745
struct vkd3d_private_store private_store
Definition: device.c:2746
D3D12_SHADER_CACHE_SESSION_DESC desc
Definition: device.c:2747
unsigned int refcount
Definition: device.c:2741
VkPhysicalDevice vk_physical_device
VkDevice vk_device
IUnknown * parent
ID3D12Device9 ID3D12Device9_iface
struct vkd3d_instance * vkd3d_instance
unsigned int refcount
uint64_t heap_offset
D3D12_RESOURCE_STATES initial_state
Definition: devices.h:37
Definition: cookie.c:42
Definition: filter.c:185
Definition: parser.c:44
Definition: heap.c:86
UINT flags
Definition: heap.c:93
Definition: copy.c:22
Definition: tftpd.h:60
Definition: name.c:39
void * data
Definition: main.c:1575
uint32_t engine_version
Definition: vkd3d.h:211
enum vkd3d_api_version api_version
Definition: vkd3d.h:217
const char * engine_name
Definition: vkd3d.h:206
const char * application_name
Definition: vkd3d.h:199
uint32_t application_version
Definition: vkd3d.h:201
IUnknown * parent
Definition: vkd3d.h:288
uint32_t device_extension_count
Definition: vkd3d.h:282
D3D_FEATURE_LEVEL minimum_feature_level
Definition: vkd3d.h:255
const char *const * device_extensions
Definition: vkd3d.h:280
const void * next
Definition: vkd3d.h:251
VkPhysicalDevice vk_physical_device
Definition: vkd3d.h:274
unsigned int storage_image_max_descriptors
unsigned int uniform_buffer_max_descriptors
unsigned int storage_buffer_max_descriptors
unsigned int sampled_image_max_descriptors
unsigned int vk_family_count
Definition: device.c:2052
VkQueueFamilyProperties vk_properties[VKD3D_QUEUE_FAMILY_COUNT]
Definition: device.c:2050
VkDeviceQueueCreateInfo vk_queue_create_info[VKD3D_QUEUE_FAMILY_COUNT]
Definition: device.c:2053
unsigned int family_index[VKD3D_QUEUE_FAMILY_COUNT]
Definition: device.c:2049
unsigned int plane_count
D3D12_GPU_VIRTUAL_ADDRESS base
const char *const * instance_extensions
Definition: vkd3d.h:152
uint32_t instance_extension_count
Definition: vkd3d.h:154
PFN_vkd3d_signal_event pfn_signal_event
Definition: vkd3d.h:126
PFN_vkGetInstanceProcAddr pfn_vkGetInstanceProcAddr
Definition: vkd3d.h:146
const void * next
Definition: vkd3d.h:123
enum vkd3d_structure_type type
Definition: vkd3d.h:121
PFN_vkd3d_join_thread pfn_join_thread
Definition: vkd3d.h:138
PFN_vkd3d_create_thread pfn_create_thread
Definition: vkd3d.h:132
struct vkd3d_vk_instance_procs vk_procs
const char *const * extensions
Definition: vkd3d.h:314
const char * extension_name
Definition: device.c:55
ptrdiff_t vulkan_info_offset
Definition: device.c:56
const char *const * extensions
Definition: vkd3d.h:175
VkPhysicalDeviceFeatures2 features2
Definition: device.c:839
VkPhysicalDeviceRobustness2FeaturesEXT robustness2_features
Definition: device.c:830
VkPhysicalDeviceConditionalRenderingFeaturesEXT conditional_rendering_features
Definition: device.c:826
VkPhysicalDeviceDescriptorIndexingPropertiesEXT descriptor_indexing_properties
Definition: device.c:816
VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT fragment_shader_interlock_features
Definition: device.c:829
VkPhysicalDeviceTimelineSemaphoreFeaturesKHR timeline_semaphore_features
Definition: device.c:835
VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT texel_buffer_alignment_features
Definition: device.c:832
VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT texel_buffer_alignment_properties
Definition: device.c:818
VkPhysicalDeviceProperties2KHR properties2
Definition: device.c:823
VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT demote_features
Definition: device.c:831
VkPhysicalDeviceTransformFeedbackFeaturesEXT xfb_features
Definition: device.c:833
VkPhysicalDeviceMaintenance3Properties maintenance3_properties
Definition: device.c:817
VkPhysicalDeviceSubgroupProperties subgroup_properties
Definition: device.c:821
VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptor_indexing_features
Definition: device.c:828
VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT vertex_divisor_properties
Definition: device.c:820
VkPhysicalDeviceDepthClipEnableFeaturesEXT depth_clip_features
Definition: device.c:827
VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT vertex_divisor_features
Definition: device.c:834
VkPhysicalDeviceTransformFeedbackPropertiesEXT xfb_properties
Definition: device.c:819
VkPhysicalDevice4444FormatsFeaturesEXT formats4444_features
Definition: device.c:837
VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT mutable_features
Definition: device.c:836
enum vkd3d_structure_type type
Definition: device.c:26
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
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
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 transform_feedback_queries
bool EXT_mutable_descriptor_type
unsigned int max_vertex_attrib_divisor
#define max(a, b)
Definition: svc.c:63
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define LIST_INIT(head)
Definition: queue.h:197
struct sock * chain
Definition: tcpcore.h:1
#define bsearch
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#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_structure_type
Definition: vkd3d.h:51
@ VKD3D_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
Definition: vkd3d.h:53
@ VKD3D_API_VERSION_1_2
Definition: vkd3d.h:89
@ VKD3D_API_VERSION_1_0
Definition: vkd3d.h:87
static int vkd3d_dlclose(void *handle)
Definition: vkd3d_common.h:751
static const char * debugstr_hresult(HRESULT hr)
Definition: vkd3d_common.h:244
static bool vkd3d_bound_range(size_t start, size_t count, size_t limit)
Definition: vkd3d_common.h:360
static void vkd3d_cond_init(struct vkd3d_cond *cond)
Definition: vkd3d_common.h:617
static void * vkd3d_dlsym(void *handle, const char *symbol)
Definition: vkd3d_common.h:746
static void vkd3d_parse_version(const char *version, int *major, int *minor)
Definition: vkd3d_common.h:678
#define FIXME_ONCE
Definition: vkd3d_common.h:228
static void vkd3d_mutex_init(struct vkd3d_mutex *lock)
Definition: vkd3d_common.h:560
static void vkd3d_mutex_unlock(struct vkd3d_mutex *lock)
Definition: vkd3d_common.h:584
static const char * vkd3d_dlerror(void)
Definition: vkd3d_common.h:756
static void vkd3d_mutex_lock(struct vkd3d_mutex *lock)
Definition: vkd3d_common.h:572
void vkd3d_set_thread_name(const char *name)
Definition: debug.c:405
uint64_t vkd3d_parse_debug_options(const char *string, const struct vkd3d_debug_option *options, unsigned int option_count)
Definition: debug.c:370
static void vkd3d_mutex_destroy(struct vkd3d_mutex *lock)
Definition: vkd3d_common.h:596
static uint32_t vkd3d_atomic_decrement_u32(uint32_t volatile *x)
Definition: vkd3d_common.h:477
#define VKD3D_MUTEX_INITIALIZER
Definition: vkd3d_common.h:557
static void vkd3d_cond_destroy(struct vkd3d_cond *cond)
Definition: vkd3d_common.h:666
static void * vkd3d_dlopen(const char *name)
Definition: vkd3d_common.h:741
bool vkd3d_debug_list_has_member(const char *string, const char *member)
Definition: debug.c:348
#define VKD3D_ASSERT(cond)
Definition: vkd3d_common.h:49
const char const char * vkd3d_dbg_vsprintf(const char *fmt, va_list args)
Definition: debug.c:134
static uint32_t vkd3d_atomic_increment_u32(uint32_t volatile *x)
Definition: vkd3d_common.h:482
unsigned int vkd3d_env_var_as_uint(const char *name, unsigned int default_value)
Definition: debug.c:326
static void vkd3d_cond_wait(struct vkd3d_cond *cond, struct vkd3d_mutex *lock)
Definition: vkd3d_common.h:653
static void vkd3d_cond_signal(struct vkd3d_cond *cond)
Definition: vkd3d_common.h:629
static void * vkd3d_calloc(size_t count, size_t size)
Definition: vkd3d_memory.h:43
static void vkd3d_free(void *ptr)
Definition: vkd3d_memory.h:52
static void * vkd3d_malloc(size_t size)
Definition: vkd3d_memory.h:28
bool vkd3d_array_reserve(void **elements, size_t *capacity, size_t element_count, size_t element_size)
Definition: memory.c:22
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
static void vk_prepend_struct(void *header, void *structure)
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)
static ULONG d3d12_device_release(struct d3d12_device *device)
static void d3d12_resource_desc1_from_desc(D3D12_RESOURCE_DESC1 *desc1, const D3D12_RESOURCE_DESC *desc)
#define VKD3D_MAX_VIRTUAL_HEAP_DESCRIPTORS_PER_TYPE
Definition: vkd3d_private.h:66
static ULONG d3d12_device_add_ref(struct d3d12_device *device)
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 unsigned int d3d12_resource_desc_get_width(const D3D12_RESOURCE_DESC1 *desc, unsigned int miplevel_idx)
static void debug_ignored_node_mask(unsigned int mask)
static HRESULT vkd3d_private_store_init(struct vkd3d_private_store *store)
#define VKD3D_MAX_DESCRIPTOR_SET_SAMPLERS
Definition: vkd3d_private.h:62
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_resource * impl_from_ID3D12Resource(ID3D12Resource *iface)
static unsigned int d3d12_resource_desc_get_height(const D3D12_RESOURCE_DESC1 *desc, unsigned int miplevel_idx)
static unsigned int d3d12_resource_desc_get_depth(const D3D12_RESOURCE_DESC1 *desc, unsigned int miplevel_idx)
@ VKD3D_CONFIG_FLAG_VIRTUAL_HEAPS
@ VKD3D_CONFIG_FLAG_VULKAN_DEBUG
static struct d3d12_dsv_desc * d3d12_dsv_desc_from_cpu_handle(D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle)
static struct d3d12_descriptor_heap * d3d12_desc_get_descriptor_heap(const struct d3d12_desc *descriptor)
@ VKD3D_SHADER_SPIRV_EXTENSION_EXT_DEMOTE_TO_HELPER_INVOCATION
@ VKD3D_SHADER_SPIRV_EXTENSION_EXT_FRAGMENT_SHADER_INTERLOCK
@ VKD3D_SHADER_SPIRV_EXTENSION_EXT_STENCIL_EXPORT
@ VKD3D_SHADER_SPIRV_EXTENSION_EXT_VIEWPORT_INDEX_LAYER
@ VKD3D_SHADER_SPIRV_EXTENSION_EXT_DESCRIPTOR_INDEXING
@ VKD3D_SHADER_SPIRV_ENVIRONMENT_VULKAN_1_0
@ VKD3D_SHADER_SPIRV_ENVIRONMENT_VULKAN_1_1
vkd3d_result
Definition: vkd3d_types.h:41
#define VKD3D_VCS_ID
Definition: vkd3d_version.h:1
void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties *pMemoryProperties)
@ VK_DEBUG_REPORT_WARNING_BIT_EXT
Definition: vulkan.h:2320
@ VK_DEBUG_REPORT_ERROR_BIT_EXT
Definition: vulkan.h:2322
#define VK_API_VERSION_1_0
Definition: vulkan.h:842
VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties)
VkResult VKAPI_CALL vkCreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pCallback)
void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator)
void VKAPI_CALL vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 *pFeatures)
VkFormatFeatureFlagBits
Definition: vulkan.h:3127
@ VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
Definition: vulkan.h:3140
@ VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT
Definition: vulkan.h:3136
@ VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
Definition: vulkan.h:3137
@ VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT
Definition: vulkan.h:3129
@ VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT
Definition: vulkan.h:3134
@ VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
Definition: vulkan.h:3128
@ VK_FORMAT_FEATURE_BLIT_SRC_BIT
Definition: vulkan.h:3138
@ VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
Definition: vulkan.h:3135
@ VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
Definition: vulkan.h:3130
#define VK_VERSION_MAJOR(version)
Definition: vulkan.h:832
@ VK_SHADER_STAGE_COMPUTE_BIT
Definition: vulkan.h:4880
@ VK_SHADER_STAGE_ALL
Definition: vulkan.h:4899
@ VK_SHADER_STAGE_FRAGMENT_BIT
Definition: vulkan.h:4878
VkResult VKAPI_CALL vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorSetLayout *pSetLayout)
@ VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
Definition: vulkan.h:3772
@ VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT
Definition: vulkan.h:3771
#define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME
Definition: vulkan.h:323
VkFlags VkSubgroupFeatureFlags
Definition: vulkan.h:1139
void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties *pQueueFamilyProperties)
void VKAPI_CALL vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 *pProperties)
#define VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME
Definition: vulkan.h:144
VkFlags VkImageUsageFlags
Definition: vulkan.h:1050
VkTimeDomainKHR
Definition: vulkan.h:6178
@ VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT
Definition: vulkan.h:6186
@ VK_TIME_DOMAIN_DEVICE_EXT
Definition: vulkan.h:6183
@ VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT
Definition: vulkan.h:6185
@ VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT
Definition: vulkan.h:6184
VkResult VKAPI_CALL vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice physicalDevice, uint32_t *pTimeDomainCount, VkTimeDomainKHR *pTimeDomains)
#define VK_VERSION_PATCH(version)
Definition: vulkan.h:834
void VKAPI_CALL vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures)
VkResult(VKAPI_PTR * PFN_vkEnumerateInstanceVersion)(uint32_t *)
Definition: vulkan.h:18063
void VKAPI_CALL vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks *pAllocator)
@ VK_IMAGE_TILING_OPTIMAL
Definition: vulkan.h:3495
PFN_vkVoidFunction(VKAPI_PTR * PFN_vkGetInstanceProcAddr)(VkInstance, const char *)
Definition: vulkan.h:18143
VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDevice *pDevice)
@ VK_SUBGROUP_FEATURE_SHUFFLE_BIT
Definition: vulkan.h:6072
@ VK_SUBGROUP_FEATURE_VOTE_BIT
Definition: vulkan.h:6069
@ VK_SUBGROUP_FEATURE_QUAD_BIT
Definition: vulkan.h:6075
@ VK_SUBGROUP_FEATURE_BASIC_BIT
Definition: vulkan.h:6068
@ VK_SUBGROUP_FEATURE_ARITHMETIC_BIT
Definition: vulkan.h:6070
@ VK_SUBGROUP_FEATURE_BALLOT_BIT
Definition: vulkan.h:6071
#define VK_VERSION_MINOR(version)
Definition: vulkan.h:833
void VKAPI_CALL vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatProperties)
VkDebugReportObjectTypeEXT
Definition: vulkan.h:2328
@ VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT
Definition: vulkan.h:2332
@ VK_IMAGE_ASPECT_COLOR_BIT
Definition: vulkan.h:3365
@ VK_IMAGE_ASPECT_STENCIL_BIT
Definition: vulkan.h:3367
@ VK_IMAGE_ASPECT_DEPTH_BIT
Definition: vulkan.h:3366
@ VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
Definition: vulkan.h:3515
@ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
Definition: vulkan.h:3514
VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties)
VkSampleCountFlagBits
Definition: vulkan.h:4700
@ VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT
Definition: vulkan.h:2429
@ VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT
Definition: vulkan.h:2427
@ VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT
Definition: vulkan.h:2430
@ VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT
Definition: vulkan.h:2428
PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *pName)
VkResult VKAPI_CALL vkEnumerateInstanceVersion(uint32_t *pApiVersion)
#define VK_FALSE
Definition: vulkan.h:56
#define VKAPI_PTR
Definition: vulkan.h:35
#define VK_MAKE_VERSION(major, minor, patch)
Definition: vulkan.h:830
void VKAPI_CALL vkDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks *pAllocator)
#define VK_KHR_MAINTENANCE1_EXTENSION_NAME
Definition: vulkan.h:156
@ VK_IMAGE_TYPE_2D
Definition: vulkan.h:3503
@ VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU
Definition: vulkan.h:4059
@ VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
Definition: vulkan.h:4060
@ VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT
Definition: vulkan.h:2457
void VKAPI_CALL vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator)
@ VK_QUEUE_SPARSE_BINDING_BIT
Definition: vulkan.h:4534
@ VK_QUEUE_COMPUTE_BIT
Definition: vulkan.h:4532
@ VK_QUEUE_TRANSFER_BIT
Definition: vulkan.h:4533
@ VK_QUEUE_GRAPHICS_BIT
Definition: vulkan.h:4531
VkResult
Definition: vulkan.h:4639
@ VK_INCOMPLETE
Definition: vulkan.h:4677
@ VK_SUCCESS
Definition: vulkan.h:4672
@ VK_ERROR_FORMAT_NOT_SUPPORTED
Definition: vulkan.h:4661
VkDescriptorType
Definition: vulkan.h:2463
@ VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER
Definition: vulkan.h:2469
@ VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE
Definition: vulkan.h:2466
@ VK_DESCRIPTOR_TYPE_SAMPLER
Definition: vulkan.h:2464
@ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER
Definition: vulkan.h:2470
@ VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER
Definition: vulkan.h:2468
@ VK_DESCRIPTOR_TYPE_MUTABLE_EXT
Definition: vulkan.h:2478
@ VK_DESCRIPTOR_TYPE_STORAGE_IMAGE
Definition: vulkan.h:2467
VkResult VKAPI_CALL vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices)
VkFlags VkDebugReportFlagsEXT
Definition: vulkan.h:986
void VKAPI_CALL vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties)
VkDescriptorBindingFlags VkDescriptorBindingFlagsEXT
Definition: vulkan.h:993
#define VK_NULL_HANDLE
Definition: vulkan.h:861
void VKAPI_CALL vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks *pAllocator)
VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineCache *pPipelineCache)
uint32_t VkBool32
Definition: vulkan.h:946
#define VK_API_VERSION_1_1
Definition: vulkan.h:843
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT
Definition: vulkan.h:5157
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT
Definition: vulkan.h:5939
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT
Definition: vulkan.h:5451
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT
Definition: vulkan.h:5546
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT
Definition: vulkan.h:5053
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT
Definition: vulkan.h:5555
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2
Definition: vulkan.h:5109
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT
Definition: vulkan.h:5052
@ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT
Definition: vulkan.h:5923
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT
Definition: vulkan.h:5311
@ VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
Definition: vulkan.h:4966
@ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
Definition: vulkan.h:4996
@ VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT
Definition: vulkan.h:5024
@ VK_STRUCTURE_TYPE_APPLICATION_INFO
Definition: vulkan.h:4964
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT
Definition: vulkan.h:5925
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR
Definition: vulkan.h:5947
@ VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
Definition: vulkan.h:4965
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES
Definition: vulkan.h:5289
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT
Definition: vulkan.h:5924
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2
Definition: vulkan.h:5108
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT
Definition: vulkan.h:5170
@ VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT
Definition: vulkan.h:5556
@ VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
Definition: vulkan.h:4967
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT
Definition: vulkan.h:5993
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES
Definition: vulkan.h:5164
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT
Definition: vulkan.h:5996
@ VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
Definition: vulkan.h:4981
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT
Definition: vulkan.h:5383
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT
Definition: vulkan.h:5444
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define WAIT_OBJECT_0
Definition: winbase.h:383
_In_ FLONG fl
Definition: winddi.h:1279
void * arg
Definition: msvc.h:10
#define WINAPI
Definition: msvc.h:6
static size_t align(size_t addr, size_t alignment)
#define VK_CALL(f)
Definition: wined3d_vk.h:272
#define S_FALSE
Definition: winerror.h:3451
#define DXGI_ERROR_UNSUPPORTED
Definition: winerror.h:7125
#define E_NOINTERFACE
Definition: winerror.h:3479
#define E_POINTER
Definition: winerror.h:3480
#define DXGI_ERROR_ALREADY_EXISTS
Definition: winerror.h:7160