c/render: Name Vulkan objects

This commit is contained in:
Simon Zeni 2023-11-03 09:57:06 -04:00 committed by Jakob Bornecrantz
parent 38be815f6d
commit 2a513c14fe
5 changed files with 116 additions and 2 deletions

View file

@ -327,6 +327,9 @@ render_compute_init(struct render_compute *crc, struct render_resources *r)
r->compute.layer.descriptor_set_layout, // descriptor_set_layout
&crc->layer_descriptor_sets[i]); // descriptor_set
VK_CHK_WITH_RET(ret, "vk_create_descriptor_set", false);
VK_NAME_OBJECT(vk, DESCRIPTOR_SET, crc->layer_descriptor_sets[i],
"render_compute layer descriptor set");
}
ret = vk_create_descriptor_set( //
@ -336,6 +339,8 @@ render_compute_init(struct render_compute *crc, struct render_resources *r)
&crc->shared_descriptor_set); // descriptor_set
VK_CHK_WITH_RET(ret, "vk_create_descriptor_set", false);
VK_NAME_OBJECT(vk, DESCRIPTOR_SET, crc->shared_descriptor_set, "render_compute shared descriptor set");
return true;
}

View file

@ -47,6 +47,9 @@ create_distortion_image_and_view(struct vk_bundle *vk,
&image); // out_image
VK_CHK_AND_RET(ret, "vk_create_image_simple");
VK_NAME_OBJECT(vk, DEVICE_MEMORY, image, "distortion device_memory");
VK_NAME_OBJECT(vk, IMAGE, image, "distortion image");
VkImageSubresourceRange subresource_range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
@ -64,6 +67,8 @@ create_distortion_image_and_view(struct vk_bundle *vk,
&image_view); // out_image_view
VK_CHK_WITH_GOTO(ret, "vk_create_view", err_free);
VK_NAME_OBJECT(vk, IMAGE_VIEW, image, "distortion image view");
*out_device_memory = device_memory;
*out_image = image;
*out_image_view = image_view;
@ -216,10 +221,13 @@ create_and_fill_in_distortion_buffer_for_view(struct vk_bundle *vk,
ret = render_buffer_init(vk, r_buffer, usage_flags, properties, size);
VK_CHK_WITH_GOTO(ret, "render_buffer_init", err_buffers);
VK_NAME_OBJECT(vk, BUFFER, r_buffer->buffer, "distortion r_buffer");
ret = render_buffer_init(vk, g_buffer, usage_flags, properties, size);
VK_CHK_WITH_GOTO(ret, "render_buffer_init", err_buffers);
VK_NAME_OBJECT(vk, BUFFER, g_buffer->buffer, "distortion g_buffer");
ret = render_buffer_init(vk, b_buffer, usage_flags, properties, size);
VK_CHK_WITH_GOTO(ret, "render_buffer_init", err_buffers);
VK_NAME_OBJECT(vk, BUFFER, b_buffer->buffer, "distortion b_buffer");
ret = render_buffer_map(vk, r_buffer);
VK_CHK_WITH_GOTO(ret, "render_buffer_map", err_buffers);
@ -316,6 +324,7 @@ render_distortion_buffer_init(struct render_resources *r,
ret = vk_cmd_pool_create_and_begin_cmd_buffer_locked(vk, pool, 0, &upload_buffer);
VK_CHK_WITH_GOTO(ret, "vk_cmd_pool_create_and_begin_cmd_buffer_locked", err_unlock);
VK_NAME_OBJECT(vk, COMMAND_BUFFER, upload_buffer, "render_resources distortion command buffer");
for (uint32_t i = 0; i < RENDER_DISTORTION_NUM_IMAGES; i++) {
ret = create_and_queue_upload_locked( //

View file

@ -30,8 +30,7 @@ vk_from_rtr(struct render_gfx_target_resources *rtr)
return rtr->r->vk;
}
/*!
* Get the @ref vk_bundle from @ref render_gfx.
/*gfx_target_resources framebuffer@ref render_gfx.
*/
static inline struct vk_bundle *
vk_from_rr(struct render_gfx *rr)
@ -715,6 +714,7 @@ render_gfx_render_pass_init(struct render_gfx_render_pass *rgrp,
final_layout, // final_layout
&rgrp->render_pass); // out_render_pass
VK_CHK_WITH_RET(ret, "create_implicit_render_pass", false);
VK_NAME_OBJECT(vk, RENDER_PASS, rgrp->render_pass, "render_gfx_render_pass render pass");
struct mesh_params simple_params = {
.do_timewarp = false,
@ -733,6 +733,7 @@ render_gfx_render_pass_init(struct render_gfx_render_pass *rgrp,
r->shaders->mesh_frag, // mesh_frag
&rgrp->mesh.pipeline); // out_mesh_pipeline
VK_CHK_WITH_RET(ret, "create_mesh_pipeline", false);
VK_NAME_OBJECT(vk, PIPELINE, rgrp->mesh.pipeline, "render_gfx_render_pass mesh pipeline");
struct mesh_params timewarp_params = {
.do_timewarp = true,
@ -751,6 +752,7 @@ render_gfx_render_pass_init(struct render_gfx_render_pass *rgrp,
r->shaders->mesh_frag, // mesh_frag
&rgrp->mesh.pipeline_timewarp); // out_mesh_pipeline
VK_CHK_WITH_RET(ret, "create_mesh_pipeline", false);
VK_NAME_OBJECT(vk, PIPELINE, rgrp->mesh.pipeline_timewarp, "render_gfx_render_pass mesh pipeline timewarp");
const VkBlendFactor blend_factor_premultiplied_alpha = VK_BLEND_FACTOR_ONE;
const VkBlendFactor blend_factor_unpremultiplied_alpha = VK_BLEND_FACTOR_SRC_ALPHA;
@ -766,6 +768,8 @@ render_gfx_render_pass_init(struct render_gfx_render_pass *rgrp,
r->shaders->layer_cylinder_frag, // module_frag
&rgrp->layer.cylinder_premultiplied_alpha); // out_pipeline
VK_CHK_WITH_RET(ret, "create_layer_pipeline", false);
VK_NAME_OBJECT(vk, PIPELINE, rgrp->layer.cylinder_premultiplied_alpha,
"render_gfx_render_pass cylinder premultiplied alpha");
ret = create_layer_pipeline( //
vk, // vk
@ -777,6 +781,8 @@ render_gfx_render_pass_init(struct render_gfx_render_pass *rgrp,
r->shaders->layer_cylinder_frag, // module_frag
&rgrp->layer.cylinder_unpremultiplied_alpha); // out_pipeline
VK_CHK_WITH_RET(ret, "create_layer_pipeline", false);
VK_NAME_OBJECT(vk, PIPELINE, rgrp->layer.cylinder_unpremultiplied_alpha,
"render_gfx_render_pass cylinder unpremultiplied alpha");
// Equirect2
ret = create_layer_pipeline( //
@ -789,6 +795,8 @@ render_gfx_render_pass_init(struct render_gfx_render_pass *rgrp,
r->shaders->layer_equirect2_frag, // module_frag
&rgrp->layer.equirect2_premultiplied_alpha); // out_pipeline
VK_CHK_WITH_RET(ret, "create_layer_pipeline", false);
VK_NAME_OBJECT(vk, PIPELINE, rgrp->layer.equirect2_premultiplied_alpha,
"render_gfx_render_pass equirect2 premultiplied alpha");
ret = create_layer_pipeline( //
vk, // vk
@ -800,6 +808,8 @@ render_gfx_render_pass_init(struct render_gfx_render_pass *rgrp,
r->shaders->layer_equirect2_frag, // module_frag
&rgrp->layer.equirect2_unpremultiplied_alpha); // out_pipeline
VK_CHK_WITH_RET(ret, "create_layer_pipeline", false);
VK_NAME_OBJECT(vk, PIPELINE, rgrp->layer.equirect2_unpremultiplied_alpha,
"render_gfx_render_pass equirect2 unpremultiplied alpha");
// Projection.
ret = create_layer_pipeline( //
@ -812,6 +822,8 @@ render_gfx_render_pass_init(struct render_gfx_render_pass *rgrp,
r->shaders->layer_shared_frag, // module_frag
&rgrp->layer.proj_premultiplied_alpha); // out_pipeline
VK_CHK_WITH_RET(ret, "create_layer_pipeline", false);
VK_NAME_OBJECT(vk, PIPELINE, rgrp->layer.proj_premultiplied_alpha,
"render_gfx_render_pass projection premultiplied alpha");
ret = create_layer_pipeline( //
vk, // vk
@ -823,6 +835,8 @@ render_gfx_render_pass_init(struct render_gfx_render_pass *rgrp,
r->shaders->layer_shared_frag, // module_frag
&rgrp->layer.proj_unpremultiplied_alpha); // out_pipeline
VK_CHK_WITH_RET(ret, "create_layer_pipeline", false);
VK_NAME_OBJECT(vk, PIPELINE, rgrp->layer.proj_unpremultiplied_alpha,
"render_gfx_render_pass projection unpremultiplied alpha");
// Quad
ret = create_layer_pipeline( //
@ -835,6 +849,8 @@ render_gfx_render_pass_init(struct render_gfx_render_pass *rgrp,
r->shaders->layer_shared_frag, // module_frag
&rgrp->layer.quad_premultiplied_alpha); // out_pipeline
VK_CHK_WITH_RET(ret, "create_layer_pipeline", false);
VK_NAME_OBJECT(vk, PIPELINE, rgrp->layer.quad_premultiplied_alpha,
"render_gfx_render_pass quad premultiplied alpha");
ret = create_layer_pipeline( //
vk, // vk
@ -846,6 +862,8 @@ render_gfx_render_pass_init(struct render_gfx_render_pass *rgrp,
r->shaders->layer_shared_frag, // module_frag
&rgrp->layer.quad_unpremultiplied_alpha); // out_pipeline
VK_CHK_WITH_RET(ret, "create_layer_pipeline", false);
VK_NAME_OBJECT(vk, PIPELINE, rgrp->layer.quad_unpremultiplied_alpha,
"render_gfx_render_pass quad unpremultiplied alpha");
// Set fields.
rgrp->r = r;
@ -904,6 +922,7 @@ render_gfx_target_resources_init(struct render_gfx_target_resources *rtr,
extent.height, // height,
&rtr->framebuffer); // out_external_framebuffer
VK_CHK_WITH_RET(ret, "create_framebuffer", false);
VK_NAME_OBJECT(vk, FRAMEBUFFER, rtr->framebuffer, "render_gfx_target_resources framebuffer");
// Set fields.
rtr->rgrp = rgrp;

View file

@ -108,6 +108,7 @@ init_mesh_vertex_buffers(struct vk_bundle *vk,
memory_property_flags, // memory_property_flags
vbo_size); // size
VK_CHK_WITH_RET(ret, "render_buffer_init", false);
VK_NAME_OBJECT(vk, BUFFER, vbo->buffer, "mesh vbo");
ret = render_buffer_write( //
vk, // vk_bundle
@ -129,6 +130,7 @@ init_mesh_vertex_buffers(struct vk_bundle *vk,
memory_property_flags, // memory_property_flags
ibo_size); // size
VK_CHK_WITH_RET(ret, "render_buffer_init", false);
VK_NAME_OBJECT(vk, BUFFER, ibo->buffer, "mesh ibo");
ret = render_buffer_write( //
vk, // vk_bundle
@ -159,6 +161,7 @@ init_mesh_ubo_buffers(struct vk_bundle *vk, struct render_buffer *l_ubo, struct
memory_property_flags, //
ubo_size); // size
VK_CHK_WITH_RET(ret, "render_buffer_init", false);
VK_NAME_OBJECT(vk, BUFFER, l_ubo, "mesh l_ubo");
ret = render_buffer_map(vk, l_ubo);
VK_CHK_WITH_RET(ret, "render_buffer_map", false);
@ -169,6 +172,7 @@ init_mesh_ubo_buffers(struct vk_bundle *vk, struct render_buffer *l_ubo, struct
memory_property_flags, //
ubo_size); // size
VK_CHK_WITH_RET(ret, "render_buffer_init", false);
VK_NAME_OBJECT(vk, BUFFER, l_ubo, "mesh r_ubo");
ret = render_buffer_map(vk, r_ubo);
VK_CHK_WITH_RET(ret, "render_buffer_map", false);
@ -448,6 +452,9 @@ create_scratch_image_and_view(struct vk_bundle *vk, VkExtent2D extent, struct re
&image); // out_image
VK_CHK_WITH_RET(ret, "vk_create_image_mutable_rgba", false);
VK_NAME_OBJECT(vk, DEVICE_MEMORY, device_memory, "render_scratch_color_image device_memory");
VK_NAME_OBJECT(vk, IMAGE, image, "render_scratch_color_image image");
VkImageSubresourceRange subresource_range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
@ -466,6 +473,8 @@ create_scratch_image_and_view(struct vk_bundle *vk, VkExtent2D extent, struct re
&srgb_view); // out_image_view
VK_CHK_WITH_RET(ret, "vk_create_view_usage", false);
VK_NAME_OBJECT(vk, IMAGE_VIEW, srgb_view, "render_scratch_color_image image view srgb");
ret = vk_create_view_usage( //
vk, // vk_bundle
image, // image
@ -476,6 +485,8 @@ create_scratch_image_and_view(struct vk_bundle *vk, VkExtent2D extent, struct re
&unorm_view); // out_image_view
VK_CHK_WITH_RET(ret, "vk_create_view_usage", false);
VK_NAME_OBJECT(vk, IMAGE_VIEW, unorm_view, "render_scratch_color_image image view unorm");
rsci->device_memory = device_memory;
rsci->image = image;
rsci->srgb_view = srgb_view;
@ -553,24 +564,33 @@ render_resources_init(struct render_resources *r,
&r->samplers.mock); // out_sampler
VK_CHK_WITH_RET(ret, "vk_create_sampler", false);
VK_NAME_OBJECT(vk, SAMPLER, r->samplers.mock, "render_resources sampler mock");
ret = vk_create_sampler( //
vk, // vk_bundle
VK_SAMPLER_ADDRESS_MODE_REPEAT, // clamp_mode
&r->samplers.repeat); // out_sampler
VK_CHK_WITH_RET(ret, "vk_create_sampler", false);
VK_NAME_OBJECT(vk, SAMPLER, r->samplers.repeat, "render_resources sampler repeat");
ret = vk_create_sampler( //
vk, // vk_bundle
VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, // clamp_mode
&r->samplers.clamp_to_edge); // out_sampler
VK_CHK_WITH_RET(ret, "vk_create_sampler", false);
VK_NAME_OBJECT(vk, SAMPLER, r->samplers.clamp_to_edge, "render_resources sampler clamp_to_edge");
ret = vk_create_sampler( //
vk, // vk_bundle
VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, // clamp_mode
&r->samplers.clamp_to_border_black); // out_sampler
VK_CHK_WITH_RET(ret, "vk_create_sampler", false);
VK_NAME_OBJECT(vk, SAMPLER, r->samplers.clamp_to_border_black,
"render_resources sampler clamp_to_border_black");
/*
* Command buffer pool, needs to go first.
@ -579,6 +599,8 @@ render_resources_init(struct render_resources *r,
ret = vk_cmd_pool_init(vk, &r->distortion_pool, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT);
VK_CHK_WITH_RET(ret, "vk_cmd_pool_init", false);
VK_NAME_OBJECT(vk, COMMAND_POOL, r->distortion_pool.pool, "render_resources distortion command pool");
VkCommandPoolCreateInfo command_pool_info = {
.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
.flags = VK_COMMAND_POOL_CREATE_TRANSIENT_BIT,
@ -588,6 +610,8 @@ render_resources_init(struct render_resources *r,
ret = vk->vkCreateCommandPool(vk->device, &command_pool_info, NULL, &r->cmd_pool);
VK_CHK_WITH_RET(ret, "vkCreateCommandPool", false);
VK_NAME_OBJECT(vk, COMMAND_POOL, r->cmd_pool, "render_resources command pool");
/*
* Mock, used as a default image empty image.
@ -615,6 +639,9 @@ render_resources_init(struct render_resources *r,
&r->mock.color.image); // out_image
VK_CHK_WITH_RET(ret, "vk_create_image_simple", false);
VK_NAME_OBJECT(vk, DEVICE_MEMORY, r->mock.color.memory, "render_resources mock color device memory");
VK_NAME_OBJECT(vk, IMAGE, r->mock.color.image, "render_resources mock color image");
ret = vk_create_view( //
vk, // vk_bundle
r->mock.color.image, // image
@ -624,11 +651,15 @@ render_resources_init(struct render_resources *r,
&r->mock.color.image_view); // out_view
VK_CHK_WITH_RET(ret, "vk_create_view", false);
VK_NAME_OBJECT(vk, IMAGE_VIEW, r->mock.color.image_view, "render_resources mock color image view");
VkCommandBuffer cmd = VK_NULL_HANDLE;
ret = vk_cmd_create_and_begin_cmd_buffer_locked(vk, r->cmd_pool, 0, &cmd);
VK_CHK_WITH_RET(ret, "vk_cmd_create_and_begin_cmd_buffer_locked", false);
VK_NAME_OBJECT(vk, COMMAND_BUFFER, cmd, "render_resources mock command buffer");
ret = prepare_mock_image_locked( //
vk, // vk_bundle
cmd, // cmd
@ -649,6 +680,8 @@ render_resources_init(struct render_resources *r,
ret = vk_create_pipeline_cache(vk, &r->pipeline_cache);
VK_CHK_WITH_RET(ret, "vk_create_pipeline_cache", false);
VK_NAME_OBJECT(vk, PIPELINE_CACHE, r->pipeline_cache, "render_resources pipeline cache");
VkCommandBufferAllocateInfo cmd_buffer_info = {
.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
.commandPool = r->cmd_pool,
@ -662,6 +695,8 @@ render_resources_init(struct render_resources *r,
&r->cmd); // pCommandBuffers
VK_CHK_WITH_RET(ret, "vkAllocateCommandBuffers", false);
VK_NAME_OBJECT(vk, COMMAND_BUFFER, r->cmd, "render_resources command buffer");
/*
* Gfx.
@ -689,6 +724,9 @@ render_resources_init(struct render_resources *r,
&r->gfx.ubo_and_src_descriptor_pool); // out_descriptor_pool
VK_CHK_WITH_RET(ret, "vk_create_descriptor_pool", false);
VK_NAME_OBJECT(vk, DESCRIPTOR_POOL, r->gfx.ubo_and_src_descriptor_pool,
"render_resources ubo and src descriptor pool");
VkBufferUsageFlags usage_flags = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
VkMemoryPropertyFlags memory_property_flags = //
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | //
@ -715,6 +753,7 @@ render_resources_init(struct render_resources *r,
memory_property_flags, // memory_property_flags
size); // size
VK_CHK_WITH_RET(ret, "render_buffer_init", false);
VK_NAME_OBJECT(vk, BUFFER, r->gfx.shared_ubo.buffer, "render_resources gfx shared ubo");
ret = render_buffer_map( //
vk, // vk_bundle
@ -734,12 +773,18 @@ render_resources_init(struct render_resources *r,
&r->gfx.layer.shared.descriptor_set_layout); // out_descriptor_set_layout
VK_CHK_WITH_RET(ret, "create_gfx_ubo_and_src_descriptor_set_layout", false);
VK_NAME_OBJECT(vk, DESCRIPTOR_SET_LAYOUT, r->gfx.layer.shared.descriptor_set_layout,
"render_resources gfx layer shared descriptor set layout");
ret = vk_create_pipeline_layout( //
vk, // vk_bundle
r->gfx.layer.shared.descriptor_set_layout, // descriptor_set_layout
&r->gfx.layer.shared.pipeline_layout); // out_pipeline_layout
VK_CHK_WITH_RET(ret, "vk_create_pipeline_layout", false);
VK_NAME_OBJECT(vk, PIPELINE_LAYOUT, r->gfx.layer.shared.pipeline_layout,
"render_resources gfx layer shared pipeline layout");
/*
* Mesh static.
@ -752,12 +797,17 @@ render_resources_init(struct render_resources *r,
&r->mesh.descriptor_set_layout); // out_mesh_descriptor_set_layout
VK_CHK_WITH_RET(ret, "create_gfx_ubo_and_src_descriptor_set_layout", false);
VK_NAME_OBJECT(vk, DESCRIPTOR_SET_LAYOUT, r->mesh.descriptor_set_layout,
"render_resources mesh descriptor set layout");
ret = vk_create_pipeline_layout( //
vk, // vk_bundle
r->mesh.descriptor_set_layout, // descriptor_set_layout
&r->mesh.pipeline_layout); // out_pipeline_layout
VK_CHK_WITH_RET(ret, "vk_create_pipeline_layout", false);
VK_NAME_OBJECT(vk, PIPELINE_LAYOUT, r->mesh.pipeline_layout, "render_resources mesh pipeline layout");
bret = init_mesh_vertex_buffers( //
vk, //
&r->mesh.vbo, //
@ -808,6 +858,7 @@ render_resources_init(struct render_resources *r,
&r->compute.descriptor_pool); // out_descriptor_pool
VK_CHK_WITH_RET(ret, "vk_create_descriptor_pool", false);
VK_NAME_OBJECT(vk, DESCRIPTOR_POOL, r->compute.descriptor_pool, "render_resources compute descriptor pool");
/*
* Layer pipeline
@ -822,12 +873,18 @@ render_resources_init(struct render_resources *r,
&r->compute.layer.descriptor_set_layout); // out_descriptor_set_layout
VK_CHK_WITH_RET(ret, "create_compute_layer_descriptor_set_layout", false);
VK_NAME_OBJECT(vk, DESCRIPTOR_SET_LAYOUT, r->compute.layer.descriptor_set_layout,
"render_resources compute layer descriptor set layout");
ret = vk_create_pipeline_layout( //
vk, // vk_bundle
r->compute.layer.descriptor_set_layout, // descriptor_set_layout
&r->compute.layer.pipeline_layout); // out_pipeline_layout
VK_CHK_WITH_RET(ret, "vk_create_pipeline_layout", false);
VK_NAME_OBJECT(vk, PIPELINE_LAYOUT, r->compute.layer.pipeline_layout,
"render_resources compute layer pipeline layout");
struct compute_layer_params layer_params = {
.do_timewarp = false,
.do_color_correction = true,
@ -844,6 +901,9 @@ render_resources_init(struct render_resources *r,
&r->compute.layer.non_timewarp_pipeline); // out_compute_pipeline
VK_CHK_WITH_RET(ret, "create_compute_layer_pipeline", false);
VK_NAME_OBJECT(vk, PIPELINE, r->compute.layer.non_timewarp_pipeline,
"render_resources compute layer non timewarp pipeline");
struct compute_layer_params layer_timewarp_params = {
.do_timewarp = true,
.do_color_correction = true,
@ -860,6 +920,9 @@ render_resources_init(struct render_resources *r,
&r->compute.layer.timewarp_pipeline); // out_compute_pipeline
VK_CHK_WITH_RET(ret, "create_compute_layer_pipeline", false);
VK_NAME_OBJECT(vk, PIPELINE, r->compute.layer.timewarp_pipeline,
"render_resources compute layer timewarp pipeline");
size_t layer_ubo_size = sizeof(struct render_compute_layer_ubo_data);
for (uint32_t i = 0; i < ARRAY_SIZE(r->compute.layer.ubos); i++) {
@ -870,6 +933,7 @@ render_resources_init(struct render_resources *r,
memory_property_flags, // memory_property_flags
layer_ubo_size); // size
VK_CHK_WITH_RET(ret, "render_buffer_init", false);
VK_NAME_OBJECT(vk, BUFFER, r->compute.layer.ubos[i].buffer, "render_resources compute layer ubo");
ret = render_buffer_map( //
vk, // vk_bundle
@ -891,12 +955,18 @@ render_resources_init(struct render_resources *r,
&r->compute.distortion.descriptor_set_layout); // out_descriptor_set_layout
VK_CHK_WITH_RET(ret, "create_compute_distortion_descriptor_set_layout", false);
VK_NAME_OBJECT(vk, DESCRIPTOR_SET_LAYOUT, r->compute.distortion.descriptor_set_layout,
"render_resources compute distortion descriptor set layout");
ret = vk_create_pipeline_layout( //
vk, // vk_bundle
r->compute.distortion.descriptor_set_layout, // descriptor_set_layout
&r->compute.distortion.pipeline_layout); // out_pipeline_layout
VK_CHK_WITH_RET(ret, "vk_create_pipeline_layout", false);
VK_NAME_OBJECT(vk, PIPELINE_LAYOUT, r->compute.distortion.pipeline_layout,
"render_resources compute distortion pipeline layout");
struct compute_distortion_params distortion_params = {
.distortion_texel_count = RENDER_DISTORTION_IMAGE_DIMENSIONS,
.do_timewarp = false,
@ -911,6 +981,8 @@ render_resources_init(struct render_resources *r,
&r->compute.distortion.pipeline); // out_compute_pipeline
VK_CHK_WITH_RET(ret, "create_compute_distortion_pipeline", false);
VK_NAME_OBJECT(vk, PIPELINE, r->compute.distortion.pipeline, "render_resources compute distortion pipeline");
struct compute_distortion_params distortion_timewarp_params = {
.distortion_texel_count = RENDER_DISTORTION_IMAGE_DIMENSIONS,
.do_timewarp = true,
@ -925,6 +997,9 @@ render_resources_init(struct render_resources *r,
&r->compute.distortion.timewarp_pipeline); // out_compute_pipeline
VK_CHK_WITH_RET(ret, "create_compute_distortion_pipeline", false);
VK_NAME_OBJECT(vk, PIPELINE, r->compute.distortion.timewarp_pipeline,
"render_resources compute distortion timewarp pipeline");
size_t distortion_ubo_size = sizeof(struct render_compute_distortion_ubo_data);
ret = render_buffer_init( //
@ -934,6 +1009,7 @@ render_resources_init(struct render_resources *r,
memory_property_flags, // memory_property_flags
distortion_ubo_size); // size
VK_CHK_WITH_RET(ret, "render_buffer_init", false);
VK_NAME_OBJECT(vk, BUFFER, r->compute.distortion.ubo.buffer, "render_resources compute distortion ubo");
ret = render_buffer_map( //
vk, // vk_bundle
&r->compute.distortion.ubo); // buffer
@ -953,6 +1029,8 @@ render_resources_init(struct render_resources *r,
&r->compute.clear.pipeline); // out_compute_pipeline
VK_CHK_WITH_RET(ret, "vk_create_compute_pipeline", false);
VK_NAME_OBJECT(vk, PIPELINE, r->compute.clear.pipeline, "render_resources compute clear pipeline");
size_t clear_ubo_size = sizeof(struct render_compute_distortion_ubo_data);
ret = render_buffer_init( //
@ -962,6 +1040,7 @@ render_resources_init(struct render_resources *r,
memory_property_flags, // memory_property_flags
clear_ubo_size); // size
VK_CHK_WITH_RET(ret, "render_buffer_init", false);
VK_NAME_OBJECT(vk, BUFFER, r->compute.clear.ubo.buffer, "render_resources compute clear ubo");
ret = render_buffer_map( //
vk, // vk_bundle
@ -1003,6 +1082,7 @@ render_resources_init(struct render_resources *r,
NULL, // pAllocator
&r->query_pool); // pQueryPool
VK_NAME_OBJECT(vk, QUERY_POOL, r->query_pool, "render_resources query pool");
/*
* Done

View file

@ -70,6 +70,7 @@
render_shaders_close(s, vk); \
return false; \
} \
VK_NAME_OBJECT(vk, SHADER_MODULE, s->SHADER, #SHADER); \
} while (false)