소스 검색

Handle shader compilation error

luboslenco 1 주 전
부모
커밋
f89ffa76f8
1개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 3
      base/sources/backends/metal_gpu.m

+ 1 - 3
base/sources/backends/metal_gpu.m

@@ -426,13 +426,11 @@ void gpu_pipeline_compile(gpu_pipeline_t *pipeline) {
 	id<MTLLibrary> library = [device newLibraryWithSource:[[NSString alloc] initWithBytes:pipeline->vertex_shader->impl.source length:pipeline->vertex_shader->impl.length encoding:NSUTF8StringEncoding] options:nil error:&error];
 	if (library == nil) {
 		iron_error("%s", error.localizedDescription.UTF8String);
+		return;
 	}
 
 	pipeline->vertex_shader->impl.mtl_function = (__bridge_retained void *)[library newFunctionWithName:[NSString stringWithCString:pipeline->vertex_shader->impl.name encoding:NSUTF8StringEncoding]];
-	assert(pipeline->vertex_shader->impl.mtl_function);
-
 	pipeline->fragment_shader->impl.mtl_function = (__bridge_retained void *)[library newFunctionWithName:[NSString stringWithCString:pipeline->fragment_shader->impl.name encoding:NSUTF8StringEncoding]];
-	assert(pipeline->fragment_shader->impl.mtl_function);
 
 	MTLRenderPipelineDescriptor *render_pipeline_desc = [[MTLRenderPipelineDescriptor alloc] init];
 	render_pipeline_desc.vertexFunction = (__bridge id<MTLFunction>)pipeline->vertex_shader->impl.mtl_function;