mirror of
https://github.com/johndoe6345789/SDL3CPlusPlus.git
synced 2026-05-03 18:14:57 +00:00
feat: Implement render graph support in Vulkan backend
- Added RecordRenderGraph method to IRenderCommandService and its implementation in RenderCommandService. - Updated VulkanGraphicsBackend to handle render graph definitions and record commands accordingly. - Introduced GetDepthFormat method in ISwapchainService to retrieve depth buffer format. - Enhanced VulkanGraphicsBackend with methods to set render graph definitions and manage render graph resources. - Added RenderGraphImage structure to manage render targets and depth targets within the render graph. - Updated interfaces and services to accommodate new render graph functionality, including descriptor set layout retrieval in IPipelineService.
This commit is contained in:
@@ -220,7 +220,12 @@ bool VulkanGraphicsBackend::EndFrame(GraphicsDeviceHandle device) {
|
||||
logger_->Trace("VulkanGraphicsBackend", "EndFrame");
|
||||
|
||||
// Record all accumulated commands
|
||||
renderCommandService_->RecordCommands(currentImageIndex_, frameCommands_, currentViewProj_);
|
||||
if (renderGraphEnabled_) {
|
||||
renderCommandService_->RecordRenderGraph(currentImageIndex_, renderGraphDefinition_,
|
||||
frameCommands_, currentViewProj_);
|
||||
} else {
|
||||
renderCommandService_->RecordCommands(currentImageIndex_, frameCommands_, currentViewProj_);
|
||||
}
|
||||
|
||||
// End the frame
|
||||
return renderCommandService_->EndFrame(currentImageIndex_);
|
||||
@@ -231,6 +236,14 @@ void VulkanGraphicsBackend::SetViewProjection(const std::array<float, 16>& viewP
|
||||
currentViewProj_ = viewProj;
|
||||
}
|
||||
|
||||
void VulkanGraphicsBackend::SetRenderGraphDefinition(const RenderGraphDefinition& definition) {
|
||||
logger_->Trace("VulkanGraphicsBackend", "SetRenderGraphDefinition",
|
||||
"resources=" + std::to_string(definition.resources.size()) +
|
||||
", passes=" + std::to_string(definition.passes.size()));
|
||||
renderGraphDefinition_ = definition;
|
||||
renderGraphEnabled_ = !definition.passes.empty();
|
||||
}
|
||||
|
||||
void VulkanGraphicsBackend::Draw(GraphicsDeviceHandle device, GraphicsPipelineHandle pipeline,
|
||||
GraphicsBufferHandle vertexBuffer, GraphicsBufferHandle indexBuffer,
|
||||
uint32_t indexCount, const std::array<float, 16>& modelMatrix) {
|
||||
|
||||
Reference in New Issue
Block a user