Draw 8-bit software renderer with polybackend (well, sort of!)

This commit is contained in:
Magnus Norddahl 2019-12-02 01:07:28 +01:00
commit 44c2223c2f
6 changed files with 10 additions and 15 deletions

View file

@ -136,9 +136,12 @@ namespace swrenderer
RenderActorView(player->mo, true, false);
auto copyqueue = std::make_shared<DrawerCommandQueue>(MainThread()->FrameMemory.get());
copyqueue->Push<MemcpyCommand>(videobuffer, bufferpitch, target->GetPixels(), target->GetWidth(), target->GetHeight(), target->GetPitch(), target->IsBgra() ? 4 : 1);
DrawerThreads::Execute(copyqueue);
if (videobuffer != target->GetPixels())
{
auto copyqueue = std::make_shared<DrawerCommandQueue>(MainThread()->FrameMemory.get());
copyqueue->Push<MemcpyCommand>(videobuffer, bufferpitch, target->GetPixels(), target->GetWidth(), target->GetHeight(), target->GetPitch(), target->IsBgra() ? 4 : 1);
DrawerThreads::Execute(copyqueue);
}
DrawerWaitCycles.Clock();
DrawerThreads::WaitForWorkers();