mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
libs/vkd3d: Store VkPhysicalDeviceMemoryProperties in "d3d12_device".
This commit is contained in:
parent
7701228cd7
commit
5e266f70a2
@ -81,12 +81,13 @@ static void vkd3d_instance_destroy(struct vkd3d_instance *instance)
|
|||||||
static void vkd3d_trace_physical_device(VkPhysicalDevice device,
|
static void vkd3d_trace_physical_device(VkPhysicalDevice device,
|
||||||
const struct vkd3d_vk_instance_procs *vk_procs)
|
const struct vkd3d_vk_instance_procs *vk_procs)
|
||||||
{
|
{
|
||||||
|
VkPhysicalDeviceMemoryProperties memory_properties;
|
||||||
VkPhysicalDeviceProperties device_properties;
|
VkPhysicalDeviceProperties device_properties;
|
||||||
VkQueueFamilyProperties *queue_properties;
|
VkQueueFamilyProperties *queue_properties;
|
||||||
VkPhysicalDeviceFeatures features;
|
VkPhysicalDeviceFeatures features;
|
||||||
VkPhysicalDeviceLimits *limits;
|
VkPhysicalDeviceLimits *limits;
|
||||||
|
unsigned int i, j;
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
VK_CALL(vkGetPhysicalDeviceProperties(device, &device_properties));
|
VK_CALL(vkGetPhysicalDeviceProperties(device, &device_properties));
|
||||||
TRACE("Device name: %s.\n", device_properties.deviceName);
|
TRACE("Device name: %s.\n", device_properties.deviceName);
|
||||||
@ -104,13 +105,29 @@ static void vkd3d_trace_physical_device(VkPhysicalDevice device,
|
|||||||
|
|
||||||
for (i = 0; i < count; ++i)
|
for (i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
TRACE(" Queue family[%u]: flags %s, count %u, timestamp bits %u, image transfer granularity %s.\n",
|
TRACE(" Queue family [%u]: flags %s, count %u, timestamp bits %u, image transfer granularity %s.\n",
|
||||||
i, debug_vk_queue_flags(queue_properties[i].queueFlags),
|
i, debug_vk_queue_flags(queue_properties[i].queueFlags),
|
||||||
queue_properties[i].queueCount, queue_properties[i].timestampValidBits,
|
queue_properties[i].queueCount, queue_properties[i].timestampValidBits,
|
||||||
debug_vk_extent_3d(queue_properties[i].minImageTransferGranularity));
|
debug_vk_extent_3d(queue_properties[i].minImageTransferGranularity));
|
||||||
}
|
}
|
||||||
vkd3d_free(queue_properties);
|
vkd3d_free(queue_properties);
|
||||||
|
|
||||||
|
VK_CALL(vkGetPhysicalDeviceMemoryProperties(device, &memory_properties));
|
||||||
|
for (i = 0; i < memory_properties.memoryHeapCount; ++i)
|
||||||
|
{
|
||||||
|
const VkMemoryHeap *heap = &memory_properties.memoryHeaps[i];
|
||||||
|
TRACE("Memory heap [%u]: size %s (%lu MiB), flags %s, memory types:\n",
|
||||||
|
i, debugstr_uint64(heap->size), (unsigned long)(heap->size / 1024 / 1024),
|
||||||
|
debug_vk_memory_heap_flags(heap->flags));
|
||||||
|
for (j = 0; j < memory_properties.memoryTypeCount; ++j)
|
||||||
|
{
|
||||||
|
const VkMemoryType *type = &memory_properties.memoryTypes[j];
|
||||||
|
if (type->heapIndex != i)
|
||||||
|
continue;
|
||||||
|
TRACE(" Memory type [%u]: flags %s.\n", j, debug_vk_memory_property_flags(type->propertyFlags));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
limits = &device_properties.limits;
|
limits = &device_properties.limits;
|
||||||
TRACE("Device limits:\n");
|
TRACE("Device limits:\n");
|
||||||
TRACE(" maxImageDimension1D: %u.\n", limits->maxImageDimension1D);
|
TRACE(" maxImageDimension1D: %u.\n", limits->maxImageDimension1D);
|
||||||
@ -394,6 +411,8 @@ static HRESULT vkd3d_create_vk_device(struct d3d12_device *device)
|
|||||||
TRACE("Using queue family %u for direct command queues.\n", direct_queue_family_index);
|
TRACE("Using queue family %u for direct command queues.\n", direct_queue_family_index);
|
||||||
TRACE("Using queue family %u for copy command queues.\n", copy_queue_family_index);
|
TRACE("Using queue family %u for copy command queues.\n", copy_queue_family_index);
|
||||||
|
|
||||||
|
VK_CALL(vkGetPhysicalDeviceMemoryProperties(selected_physical_device, &device->memory_properties));
|
||||||
|
|
||||||
/* Create device */
|
/* Create device */
|
||||||
VK_CALL(vkGetPhysicalDeviceFeatures(selected_physical_device, &device_features));
|
VK_CALL(vkGetPhysicalDeviceFeatures(selected_physical_device, &device_features));
|
||||||
|
|
||||||
|
@ -95,6 +95,42 @@ const char *debug_vk_queue_flags(VkQueueFlags flags)
|
|||||||
return vkd3d_dbg_sprintf("%s", &buffer[3]);
|
return vkd3d_dbg_sprintf("%s", &buffer[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *debug_vk_memory_heap_flags(VkMemoryHeapFlags flags)
|
||||||
|
{
|
||||||
|
char buffer[50];
|
||||||
|
|
||||||
|
buffer[0] = '\0';
|
||||||
|
#define FLAG_TO_STR(f) if (flags & f) { strcat(buffer, " | "#f); flags &= ~f; }
|
||||||
|
FLAG_TO_STR(VK_MEMORY_HEAP_DEVICE_LOCAL_BIT)
|
||||||
|
#undef FLAG_TO_STR
|
||||||
|
if (flags)
|
||||||
|
FIXME("Unrecognized flag(s) %#x.\n", flags);
|
||||||
|
|
||||||
|
if (!buffer[0])
|
||||||
|
return "0";
|
||||||
|
return vkd3d_dbg_sprintf("%s", &buffer[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *debug_vk_memory_property_flags(VkMemoryPropertyFlags flags)
|
||||||
|
{
|
||||||
|
char buffer[200];
|
||||||
|
|
||||||
|
buffer[0] = '\0';
|
||||||
|
#define FLAG_TO_STR(f) if (flags & f) { strcat(buffer, " | "#f); flags &= ~f; }
|
||||||
|
FLAG_TO_STR(VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)
|
||||||
|
FLAG_TO_STR(VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)
|
||||||
|
FLAG_TO_STR(VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)
|
||||||
|
FLAG_TO_STR(VK_MEMORY_PROPERTY_HOST_CACHED_BIT)
|
||||||
|
FLAG_TO_STR(VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)
|
||||||
|
#undef FLAG_TO_STR
|
||||||
|
if (flags)
|
||||||
|
FIXME("Unrecognized flag(s) %#x.\n", flags);
|
||||||
|
|
||||||
|
if (!buffer[0])
|
||||||
|
return "0";
|
||||||
|
return vkd3d_dbg_sprintf("%s", &buffer[3]);
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT hresult_from_vk_result(VkResult vr)
|
HRESULT hresult_from_vk_result(VkResult vr)
|
||||||
{
|
{
|
||||||
switch (vr)
|
switch (vr)
|
||||||
|
@ -159,6 +159,7 @@ struct d3d12_device
|
|||||||
|
|
||||||
unsigned int direct_queue_family_index;
|
unsigned int direct_queue_family_index;
|
||||||
unsigned int copy_queue_family_index;
|
unsigned int copy_queue_family_index;
|
||||||
|
VkPhysicalDeviceMemoryProperties memory_properties;
|
||||||
|
|
||||||
struct vkd3d_instance vkd3d_instance;
|
struct vkd3d_instance vkd3d_instance;
|
||||||
};
|
};
|
||||||
@ -173,6 +174,8 @@ HRESULT return_interface(IUnknown *iface, REFIID iface_riid,
|
|||||||
REFIID requested_riid, void **object) DECLSPEC_HIDDEN;
|
REFIID requested_riid, void **object) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
const char *debug_vk_extent_3d(VkExtent3D extent) DECLSPEC_HIDDEN;
|
const char *debug_vk_extent_3d(VkExtent3D extent) DECLSPEC_HIDDEN;
|
||||||
|
const char *debug_vk_memory_heap_flags(VkMemoryHeapFlags flags) DECLSPEC_HIDDEN;
|
||||||
|
const char *debug_vk_memory_property_flags(VkMemoryPropertyFlags flags) DECLSPEC_HIDDEN;
|
||||||
const char *debug_vk_queue_flags(VkQueueFlags flags) DECLSPEC_HIDDEN;
|
const char *debug_vk_queue_flags(VkQueueFlags flags) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
static inline void *vkd3d_malloc(size_t size)
|
static inline void *vkd3d_malloc(size_t size)
|
||||||
|
Loading…
Reference in New Issue
Block a user