diff --git a/src/gpu/gpu_dx12/gpu_dx12.c b/src/gpu/gpu_dx12/gpu_dx12.c index 65a96a6e..2c10e61f 100644 --- a/src/gpu/gpu_dx12/gpu_dx12.c +++ b/src/gpu/gpu_dx12/gpu_dx12.c @@ -286,6 +286,18 @@ void GPU_Startup(void) } } + ////////////////////////////// + //- Initialize workers + + for (GPU_QueueKind kind = 0; kind < GPU_NumQueues; ++kind) + { + String name = ZI; + if (kind == GPU_QueueKind_Direct) name = Lit("Direct queue worker"); + if (kind == GPU_QueueKind_AsyncCompute) name = Lit("Compute queue worker"); + if (kind == GPU_QueueKind_AsyncCopy) name = Lit("Copy queue worker"); + DispatchWave(name, 1, GPU_D12_WorkerEntry, (void *)(u64)kind); + } + EndScratch(scratch); } @@ -2704,3 +2716,17 @@ void GPU_CommitBackbuffer(GPU_ResourceHandle backbuffer_handle, i32 vsync) ID3D12CommandQueue_Signal(direct_queue->d3d_queue, swapchain->present_fence, target); } } + +//////////////////////////////////////////////////////////// +//~ Workers + +void GPU_D12_WorkerEntry(WaveLaneCtx *lane) +{ + GPU_QueueKind queue_kind = (GPU_QueueKind)lane->wave->udata; + GPU_D12_Queue *queue = GPU_D12_QueueFromKind(queue_kind); + + // for (;;) + // { + + // } +} diff --git a/src/gpu/gpu_dx12/gpu_dx12.h b/src/gpu/gpu_dx12/gpu_dx12.h index 1a8e243d..bceacf9a 100644 --- a/src/gpu/gpu_dx12/gpu_dx12.h +++ b/src/gpu/gpu_dx12/gpu_dx12.h @@ -429,6 +429,6 @@ GPU_D12_Cmd *GPU_D12_PushConstCmd(GPU_D12_CmdList *cl, i32 slot, void *v); GPU_D12_StagingRegionNode *GPU_D12_PushStagingRegion(GPU_D12_CmdList *cl, u64 size); //////////////////////////////////////////////////////////// -//~ Sync job +//~ Workers -// JobDecl(GPU_D12_StartQueueSync, EmptySig); +void GPU_D12_WorkerEntry(WaveLaneCtx *lane); diff --git a/src/meta/meta.c b/src/meta/meta.c index 55b0d054..e93bdea8 100644 --- a/src/meta/meta.c +++ b/src/meta/meta.c @@ -356,6 +356,7 @@ void BuildEntryPoint(WaveLaneCtx *lane) PushStringToList(perm, &cp.warnings_msvc, Lit("-W4")); PushStringToList(perm, &cp.warnings_msvc, Lit("-WX")); // PushStringToList(perm, &cp.warnings_msvc, Lit("-we4013")); /* function undefined; assuming extern returning int */ + PushStringToList(perm, &cp.warnings_msvc, Lit("-we4668")); /* 'X' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' /* Disable warnings */ PushStringToList(perm, &cp.warnings_msvc, Lit("-wd4244")); /* 'function': conversion from 'int' to 'f32', possible loss of data */