From fada50119020483021a6b620c8fb85d62fc3e8f0 Mon Sep 17 00:00:00 2001 From: Jiawei Shao Date: Fri, 31 Jul 2020 00:03:43 +0000 Subject: [PATCH] Metal: Add shader compilation error message to DAWN_VALIDATION_ERROR BUG=dawn:498 Change-Id: I850956a6c57ffe9d77e0729e89da6d9a62076509 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/26060 Reviewed-by: Corentin Wallez Reviewed-by: Austin Eng Commit-Queue: Jiawei Shao --- src/dawn_native/metal/ShaderModuleMTL.mm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/dawn_native/metal/ShaderModuleMTL.mm b/src/dawn_native/metal/ShaderModuleMTL.mm index bb3dffa9f8..e49cc952af 100644 --- a/src/dawn_native/metal/ShaderModuleMTL.mm +++ b/src/dawn_native/metal/ShaderModuleMTL.mm @@ -218,11 +218,10 @@ namespace dawn_native { namespace metal { options:nil error:&error]; if (error != nil) { - // TODO(cwallez@chromium.org): Switch that NSLog to use dawn::InfoLog or even be - // folded in the DAWN_VALIDATION_ERROR - NSLog(@"MTLDevice newLibraryWithSource => %@", error); if (error.code != MTLLibraryErrorCompileWarning) { - return DAWN_VALIDATION_ERROR("Unable to create library object"); + const char* errorString = [error.localizedDescription UTF8String]; + return DAWN_VALIDATION_ERROR(std::string("Unable to create library object: ") + + errorString); } }