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 <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This commit is contained in:
Jiawei Shao 2020-07-31 00:03:43 +00:00 committed by Commit Bot service account
parent f03590a754
commit fada501190
1 changed files with 3 additions and 4 deletions
src/dawn_native/metal

View File

@ -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);
}
}