Fix timeout for Metal compiler.

dispatch_time() takes nanoseconds, not microseconds.

Change-Id: Ia292eef0373fc8e48e6cc900f106ddf438cd74f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268440
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
Jim Van Verth 2020-02-03 16:10:17 -05:00 committed by Skia Commit-Bot
parent d129e08366
commit 073d271864

View File

@ -143,8 +143,8 @@ id<MTLLibrary> GrMtlNewLibraryWithSource(id<MTLDevice> device, NSString* mslCode
options: options
completionHandler: completionHandler];
// Wait 5 seconds for the compiler
if (dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, 5000000UL))) {
// Wait 100 ms for the compiler
if (dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, 100000000UL))) {
SkDebugf("Timeout compiling MSL shader\n");
return nil;
}
@ -171,8 +171,8 @@ id<MTLRenderPipelineState> GrMtlNewRenderPipelineStateWithDescriptor(
[device newRenderPipelineStateWithDescriptor: pipelineDescriptor
completionHandler: completionHandler];
// Wait 5 seconds for pipeline creation
if (dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, 5000000UL))) {
// Wait 100 ms for pipeline creation
if (dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, 100000000UL))) {
SkDebugf("Timeout creating pipeline.\n");
return nil;
}