From eb8fc0fb9adf10bd964242fef05fd3656266bf84 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 29 Mar 2023 09:45:17 +0900 Subject: [PATCH] [vulkan] Be clearer about descriptor set layouts vs sets This get pretty confusing when you refer to both the sets and the set layouts in close vicinity. --- include/QF/Vulkan/render.h | 8 ++++---- libs/video/renderer/vulkan/render.c | 8 ++++---- libs/video/renderer/vulkan/vkparse.plist | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/QF/Vulkan/render.h b/include/QF/Vulkan/render.h index a78f08f44..4dc03496e 100644 --- a/include/QF/Vulkan/render.h +++ b/include/QF/Vulkan/render.h @@ -27,13 +27,13 @@ typedef struct qfv_reference_s { int line; } qfv_reference_t; -typedef struct qfv_descriptorsetinfo_s { +typedef struct qfv_descriptorsetlayoutinfo_s { const char *name; VkDescriptorSetLayoutCreateFlags flags; uint32_t num_bindings; VkDescriptorSetLayoutBinding *bindings; VkDescriptorSetLayout setLayout; -} qfv_descriptorsetinfo_t; +} qfv_descriptorsetlayoutinfo_t; typedef struct qfv_layoutinfo_s { const char *name; @@ -243,8 +243,8 @@ typedef struct qfv_jobinfo_s { qfv_imageinfo_t *buffers; qfv_imageviewinfo_t *bufferviews; - uint32_t num_descriptorsets; - qfv_descriptorsetinfo_t *descriptorsets; + uint32_t num_descriptorsetlayouts; + qfv_descriptorsetlayoutinfo_t *descriptorsetlayouts; } qfv_jobinfo_t; #ifndef __QFCC__ diff --git a/libs/video/renderer/vulkan/render.c b/libs/video/renderer/vulkan/render.c index 69a2987ee..fcaa152c8 100644 --- a/libs/video/renderer/vulkan/render.c +++ b/libs/video/renderer/vulkan/render.c @@ -546,8 +546,8 @@ find_subpass (qfv_dependencyinfo_t *d, uint32_t spind, static VkDescriptorSetLayout find_descriptorSet (const qfv_reference_t *ref, objstate_t *s) { - for (uint32_t i = 0; i < s->jinfo->num_descriptorsets; i++) { - __auto_type ds = &s->jinfo->descriptorsets[i]; + for (uint32_t i = 0; i < s->jinfo->num_descriptorsetlayouts; i++) { + __auto_type ds = &s->jinfo->descriptorsetlayouts[i]; if (strcmp (ds->name, ref->name) == 0) { if (!ds->setLayout) { VkDescriptorSetLayoutCreateInfo cInfo = { @@ -1386,8 +1386,8 @@ QFV_Render_Shutdown (vulkan_ctx_t *ctx) } if (rctx->jobinfo) { __auto_type jinfo = rctx->jobinfo; - for (uint32_t i = 0; i < jinfo->num_descriptorsets; i++) { - __auto_type setLayout = jinfo->descriptorsets[i].setLayout; + for (uint32_t i = 0; i < jinfo->num_descriptorsetlayouts; i++) { + __auto_type setLayout = jinfo->descriptorsetlayouts[i].setLayout; dfunc->vkDestroyDescriptorSetLayout (device->dev, setLayout, 0); } delete_memsuper (jinfo->memsuper); diff --git a/libs/video/renderer/vulkan/vkparse.plist b/libs/video/renderer/vulkan/vkparse.plist index a6a5f83f4..019c27e70 100644 --- a/libs/video/renderer/vulkan/vkparse.plist +++ b/libs/video/renderer/vulkan/vkparse.plist @@ -33,7 +33,7 @@ search = ( qfv_subpass_t, qfv_output_t, - qfv_descriptorsetinfo_t, + qfv_descriptorsetlayoutinfo_t, qfv_imageinfo_t, qfv_imageviewinfo_t, qfv_bufferinfo_t, @@ -616,8 +616,8 @@ parse = { values = subpasses; }; }; - qfv_descriptorsetinfo_s = { - .name = qfv_descriptorsetinfo_t; + qfv_descriptorsetlayoutinfo_s = { + .name = qfv_descriptorsetlayoutinfo_t; flags = auto; bindings = { type = (array, VkDescriptorSetLayoutBinding); @@ -714,9 +714,9 @@ parse = { values = steps; }; descriptorSetLayouts = { - type = (labeledarray, qfv_descriptorsetinfo_t, name); - size = num_descriptorsets; - values = descriptorsets; + type = (labeledarray, qfv_descriptorsetlayoutinfo_t, name); + size = num_descriptorsetlayouts; + values = descriptorsetlayouts; }; }; };