union CommandData
{
CommandData()
- {}
+ {
+ }
~CommandData()
- {} // do nothing
+ {
+ } // do nothing
struct
{
void BindPipeline(const Graphics::Pipeline& pipeline) override
{
mCommands.emplace_back();
- mCommands.back().type = CommandType::BIND_PIPELINE;
+ mCommands.back().type = CommandType::BIND_PIPELINE;
mCommands.back().data.bindPipeline.pipeline = static_cast<const TestGraphicsPipeline*>(&pipeline);
mCallStack.PushCall("BindPipeline", "");
}
void BindTextures(std::vector<Graphics::TextureBinding>& textureBindings) override
{
mCommands.emplace_back();
- mCommands.back().type = CommandType::BIND_TEXTURES;
+ mCommands.back().type = CommandType::BIND_TEXTURES;
mCommands.back().data.bindTextures.textureBindings = std::move(textureBindings);
mCallStack.PushCall("BindTextures", "");
}
Graphics::Format format) override
{
mCommands.emplace_back();
- mCommands.back().type = CommandType::BIND_INDEX_BUFFER;
+ mCommands.back().type = CommandType::BIND_INDEX_BUFFER;
mCommands.back().data.bindIndexBuffer.buffer = static_cast<const TestGraphicsBuffer*>(&buffer);
mCommands.back().data.bindIndexBuffer.offset = offset;
mCommands.back().data.bindIndexBuffer.format = format;
mCallStack.PushCall("SetScissor", params.str(), params);
mCommands.emplace_back();
- mCommands.back().type = CommandType::SET_SCISSOR;
+ mCommands.back().type = CommandType::SET_SCISSOR;
mCommands.back().data.scissor.region = value;
}
mCallStack.PushCall("SetScissorTestEnable", params.str(), params);
mCommands.emplace_back();
- mCommands.back().type = CommandType::SET_SCISSOR_TEST;
+ mCommands.back().type = CommandType::SET_SCISSOR_TEST;
mCommands.back().data.scissorTest.enable = value;
}
mCallStack.PushCall("SetViewport", params.str(), params);
mCommands.emplace_back();
- mCommands.back().type = CommandType::SET_VIEWPORT;
+ mCommands.back().type = CommandType::SET_VIEWPORT;
mCommands.back().data.viewport.region = value;
}
mCallStack.PushCall("SetViewportEnable", params.str(), params);
mCommands.emplace_back();
- mCommands.back().type = CommandType::SET_VIEWPORT_TEST;
+ mCommands.back().type = CommandType::SET_VIEWPORT_TEST;
mCommands.back().data.viewportTest.enable = value;
}
if(!value.empty())
{
// must be fixed
- for (auto& binding : value[0]->data.bindTextures.textureBindings)
+ for(auto& binding : value[0]->data.bindTextures.textureBindings)
{
if(binding.texture)
{
auto bindIndexBufferCmds = commandBuffer->GetCommandsByType(0 | CommandType::BIND_INDEX_BUFFER);
if(!bindIndexBufferCmds.empty())
{
- auto &indexBufferBinding = bindIndexBufferCmds[0]->data.bindIndexBuffer;
+ auto& indexBufferBinding = bindIndexBufferCmds[0]->data.bindIndexBuffer;
if(indexBufferBinding.buffer)
{
auto buffer = Uncast<TestGraphicsBuffer>(indexBufferBinding.buffer);
auto bindVertexBufferCmds = commandBuffer->GetCommandsByType(0 | CommandType::BIND_VERTEX_BUFFERS);
if(!bindVertexBufferCmds.empty())
{
- for (auto &binding : bindVertexBufferCmds[0]->data.bindVertexBuffers.vertexBufferBindings)
+ for(auto& binding : bindVertexBufferCmds[0]->data.bindVertexBuffers.vertexBufferBindings)
{
auto graphicsBuffer = binding.buffer;
auto vertexBuffer = Uncast<TestGraphicsBuffer>(graphicsBuffer);
auto bindPipelineCmds = commandBuffer->GetCommandsByType(0 | CommandType::BIND_PIPELINE);
if(!bindPipelineCmds.empty())
{
- auto pipeline = bindPipelineCmds[0]->data.bindPipeline.pipeline;
+ auto pipeline = bindPipelineCmds[0]->data.bindPipeline.pipeline;
auto& vi = pipeline->vertexInputState;
for(auto& attribute : vi.attributes)
{
if(!drawCmds.empty())
{
- if (drawCmds[0]->data.draw.type == DrawCallDescriptor::Type::DRAW_INDEXED )
+ if(drawCmds[0]->data.draw.type == DrawCallDescriptor::Type::DRAW_INDEXED)
{
mGl.DrawElements(GetTopology(topology),
static_cast<GLsizei>(drawCmds[0]->data.draw.drawIndexed.indexCount),
GL_UNSIGNED_SHORT,
- reinterpret_cast<void *>(drawCmds[0]->data.draw.drawIndexed.firstIndex));
+ reinterpret_cast<void*>(drawCmds[0]->data.draw.drawIndexed.firstIndex));
}
else
{