History

hwcontext_vulkan: fix p->img_qfs

The array was tied to our old queue API, which meant that if users set it, it was never set.

Lynne committed 2 years ago

Commit 32d47161 parent 0aa4ac01 file · +16 −1Browse files

Unified · Split

libavutil/hwcontext_vulkan.c+16−1
@@ -1759,7 +1759,6 @@ FF_DISABLE_DEPRECATION_WARNINGS · 1758 unmodified lines
17591759 tx_index = (ctx_qf == tx_index) ? -1 : tx_index; \
17601760 enc_index = (ctx_qf == enc_index) ? -1 : enc_index; \
17611761 dec_index = (ctx_qf == dec_index) ? -1 : dec_index; \
1762− p->img_qfs[p->nb_img_qfs++] = ctx_qf; \
17631762 } while (0)
17641763
17651764 CHECK_QUEUE("graphics", 0, graph_index, hwctx->queue_family_index, hwctx->nb_graphics_queues);
@@ -1802,6 +1801,22 @@ FF_ENABLE_DEPRECATION_WARNINGS · 36 unmodified lines
18021801 }
18031802 }
18041803
1804+ /* Setup array for pQueueFamilyIndices with used queue families */
1805+ p->nb_img_qfs = 0;
1806+ for (int i = 0; i < hwctx->nb_qf; i++) {
1807+ int seen = 0;
1808+ /* Make sure each entry is unique
1809+ * (VUID-VkBufferCreateInfo-sharingMode-01419) */
1810+ for (int j = (i - 1); j >= 0; j--) {
1811+ if (hwctx->qf[i].idx == hwctx->qf[j].idx) {
1812+ seen = 1;
1813+ break;
1814+ }
1815+ }
1816+ if (!seen)
1817+ p->img_qfs[p->nb_img_qfs++] = hwctx->qf[i].idx;
1818+ }
1819+
18051820 if (!hwctx->lock_queue)
18061821 hwctx->lock_queue = lock_queue;
18071822 if (!hwctx->unlock_queue)

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