| 145 | } |
| 146 | |
| 147 | uint32_t |
| 148 | CommandQueue::EncodingThread() { |
| 149 | #if ASYNC_ENCODING |
| 150 | env::setThreadName("dxmt-encode-thread"); |
| 151 | SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); |
| 152 | uint64_t internal_seq = 1; |
| 153 | while (!stopped.load()) { |
| 154 | ready_for_encode.wait(internal_seq, std::memory_order_acquire); |
| 155 | if (stopped.load()) |
| 156 | break; |
| 157 | // perform... |
| 158 | auto &chunk = chunks[internal_seq % kCommandChunkCount]; |
| 159 | CommitChunkInternal(chunk, internal_seq); |
| 160 | internal_seq++; |
| 161 | } |
| 162 | TRACE("encoder thread gracefully terminates"); |
| 163 | #endif |
| 164 | return 0; |
| 165 | } |
| 166 | |
| 167 | uint32_t |
| 168 | CommandQueue::WaitForFinishThread() { |
no test coverage detected