test: allow multithreading for masked planes

quite a neat speedup on some maps
needs testing
This commit is contained in:
Alug committed 2025-06-07 01:20:52 +02:00
1 parent 064db977aa
commit 5f8c77e752
1 file changed
+9 -2
+9 -2
View File
@@ -30,6 +30,8 @@
#include "w_wad.h"
#include "z_zone.h"
#include "core/thread_pool.h"
#ifdef HWRENDER
#include "hardware/hw_md2.h"
#endif
@@ -2934,7 +2936,7 @@ boolean R_ThingIsFullDark(mobj_t *thing)
//
// R_DrawMasked
//
static void R_DrawMaskedList (drawnode_t* head)
static void R_DrawMaskedList(drawnode_t* head)
{
drawnode_t *r2;
drawnode_t *next;
@@ -2945,7 +2947,12 @@ static void R_DrawMaskedList (drawnode_t* head)
{
drawspandata_t ds = {};
next = r2->prev;
R_DrawSinglePlane(&ds, r2->plane, false);
srb2::ThreadPool::Sema tp_sema;
srb2::g_main_threadpool->begin_sema();
R_DrawSinglePlane(&ds, r2->plane, cv_parallelsoftware.value);
tp_sema = srb2::g_main_threadpool->end_sema();
srb2::g_main_threadpool->notify_sema(tp_sema);
srb2::g_main_threadpool->wait_sema(tp_sema);
R_DoneWithNode(r2);
r2 = next;
}