mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-15 11:17:49 +00:00
hwcontext_vulkan: remove contiguous memory path/mode
The hack was added to enable exporting of vulkan images to DRM. On Intel hardware, specifically for DRM images, all planes must be allocated next to each other, due to hardware limitation, so the hack used a single large allocation and suballocated all planes from it. By natively supporting multiplane images, the driver is what decides the layout, so exporting just works. It's a hack because it conflicted heavily with image allocation, and with the whole ecosystem in general, before multiplane images were supported, which just made it redundant. This is also the commit which broke the hwcontext hardest and prompted the entire rewrite in the first place.
This commit is contained in:
parent
46a77c6496
commit
e0f2d2e702
@ -112,9 +112,6 @@ typedef struct VulkanDevicePriv {
|
||||
|
||||
/* Nvidia */
|
||||
int dev_is_nvidia;
|
||||
|
||||
/* Intel */
|
||||
int dev_is_intel;
|
||||
} VulkanDevicePriv;
|
||||
|
||||
typedef struct VulkanFramesPriv {
|
||||
@ -1504,7 +1501,6 @@ static int vulkan_device_init(AVHWDeviceContext *ctx)
|
||||
p->hprops.minImportedHostPointerAlignment);
|
||||
|
||||
p->dev_is_nvidia = (p->props.properties.vendorID == 0x10de);
|
||||
p->dev_is_intel = (p->props.properties.vendorID == 0x8086);
|
||||
|
||||
vk->GetPhysicalDeviceQueueFamilyProperties(hwctx->phys_dev, &qf_num, NULL);
|
||||
if (!qf_num) {
|
||||
@ -1629,8 +1625,6 @@ static int vulkan_device_derive(AVHWDeviceContext *ctx,
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
if (strstr(vendor, "Intel"))
|
||||
dev_select.vendor_id = 0x8086;
|
||||
if (strstr(vendor, "AMD"))
|
||||
dev_select.vendor_id = 0x1002;
|
||||
|
||||
@ -2366,12 +2360,6 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc)
|
||||
if (!hwctx->usage)
|
||||
hwctx->usage = FF_VK_DEFAULT_USAGE_FLAGS;
|
||||
|
||||
if (!(hwctx->flags & AV_VK_FRAME_FLAG_NONE)) {
|
||||
if (p->contiguous_planes == 1 ||
|
||||
((p->contiguous_planes == -1) && p->dev_is_intel))
|
||||
hwctx->flags |= AV_VK_FRAME_FLAG_CONTIGUOUS_MEMORY;
|
||||
}
|
||||
|
||||
modifier_info = vk_find_struct(hwctx->create_pnext,
|
||||
VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT);
|
||||
|
||||
|
@ -160,10 +160,10 @@ typedef enum AVVkFrameFlags {
|
||||
* device and tiling during av_hwframe_ctx_init(). */
|
||||
AV_VK_FRAME_FLAG_NONE = (1ULL << 0),
|
||||
|
||||
/* Image planes will be allocated in a single VkDeviceMemory, rather
|
||||
* than as per-plane VkDeviceMemory allocations. Required for exporting
|
||||
* to VAAPI on Intel devices. */
|
||||
#if FF_API_VULKAN_CONTIGUOUS_MEMORY
|
||||
/* DEPRECATED: does nothing. Replaced by multiplane images. */
|
||||
AV_VK_FRAME_FLAG_CONTIGUOUS_MEMORY = (1ULL << 1),
|
||||
#endif
|
||||
} AVVkFrameFlags;
|
||||
|
||||
/**
|
||||
|
@ -118,6 +118,7 @@
|
||||
#define FF_API_INTERLACED_FRAME (LIBAVUTIL_VERSION_MAJOR < 59)
|
||||
#define FF_API_FRAME_KEY (LIBAVUTIL_VERSION_MAJOR < 59)
|
||||
#define FF_API_PALETTE_HAS_CHANGED (LIBAVUTIL_VERSION_MAJOR < 59)
|
||||
#define FF_API_VULKAN_CONTIGUOUS_MEMORY (LIBAVUTIL_VERSION_MAJOR < 59)
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
Loading…
Reference in New Issue
Block a user