MCPcopy Create free account
hub / github.com/3Shain/dxmt / CommandQueue

Method CommandQueue

src/dxmt/dxmt_command_queue.cpp:17–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17CommandQueue::CommandQueue(WMT::Device device) :
18 encodeThread([this]() { this->EncodingThread(); }),
19 finishThread([this]() { this->WaitForFinishThread(); }),
20 device(device),
21 commandQueue(device.newCommandQueue(kCommandChunkCount)),
22 shared_event_listener(SharedEventListener_create()),
23 event_listener_thread([this]() { SharedEventListener_start(this->shared_event_listener); }),
24 staging_allocator({
25 device, WMTResourceOptionCPUCacheModeWriteCombined | WMTResourceHazardTrackingModeUntracked |
26 WMTResourceStorageModeManaged, false
27 }),
28 copy_temp_allocator({device, WMTResourceHazardTrackingModeUntracked | WMTResourceStorageModePrivate}),
29 argbuf_allocator({
30 device,
31 WMTResourceHazardTrackingModeUntracked | WMTResourceCPUCacheModeWriteCombined | WMTResourceStorageModeShared
32 }),
33 cpu_command_allocator({}),
34 reftracker_storage_allocator({}),
35 cmd_library(device),
36 argument_encoding_ctx(*this, device, cmd_library),
37 initializer(device) {
38 for (unsigned i = 0; i < kCommandChunkCount; i++) {
39 auto &chunk = chunks[i];
40 chunk.queue = this;
41 chunk.reset();
42 };
43 event = device.newSharedEvent();
44
45 std::string env = env::getEnvVar("DXMT_CAPTURE_FRAME");
46
47 if (!env.empty()) {
48 try {
49 capture_state.scheduleNextFrameCapture(std::stoull(env));
50 } catch (const std::invalid_argument &) {
51 }
52 }
53}
54
55CommandQueue::~CommandQueue() {
56 TRACE("Destructing command queue");

Callers

nothing calls this directly

Calls 10

EncodingThreadMethod · 0.95
WaitForFinishThreadMethod · 0.95
getEnvVarFunction · 0.85
newCommandQueueMethod · 0.80
newSharedEventMethod · 0.80
resetMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected