mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
vulkan: update to release 1.0.1.1
This commit is contained in:
parent
700eb16af8
commit
08fd5c2ae5
7 changed files with 121 additions and 89 deletions
|
@ -2905,8 +2905,8 @@ translit(dnm, m, l) AM_CONDITIONAL(USE_VULKAN, true)
|
||||||
AG_GST_CHECK_FEATURE(VULKAN, [Vulkan elements], vulkan, [
|
AG_GST_CHECK_FEATURE(VULKAN, [Vulkan elements], vulkan, [
|
||||||
HAVE_VULKAN=no
|
HAVE_VULKAN=no
|
||||||
AC_CHECK_HEADER(vulkan/vulkan.h, [
|
AC_CHECK_HEADER(vulkan/vulkan.h, [
|
||||||
AC_CHECK_LIB(vulkan, vkCreateDevice, [
|
AC_CHECK_LIB(vulkan-1, vkCreateDevice, [
|
||||||
VULKAN_LIBS="-lvulkan"
|
VULKAN_LIBS="-lvulkan-1"
|
||||||
AC_SUBST(VULKAN_LIBS)
|
AC_SUBST(VULKAN_LIBS)
|
||||||
dnl TODO check platform support (x11, win32, wayland, android, etc)
|
dnl TODO check platform support (x11, win32, wayland, android, etc)
|
||||||
if test "x$HAVE_XCB" = "xyes"; then
|
if test "x$HAVE_XCB" = "xyes"; then
|
||||||
|
|
|
@ -35,6 +35,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <vulkan/vulkan.h>
|
#include <vulkan/vulkan.h>
|
||||||
#include <vulkan/vk_lunarg_debug_report.h>
|
#include <vulkan/vk_ext_debug_report.h>
|
||||||
|
|
||||||
#endif /* _VK_H_ */
|
#endif /* _VK_H_ */
|
||||||
|
|
|
@ -28,14 +28,14 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
static const char *device_validation_layers[] = {
|
static const char *device_validation_layers[] = {
|
||||||
"VK_LAYER_LUNARG_Threading",
|
"VK_LAYER_LUNARG_threading",
|
||||||
"VK_LAYER_LUNARG_MemTracker",
|
"VK_LAYER_LUNARG_mem_tracker",
|
||||||
"VK_LAYER_LUNARG_ObjectTracker",
|
"VK_LAYER_LUNARG_object_tracker",
|
||||||
"VK_LAYER_LUNARG_DrawState",
|
"VK_LAYER_LUNARG_draw_state",
|
||||||
"VK_LAYER_LUNARG_ParamChecker",
|
"VK_LAYER_LUNARG_param_checker",
|
||||||
"VK_LAYER_LUNARG_Swapchain",
|
"VK_LAYER_LUNARG_swapchain",
|
||||||
"VK_LAYER_LUNARG_DeviceLimits",
|
"VK_LAYER_LUNARG_device_limits",
|
||||||
"VK_LAYER_LUNARG_Image",
|
"VK_LAYER_LUNARG_image",
|
||||||
};
|
};
|
||||||
|
|
||||||
#define GST_CAT_DEFAULT gst_vulkan_device_debug
|
#define GST_CAT_DEFAULT gst_vulkan_device_debug
|
||||||
|
@ -284,10 +284,10 @@ gst_vulkan_device_open (GstVulkanDevice * device, GError ** error)
|
||||||
device_info.pNext = NULL;
|
device_info.pNext = NULL;
|
||||||
device_info.queueCreateInfoCount = 1;
|
device_info.queueCreateInfoCount = 1;
|
||||||
device_info.pQueueCreateInfos = &queue_info;
|
device_info.pQueueCreateInfos = &queue_info;
|
||||||
device_info.enabledLayerNameCount = enabled_layer_count;
|
device_info.enabledLayerCount = enabled_layer_count;
|
||||||
device_info.ppEnabledLayerNames =
|
device_info.ppEnabledLayerNames =
|
||||||
(const char *const *) device_validation_layers;
|
(const char *const *) device_validation_layers;
|
||||||
device_info.enabledExtensionNameCount = enabled_extension_count;
|
device_info.enabledExtensionCount = enabled_extension_count;
|
||||||
device_info.ppEnabledExtensionNames = (const char *const *) extension_names;
|
device_info.ppEnabledExtensionNames = (const char *const *) extension_names;
|
||||||
device_info.pEnabledFeatures = NULL;
|
device_info.pEnabledFeatures = NULL;
|
||||||
|
|
||||||
|
@ -387,7 +387,7 @@ gst_vulkan_device_create_cmd_buffer (GstVulkanDevice * device,
|
||||||
cmd_info.pNext = NULL;
|
cmd_info.pNext = NULL;
|
||||||
cmd_info.commandPool = device->cmd_pool;
|
cmd_info.commandPool = device->cmd_pool;
|
||||||
cmd_info.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY;
|
cmd_info.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY;
|
||||||
cmd_info.bufferCount = 1;
|
cmd_info.commandBufferCount = 1;
|
||||||
|
|
||||||
err = vkAllocateCommandBuffers (device->device, &cmd_info, cmd);
|
err = vkAllocateCommandBuffers (device->device, &cmd_info, cmd);
|
||||||
if (gst_vulkan_error_to_g_error (err, error, "vkCreateCommandBuffer") < 0)
|
if (gst_vulkan_error_to_g_error (err, error, "vkCreateCommandBuffer") < 0)
|
||||||
|
|
|
@ -30,14 +30,14 @@
|
||||||
#define APP_SHORT_NAME "GStreamer"
|
#define APP_SHORT_NAME "GStreamer"
|
||||||
|
|
||||||
static const char *instance_validation_layers[] = {
|
static const char *instance_validation_layers[] = {
|
||||||
"VK_LAYER_LUNARG_Threading",
|
"VK_LAYER_LUNARG_threading",
|
||||||
"VK_LAYER_LUNARG_MemTracker",
|
"VK_LAYER_LUNARG_mem_tracker",
|
||||||
"VK_LAYER_LUNARG_ObjectTracker",
|
"VK_LAYER_LUNARG_object_tracker",
|
||||||
"VK_LAYER_LUNARG_DrawState",
|
"VK_LAYER_LUNARG_draw_state",
|
||||||
"VK_LAYER_LUNARG_ParamChecker",
|
"VK_LAYER_LUNARG_param_checker",
|
||||||
"VK_LAYER_LUNARG_Swapchain",
|
"VK_LAYER_LUNARG_swapchain",
|
||||||
"VK_LAYER_LUNARG_DeviceLimits",
|
"VK_LAYER_LUNARG_device_limits",
|
||||||
"VK_LAYER_LUNARG_Image",
|
"VK_LAYER_LUNARG_image",
|
||||||
};
|
};
|
||||||
|
|
||||||
#define GST_CAT_DEFAULT gst_vulkan_instance_debug
|
#define GST_CAT_DEFAULT gst_vulkan_instance_debug
|
||||||
|
@ -90,9 +90,9 @@ gst_vulkan_instance_finalize (GObject * object)
|
||||||
GstVulkanInstance *instance = GST_VULKAN_INSTANCE (object);
|
GstVulkanInstance *instance = GST_VULKAN_INSTANCE (object);
|
||||||
|
|
||||||
if (instance->priv->opened) {
|
if (instance->priv->opened) {
|
||||||
if (instance->dbgDestroyMsgCallback)
|
if (instance->dbgDestroyDebugReportCallback)
|
||||||
instance->dbgDestroyMsgCallback (instance->instance,
|
instance->dbgDestroyDebugReportCallback (instance->instance,
|
||||||
instance->msg_callback);
|
instance->msg_callback, NULL);
|
||||||
|
|
||||||
g_free (instance->physical_devices);
|
g_free (instance->physical_devices);
|
||||||
}
|
}
|
||||||
|
@ -104,23 +104,24 @@ gst_vulkan_instance_finalize (GObject * object)
|
||||||
}
|
}
|
||||||
|
|
||||||
static VkBool32
|
static VkBool32
|
||||||
_gst_vk_debug_callback (VkFlags msgFlags, VkDbgObjectType objType,
|
_gst_vk_debug_callback (VkDebugReportFlagsEXT msgFlags,
|
||||||
uint64_t srcObject, size_t location, int32_t msgCode,
|
VkDebugReportObjectTypeEXT objType, uint64_t srcObject, size_t location,
|
||||||
const char *pLayerPrefix, const char *pMsg, void *pUserData)
|
int32_t msgCode, const char *pLayerPrefix, const char *pMsg,
|
||||||
|
void *pUserData)
|
||||||
{
|
{
|
||||||
if (msgFlags & VK_DBG_REPORT_ERROR_BIT) {
|
if (msgFlags & VK_DEBUG_REPORT_ERROR_BIT_EXT) {
|
||||||
GST_CAT_ERROR (GST_VULKAN_DEBUG_CAT, "[%s] Code %d : %s", pLayerPrefix,
|
GST_CAT_ERROR (GST_VULKAN_DEBUG_CAT, "[%s] Code %d : %s", pLayerPrefix,
|
||||||
msgCode, pMsg);
|
msgCode, pMsg);
|
||||||
} else if (msgFlags & VK_DBG_REPORT_WARN_BIT) {
|
} else if (msgFlags & VK_DEBUG_REPORT_WARN_BIT_EXT) {
|
||||||
GST_CAT_WARNING (GST_VULKAN_DEBUG_CAT, "[%s] Code %d : %s", pLayerPrefix,
|
GST_CAT_WARNING (GST_VULKAN_DEBUG_CAT, "[%s] Code %d : %s", pLayerPrefix,
|
||||||
msgCode, pMsg);
|
msgCode, pMsg);
|
||||||
} else if (msgFlags & VK_DBG_REPORT_INFO_BIT) {
|
} else if (msgFlags & VK_DEBUG_REPORT_INFO_BIT_EXT) {
|
||||||
GST_CAT_LOG (GST_VULKAN_DEBUG_CAT, "[%s] Code %d : %s", pLayerPrefix,
|
GST_CAT_LOG (GST_VULKAN_DEBUG_CAT, "[%s] Code %d : %s", pLayerPrefix,
|
||||||
msgCode, pMsg);
|
msgCode, pMsg);
|
||||||
} else if (msgFlags & VK_DBG_REPORT_PERF_WARN_BIT) {
|
} else if (msgFlags & VK_DEBUG_REPORT_PERF_WARN_BIT_EXT) {
|
||||||
GST_CAT_FIXME (GST_VULKAN_DEBUG_CAT, "[%s] Code %d : %s", pLayerPrefix,
|
GST_CAT_FIXME (GST_VULKAN_DEBUG_CAT, "[%s] Code %d : %s", pLayerPrefix,
|
||||||
msgCode, pMsg);
|
msgCode, pMsg);
|
||||||
} else if (msgFlags & VK_DBG_REPORT_DEBUG_BIT) {
|
} else if (msgFlags & VK_DEBUG_REPORT_DEBUG_BIT_EXT) {
|
||||||
GST_CAT_TRACE (GST_VULKAN_DEBUG_CAT, "[%s] Code %d : %s", pLayerPrefix,
|
GST_CAT_TRACE (GST_VULKAN_DEBUG_CAT, "[%s] Code %d : %s", pLayerPrefix,
|
||||||
msgCode, pMsg);
|
msgCode, pMsg);
|
||||||
} else {
|
} else {
|
||||||
|
@ -233,10 +234,10 @@ gst_vulkan_instance_open (GstVulkanInstance * instance, GError ** error)
|
||||||
extension_names[enabled_extension_count++] =
|
extension_names[enabled_extension_count++] =
|
||||||
(gchar *) VK_KHR_SURFACE_EXTENSION_NAME;
|
(gchar *) VK_KHR_SURFACE_EXTENSION_NAME;
|
||||||
}
|
}
|
||||||
if (!g_strcmp0 (VK_DEBUG_REPORT_EXTENSION_NAME,
|
if (!g_strcmp0 (VK_EXT_DEBUG_REPORT_EXTENSION_NAME,
|
||||||
instance_extensions[i].extensionName)) {
|
instance_extensions[i].extensionName)) {
|
||||||
extension_names[enabled_extension_count++] =
|
extension_names[enabled_extension_count++] =
|
||||||
(gchar *) VK_DEBUG_REPORT_EXTENSION_NAME;
|
(gchar *) VK_EXT_DEBUG_REPORT_EXTENSION_NAME;
|
||||||
}
|
}
|
||||||
if (!g_strcmp0 (winsys_ext_name, instance_extensions[i].extensionName)) {
|
if (!g_strcmp0 (winsys_ext_name, instance_extensions[i].extensionName)) {
|
||||||
winsys_ext_found = TRUE;
|
winsys_ext_found = TRUE;
|
||||||
|
@ -277,10 +278,10 @@ gst_vulkan_instance_open (GstVulkanInstance * instance, GError ** error)
|
||||||
inst_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
|
inst_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
|
||||||
inst_info.pNext = NULL;
|
inst_info.pNext = NULL;
|
||||||
inst_info.pApplicationInfo = &app;
|
inst_info.pApplicationInfo = &app;
|
||||||
inst_info.enabledLayerNameCount = enabled_layer_count;
|
inst_info.enabledLayerCount = enabled_layer_count;
|
||||||
inst_info.ppEnabledLayerNames =
|
inst_info.ppEnabledLayerNames =
|
||||||
(const char *const *) instance_validation_layers;
|
(const char *const *) instance_validation_layers;
|
||||||
inst_info.enabledExtensionNameCount = enabled_extension_count;
|
inst_info.enabledExtensionCount = enabled_extension_count;
|
||||||
inst_info.ppEnabledExtensionNames = (const char *const *) extension_names;
|
inst_info.ppEnabledExtensionNames = (const char *const *) extension_names;
|
||||||
|
|
||||||
err = vkCreateInstance (&inst_info, NULL, &instance->instance);
|
err = vkCreateInstance (&inst_info, NULL, &instance->instance);
|
||||||
|
@ -310,36 +311,51 @@ gst_vulkan_instance_open (GstVulkanInstance * instance, GError ** error)
|
||||||
"vkEnumeratePhysicalDevices") < 0)
|
"vkEnumeratePhysicalDevices") < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
instance->dbgCreateMsgCallback = (PFN_vkDbgCreateMsgCallback)
|
instance->dbgCreateDebugReportCallback = (PFN_vkCreateDebugReportCallbackEXT)
|
||||||
gst_vulkan_instance_get_proc_address (instance, "vkDbgCreateMsgCallback");
|
|
||||||
if (!instance->dbgCreateMsgCallback) {
|
|
||||||
g_set_error (error, GST_VULKAN_ERROR, VK_ERROR_INITIALIZATION_FAILED,
|
|
||||||
"Failed to retreive vkDbgCreateMsgCallback");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
instance->dbgDestroyMsgCallback = (PFN_vkDbgDestroyMsgCallback)
|
|
||||||
gst_vulkan_instance_get_proc_address (instance,
|
gst_vulkan_instance_get_proc_address (instance,
|
||||||
"vkDbgDestroyMsgCallback");
|
"vkCreateDebugReportCallbackEXT");
|
||||||
if (!instance->dbgDestroyMsgCallback) {
|
if (!instance->dbgCreateDebugReportCallback) {
|
||||||
g_set_error (error, GST_VULKAN_ERROR, VK_ERROR_INITIALIZATION_FAILED,
|
g_set_error (error, GST_VULKAN_ERROR, VK_ERROR_INITIALIZATION_FAILED,
|
||||||
"Failed to retreive vkDbgDestroyMsgCallback");
|
"Failed to retreive vkCreateDebugReportCallback");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
instance->dbgBreakCallback =
|
instance->dbgDestroyDebugReportCallback =
|
||||||
(PFN_vkDbgMsgCallback) gst_vulkan_instance_get_proc_address (instance,
|
(PFN_vkDestroyDebugReportCallbackEXT)
|
||||||
"vkDbgBreakCallback");
|
gst_vulkan_instance_get_proc_address (instance,
|
||||||
if (!instance->dbgBreakCallback) {
|
"vkDestroyDebugReportCallbackEXT");
|
||||||
|
if (!instance->dbgDestroyDebugReportCallback) {
|
||||||
g_set_error (error, GST_VULKAN_ERROR, VK_ERROR_INITIALIZATION_FAILED,
|
g_set_error (error, GST_VULKAN_ERROR, VK_ERROR_INITIALIZATION_FAILED,
|
||||||
"Failed to retreive vkDbgBreakCallback");
|
"Failed to retreive vkDestroyDebugReportCallback");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
instance->dbgReportMessage = (PFN_vkDebugReportMessageEXT)
|
||||||
|
gst_vulkan_instance_get_proc_address (instance,
|
||||||
|
"vkDebugReportMessageEXT");
|
||||||
|
if (!instance->dbgReportMessage) {
|
||||||
|
g_set_error (error, GST_VULKAN_ERROR, VK_ERROR_INITIALIZATION_FAILED,
|
||||||
|
"Failed to retreive vkDebugReportMessage");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = instance->dbgCreateMsgCallback (instance->instance,
|
{
|
||||||
VK_DBG_REPORT_ERROR_BIT | VK_DBG_REPORT_WARN_BIT | VK_DBG_REPORT_INFO_BIT
|
VkDebugReportCallbackCreateInfoEXT info = { 0, };
|
||||||
| VK_DBG_REPORT_DEBUG_BIT | VK_DBG_REPORT_PERF_WARN_BIT,
|
|
||||||
_gst_vk_debug_callback, NULL, &instance->msg_callback);
|
info.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT;
|
||||||
if (gst_vulkan_error_to_g_error (err, error, "vkDbgCreateMsgCallback") < 0)
|
info.pNext = NULL;
|
||||||
goto error;
|
info.flags =
|
||||||
|
VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARN_BIT_EXT |
|
||||||
|
VK_DEBUG_REPORT_INFO_BIT_EXT | VK_DEBUG_REPORT_DEBUG_BIT_EXT |
|
||||||
|
VK_DEBUG_REPORT_PERF_WARN_BIT_EXT;
|
||||||
|
info.pfnCallback = (PFN_vkDebugReportCallbackEXT) _gst_vk_debug_callback;
|
||||||
|
info.pUserData = NULL;
|
||||||
|
|
||||||
|
err =
|
||||||
|
instance->dbgCreateDebugReportCallback (instance->instance, &info, NULL,
|
||||||
|
&instance->msg_callback);
|
||||||
|
if (gst_vulkan_error_to_g_error (err, error,
|
||||||
|
"vkCreateDebugReportCallback") < 0)
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
instance->priv->opened = TRUE;
|
instance->priv->opened = TRUE;
|
||||||
GST_OBJECT_UNLOCK (instance);
|
GST_OBJECT_UNLOCK (instance);
|
||||||
|
|
|
@ -43,10 +43,10 @@ struct _GstVulkanInstance
|
||||||
VkPhysicalDevice *physical_devices; /* hides a pointer */
|
VkPhysicalDevice *physical_devices; /* hides a pointer */
|
||||||
guint32 n_physical_devices;
|
guint32 n_physical_devices;
|
||||||
|
|
||||||
VkDbgMsgCallback msg_callback;
|
VkDebugReportCallbackEXT msg_callback;
|
||||||
PFN_vkDbgCreateMsgCallback dbgCreateMsgCallback;
|
PFN_vkCreateDebugReportCallbackEXT dbgCreateDebugReportCallback;
|
||||||
PFN_vkDbgDestroyMsgCallback dbgDestroyMsgCallback;
|
PFN_vkDestroyDebugReportCallbackEXT dbgDestroyDebugReportCallback;
|
||||||
PFN_vkDbgMsgCallback dbgBreakCallback;
|
PFN_vkDebugReportMessageEXT dbgReportMessage;
|
||||||
|
|
||||||
GstVulkanInstancePrivate *priv;
|
GstVulkanInstancePrivate *priv;
|
||||||
};
|
};
|
||||||
|
|
|
@ -181,8 +181,8 @@ _vulkan_swapper_retrieve_surface_properties (GstVulkanSwapper * swapper,
|
||||||
supports_present =
|
supports_present =
|
||||||
gst_vulkan_window_get_presentation_support (swapper->window,
|
gst_vulkan_window_get_presentation_support (swapper->window,
|
||||||
swapper->device, i);
|
swapper->device, i);
|
||||||
if ((swapper->device->
|
if ((swapper->device->queue_family_props[i].
|
||||||
queue_family_props[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) != 0) {
|
queueFlags & VK_QUEUE_GRAPHICS_BIT) != 0) {
|
||||||
if (supports_present) {
|
if (supports_present) {
|
||||||
/* found one that supports both */
|
/* found one that supports both */
|
||||||
graphics_queue = present_queue = i;
|
graphics_queue = present_queue = i;
|
||||||
|
@ -402,13 +402,12 @@ _swapper_set_image_layout_with_cmd (GstVulkanSwapper * swapper,
|
||||||
VkPipelineStageFlags src_stages = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
|
VkPipelineStageFlags src_stages = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
|
||||||
VkPipelineStageFlags dest_stages = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
|
VkPipelineStageFlags dest_stages = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
|
||||||
VkImageMemoryBarrier image_memory_barrier;
|
VkImageMemoryBarrier image_memory_barrier;
|
||||||
VkImageMemoryBarrier *pmemory_barrier = &image_memory_barrier;
|
|
||||||
|
|
||||||
gst_vulkan_image_memory_set_layout (image, new_image_layout,
|
gst_vulkan_image_memory_set_layout (image, new_image_layout,
|
||||||
&image_memory_barrier);
|
&image_memory_barrier);
|
||||||
|
|
||||||
vkCmdPipelineBarrier (cmd, src_stages, dest_stages, FALSE, 1,
|
vkCmdPipelineBarrier (cmd, src_stages, dest_stages, 0, 0, NULL, 0, NULL, 1,
|
||||||
(const void *const *) &pmemory_barrier);
|
&image_memory_barrier);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -446,17 +445,22 @@ _swapper_set_image_layout (GstVulkanSwapper * swapper,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
VkCommandBufferInheritanceInfo buf_inh = { 0, };
|
||||||
VkCommandBufferBeginInfo cmd_buf_info = { 0, };
|
VkCommandBufferBeginInfo cmd_buf_info = { 0, };
|
||||||
|
|
||||||
|
buf_inh.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO;
|
||||||
|
buf_inh.pNext = NULL;
|
||||||
|
buf_inh.renderPass = VK_NULL_HANDLE;
|
||||||
|
buf_inh.subpass = 0;
|
||||||
|
buf_inh.framebuffer = VK_NULL_HANDLE;
|
||||||
|
buf_inh.occlusionQueryEnable = FALSE;
|
||||||
|
buf_inh.queryFlags = 0;
|
||||||
|
buf_inh.pipelineStatistics = 0;
|
||||||
|
|
||||||
cmd_buf_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
|
cmd_buf_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
|
||||||
cmd_buf_info.pNext = NULL;
|
cmd_buf_info.pNext = NULL;
|
||||||
cmd_buf_info.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
|
cmd_buf_info.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
|
||||||
cmd_buf_info.renderPass = VK_NULL_HANDLE;
|
cmd_buf_info.pInheritanceInfo = &buf_inh;
|
||||||
cmd_buf_info.subpass = 0;
|
|
||||||
cmd_buf_info.framebuffer = VK_NULL_HANDLE;
|
|
||||||
cmd_buf_info.occlusionQueryEnable = FALSE;
|
|
||||||
cmd_buf_info.queryFlags = 0;
|
|
||||||
cmd_buf_info.pipelineStatistics = 0;
|
|
||||||
|
|
||||||
err = vkBeginCommandBuffer (cmd, &cmd_buf_info);
|
err = vkBeginCommandBuffer (cmd, &cmd_buf_info);
|
||||||
if (gst_vulkan_error_to_g_error (err, error, "vkBeginCommandBuffer") < 0)
|
if (gst_vulkan_error_to_g_error (err, error, "vkBeginCommandBuffer") < 0)
|
||||||
|
@ -564,9 +568,9 @@ _allocate_swapchain (GstVulkanSwapper * swapper, GstCaps * caps,
|
||||||
n_images_wanted = swapper->surf_props.maxImageCount;
|
n_images_wanted = swapper->surf_props.maxImageCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (swapper->surf_props.
|
if (swapper->
|
||||||
supportedTransforms & VK_SURFACE_TRANSFORM_NONE_BIT_KHR) {
|
surf_props.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) {
|
||||||
preTransform = VK_SURFACE_TRANSFORM_NONE_BIT_KHR;
|
preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;
|
||||||
} else {
|
} else {
|
||||||
preTransform = swapper->surf_props.currentTransform;
|
preTransform = swapper->surf_props.currentTransform;
|
||||||
}
|
}
|
||||||
|
@ -575,7 +579,7 @@ _allocate_swapchain (GstVulkanSwapper * swapper, GstCaps * caps,
|
||||||
_vk_format_from_video_format (GST_VIDEO_INFO_FORMAT (&swapper->v_info));
|
_vk_format_from_video_format (GST_VIDEO_INFO_FORMAT (&swapper->v_info));
|
||||||
color_space = _vk_color_space_from_video_info (&swapper->v_info);
|
color_space = _vk_color_space_from_video_info (&swapper->v_info);
|
||||||
|
|
||||||
#if 0
|
#if 1
|
||||||
/* FIXME: unsupported by LunarG's driver */
|
/* FIXME: unsupported by LunarG's driver */
|
||||||
g_print ("alpha flags 0x%x\n",
|
g_print ("alpha flags 0x%x\n",
|
||||||
(guint) swapper->surf_props.supportedCompositeAlpha);
|
(guint) swapper->surf_props.supportedCompositeAlpha);
|
||||||
|
@ -605,8 +609,8 @@ _allocate_swapchain (GstVulkanSwapper * swapper, GstCaps * caps,
|
||||||
"Incorrect usage flags available for the swap images");
|
"Incorrect usage flags available for the swap images");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if ((swapper->
|
if ((swapper->surf_props.
|
||||||
surf_props.supportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
|
supportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
|
||||||
!= 0) {
|
!= 0) {
|
||||||
usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
|
usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
|
||||||
} else {
|
} else {
|
||||||
|
@ -800,17 +804,22 @@ _build_render_buffer_cmd (GstVulkanSwapper * swapper, guint32 swap_idx,
|
||||||
gst_memory_unmap ((GstMemory *) staging, &staging_map_info);
|
gst_memory_unmap ((GstMemory *) staging, &staging_map_info);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
VkCommandBufferInheritanceInfo buf_inh = { 0, };
|
||||||
VkCommandBufferBeginInfo cmd_buf_info = { 0, };
|
VkCommandBufferBeginInfo cmd_buf_info = { 0, };
|
||||||
|
|
||||||
|
buf_inh.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO;
|
||||||
|
buf_inh.pNext = NULL;
|
||||||
|
buf_inh.renderPass = VK_NULL_HANDLE;
|
||||||
|
buf_inh.subpass = 0;
|
||||||
|
buf_inh.framebuffer = VK_NULL_HANDLE;
|
||||||
|
buf_inh.occlusionQueryEnable = FALSE;
|
||||||
|
buf_inh.queryFlags = 0;
|
||||||
|
buf_inh.pipelineStatistics = 0;
|
||||||
|
|
||||||
cmd_buf_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
|
cmd_buf_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
|
||||||
cmd_buf_info.pNext = NULL;
|
cmd_buf_info.pNext = NULL;
|
||||||
cmd_buf_info.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
|
cmd_buf_info.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
|
||||||
cmd_buf_info.renderPass = VK_NULL_HANDLE;
|
cmd_buf_info.pInheritanceInfo = &buf_inh;
|
||||||
cmd_buf_info.subpass = 0;
|
|
||||||
cmd_buf_info.framebuffer = VK_NULL_HANDLE;
|
|
||||||
cmd_buf_info.occlusionQueryEnable = FALSE;
|
|
||||||
cmd_buf_info.queryFlags = 0;
|
|
||||||
cmd_buf_info.pipelineStatistics = 0;
|
|
||||||
|
|
||||||
err = vkBeginCommandBuffer (cmd, &cmd_buf_info);
|
err = vkBeginCommandBuffer (cmd, &cmd_buf_info);
|
||||||
if (gst_vulkan_error_to_g_error (err, error, "vkBeginCommandBuffer") < 0)
|
if (gst_vulkan_error_to_g_error (err, error, "vkBeginCommandBuffer") < 0)
|
||||||
|
|
|
@ -206,12 +206,19 @@ gst_vulkan_window_xcb_create_window (GstVulkanWindowXCB * window_xcb)
|
||||||
static VkSurfaceKHR
|
static VkSurfaceKHR
|
||||||
gst_vulkan_window_xcb_get_surface (GstVulkanWindow * window, GError ** error)
|
gst_vulkan_window_xcb_get_surface (GstVulkanWindow * window, GError ** error)
|
||||||
{
|
{
|
||||||
|
VkXcbSurfaceCreateInfoKHR info = { 0, };
|
||||||
VkSurfaceKHR ret;
|
VkSurfaceKHR ret;
|
||||||
VkResult err;
|
VkResult err;
|
||||||
|
|
||||||
err = vkCreateXcbSurfaceKHR (window->display->instance->instance,
|
info.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR;
|
||||||
GST_VULKAN_DISPLAY_XCB_CONNECTION (window->display),
|
info.pNext = NULL;
|
||||||
GST_VULKAN_WINDOW_XCB (window)->win_id, NULL, &ret);
|
info.flags = 0;
|
||||||
|
info.connection = GST_VULKAN_DISPLAY_XCB_CONNECTION (window->display);
|
||||||
|
info.window = GST_VULKAN_WINDOW_XCB (window)->win_id;
|
||||||
|
|
||||||
|
err =
|
||||||
|
vkCreateXcbSurfaceKHR (window->display->instance->instance, &info, NULL,
|
||||||
|
&ret);
|
||||||
if (gst_vulkan_error_to_g_error (err, error, "vkCreateXcbSurfaceKHR") < 0)
|
if (gst_vulkan_error_to_g_error (err, error, "vkCreateXcbSurfaceKHR") < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue