diff --git a/include/vkcv/Core.hpp b/include/vkcv/Core.hpp index 9024b846c0f4e344aa360d5a08ca78a9baf36927..7e46ab575142dd9d5ff928c93bc695b4109db29c 100644 --- a/include/vkcv/Core.hpp +++ b/include/vkcv/Core.hpp @@ -331,15 +331,16 @@ namespace vkcv const std::vector<ImageHandle> &renderTargets, const WindowHandle &windowHandle); - void recordIndexedIndirectDrawcallsToCmdStream( - const CommandStreamHandle cmdStreamHandle, - const PassHandle renderpassHandle, - const PipelineHandle pipelineHandle, - const PushConstants &pushConstantData, - const vkcv::Mesh &compiledMesh, - const std::vector<ImageHandle> &renderTargets, - const vkcv::Buffer<vk::DrawIndexedIndirectCommand> &indirectBuffer, - const uint32_t drawCount); + void Core::recordIndexedIndirectDrawcallsToCmdStream( + const CommandStreamHandle cmdStreamHandle, + const PassHandle renderpassHandle, + const GraphicsPipelineHandle &pipelineHandle, + const PushConstants &pushConstantData, + const vkcv::Mesh &compiledMesh, + const std::vector<ImageHandle> &renderTargets, + const vkcv::Buffer<vk::DrawIndexedIndirectCommand> &indirectBuffer, + const uint32_t drawCount, + const WindowHandle &windowHandle); void recordMeshShaderDrawcalls( const CommandStreamHandle& cmdStreamHandle, diff --git a/projects/draw_indirect/src/main.cpp b/projects/draw_indirect/src/main.cpp index 03dddb68ed79e1e963608afea826733a43b368b8..5ab0c09e5a4e300993ab563d960322bfcb4d8837 100644 --- a/projects/draw_indirect/src/main.cpp +++ b/projects/draw_indirect/src/main.cpp @@ -398,7 +398,8 @@ int main(int argc, const char** argv) { mesh, renderTargets, indirectBuffer, - 1); + 1, + windowHandle); core.prepareSwapchainImageForPresent(cmdStream); core.submitCommandStream(cmdStream); diff --git a/src/vkcv/Core.cpp b/src/vkcv/Core.cpp index 3fd406626ef1cd9a8190dfd80a49b99bbd9bfba6..074daac487358acb98fb7a78d35c6384cf087528 100644 --- a/src/vkcv/Core.cpp +++ b/src/vkcv/Core.cpp @@ -333,18 +333,19 @@ namespace vkcv void Core::recordIndexedIndirectDrawcallsToCmdStream( const CommandStreamHandle cmdStreamHandle, const PassHandle renderpassHandle, - const PipelineHandle pipelineHandle, + const GraphicsPipelineHandle &pipelineHandle, const PushConstants &pushConstantData, const vkcv::Mesh &compiledMesh, const std::vector<ImageHandle> &renderTargets, const vkcv::Buffer<vk::DrawIndexedIndirectCommand> &indirectBuffer, - const uint32_t drawCount) { + const uint32_t drawCount, + const WindowHandle &windowHandle) { if (m_currentSwapchainImageIndex == std::numeric_limits<uint32_t>::max()) { return; } - - const std::array<uint32_t, 2> widthHeight = getWidthHeightFromRenderTargets(renderTargets, m_swapchain, + SwapchainHandle swapchainHandle = m_WindowManager->getWindow(windowHandle).getSwapchainHandle(); + const std::array<uint32_t, 2> widthHeight = getWidthHeightFromRenderTargets(renderTargets, m_SwapchainManager->getSwapchain(swapchainHandle), *m_ImageManager); const auto width = widthHeight[0]; const auto height = widthHeight[1]; @@ -359,7 +360,7 @@ namespace vkcv vk::CommandBuffer cmdBuffer = m_CommandStreamManager->getStreamCommandBuffer(cmdStreamHandle); transitionRendertargetsToAttachmentLayout(renderTargets, *m_ImageManager, cmdBuffer); - const vk::Framebuffer framebuffer = createFramebuffer(renderTargets, *m_ImageManager, m_swapchain, renderpass, + const vk::Framebuffer framebuffer = createFramebuffer(renderTargets, *m_ImageManager, m_SwapchainManager->getSwapchain(swapchainHandle), renderpass, m_Context.m_Device); if (!framebuffer) { @@ -381,7 +382,7 @@ namespace vkcv cmdBuffer.bindPipeline(vk::PipelineBindPoint::eGraphics, pipeline, {}); - const PipelineConfig &pipeConfig = m_PipelineManager->getPipelineConfig(pipelineHandle); + const GraphicsPipelineConfig &pipeConfig = m_PipelineManager->getPipelineConfig(pipelineHandle); if (pipeConfig.m_UseDynamicViewport) { recordDynamicViewport(cmdBuffer, width, height); }