|
@@ -59,7 +59,14 @@
|
|
/// Create our render pipeline
|
|
/// Create our render pipeline
|
|
|
|
|
|
// Load all the shader files with a .metal file extension in the project
|
|
// Load all the shader files with a .metal file extension in the project
|
|
- id<MTLLibrary> defaultLibrary = [_device newDefaultLibrary];
|
|
|
|
|
|
+ // FIXME: on Swift we have `Bundle.module` generated by SPM but it doesn't appear to be the case for Obj-C
|
|
|
|
+ NSURL *modulePath = [NSBundle.mainBundle.resourceURL URLByAppendingPathComponent:@"CocoaSpice_CocoaSpiceRenderer.bundle"];
|
|
|
|
+ NSBundle *bundle = [NSBundle bundleWithURL:modulePath];
|
|
|
|
+ NSError *err = nil;
|
|
|
|
+ id<MTLLibrary> defaultLibrary = [_device newDefaultLibraryWithBundle:bundle error:&err];
|
|
|
|
+ if (!defaultLibrary || err) {
|
|
|
|
+ NSLog(@"Failed to get library from bundle: %@", err.localizedDescription);
|
|
|
|
+ }
|
|
|
|
|
|
// Load the vertex function from the library
|
|
// Load the vertex function from the library
|
|
id<MTLFunction> vertexFunction = [defaultLibrary newFunctionWithName:@"vertexShader"];
|
|
id<MTLFunction> vertexFunction = [defaultLibrary newFunctionWithName:@"vertexShader"];
|