From d96876db07c6e5e83407fe714349021696e9af55 Mon Sep 17 00:00:00 2001 From: Andreas Loew Date: Thu, 9 Feb 2023 16:07:36 +0100 Subject: [PATCH] display error message if shader initialization fails (#1051) --- core/renderer/backend/metal/ShaderModuleMTL.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/renderer/backend/metal/ShaderModuleMTL.mm b/core/renderer/backend/metal/ShaderModuleMTL.mm index 08af97a5f9..29ddf237ad 100644 --- a/core/renderer/backend/metal/ShaderModuleMTL.mm +++ b/core/renderer/backend/metal/ShaderModuleMTL.mm @@ -49,7 +49,9 @@ ShaderModuleMTL::ShaderModuleMTL(id 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, 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, ShaderStage stage, std { NSLog(@"metal shader is ---------------"); NSLog(@"%s", metalShader); + NSLog(@"%s", glslopt_get_log(glslShader)); assert(false); }