display error message if shader initialization fails (#1051)

This commit is contained in:
Andreas Loew 2023-02-09 16:07:36 +01:00 committed by GitHub
parent 5b9fa73640
commit d96876db07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -49,7 +49,9 @@ ShaderModuleMTL::ShaderModuleMTL(id<MTLDevice> mtlDevice, ShaderStage stage, std
{
NSLog(@"Can not get metal shader:");
NSLog(@"%s", source.data());
NSLog(@"%s", glslopt_get_log(glslShader));
glslopt_cleanup(ctx);
assert(false);
return;
}
@ -68,8 +70,10 @@ ShaderModuleMTL::ShaderModuleMTL(id<MTLDevice> mtlDevice, ShaderStage stage, std
{
NSLog(@"Can not compile metal shader: %@", error);
NSLog(@"%s", metalShader);
NSLog(@"%s", glslopt_get_log(glslShader));
glslopt_shader_delete(glslShader);
glslopt_cleanup(ctx);
assert(false);
return;
}
@ -81,6 +85,7 @@ ShaderModuleMTL::ShaderModuleMTL(id<MTLDevice> mtlDevice, ShaderStage stage, std
{
NSLog(@"metal shader is ---------------");
NSLog(@"%s", metalShader);
NSLog(@"%s", glslopt_get_log(glslShader));
assert(false);
}