-
Notifications
You must be signed in to change notification settings - Fork 0
Update from task f96c1ed4-2a53-4444-90e8-9b57f386bac1 #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: chunkkeyubfixsimulationmoduleperformance-ebd4e
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,17 +123,14 @@ RenderGraphBuilder& RenderGraphBuilder::addDependency(uint32_t from, uint32_t to | |
| // ============================================================================ | ||
| // RenderGraph Implementation | ||
| // ============================================================================ | ||
|
|
||
| RenderGraph::~RenderGraph() { | ||
| // Destructor - cleanup se hace explícitamente en cleanup() | ||
| } | ||
|
|
||
| void RenderGraph::compile(RenderGraphBuilder&& builder) { | ||
| device = VK_NULL_HANDLE; // Se seteará cuando tengamos contexto Vulkan | ||
|
|
||
| // Copiar recursos y passes | ||
| compiledRegistry.resources = std::move(builder.resources); | ||
|
|
||
| // Limpiar estado previo antes de compilar | ||
| compiledPasses.clear(); | ||
|
|
||
| compiledPasses.resize(builder.passes.size()); | ||
|
tronpis marked this conversation as resolved.
tronpis marked this conversation as resolved.
|
||
|
|
||
|
|
||
| // Construir mapa nombre->índice | ||
|
Comment on lines
+137
to
149
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Stale resource index map RenderGraph::compile() rebuilds compiledRegistry.nameToIndex without clearing previous entries, so recompiling with a different resource set can make getResource() return a pointer to the wrong resource (or out-of-bounds). This can also defeat the intended "not found" checks during compilation by returning a stale hit. Agent Prompt
|
||
| for (size_t i = 0; i < compiledRegistry.resources.size(); ++i) { | ||
|
|
@@ -200,21 +197,9 @@ void RenderGraph::compile(RenderGraphBuilder&& builder) { | |
| // TODO: Implementar análisis de dependencias del grafo | ||
| } | ||
|
|
||
| // Añadir dependencias explícitas | ||
| for (const auto& dep : builder.explicitDependencies) { | ||
| if (dep.from < compiledPasses.size() && dep.to < compiledPasses.size()) { | ||
| VkSubpassDependency vkDep{}; | ||
| vkDep.srcSubpass = dep.from; | ||
| vkDep.dstSubpass = dep.to; | ||
| vkDep.srcStageMask = dep.srcStageMask; | ||
| vkDep.dstStageMask = dep.dstStageMask; | ||
| vkDep.srcAccessMask = dep.srcAccessMask; | ||
| vkDep.dstAccessMask = dep.dstAccessMask; | ||
| vkDep.dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT; | ||
|
|
||
| compiledPasses[dep.to].dependencies.push_back(vkDep); | ||
| } | ||
| } | ||
| // Las dependencias entre passes separados se manejan mediante barreras de pipeline | ||
| // registradas durante la ejecución, no mediante VkSubpassDependency | ||
| // VkSubpassDependency solo es válido para subpasses dentro del mismo VkRenderPass | ||
| } | ||
|
|
||
| void RenderGraph::createRenderPasses(VkDevice dev) { | ||
|
|
@@ -251,21 +236,33 @@ void RenderGraph::createFramebuffers(VkDevice dev, VkExtent2D swapchainExtent) { | |
| // Obtener views de todos los attachments | ||
| for (const auto& colorName : compiled.definition.colorAttachments) { | ||
| const ResourceHandle* res = compiledRegistry.getResource(colorName); | ||
| if (res) { | ||
| attachments.push_back(res->imageView); | ||
| if (!res->isSwapchain) { | ||
| extent = res->extent; | ||
| } | ||
| if (!res) { | ||
| throw std::runtime_error("Color attachment not found: " + colorName); | ||
| } | ||
| if (res->imageView == VK_NULL_HANDLE) { | ||
| throw std::runtime_error("Color attachment has null imageView: " + colorName + | ||
| ". For external targets, use addExternalImage() instead of addColorTarget()."); | ||
| } | ||
| attachments.push_back(res->imageView); | ||
| if (!res->isSwapchain) { | ||
| extent = res->extent; | ||
| } | ||
|
Comment on lines
+247
to
249
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| } | ||
|
|
||
| if (!compiled.definition.depthAttachment.empty()) { | ||
| const ResourceHandle* res = compiledRegistry.getResource(compiled.definition.depthAttachment); | ||
| if (res) { | ||
| attachments.push_back(res->imageView); | ||
| if (!res) { | ||
| throw std::runtime_error("Depth attachment not found: " + compiled.definition.depthAttachment); | ||
| } | ||
| if (res->imageView == VK_NULL_HANDLE) { | ||
| throw std::runtime_error("Depth attachment has null imageView: " + compiled.definition.depthAttachment); | ||
| } | ||
| attachments.push_back(res->imageView); | ||
| } | ||
|
|
||
| // Guardar el extent calculado en el CompiledPass para usarlo en execute() | ||
| compiled.extent = extent; | ||
|
|
||
| VkFramebufferCreateInfo fbInfo{}; | ||
| fbInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO; | ||
| fbInfo.renderPass = compiled.vkRenderPass; | ||
|
|
@@ -311,18 +308,20 @@ void RenderGraph::execute(VkCommandBuffer cmd, ResourceRegistry& registry, uint3 | |
| rpBegin.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; | ||
| rpBegin.renderPass = compiled.vkRenderPass; | ||
| rpBegin.framebuffer = compiled.framebuffer; | ||
| rpBegin.renderArea.extent = {compiled.attachments.empty() ? 0 : | ||
| registry.resources[0].extent.width, | ||
| compiled.attachments.empty() ? 0 : | ||
| registry.resources[0].extent.height}; | ||
| rpBegin.renderArea.extent = compiled.extent; | ||
|
|
||
|
Comment on lines
322
to
326
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Zero render area extent RenderGraph::execute() uses compiled.extent for rpBegin.renderArea.extent, but CompiledPass::extent
defaults to {0,0} and is only set in createFramebuffers(). Since createFramebuffers() is private and
not called anywhere in this module, execute() can begin render passes with a 0x0 render area.
Agent Prompt
|
||
| // Clear values | ||
| // Clear values - uno por cada attachment (color attachments primero, luego depth) | ||
| std::vector<VkClearValue> clearValues; | ||
| if (!compiled.definition.colorAttachments.empty()) { | ||
| clearValues.reserve(compiled.attachments.size()); | ||
|
|
||
| // Color attachments | ||
| for (size_t i = 0; i < compiled.definition.colorAttachments.size(); ++i) { | ||
| VkClearValue colorClear{}; | ||
| colorClear.color = compiled.definition.clearColorValue; | ||
| clearValues.push_back(colorClear); | ||
| } | ||
|
|
||
| // Depth attachment | ||
| if (!compiled.definition.depthAttachment.empty()) { | ||
| VkClearValue depthClear{}; | ||
| depthClear.depthStencil = compiled.definition.clearDepthValue; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing standard ignore patterns for IDEs (
.vscode/,.idea/), environment files (.env*), and coverage reports is a regression in project hygiene. These files are local to a developer's environment and should not be tracked in the repository to avoid accidental commits of sensitive or environment-specific data.