mirror of https://github.com/axmolengine/axmol.git
display error message if shader initialization fails (#1051)
This commit is contained in:
parent
5b9fa73640
commit
d96876db07
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue