Skip to content

Commit

Permalink
added compile switches to select between thread wake factors
Browse files Browse the repository at this point in the history
  • Loading branch information
megai2 committed Jul 25, 2019
1 parent 64734e6 commit 895e7db
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion d912pxy/d912pxy_buffer_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ d912pxy_buffer_loader::~d912pxy_buffer_loader()

void d912pxy_buffer_loader::Init()
{
d912pxy_async_upload_thread::Init(PXY_INNER_MAX_ASYNC_BUFFERLOADS, PXY_INNER_THREADID_BUF_LOADER, 10, L"buffer upload thread", "d912pxy bufld");
d912pxy_async_upload_thread::Init(PXY_INNER_MAX_ASYNC_BUFFERLOADS, PXY_INNER_THREADID_BUF_LOADER, PXY_WAKE_FACTOR_BUFFER, L"buffer upload thread", "d912pxy bufld");

d912pxy_s.dx12.que.EnableGID(CLG_BUF, PXY_INNER_CLG_PRIO_ASYNC_LOAD);
Resume();
Expand Down
15 changes: 15 additions & 0 deletions d912pxy/d912pxy_fwdecl.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ SOFTWARE.
//#define PER_BATCH_FLUSH_DEBUG 1
//#define USE_PIX_EVENT_ANNOTATIONS

#define THREAD_FAST_WAKE
//#define THREAD_MODEST_WAKE

#ifdef _DEBUG
#define ENABLE_METRICS
#define ENABLE_DEBUG_LOGGING
Expand Down Expand Up @@ -111,6 +114,18 @@ SOFTWARE.

#define PXY_INNER_REPLAY_THREADS_MAX 4

#ifdef THREAD_MODEST_WAKE
#define PXY_WAKE_FACTOR_TEXTURE 1
#define PXY_WAKE_FACTOR_BUFFER 10
#define PXY_WAKE_FACTOR_REPLAY 100
#endif

#ifdef THREAD_FAST_WAKE
#define PXY_WAKE_FACTOR_TEXTURE 1
#define PXY_WAKE_FACTOR_BUFFER 1
#define PXY_WAKE_FACTOR_REPLAY 10
#endif

//memory manager ============================

#define PXY_MEM_MGR_TRIES 100
Expand Down
2 changes: 1 addition & 1 deletion d912pxy/d912pxy_replay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ void d912pxy_replay::IssueWork(UINT batch)
threads[cWorker]->SignalWork();

}
else if ((batch % 100) == 0) {
else if ((batch % PXY_WAKE_FACTOR_REPLAY) == 0) {
SyncStackTop();
threads[cWorker]->SignalWork();
}
Expand Down
2 changes: 1 addition & 1 deletion d912pxy/d912pxy_texture_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ d912pxy_texture_loader::~d912pxy_texture_loader()

void d912pxy_texture_loader::Init()
{
d912pxy_async_upload_thread::Init(PXY_INNER_MAX_ASYNC_TEXLOADS, PXY_INNER_THREADID_TEX_LOADER, 1, L"texture upload thread", "d912pxy texld");
d912pxy_async_upload_thread::Init(PXY_INNER_MAX_ASYNC_TEXLOADS, PXY_INNER_THREADID_TEX_LOADER, PXY_WAKE_FACTOR_TEXTURE, L"texture upload thread", "d912pxy texld");

d912pxy_s.dx12.que.EnableGID(CLG_TEX, PXY_INNER_CLG_PRIO_ASYNC_LOAD);

Expand Down

0 comments on commit 895e7db

Please sign in to comment.