mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 21:43:06 +01:00
Introduce rendering engine flag for parallel drawing
This commit is contained in:
@@ -32,6 +32,11 @@ enum DRAWING_ENGINE_FLAGS
|
||||
* Whether or not the engine will only draw changed blocks of the screen each frame.
|
||||
*/
|
||||
DEF_DIRTY_OPTIMISATIONS = 1 << 0,
|
||||
|
||||
/**
|
||||
* The drawing engine is capable of processing the drawing in parallel.
|
||||
*/
|
||||
DEF_PARALLEL_DRAWING = 1 << 1,
|
||||
};
|
||||
|
||||
struct rct_drawpixelinfo;
|
||||
|
||||
@@ -284,7 +284,7 @@ rct_drawpixelinfo* X8DrawingEngine::GetDrawingPixelInfo()
|
||||
|
||||
DRAWING_ENGINE_FLAGS X8DrawingEngine::GetFlags()
|
||||
{
|
||||
return DEF_DIRTY_OPTIMISATIONS;
|
||||
return static_cast<DRAWING_ENGINE_FLAGS>(DEF_DIRTY_OPTIMISATIONS | DEF_PARALLEL_DRAWING);
|
||||
}
|
||||
|
||||
void X8DrawingEngine::InvalidateImage([[maybe_unused]] uint32_t image)
|
||||
|
||||
@@ -996,6 +996,12 @@ void viewport_paint(
|
||||
_paintJobs.reset();
|
||||
}
|
||||
|
||||
bool useParallelDrawing = false;
|
||||
if (useMultithreading && (dpi->DrawingEngine->GetFlags() & DEF_PARALLEL_DRAWING))
|
||||
{
|
||||
useParallelDrawing = true;
|
||||
}
|
||||
|
||||
// Create space to record sessions and keep track which index is being drawn
|
||||
size_t index = 0;
|
||||
if (recorded_sessions != nullptr)
|
||||
|
||||
Reference in New Issue
Block a user