]> git.sesse.net Git - ffmpeg/commitdiff
hwcontext_vulkan: reorder structure fields and add spaces in between
authorLynne <dev@lynne.ee>
Tue, 27 Apr 2021 23:39:25 +0000 (01:39 +0200)
committerLynne <dev@lynne.ee>
Wed, 28 Apr 2021 16:18:05 +0000 (18:18 +0200)
We're in the middle of an ABI unstable period, so we're allowed to.

libavutil/hwcontext_vulkan.h

index 5cbeb8e7efa2bcd2a770ec8644f42649d55e08f1..ab075a74e0ce04d98bc314e403419eb332c75915 100644 (file)
@@ -41,18 +41,51 @@ typedef struct AVVulkanDeviceContext {
      * Custom memory allocator, else NULL
      */
     const VkAllocationCallbacks *alloc;
+
     /**
      * Vulkan instance. Must be at least version 1.1.
      */
     VkInstance inst;
+
     /**
      * Physical device
      */
     VkPhysicalDevice phys_dev;
+
     /**
      * Active device
      */
     VkDevice act_dev;
+
+    /**
+     * This structure should be set to the set of features that present and enabled
+     * during device creation. When a device is created by FFmpeg, it will default to
+     * enabling all that are present of the shaderImageGatherExtended,
+     * fragmentStoresAndAtomics, shaderInt64 and vertexPipelineStoresAndAtomics features.
+     */
+    VkPhysicalDeviceFeatures2 device_features;
+
+    /**
+     * Enabled instance extensions.
+     * If supplying your own device context, set this to an array of strings, with
+     * each entry containing the specified Vulkan extension string to enable.
+     * Duplicates are possible and accepted.
+     * If no extensions are enabled, set these fields to NULL, and 0 respectively.
+     */
+    const char * const *enabled_inst_extensions;
+    int nb_enabled_inst_extensions;
+
+    /**
+     * Enabled device extensions. By default, VK_KHR_external_memory_fd,
+     * VK_EXT_external_memory_dma_buf, VK_EXT_image_drm_format_modifier,
+     * VK_KHR_external_semaphore_fd and VK_EXT_external_memory_host are enabled if found.
+     * If supplying your own device context, these fields takes the same format as
+     * the above fields, with the same conditions that duplicates are possible
+     * and accepted, and that NULL and 0 respectively means no extensions are enabled.
+     */
+    const char * const *enabled_dev_extensions;
+    int nb_enabled_dev_extensions;
+
     /**
      * Queue family index for graphics
      * @note av_hwdevice_create() will set all 3 queue indices if unset
@@ -63,6 +96,7 @@ typedef struct AVVulkanDeviceContext {
      */
     int queue_family_index;
     int nb_graphics_queues;
+
     /**
      * Queue family index to use for transfer operations, and the amount of queues
      * enabled. In case there is no dedicated transfer queue, nb_tx_queues
@@ -71,6 +105,7 @@ typedef struct AVVulkanDeviceContext {
      */
     int queue_family_tx_index;
     int nb_tx_queues;
+
     /**
      * Queue family index for compute ops, and the amount of queues enabled.
      * In case there are no dedicated compute queues, nb_comp_queues must be
@@ -78,32 +113,6 @@ typedef struct AVVulkanDeviceContext {
      */
     int queue_family_comp_index;
     int nb_comp_queues;
-    /**
-     * Enabled instance extensions.
-     * If supplying your own device context, set this to an array of strings, with
-     * each entry containing the specified Vulkan extension string to enable.
-     * Duplicates are possible and accepted.
-     * If no extensions are enabled, set these fields to NULL, and 0 respectively.
-     */
-    const char * const *enabled_inst_extensions;
-    int nb_enabled_inst_extensions;
-    /**
-     * Enabled device extensions. By default, VK_KHR_external_memory_fd,
-     * VK_EXT_external_memory_dma_buf, VK_EXT_image_drm_format_modifier,
-     * VK_KHR_external_semaphore_fd and VK_EXT_external_memory_host are enabled if found.
-     * If supplying your own device context, these fields takes the same format as
-     * the above fields, with the same conditions that duplicates are possible
-     * and accepted, and that NULL and 0 respectively means no extensions are enabled.
-     */
-    const char * const *enabled_dev_extensions;
-    int nb_enabled_dev_extensions;
-    /**
-     * This structure should be set to the set of features that present and enabled
-     * during device creation. When a device is created by FFmpeg, it will default to
-     * enabling all that are present of the shaderImageGatherExtended,
-     * fragmentStoresAndAtomics, shaderInt64 and vertexPipelineStoresAndAtomics features.
-     */
-    VkPhysicalDeviceFeatures2 device_features;
 } AVVulkanDeviceContext;
 
 /**
@@ -114,15 +123,18 @@ typedef struct AVVulkanFramesContext {
      * Controls the tiling of allocated frames.
      */
     VkImageTiling tiling;
+
     /**
      * Defines extra usage of output frames. If left as 0, the following bits
      * are set: TRANSFER_SRC, TRANSFER_DST. SAMPLED and STORAGE.
      */
     VkImageUsageFlagBits usage;
+
     /**
      * Extension data for image creation.
      */
     void *create_pnext;
+
     /**
      * Extension data for memory allocation. Must have as many entries as
      * the number of planes of the sw_format.