diff --git a/build.sh b/build.sh index 5fcf322..9c578a3 100755 --- a/build.sh +++ b/build.sh @@ -52,11 +52,16 @@ if [ ! \( -e bin \) ] ; then mkdir ./bin fi +if [ ! \( -e resources \) ] ; then + mkdir ./resources +fi + + if [ $target = 'lib' ] ; then # compile metal shader xcrun -sdk macosx metal $shaderFlagParam -fno-fast-math -c -o $BINDIR/mtl_renderer.air $SRCDIR/mtl_renderer.metal - xcrun -sdk macosx metallib -o $RESDIR/mtl_renderer.metallib $BINDIR/mtl_renderer.air + xcrun -sdk macosx metallib -o $BINDIR/mtl_renderer.metallib $BINDIR/mtl_renderer.air # compile milepost. We use one compilation unit for all C code, and one compilation # unit for all ObjectiveC code diff --git a/src/mtl_renderer.m b/src/mtl_renderer.m index 8cbd90b..67df75e 100644 --- a/src/mtl_renderer.m +++ b/src/mtl_renderer.m @@ -1155,7 +1155,7 @@ mg_canvas_backend* mg_mtl_canvas_create(mg_surface surface) @autoreleasepool{ //NOTE: load metal library - str8 shaderPath = mp_app_get_resource_path(mem_scratch(), "../resources/mtl_renderer.metallib"); + str8 shaderPath = mp_app_get_resource_path(mem_scratch(), "mtl_renderer.metallib"); NSString* metalFileName = [[NSString alloc] initWithBytes: shaderPath.ptr length:shaderPath.len encoding: NSUTF8StringEncoding]; NSError* err = 0; id library = [metalSurface->device newLibraryWithFile: metalFileName error:&err];