Fix #104012: Selection crash with AMD on Metal #105739

Merged
Jeroen Bakker merged 2 commits from Jason-Fielder/blender:Fix_104012 into blender-v3.5-release 2023-03-16 08:03:26 +01:00
1 changed files with 14 additions and 6 deletions

View File

@ -342,9 +342,13 @@ id<MTLComputePipelineState> gpu::MTLTexture::mtl_texture_update_impl(
options:options options:options
error:&error] autorelease]; error:&error] autorelease];
if (error) { if (error) {
NSLog(@"Compile Error - Metal Shader Library error %@ ", error); /* Only exit out if genuine error and not warning. */
BLI_assert(false); if ([[error localizedDescription] rangeOfString:@"Compilation succeeded"].location ==
return nullptr; NSNotFound) {
NSLog(@"Compile Error - Metal Shader Library error %@ ", error);
BLI_assert(false);
return nil;
}
} }
/* Fetch compute function. */ /* Fetch compute function. */
@ -658,9 +662,13 @@ id<MTLComputePipelineState> gpu::MTLTexture::mtl_texture_read_impl(
options:options options:options
error:&error] autorelease]; error:&error] autorelease];
if (error) { if (error) {
NSLog(@"Compile Error - Metal Shader Library error %@ ", error); /* Only exit out if genuine error and not warning. */
BLI_assert(false); if ([[error localizedDescription] rangeOfString:@"Compilation succeeded"].location ==
return nil; NSNotFound) {
NSLog(@"Compile Error - Metal Shader Library error %@ ", error);
BLI_assert(false);
return nil;
}
} }
/* Fetch compute function. */ /* Fetch compute function. */