diff options
Diffstat (limited to 'gpu/command_buffer/common/constants.h')
-rw-r--r-- | gpu/command_buffer/common/constants.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gpu/command_buffer/common/constants.h b/gpu/command_buffer/common/constants.h index ca1d5a8..3b06cad 100644 --- a/gpu/command_buffer/common/constants.h +++ b/gpu/command_buffer/common/constants.h @@ -26,12 +26,23 @@ namespace error { // This is not an error. It is returned by WaitLatch when it is blocked. // When blocked, the context will not reschedule itself until another // context executes a SetLatch command. - kWaiting + kWaiting, + + // This is not an error either. It just hints the scheduler that it can exit + // its loop, update state, and schedule other command buffers. + kYield }; // Return true if the given error code is an actual error. inline bool IsError(Error error) { - return (error != kNoError && error != kWaiting); + switch (error) { + case kNoError: + case kWaiting: + case kYield: + return false; + default: + return true; + } } } |