[vulkan] Label the drawing command buffers

This commit is contained in:
Bill Currie 2021-04-18 20:40:43 +09:00
parent da39bb2df3
commit 52bfb0aeb0
5 changed files with 23 additions and 3 deletions

View file

@ -191,6 +191,10 @@ alias_begin_subpass (QFV_AliasSubpass subpass, VkPipeline pipeline,
};
dfunc->vkBeginCommandBuffer (cmd, &beginInfo);
QFV_duCmdBeginLabel (device, cmd, va (ctx->va_ctx, "alias:%s",
alias_pass_names[subpass]),
{ 0.6, 0.5, 0, 1});
dfunc->vkCmdBindPipeline (cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
//VkDescriptorSet sets[] = {
// aframe->descriptors[0].dstSet,
@ -216,6 +220,7 @@ alias_end_subpass (VkCommandBuffer cmd, vulkan_ctx_t *ctx)
qfv_device_t *device = ctx->device;
qfv_devfuncs_t *dfunc = device->funcs;
QFV_duCmdEndLabel (device, cmd);
dfunc->vkEndCommandBuffer (cmd);
}

View file

@ -891,7 +891,8 @@ bsp_begin_subpass (QFV_BspSubpass subpass, VkPipeline pipeline,
};
dfunc->vkBeginCommandBuffer (cmd, &beginInfo);
QFV_duCmdBeginLabel (device, cmd, bsp_pass_names[subpass],
QFV_duCmdBeginLabel (device, cmd, va (ctx->va_ctx, "bsp:%s",
bsp_pass_names[subpass]),
{0, 0.5, 0.6, 1});
dfunc->vkCmdBindPipeline (cmd, VK_PIPELINE_BIND_POINT_GRAPHICS,

View file

@ -79,6 +79,8 @@ Vulkan_Compose_Draw (vulkan_ctx_t *ctx)
};
dfunc->vkBeginCommandBuffer (cmd, &beginInfo);
QFV_duCmdBeginLabel (device, cmd, "compose", { 0, 0.2, 0.6, 1});
dfunc->vkCmdBindPipeline (cmd, VK_PIPELINE_BIND_POINT_GRAPHICS,
cctx->pipeline);
@ -101,6 +103,7 @@ Vulkan_Compose_Draw (vulkan_ctx_t *ctx)
dfunc->vkCmdBindVertexBuffers (cmd, 0, 1, &ctx->quad_buffer, &offset);
dfunc->vkCmdDraw (cmd, 4, 1, 0, 0);
QFV_duCmdEndLabel (device, cmd);
dfunc->vkEndCommandBuffer (cmd);
}

View file

@ -46,6 +46,7 @@
#include "QF/quakefs.h"
#include "QF/render.h"
#include "QF/sys.h"
#include "QF/va.h"
#include "QF/vid.h"
#include "compat.h"
@ -54,6 +55,7 @@
#include "QF/Vulkan/barrier.h"
#include "QF/Vulkan/buffer.h"
#include "QF/Vulkan/command.h"
#include "QF/Vulkan/debug.h"
#include "QF/Vulkan/descriptor.h"
#include "QF/Vulkan/device.h"
#include "QF/Vulkan/image.h"
@ -440,6 +442,9 @@ Vulkan_Draw_Init (vulkan_ctx_t *ctx)
};
dfunc->vkUpdateDescriptorSets (device->dev, 2, write, 0, 0);
dframe->cmd = cmdBuffers->a[i];
QFV_duSetObjectName (device, VK_OBJECT_TYPE_COMMAND_BUFFER,
dframe->cmd,
va (ctx->va_ctx, "cmd:draw:%zd", i));
}
free (sets);
}
@ -730,6 +735,8 @@ Vulkan_FlushText (vulkan_ctx_t *ctx)
};
dfunc->vkBeginCommandBuffer (cmd, &beginInfo);
QFV_duCmdBeginLabel (device, cmd, "twod", { 0.6, 0.2, 0, 1});
dfunc->vkCmdBindPipeline (cmd, VK_PIPELINE_BIND_POINT_GRAPHICS,
dctx->pipeline);
dfunc->vkCmdSetViewport (cmd, 0, 1, &ctx->viewport);
@ -745,6 +752,7 @@ Vulkan_FlushText (vulkan_ctx_t *ctx)
dfunc->vkCmdDrawIndexed (cmd, dframe->num_quads * INDS_PER_QUAD,
1, 0, 0, 0);
QFV_duCmdEndLabel (device, cmd);
dfunc->vkEndCommandBuffer (cmd);
dframe->num_quads = 0;

View file

@ -143,8 +143,8 @@ update_lights (vulkan_ctx_t *ctx)
VectorZero (light_data->lights[i].direction);
light_data->lights[i].cone = 1;
}
for (size_t i = 0;
i < lframe->lightvis.size && light_data->lightCount < NUM_LIGHTS; i++) {
for (size_t i = 0; (i < lframe->lightvis.size
&& light_data->lightCount < NUM_LIGHTS); i++) {
if (lframe->lightvis.a[i]) {
light_data->lights[light_data->lightCount++] = lctx->lights.a[i];
}
@ -207,6 +207,8 @@ Vulkan_Lighting_Draw (vulkan_ctx_t *ctx)
};
dfunc->vkBeginCommandBuffer (cmd, &beginInfo);
QFV_duCmdBeginLabel (device, cmd, "lighting", { 0.6, 0.5, 0.6, 1});
dfunc->vkCmdBindPipeline (cmd, VK_PIPELINE_BIND_POINT_GRAPHICS,
lctx->pipeline);
@ -237,6 +239,7 @@ Vulkan_Lighting_Draw (vulkan_ctx_t *ctx)
dfunc->vkCmdBindVertexBuffers (cmd, 0, 1, &ctx->quad_buffer, &offset);
dfunc->vkCmdDraw (cmd, 4, 1, 0, 0);
QFV_duCmdEndLabel (device, cmd);
dfunc->vkEndCommandBuffer (cmd);
}