return o;
}
-
int GetNumComponents(Graphics::VertexInputFormat vertexFormat)
{
switch(vertexFormat)
return op;
}
-
class TestGraphicsMemory : public Graphics::Memory
{
public:
trace.EnableLogging(true);
}
-
void TestGraphicsController::SubmitCommandBuffers(const Graphics::SubmitInfo& submitInfo)
{
TraceCallStack::NamedParams namedParams;
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;
}
{
// Test scissor area and RT size
const auto& area = cmd.data.beginRenderPass.renderArea;
- if( area.x == 0 &&
- area.y == 0 &&
- area.width == renderTarget->mCreateInfo.extent.width &&
- area.height == renderTarget->mCreateInfo.extent.height )
+ if(area.x == 0 &&
+ area.y == 0 &&
+ area.width == renderTarget->mCreateInfo.extent.width &&
+ area.height == renderTarget->mCreateInfo.extent.height)
{
mGl.Disable(GL_SCISSOR_TEST);
mGl.Clear(mask);
else
{
mGl.Enable(GL_SCISSOR_TEST);
- mGl.Scissor(cmd.data.beginRenderPass.renderArea.x, cmd.data.beginRenderPass.renderArea.y,
- cmd.data.beginRenderPass.renderArea.width, cmd.data.beginRenderPass.renderArea.height);
+ mGl.Scissor(cmd.data.beginRenderPass.renderArea.x, cmd.data.beginRenderPass.renderArea.y, cmd.data.beginRenderPass.renderArea.width, cmd.data.beginRenderPass.renderArea.height);
mGl.Clear(mask);
mGl.Disable(GL_SCISSOR_TEST);
}
{
mGl.Disable(GL_BLEND);
}
+
+ auto* program = static_cast<const TestGraphicsProgram*>(pipeline->programState.program);
+ mGl.UseProgram(program->mImpl->mId);
}
/**