From d8a580d8750c9978f33793caec57d37ae5822c3b Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sat, 25 Sep 2021 15:45:11 +0100 Subject: [PATCH] c/render: Tidy compute rendering --- src/xrt/compositor/render/comp_compute.c | 16 +++++++-------- src/xrt/compositor/render/comp_render.h | 26 ++---------------------- 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/src/xrt/compositor/render/comp_compute.c b/src/xrt/compositor/render/comp_compute.c index c27f96376..c9ace9915 100644 --- a/src/xrt/compositor/render/comp_compute.c +++ b/src/xrt/compositor/render/comp_compute.c @@ -474,7 +474,7 @@ comp_rendering_compute_init(struct comp_compositor *c, struct comp_resources *r, vk, // r->compute.descriptor_pool, // descriptor_pool r->compute.descriptor_set_layout, // descriptor_set_layout - &crc->clear_descriptor_set)); // descriptor_set + &crc->descriptor_set)); // descriptor_set return true; } @@ -510,7 +510,7 @@ comp_rendering_compute_close(struct comp_rendering_compute *crc) destroy_command_buffer(vk, crc->cmd); // Reclaimed by vkResetDescriptorPool. - crc->clear_descriptor_set = VK_NULL_HANDLE; + crc->descriptor_set = VK_NULL_HANDLE; vk->vkResetDescriptorPool(vk->device, crc->r->compute.descriptor_pool, 0); @@ -606,7 +606,7 @@ comp_rendering_compute_projection_timewarp(struct comp_rendering_compute *crc, r->compute.ubo_binding, // r->compute.ubo.buffer, // VK_WHOLE_SIZE, // - crc->clear_descriptor_set); // + crc->descriptor_set); // vk->vkCmdBindPipeline( // crc->cmd, // commandBuffer @@ -619,7 +619,7 @@ comp_rendering_compute_projection_timewarp(struct comp_rendering_compute *crc, r->compute.pipeline_layout, // layout 0, // firstSet 1, // descriptorSetCount - &crc->clear_descriptor_set, // pDescriptorSets + &crc->descriptor_set, // pDescriptorSets 0, // dynamicOffsetCount NULL); // pDynamicOffsets @@ -726,7 +726,7 @@ comp_rendering_compute_projection(struct comp_rendering_compute *crc, r->compute.ubo_binding, // r->compute.ubo.buffer, // VK_WHOLE_SIZE, // - crc->clear_descriptor_set); // + crc->descriptor_set); // vk->vkCmdBindPipeline( // crc->cmd, // commandBuffer @@ -739,7 +739,7 @@ comp_rendering_compute_projection(struct comp_rendering_compute *crc, r->compute.pipeline_layout, // layout 0, // firstSet 1, // descriptorSetCount - &crc->clear_descriptor_set, // pDescriptorSets + &crc->descriptor_set, // pDescriptorSets 0, // dynamicOffsetCount NULL); // pDynamicOffsets @@ -849,7 +849,7 @@ comp_rendering_compute_clear(struct comp_rendering_compute *crc, // r->compute.ubo_binding, // r->compute.ubo.buffer, // VK_WHOLE_SIZE, // - crc->clear_descriptor_set); // + crc->descriptor_set); // vk->vkCmdBindPipeline( // crc->cmd, // commandBuffer @@ -862,7 +862,7 @@ comp_rendering_compute_clear(struct comp_rendering_compute *crc, // r->compute.pipeline_layout, // layout 0, // firstSet 1, // descriptorSetCount - &crc->clear_descriptor_set, // pDescriptorSets + &crc->descriptor_set, // pDescriptorSets 0, // dynamicOffsetCount NULL); // pDynamicOffsets diff --git a/src/xrt/compositor/render/comp_render.h b/src/xrt/compositor/render/comp_render.h index e76cc6add..054da4494 100644 --- a/src/xrt/compositor/render/comp_render.h +++ b/src/xrt/compositor/render/comp_render.h @@ -469,30 +469,8 @@ struct comp_rendering_compute //! Command buffer where all commands are recorded. VkCommandBuffer cmd; - //! Clear descriptor set. - VkDescriptorSet clear_descriptor_set; - -#if 0 - struct - { - //! The data for this target. - struct comp_target_data data; - - //! Image view we are targeting, not owned by the rendering. - VkImageView image_view; - } targets[2]; - - //! Number of different targets, number of views are always two. - uint32_t num_targets; -#endif - - struct - { - int temp; - } view; - - //! The current view we are "rendering" to. - uint32_t current_view; + //! Shared descriptor set between clear, projection and timewarp. + VkDescriptorSet descriptor_set; }; struct comp_rendering_compute_data