| 55 | } |
| 56 | |
| 57 | bool vvl::Fence::EnqueueSignal(vvl::Queue* queue_state, uint64_t next_seq) { |
| 58 | auto guard = WriteLock(); |
| 59 | if (scope_ != kInternal) { |
| 60 | return true; |
| 61 | } |
| 62 | |
| 63 | // Ensure that the fence's std::promise is not set when the fence is submitted to the queue. |
| 64 | // This guarantees that we can always call set_value() on the promise during Retire. |
| 65 | // (For ill-formed applications that forgot to call vkResetFences, the fence may be in the |
| 66 | // signaled state and its promise set - this would cause a crash during Retire) |
| 67 | ResetPromise(); |
| 68 | |
| 69 | // Mark fence in use |
| 70 | state_ = kInflight; |
| 71 | queue_ = queue_state; |
| 72 | seq_ = next_seq; |
| 73 | return false; |
| 74 | } |
| 75 | |
| 76 | // Called from a non-queue operation, such as vkWaitForFences()| |
| 77 | void vvl::Fence::NotifyAndWait(const Location& loc) { |
no test coverage detected