diff --git a/include/vkcv/Buffer.hpp b/include/vkcv/Buffer.hpp index 352d7e89c99ced73bd223007d80e9c9664d8254f..5a4afb060c8ae9048fbd2edb65c6d8167976f810 100644 --- a/include/vkcv/Buffer.hpp +++ b/include/vkcv/Buffer.hpp @@ -26,12 +26,12 @@ namespace vkcv { Buffer(Core* core, const BufferHandle& handle) : m_core(core), m_handle(handle) {} Buffer(const Buffer& other) = default; - Buffer(Buffer&& other) = default; + Buffer(Buffer&& other) noexcept = default; ~Buffer() = default; Buffer& operator=(const Buffer& other) = default; - Buffer& operator=(Buffer&& other) = default; + Buffer& operator=(Buffer&& other) noexcept = default; /** * @brief Returns the buffers handle. diff --git a/include/vkcv/Core.hpp b/include/vkcv/Core.hpp index 835248659a9eb71fec20b4079ca506f04257b4ce..39addd72dbe15cd24ffd8b263075caf14c492437 100644 --- a/include/vkcv/Core.hpp +++ b/include/vkcv/Core.hpp @@ -555,7 +555,7 @@ namespace vkcv * @param cmdStreamHandle Handle of the command stream that the drawcalls are recorded into * @param pipelineHandle Handle of the pipeline that is used for the drawcalls * @param pushConstantData Push constants that are used for the drawcalls, ignored if constant size is set to 0 - * @param compiledDescriptorSet TODO + * @param descriptorSetUsages Descriptor set usages of the drawcalls * @param compiledMesh TODO * @param drawcalls Information about each drawcall, consisting of mesh handle, descriptor set bindings and instance count * @param renderTargets Image handles that are used as render targets @@ -567,7 +567,7 @@ namespace vkcv const CommandStreamHandle cmdStreamHandle, const GraphicsPipelineHandle &pipelineHandle, const PushConstants &pushConstantData, - const vkcv::DescriptorSetHandle &compiledDescriptorSet, + const std::vector<DescriptorSetUsage> &descriptorSetUsages, const vkcv::Mesh &compiledMesh, const std::vector<ImageHandle> &renderTargets, const BufferHandle &indirectBuffer, @@ -625,7 +625,7 @@ namespace vkcv * @param cmdStream Handle of the command stream that the dispatch is recorded into * @param computePipeline Handle of the pipeline that is used for the dispatch * @param dispatchSize How many work groups are dispatched - * @param descriptorSetUsages Descriptor set bindings of the dispatch + * @param descriptorSetUsages Descriptor set usages of the dispatch * @param pushConstants Push constant data for the dispatch */ void recordComputeDispatchToCmdStream(const CommandStreamHandle& cmdStream, diff --git a/projects/indirect_draw/src/main.cpp b/projects/indirect_draw/src/main.cpp index 2f1f08455190986fcd7abdf2bc15b27a116f8a29..b6e9049b6e648f954a1cf2590b08f4bac39bf998 100644 --- a/projects/indirect_draw/src/main.cpp +++ b/projects/indirect_draw/src/main.cpp @@ -553,7 +553,7 @@ int main(int argc, const char** argv) { cmdStream, sponzaPipelineHandle, pushConstants, - descriptorSet, + { vkcv::DescriptorSetUsage(0, descriptorSet) }, compiledMesh, renderTargets, indirectBuffer.getHandle(), diff --git a/src/vkcv/Core.cpp b/src/vkcv/Core.cpp index ad0b7d4947c624be0d38e3f6aee79eb1b291537b..3d7d126cbc08632367ba5f598fe98dfb273cbe42 100644 --- a/src/vkcv/Core.cpp +++ b/src/vkcv/Core.cpp @@ -413,7 +413,7 @@ namespace vkcv pipelineLayout, descriptorUsage.setLocation, descriptorSetManager.getDescriptorSet(descriptorUsage.descriptorSet).vulkanHandle, - nullptr + descriptorUsage.dynamicOffsets ); } @@ -574,7 +574,7 @@ namespace vkcv void Core::recordIndexedIndirectDrawcallsToCmdStream(const CommandStreamHandle cmdStreamHandle, const GraphicsPipelineHandle &pipelineHandle, const PushConstants &pushConstantData, - const vkcv::DescriptorSetHandle &compiledDescriptorSet, + const std::vector<DescriptorSetUsage> &descriptorSetUsages, const vkcv::Mesh &compiledMesh, const std::vector<ImageHandle> &renderTargets, const BufferHandle &indirectBuffer, @@ -590,15 +590,15 @@ namespace vkcv ); auto recordFunction = [&](const vk::CommandBuffer& cmdBuffer) { - const auto& descSet = m_DescriptorSetManager->getDescriptorSet(compiledDescriptorSet); - - cmdBuffer.bindDescriptorSets( - vk::PipelineBindPoint::eGraphics, - pipelineLayout, - 0, - descSet.vulkanHandle, - nullptr - ); + for (const auto& usage : descriptorSetUsages) { + cmdBuffer.bindDescriptorSets( + vk::PipelineBindPoint::eGraphics, + pipelineLayout, + usage.setLocation, + m_DescriptorSetManager->getDescriptorSet(usage.descriptorSet).vulkanHandle, + usage.dynamicOffsets + ); + } if (pushConstantData.getSizePerDrawcall() > 0) { cmdBuffer.pushConstants( @@ -660,7 +660,8 @@ namespace vkcv pipelineLayout, descriptorUsage.setLocation, descriptorSetManager.getDescriptorSet(descriptorUsage.descriptorSet).vulkanHandle, - nullptr); + descriptorUsage.dynamicOffsets + ); } if (pushConstantData.getData()) {