History

hwcontext_vulkan: ask for storage images by default

The issue is that we ask for storage images by default if available, but because that is gated by the format supporting storage images, and the check for the format supporting storage images is gated by the usage, this resulted in a catch-22.

Lynne committed 2 years ago

Commit 0ffa9671 parent eb5088d1 file · +4 −2Browse files

Unified · Split

libavutil/hwcontext_vulkan.c+4−2
@@ -2617,7 +2617,8 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc) · 2616 unmodified lines
2617 err = vkfmt_from_pixfmt2(hwfc->device_ctx, hwfc->sw_format,2617 err = vkfmt_from_pixfmt2(hwfc->device_ctx, hwfc->sw_format,
2618 hwctx->tiling, NULL,2618 hwctx->tiling, NULL,
2619 NULL, NULL, &supported_usage, 0,2619 NULL, NULL, &supported_usage, 0,
2620 hwctx->usage & VK_IMAGE_USAGE_STORAGE_BIT);2620 !hwctx->usage ||
2621 (hwctx->usage & VK_IMAGE_USAGE_STORAGE_BIT));
2621 if (err < 0) {2622 if (err < 0) {
2622 av_log(hwfc, AV_LOG_ERROR, "Unsupported sw format: %s!\n",2623 av_log(hwfc, AV_LOG_ERROR, "Unsupported sw format: %s!\n",
2623 av_get_pix_fmt_name(hwfc->sw_format));2624 av_get_pix_fmt_name(hwfc->sw_format));
@@ -2628,7 +2629,8 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc) · 4 unmodified lines
2628 hwctx->tiling, hwctx->format, NULL,2629 hwctx->tiling, hwctx->format, NULL,
2629 NULL, &supported_usage,2630 NULL, &supported_usage,
2630 disable_multiplane,2631 disable_multiplane,
2631 hwctx->usage & VK_IMAGE_USAGE_STORAGE_BIT);2632 !hwctx->usage ||
2633 (hwctx->usage & VK_IMAGE_USAGE_STORAGE_BIT));
2632 if (err < 0)2634 if (err < 0)
2633 return err;2635 return err;
2634 }2636 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t