- fixed: Rendering to a camera textures clobbered the main render target for the software renderer.

This commit is contained in:
Christoph Oelckers 2018-04-14 08:09:40 +02:00
parent 13567f2505
commit cef6ddca6e

View file

@ -337,6 +337,7 @@ namespace swrenderer
auto viewport = MainThread()->Viewport.get(); auto viewport = MainThread()->Viewport.get();
const bool savedviewactive = viewactive; const bool savedviewactive = viewactive;
auto savedtarget = viewport->RenderTarget;
viewwidth = width; viewwidth = width;
viewport->RenderTarget = canvas; viewport->RenderTarget = canvas;
@ -353,7 +354,7 @@ namespace swrenderer
DrawerThreads::WaitForWorkers(); DrawerThreads::WaitForWorkers();
DrawerWaitCycles.Unclock(); DrawerWaitCycles.Unclock();
viewport->RenderTarget = nullptr; viewport->RenderTarget = savedtarget;
viewport->RenderingToCanvas = false; viewport->RenderingToCanvas = false;
R_ExecuteSetViewSize(MainThread()->Viewport->viewpoint, MainThread()->Viewport->viewwindow); R_ExecuteSetViewSize(MainThread()->Viewport->viewpoint, MainThread()->Viewport->viewwindow);