}
}
-std::vector<Command*> TestGraphicsCommandBuffer::GetCommandsByType(CommandTypeMask mask)
+std::vector<const Command*> TestGraphicsCommandBuffer::GetCommandsByType(CommandTypeMask mask) const
{
- std::vector<Command*> mCommandStack{};
+ std::vector<const Command*> mCommandStack{};
for(auto& cmd : mCommands)
{
if(uint32_t(cmd.type) == (mask & uint32_t(cmd.type)))
return mCommandStack;
}
-std::vector<Command*> TestGraphicsCommandBuffer::GetChildCommandsByType(CommandTypeMask mask)
+std::vector<const Command*> TestGraphicsCommandBuffer::GetChildCommandsByType(CommandTypeMask mask) const
{
- std::vector<Command*> mCommandStack{};
+ std::vector<const Command*> mCommandStack{};
for(auto& cmd : mCommands)
{
if(uint32_t(cmd.type) == (mask & uint32_t(cmd.type)))
struct
{
- std::vector<TestGraphicsCommandBuffer*> buffers;
+ std::vector<const TestGraphicsCommandBuffer*> buffers;
} executeCommandBuffers;
} data;
mCallStack.PushCall("EndRenderPass", "");
}
- void ExecuteCommandBuffers(std::vector<CommandBuffer*>&& commandBuffers) override
+ void ExecuteCommandBuffers(std::vector<const CommandBuffer*>&& commandBuffers) override
{
mCommands.emplace_back();
auto& cmd = mCommands.back();
cmd.data.executeCommandBuffers.buffers.reserve(commandBuffers.size());
for(auto&& item : commandBuffers)
{
- cmd.data.executeCommandBuffers.buffers.emplace_back(static_cast<TestGraphicsCommandBuffer*>(item));
+ cmd.data.executeCommandBuffers.buffers.emplace_back(static_cast<const TestGraphicsCommandBuffer*>(item));
}
mCallStack.PushCall("ExecuteCommandBuffers", "");
}
/**
* Retrieves commands of specified type
*/
- std::vector<Command*> GetCommandsByType(CommandTypeMask mask);
+ std::vector<const Command*> GetCommandsByType(CommandTypeMask mask) const;
- std::vector<Command*> GetChildCommandsByType(CommandTypeMask mask);
+ std::vector<const Command*> GetChildCommandsByType(CommandTypeMask mask) const;
private:
TraceCallStack& mCallStack;
case CommandType::BIND_PIPELINE:
{
currentPipeline = Uncast<TestGraphicsPipeline>(cmd.data.bindPipeline.pipeline);
-
- // Bind framebuffer if different. @todo Move to RenderPass
- auto framebuffer = currentPipeline->framebufferState.framebuffer;
- if(framebuffer && framebuffer != currentFramebuffer)
- {
- auto graphicsFramebuffer = Uncast<TestGraphicsFramebuffer>(framebuffer);
- graphicsFramebuffer->Bind();
- }
- else
- {
- if(currentFramebuffer)
- currentFramebuffer->Bind();
- else
- mGl.BindFramebuffer(GL_FRAMEBUFFER, 0);
- }
BindPipeline(currentPipeline);
break;
}
// Process secondary command buffers
for(auto& buf : cmd.data.executeCommandBuffers.buffers)
{
- ProcessCommandBuffer(*static_cast<TestGraphicsCommandBuffer*>(buf));
+ ProcessCommandBuffer(*Uncast<TestGraphicsCommandBuffer>(buf));
}
break;
}
};
std::vector<ProgramCache> mProgramCache;
+ struct PipelineCache
+ {
+ };
+
std::vector<UniformData> mCustomUniforms;
};