1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

vulkan: add .buf_elems to FFVulkanDescriptorSet

This enables users to specify a number that would be appended to
the buf_content string.
Saves users from needing to manually print to a string.

An earlier commit tried doing this via .elems, but it was
faulty, as this also incremented the total number of descriptors
in the descriptor set.
This commit is contained in:
Lynne
2025-02-21 00:46:52 +00:00
parent 89704f07bb
commit f774a9376a
2 changed files with 3 additions and 2 deletions

View File

@ -2190,9 +2190,9 @@ print:
if (prop->buf_content) {
GLSLA(" {\n ");
if (desc[i].elems) {
if (desc[i].buf_elems) {
GLSLA("%s", desc[i].buf_content);
GLSLA("[%i];", desc[i].elems);
GLSLA("[%i];", desc[i].buf_elems);
} else {
GLSLA("%s", desc[i].buf_content);
}

View File

@ -81,6 +81,7 @@ typedef struct FFVulkanDescriptorSetBinding {
uint32_t dimensions; /* Needed for e.g. sampler%iD */
uint32_t elems; /* 0 - scalar, 1 or more - vector */
VkShaderStageFlags stages;
uint32_t buf_elems; /* Appends [buf_elems] to the contents. Avoids manually printing to a string. */
VkSampler samplers[4]; /* Sampler to use for all elems */
} FFVulkanDescriptorSetBinding;