mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 14:36:24 +00:00
vkmemory: debug output the memory properties requested
This commit is contained in:
parent
87a35f679d
commit
a4e82bcef7
2 changed files with 54 additions and 6 deletions
|
@ -131,8 +131,8 @@ _find_memory_type_index_with_type_properties (GstVulkanDevice * device,
|
||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
if ((typeBits & 1) == 1) {
|
if ((typeBits & 1) == 1) {
|
||||||
/* Type is available, does it match user properties? */
|
/* Type is available, does it match user properties? */
|
||||||
if ((device->memory_properties.memoryTypes[i].
|
if ((device->memory_properties.
|
||||||
propertyFlags & properties) == properties) {
|
memoryTypes[i].propertyFlags & properties) == properties) {
|
||||||
*typeIndex = i;
|
*typeIndex = i;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -195,8 +195,8 @@ _vk_image_mem_init (GstVulkanImageMemory * mem, GstAllocator * allocator,
|
||||||
|
|
||||||
g_mutex_init (&mem->lock);
|
g_mutex_init (&mem->lock);
|
||||||
|
|
||||||
GST_CAT_DEBUG (GST_CAT_VULKAN_IMAGE_MEMORY, "new GL buffer memory:%p size:%"
|
GST_CAT_DEBUG (GST_CAT_VULKAN_IMAGE_MEMORY,
|
||||||
G_GSIZE_FORMAT, mem, maxsize);
|
"new Vulkan Image memory:%p size:%" G_GSIZE_FORMAT, mem, maxsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstVulkanImageMemory *
|
static GstVulkanImageMemory *
|
||||||
|
|
|
@ -40,6 +40,49 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFUALT);
|
||||||
|
|
||||||
static GstAllocator *_vulkan_memory_allocator;
|
static GstAllocator *_vulkan_memory_allocator;
|
||||||
|
|
||||||
|
static gchar *
|
||||||
|
_memory_properties_to_string (VkMemoryPropertyFlags prop_bits)
|
||||||
|
{
|
||||||
|
GString *s;
|
||||||
|
gboolean first = TRUE;
|
||||||
|
|
||||||
|
#define STR_APPEND(s,str) \
|
||||||
|
G_STMT_START { \
|
||||||
|
if (!first) \
|
||||||
|
g_string_append (s, "|"); \
|
||||||
|
g_string_append (s, str); \
|
||||||
|
first = FALSE; \
|
||||||
|
} G_STMT_END
|
||||||
|
|
||||||
|
s = g_string_new (NULL);
|
||||||
|
if (prop_bits & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {
|
||||||
|
STR_APPEND (s, "host-visible");
|
||||||
|
if (prop_bits & VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT) {
|
||||||
|
STR_APPEND (s, "host-incoherent");
|
||||||
|
} else {
|
||||||
|
STR_APPEND (s, "host-coherent");
|
||||||
|
}
|
||||||
|
if (prop_bits & VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT) {
|
||||||
|
STR_APPEND (s, "host-uncached");
|
||||||
|
} else {
|
||||||
|
STR_APPEND (s, "host-cached");
|
||||||
|
}
|
||||||
|
if (prop_bits & VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT) {
|
||||||
|
STR_APPEND (s, "host-write-combined");
|
||||||
|
} else {
|
||||||
|
STR_APPEND (s, "host-write-uncombined");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
STR_APPEND (s, "device-only");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prop_bits & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) {
|
||||||
|
STR_APPEND (s, "lazily-allocated");
|
||||||
|
}
|
||||||
|
|
||||||
|
return g_string_free (s, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_vk_mem_init (GstVulkanMemory * mem, GstAllocator * allocator,
|
_vk_mem_init (GstVulkanMemory * mem, GstAllocator * allocator,
|
||||||
GstMemory * parent, GstVulkanDevice * device, guint32 memory_type_index,
|
GstMemory * parent, GstVulkanDevice * device, guint32 memory_type_index,
|
||||||
|
@ -49,6 +92,7 @@ _vk_mem_init (GstVulkanMemory * mem, GstAllocator * allocator,
|
||||||
{
|
{
|
||||||
gsize align = gst_memory_alignment, offset = 0, maxsize = size;
|
gsize align = gst_memory_alignment, offset = 0, maxsize = size;
|
||||||
GstMemoryFlags flags = 0;
|
GstMemoryFlags flags = 0;
|
||||||
|
gchar *props_str;
|
||||||
|
|
||||||
if (params) {
|
if (params) {
|
||||||
flags = params->flags;
|
flags = params->flags;
|
||||||
|
@ -73,8 +117,12 @@ _vk_mem_init (GstVulkanMemory * mem, GstAllocator * allocator,
|
||||||
|
|
||||||
g_mutex_init (&mem->lock);
|
g_mutex_init (&mem->lock);
|
||||||
|
|
||||||
GST_CAT_DEBUG (GST_CAT_VULKAN_MEMORY, "new GL buffer memory:%p size:%"
|
props_str = _memory_properties_to_string (mem_prop_flags);
|
||||||
G_GSIZE_FORMAT, mem, maxsize);
|
|
||||||
|
GST_CAT_DEBUG (GST_CAT_VULKAN_MEMORY, "new Vulkan memory:%p size:%"
|
||||||
|
G_GSIZE_FORMAT " properties:%s", mem, maxsize, props_str);
|
||||||
|
|
||||||
|
g_free (props_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstVulkanMemory *
|
static GstVulkanMemory *
|
||||||
|
|
Loading…
Reference in a new issue