Skip to content

Commit b51852e

Browse files
committed
Package iOS NVN shaders as a verified optional image
1 parent dca004a commit b51852e

7 files changed

Lines changed: 239 additions & 10 deletions

File tree

‎dm/gfx/nvn/nvn_mtl.m‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ int mtl_link_tick(uint64_t n, double *target, double *lead_ms, int *ticks, doubl
177177
#include <os/proc.h> // os_proc_available_memory: for the memory readout line
178178
#endif
179179
#include "nvn_mtl.h"
180+
#include "nvn_shader_image.h"
180181
#import "nvn_framegen.h"
181182
#include "nvn_obj.h"
182183
#include "../tex/nvn_fmt_mtl.h"
@@ -3980,6 +3981,8 @@ static void shmap_read(void) {
39803981
const char *m = getenv("DM_MSL_DIR");
39813982
// Library directory = <DM_MSL_DIR or default cache>/b-<translation chain version>: the version comes from dm/gfx/nvn/dmsh_chain.h (tools/dmsh_chain.py), one for every game; a host built from an old source tree only accepts libraries of the old version
39823983
g_msl_dir = [NSString stringWithFormat:@"%@/b-%s", m ? @(m) : [NSString stringWithFormat:@"%s%s/build/cache/metal_shader_cache", getenv("DM_ROOT") ?: getenv("HOME"), getenv("DM_ROOT") ? "" : "/dm-work"], DMSH_CHAIN];
3984+
if (nvn_shader_image_open(g_msl_dir, [NSData dataWithContentsOfFile:[g_msl_dir stringByAppendingPathComponent:@"inputs.tsv"]]))
3985+
MLOG("shader image: %s.img", g_msl_dir.UTF8String);
39833986
if (![NSFileManager.defaultManager fileExistsAtPath:g_msl_dir]) MLOG("[RED] shader library directory %s does not exist: translation chain version %s of this source tree has not been built yet (dm/gfx/tools/dmsh_build.py)", g_msl_dir.UTF8String, DMSH_CHAIN);
39843987
// The library's stamp (inputs.tsv, written by a full dmsh_build.py run): the game and the digest of the profile inputs it was built from. The chain version is the same for every
39853988
// game and every state of a profile's tables, so the stamp is what ties c1_full.tsv / cb_extent.tsv to these libraries: each names the inputs of the library it was made from
@@ -4138,6 +4141,13 @@ static void pso_user_record(const char *fmt, ...) {
41384141
// while the default soft limit of an iOS process is 256; new shaders created in other acts raise it further). Here the file is mapped into memory and closed immediately, and the library is built from the in-memory data; the mapping is released when the library's data object is freed
41394142
static __thread int t_lib_layer;
41404143
static id<MTLLibrary> lib_from_file(NSString *path, NSError **err) {
4144+
nvn_shader_mapping map;
4145+
if (nvn_shader_image_map(g_msl_dir, path, &map)) {
4146+
t_lib_layer = memmem(map.bytes, map.size, "render_target_array_index", 25) != NULL;
4147+
dispatch_data_t data = dispatch_data_create(map.bytes, map.size, dispatch_get_global_queue(QOS_CLASS_UTILITY, 0),
4148+
^{ munmap(map.base, map.mapped); });
4149+
return [g_dev newLibraryWithData:data error:err];
4150+
}
41414151
int fd = open(path.fileSystemRepresentation, O_RDONLY); struct stat st;
41424152
if (fd < 0 || fstat(fd, &st) || st.st_size <= 0) { if (fd >= 0) close(fd); if (err) *err = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:@{NSLocalizedDescriptionKey: [NSString stringWithFormat:@"cannot open %@", path]}]; return nil; }
41434153
size_t len = (size_t)st.st_size; void *m = mmap(NULL, len, PROT_READ, MAP_PRIVATE, fd, 0); close(fd);
@@ -4221,7 +4231,7 @@ @implementation FnDev @end
42214231
// layer: a vertex shader's layer entry points (entry_layer / entry_layer_z, which also write the layer) instead of main0 / main0_z, for a program whose geometry shader is a slice writer (prog_fold_gs)
42224232
static NvShader *shader_load(NSString *pc, int stage, int layer) {
42234233
NSError *e = nil;
4224-
NSData *jd = [NSData dataWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.json", g_msl_dir, pc]];
4234+
NSData *jd = nvn_shader_data(g_msl_dir, [NSString stringWithFormat:@"%@/%@.json", g_msl_dir, pc]);
42254235
NSDictionary *j = jd ? [NSJSONSerialization JSONObjectWithData:jd options:0 error:nil] : nil;
42264236
if (j && stage == 2 && [j[@"gs_slice"] isKindOfClass:[NSDictionary class]] && [j[@"chain"] isEqual:@DMSH_CHAIN]) { // a slice-writing geometry shader has no library: a stub prog_fold_gs replaces
42274237
NvShader *o = [NvShader new]; o->stage = 2; o->lay_loc = -1; strlcpy(o->key, pc.UTF8String, sizeof o->key);
@@ -6673,7 +6683,7 @@ void mtl_pso_line(char *o, size_t n) {
66736683
if (!f.functionConstantsDictionary.count) return ld;
66746684
MTL4SpecializedFunctionDescriptor *sd = [MTL4SpecializedFunctionDescriptor new]; sd.functionDescriptor = ld; sd.constantValues = [MTLFunctionConstantValues new]; return sd;
66756685
}
6676-
static NSDictionary *pre_json(NSString *key) { NSData *d = [NSData dataWithContentsOfFile:[NSString stringWithFormat:@"%@/%@_b.json", g_msl_dir, key]]; return d ? [NSJSONSerialization JSONObjectWithData:d options:0 error:nil] : nil; }
6686+
static NSDictionary *pre_json(NSString *key) { NSData *d = nvn_shader_data(g_msl_dir, [NSString stringWithFormat:@"%@/%@_b.json", g_msl_dir, key]); return d ? [NSJSONSerialization JSONObjectWithData:d options:0 error:nil] : nil; }
66776687
// The base of one pair as the draws make it (pso_desc_pull / pso_desc), or nil when the pair is left to the draws. Call inside an autorelease pool
66786688
static MTL4RenderPipelineDescriptor *pre_desc(NSString *vk, NSString *fk, int zero) {
66796689
NSDictionary *vj = pre_json(vk), *fj = pre_json(fk);

‎dm/gfx/nvn/nvn_mtl_legacy.inc‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <os/proc.h> // os_proc_available_memory: for the memory readout line
2222
#endif
2323
#include "nvn_mtl.h"
24+
#include "nvn_shader_image.h"
2425
#include "nvn_prepare.h"
2526
#include "nvn_obj.h"
2627
#include "../tex/nvn_fmt_mtl.h"
@@ -3556,6 +3557,8 @@ static void shmap_load(void) {
35563557
const char *m = getenv("DM_MSL_DIR");
35573558
// Library directory = <DM_MSL_DIR or default cache>/b-<translation chain version>: the version comes from the game profile's dmsh_chain.h (tools/dmsh_chain.py); a host built from an old source tree only accepts libraries of the old version
35583559
g_msl_dir = [NSString stringWithFormat:@"%@/b-%s", m ? @(m) : [NSString stringWithFormat:@"%s%s/build/cache/metal_shader_cache", getenv("DM_ROOT") ?: getenv("HOME"), getenv("DM_ROOT") ? "" : "/dm-work"], DMSH_CHAIN];
3560+
if (nvn_shader_image_open(g_msl_dir, [NSData dataWithContentsOfFile:[g_msl_dir stringByAppendingPathComponent:@"inputs.tsv"]]))
3561+
MLOG("shader image: %s.img", g_msl_dir.UTF8String);
35593562
if (![NSFileManager.defaultManager fileExistsAtPath:g_msl_dir]) MLOG("【红】着色器库目录 %s 不存在:本源码树的翻译链版本 %s 还没出包(dm/gfx/tools/dmsh_build.py)", g_msl_dir.UTF8String, DMSH_CHAIN);
35603563
NSString *cp = [[path stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"c1_full.tsv"]; // Same directory as the mapping table (Mac: dm/games/<id>; iOS: dm/ inside the App, copied along by build_ipa.sh)
35613564
NSString *ct = cp ? [NSString stringWithContentsOfFile:cp encoding:NSUTF8StringEncoding error:nil] : nil;
@@ -3651,6 +3654,12 @@ static void pso_record(const char *fmt, ...) {
36513654
// Build the library from a .metallib file without permanently occupying a file descriptor: newLibraryWithURL keeps that file open for as long as the library object lives (one per game shader - of the 258 descriptors the iOS app permanently holds in a run, 213 are these,
36523655
// while the default soft limit of an iOS process is 256; new shaders created in other acts raise it further). Here the file is mapped into memory and closed immediately, and the library is built from the in-memory data; the mapping is released when the library's data object is freed
36533656
static id<MTLLibrary> lib_from_file(NSString *path, NSError **err) {
3657+
nvn_shader_mapping map;
3658+
if (nvn_shader_image_map(g_msl_dir, path, &map)) {
3659+
dispatch_data_t data = dispatch_data_create(map.bytes, map.size, dispatch_get_global_queue(QOS_CLASS_UTILITY, 0),
3660+
^{ munmap(map.base, map.mapped); });
3661+
return [g_dev newLibraryWithData:data error:err];
3662+
}
36543663
int fd = open(path.fileSystemRepresentation, O_RDONLY); struct stat st;
36553664
if (fd < 0 || fstat(fd, &st) || st.st_size <= 0) { if (fd >= 0) close(fd); if (err) *err = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:@{NSLocalizedDescriptionKey: [NSString stringWithFormat:@"打不开 %@", path]}]; return nil; }
36563665
size_t len = (size_t)st.st_size; void *m = mmap(NULL, len, PROT_READ, MAP_PRIVATE, fd, 0); close(fd);
@@ -3686,7 +3695,7 @@ static id<MTLLibrary> bounded_atomic_library(NSString *key, NSError **error) {
36863695
NSData *meta = [NSData dataWithContentsOfFile:[root stringByAppendingPathComponent:[key stringByAppendingString:@".json"]]];
36873696
NSDictionary *record = meta ? [NSJSONSerialization JSONObjectWithData:meta options:0 error:nil] : nil;
36883697
NSData *source = [NSData dataWithContentsOfFile:[root stringByAppendingPathComponent:[key stringByAppendingString:@".metal"]]];
3689-
NSData *base = [NSData dataWithContentsOfFile:[g_msl_dir stringByAppendingPathComponent:[key stringByAppendingString:@".metallib"]] options:NSDataReadingMappedIfSafe error:nil];
3698+
NSData *base = nvn_shader_data(g_msl_dir, [g_msl_dir stringByAppendingPathComponent:[key stringByAppendingString:@".metallib"]]);
36903699
if (![record[@"schema"] isEqual:@1] || ![record[@"chain"] isEqual:@DMSH_CHAIN] || ![record[@"kind"] isEqual:@"bounded-image-atomics-v1"] || ![record[@"source_sha256"] isEqual:nonpoint_digest(source)] || ![record[@"library_sha256"] isEqual:nonpoint_digest(base)]) {
36913700
if (error) *error = [NSError errorWithDomain:@"NVNLegacyAtomics" code:1 userInfo:@{NSLocalizedDescriptionKey:@"Missing or mismatched bounded image-atomic source; export_legacy_atomics.py is required"}];
36923701
return nil;
@@ -3709,7 +3718,7 @@ void mtl_set_depth_zero(int on) {
37093718
static NvShader *shader_load(NSString *pc, int stage) {
37103719
NSError *e = nil;
37113720
NSString *lp = [NSString stringWithFormat:@"%@/%@.metallib", g_msl_dir, pc];
3712-
NSData *jd = [NSData dataWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.json", g_msl_dir, pc]];
3721+
NSData *jd = nvn_shader_data(g_msl_dir, [NSString stringWithFormat:@"%@/%@.json", g_msl_dir, pc]);
37133722
NSDictionary *j = jd ? [NSJSONSerialization JSONObjectWithData:jd options:0 error:nil] : nil;
37143723
if (j[@"legacy_image_atomic"]) {
37153724
NSData *bytes = [NSData dataWithContentsOfFile:lp options:NSDataReadingMappedIfSafe error:nil];
@@ -4590,7 +4599,7 @@ static id<MTLFunction> legacy_dual_function(NvShader *fs) {
45904599
NSDictionary *record = manifest[@"fragment_dual_sources"][key];
45914600
NSString *root = [g_msl_dir stringByAppendingPathComponent:@"nonpoint-v1"];
45924601
NSData *source = [NSData dataWithContentsOfFile:[root stringByAppendingPathComponent:[key stringByAppendingString:@".dual.metal"]]];
4593-
NSData *base = [NSData dataWithContentsOfFile:[g_msl_dir stringByAppendingPathComponent:[key stringByAppendingString:@".metallib"]] options:NSDataReadingMappedIfSafe error:nil];
4602+
NSData *base = nvn_shader_data(g_msl_dir, [g_msl_dir stringByAppendingPathComponent:[key stringByAppendingString:@".metallib"]]);
45944603
if (![manifest[@"schema"] isEqual:@1] || ![manifest[@"chain"] isEqual:@DMSH_CHAIN] ||
45954604
![record[@"source_sha256"] isEqual:nonpoint_digest(source)] ||
45964605
![record[@"library_sha256"] isEqual:nonpoint_digest(base)]) {
@@ -4755,7 +4764,7 @@ static id<MTLFunction> nonpoint_vertex(NvShader *vs, NSError **error) {
47554764
NSString *key = @(vs->key);
47564765
NSDictionary *record = manifest[@"shaders"][key];
47574766
NSData *source = [NSData dataWithContentsOfFile:[root stringByAppendingPathComponent:[key stringByAppendingString:@".metal"]]];
4758-
NSData *library = [NSData dataWithContentsOfFile:[g_msl_dir stringByAppendingPathComponent:[key stringByAppendingString:@".metallib"]] options:NSDataReadingMappedIfSafe error:nil];
4767+
NSData *library = nvn_shader_data(g_msl_dir, [g_msl_dir stringByAppendingPathComponent:[key stringByAppendingString:@".metallib"]]);
47594768
NSError *e = nil;
47604769
BOOL valid = [manifest[@"schema"] isEqual:@1] && [manifest[@"chain"] isEqual:@DMSH_CHAIN]
47614770
&& [record[@"source_sha256"] isEqual:nonpoint_digest(source)]

‎dm/gfx/nvn/nvn_shader_image.h‎

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// Read an optional b-<chain>.img without unpacking it or changing the shader ABI.
2+
#pragma once
3+
#include "../../host/romfs_image.h"
4+
#include <sys/mman.h>
5+
6+
typedef struct { const void *bytes; size_t size; void *base; size_t mapped; } nvn_shader_mapping;
7+
static romfs_img *nvn_shader_image;
8+
9+
static const img_ent *nvn_shader_find(const romfs_img *image, const char *name) {
10+
size_t len = strlen(name);
11+
uint64_t lo = 1, hi = image->n;
12+
while (lo < hi) {
13+
uint64_t mid = lo + (hi - lo) / 2;
14+
const img_ent *entry = &image->e[mid];
15+
int cmp = memcmp(image->names + entry->name, name, MIN(entry->nlen, len));
16+
if (!cmp) cmp = (entry->nlen > len) - (entry->nlen < len);
17+
if (!cmp) return entry;
18+
if (cmp < 0) lo = mid + 1; else hi = mid;
19+
}
20+
return NULL;
21+
}
22+
23+
static BOOL nvn_shader_image_open(NSString *folder, NSData *stamp) {
24+
if (!stamp.length || stamp.length > 4096) return NO;
25+
NSString *path = [folder stringByAppendingString:@".img"];
26+
romfs_img *image = romfs_image_open(path.fileSystemRepresentation);
27+
if (!image) return NO;
28+
const img_ent *entry = image->e[0].b == image->n - 1 && !image->damaged ?
29+
nvn_shader_find(image, "inputs.tsv") : NULL;
30+
unsigned char copy[4096];
31+
if (!entry || !entry->type || entry->b != stamp.length ||
32+
!romfs_image_read(image->fd, copy, stamp.length, (off_t)entry->a) ||
33+
memcmp(copy, stamp.bytes, stamp.length)) {
34+
romfs_image_close(image);
35+
return NO;
36+
}
37+
// The profile is fixed for this host. Archive updates publish a new inode for its next launch.
38+
nvn_shader_image = image;
39+
return YES;
40+
}
41+
42+
static BOOL nvn_shader_image_map(NSString *folder, NSString *path, nvn_shader_mapping *out) {
43+
if (!nvn_shader_image || ![folder isEqualToString:path.stringByDeletingLastPathComponent]) return NO;
44+
NSString *name = path.lastPathComponent;
45+
const img_ent *entry = nvn_shader_find(nvn_shader_image, name.fileSystemRepresentation);
46+
if (!entry || !entry->type || !entry->b) return NO;
47+
if (name.length < 19) return NO;
48+
// Keep the entire shader family loose whenever a base override exists. Never mix
49+
// an incremental reflection file with a metallib (or variant) from a previous build.
50+
NSString *key = [name substringToIndex:16];
51+
NSString *base = [folder stringByAppendingPathComponent:[key stringByAppendingString:@"_b"]];
52+
struct stat st;
53+
if (!lstat(path.fileSystemRepresentation, &st) || errno != ENOENT ||
54+
!lstat([base stringByAppendingString:@".json"].fileSystemRepresentation, &st) || errno != ENOENT ||
55+
!lstat([base stringByAppendingString:@".metallib"].fileSystemRepresentation, &st) || errno != ENOENT) return NO;
56+
uint64_t delta = entry->a % (uint64_t)getpagesize();
57+
if (entry->b > SIZE_MAX - delta) return NO;
58+
size_t length = (size_t)(entry->b + delta);
59+
void *mapped = mmap(NULL, length, PROT_READ, MAP_SHARED, nvn_shader_image->fd, (off_t)(entry->a - delta));
60+
if (mapped == MAP_FAILED) return NO;
61+
*out = (nvn_shader_mapping){ (const char *)mapped + delta, (size_t)entry->b, mapped, length };
62+
return YES;
63+
}
64+
65+
static NSData *nvn_shader_data(NSString *folder, NSString *path) {
66+
nvn_shader_mapping map;
67+
if (nvn_shader_image_map(folder, path, &map))
68+
return [[NSData alloc] initWithBytesNoCopy:(void *)map.bytes length:map.size deallocator:^(void *unused, NSUInteger length) {
69+
(void)unused; (void)length; munmap(map.base, map.mapped);
70+
}];
71+
return [NSData dataWithContentsOfFile:path options:NSDataReadingMappedIfSafe error:nil];
72+
}

‎dm/ios/tools/build_ipa.sh‎

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# Usage: dm/ios/tools/build_ipa.sh [output.ipa | --prepare-xcode]; --prepare-xcode generates the project without building, signing or packing.
77
# Environment: GAME=game profile (dm/games/<base game title ID>, or one in DM_GAMES_DIR; required), W=the game's work folder (required: <NSP folder>/<title ID>-work, never the home folder), PATCHED / ROMFS / MSL_IOS can each be overridden
88
# DM_COPY_ROMFS=NO leaves the game files (RomFS) out of the IPA, as it does for the Xcode build phase: the package then stays small (a large game's full package can exceed what iOS extracts), and the app takes the files from Documents/romfs.img (scripts/push_romfs.sh); default: they are packed
9+
# DM_PACK_SHADER_IMAGE=1 packs compiled NVN libraries into a verified single file; the profile stamp and other resources remain loose. IPA mode only.
910
# DM_ENTITLEMENTS=<plist> is the unsigned IPA's entitlements, signed ad-hoc into the executable (default: <profile>/ios.entitlements, then Increased Memory Limit; an empty string = none)
1011
# AOC=add-on content directory (default $W/data/aoc; when it exists it goes to DmIOS.app/aoc/<index>/; an empty string = none), GFXAPI=nvn / vulkan (default: by the shader libraries in MSL_IOS)
1112
# The app name is the game name in the base NSP's control data ($W/data/v0/control.nacp, else the one next to the RomFS), the app version is the display version in the packed game's control data (the one next to the RomFS:
@@ -39,6 +40,9 @@ PKG=$(gp package)
3940
if [ -z "${ROMFS:-}" ] && [ -f "$W/data/$PKG/RomFS.img" ]; then ROMFS=$W/data/$PKG/RomFS.img; fi
4041
PATCHED=${PATCHED:-$W/build/patched_$PKG}; ROMFS=${ROMFS:-$W/data/$PKG/RomFS}; MSL_IOS=${MSL_IOS:-$W/build/ios/dmsh_b}; AOC=${AOC-$W/data/aoc}
4142
PREPARE_XCODE=NO; [ "${1:-}" != --prepare-xcode ] || PREPARE_XCODE=YES
43+
if [ "${DM_PACK_SHADER_IMAGE:-0}" = 1 ] && [ "$PREPARE_XCODE" = YES ]; then
44+
die "DM_PACK_SHADER_IMAGE is supported in IPA mode only"
45+
fi
4246
OUT_IPA=${1:-$(dirname "$W")/$(gp ipa)}; O=$W/build/ios/pkg; DD=$O/dd
4347
XCODE_DD=${DM_XCODE_DERIVED_DATA:-$W/build/ios/xcode-dd}
4448
MODS=$(gp modules); MARKER=$(gp romfs_marker)
@@ -226,12 +230,28 @@ if [ "${DM_COPY_ROMFS:-YES}" = NO ]; then
226230
elif [ -f "$ROMFS" ]; then MAPS=("$P/romfs.img=$ROMFS"); else MAPS=("$P/romfs=$ROMFS"); fi
227231
if [ -n "$AOC" ] && [ -d "$AOC" ]; then MAPS+=("$P/aoc=$AOC"); t "add-on content: $(ls "$AOC" | tr '\n' ' ')"; fi
228232
if [ -n "${PSO:-}" ]; then MAPS+=("$P/pso=$PSO"); fi
229-
MAPS+=("$P/msl/$MSLDIR=$MSL_IOS/$MSLDIR" "$P=$APP")
230-
t "pack IPA (already-compressed game files stored, everything else deflated)"
231-
# The pulling vertex libraries (<key>_bp, dm/gfx/tools/dmsh_pull.py) serve the hybrid pipelines. Default to the same pso_mtl4 setting compiled by gen_build.py; IOS_PULL=0 / 1 overrides it.
232-
# The pipeline archive's bases are made of them, so an IPA with an archive (pso/) always carries them, whatever IOS_PULL says (an Xcode build copies them always).
233+
# The shader image and loose IPA use the same policy for pulling vertex libraries.
233234
PULL=$(sed -n 's/^#define DM_GAME_PSO_MTL4 //p' "$DM/host/gen/$GAME/game_profile.h") || die "read game profile header"
234235
case "$PULL" in 0|1) ;; *) die "no DM_GAME_PSO_MTL4 in generated game profile";; esac
236+
if [ "${DM_PACK_SHADER_IMAGE:-0}" = 1 ] && [ "$GFXAPI" = nvn ]; then
237+
image="$O/$MSLDIR.img"
238+
image_options=(--output "$image")
239+
[ -n "${PSO:-}" ] || [ "${IOS_PULL:-$PULL}" = 1 ] || image_options+=(--skip-pulling)
240+
python3 "$DM/tools/pack_nvn_shader_image.py" "$MSL_IOS/$MSLDIR" "${image_options[@]}" || die "pack NVN shader image"
241+
MAPS+=("$P/msl/$MSLDIR.img=$image")
242+
# Keep readiness stamps and auxiliary shader subdirectories accessible to older code.
243+
# Match the packer's file pattern; all other entries retain their existing path.
244+
for f in "$MSL_IOS/$MSLDIR/"*; do
245+
leaf=${f##*/}
246+
[[ "$leaf" =~ ^[a-f0-9]{16}_b[a-z0-9]*\.(json|metallib)$ ]] && continue
247+
MAPS+=("$P/msl/$MSLDIR/$leaf=$f")
248+
done
249+
else
250+
MAPS+=("$P/msl/$MSLDIR=$MSL_IOS/$MSLDIR")
251+
fi
252+
MAPS+=("$P=$APP")
253+
t "pack IPA (already-compressed game files stored, everything else deflated)"
254+
# The pipeline archive always carries the pulling vertex libraries, whatever IOS_PULL says.
235255
# Keep this array nonempty: macOS Bash 3.2 treats an empty array as unset under set -u.
236256
PACK_OPTS=(--store "$(gp zip_store)"); [ -n "${PSO:-}" ] || [ "${IOS_PULL:-$PULL}" = 1 ] || PACK_OPTS+=(--skip-suffix _bp.metallib)
237257
python3 tools/pack_ipa.py "$OUT_IPA" "${PACK_OPTS[@]}" --skip $P/_CodeSignature --skip $P/embedded.mobileprovision --skip $P/msl --skip $P/aoc --skip $P/romfs --skip $P/romfs.img --skip $P/romfs.id "${MAPS[@]}" || die "pack_ipa"

0 commit comments

Comments
 (0)