Changes to command ownership
This commit is contained in:
@@ -48,13 +48,13 @@ void DebugPass::beginFrame(const Component::Camera& cam)
|
||||
void DebugPass::render()
|
||||
{
|
||||
graphics->beginRenderPass(renderPass);
|
||||
Gfx::PRenderCommand renderCommand = graphics->createRenderCommand("DebugRender");
|
||||
Gfx::ORenderCommand renderCommand = graphics->createRenderCommand("DebugRender");
|
||||
renderCommand->setViewport(viewport);
|
||||
renderCommand->bindPipeline(pipeline);
|
||||
renderCommand->bindDescriptor(viewParamsSet);
|
||||
renderCommand->bindVertexBuffer({ debugVertices });
|
||||
renderCommand->draw((uint32)gDebugVertices.size(), 1, 0, 0);
|
||||
graphics->executeCommands(Array{renderCommand});
|
||||
graphics->executeCommands(Array{std::move(renderCommand)});
|
||||
graphics->endRenderPass();
|
||||
gDebugVertices.clear();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ void DepthPrepass::render()
|
||||
permutation.setVertexFile("LegacyBasePass");
|
||||
}
|
||||
graphics->beginRenderPass(renderPass);
|
||||
Array<Gfx::PRenderCommand> commands;
|
||||
Array<Gfx::ORenderCommand> commands;
|
||||
for (VertexData* vertexData : VertexData::getList())
|
||||
{
|
||||
permutation.setVertexData(vertexData->getTypeName());
|
||||
@@ -66,7 +66,7 @@ void DepthPrepass::render()
|
||||
// SceneData => per material instance
|
||||
Gfx::PermutationId id(permutation);
|
||||
|
||||
Gfx::PRenderCommand command = graphics->createRenderCommand("DepthRender");
|
||||
Gfx::ORenderCommand command = graphics->createRenderCommand("DepthRender");
|
||||
command->setViewport(viewport);
|
||||
Gfx::OPipelineLayout layout = graphics->createPipelineLayout(depthPrepassLayout);
|
||||
//layout->addDescriptorLayout(INDEX_MATERIAL, materialData.material->getDescriptorLayout());
|
||||
@@ -126,10 +126,10 @@ void DepthPrepass::render()
|
||||
}
|
||||
}
|
||||
}
|
||||
commands.add(command);
|
||||
commands.add(std::move(command));
|
||||
}
|
||||
}
|
||||
graphics->executeCommands(commands);
|
||||
graphics->executeCommands(std::move(commands));
|
||||
graphics->endRenderPass();
|
||||
}
|
||||
|
||||
|
||||
@@ -42,13 +42,13 @@ void UIPass::beginFrame(const Component::Camera& cam)
|
||||
void UIPass::render()
|
||||
{
|
||||
graphics->beginRenderPass(renderPass);
|
||||
Gfx::PRenderCommand command = graphics->createRenderCommand("UIPassCommand");
|
||||
Gfx::ORenderCommand command = graphics->createRenderCommand("UIPassCommand");
|
||||
command->setViewport(viewport);
|
||||
command->bindPipeline(pipeline);
|
||||
command->bindVertexBuffer({elementBuffer});
|
||||
command->bindDescriptor(descriptorSet);
|
||||
command->draw(4, static_cast<uint32>(renderElements.size()), 0, 0);
|
||||
graphics->executeCommands(Array<Gfx::PRenderCommand>({command}));
|
||||
graphics->executeCommands(Array{std::move(command)});
|
||||
graphics->endRenderPass();
|
||||
|
||||
//co_return;
|
||||
|
||||
Reference in New Issue
Block a user