@bloomengine/engine 0.4.7 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/native/ios/src/lib.rs +20 -5
- package/package.json +1 -1
package/native/ios/src/lib.rs
CHANGED
|
@@ -365,11 +365,16 @@ unsafe extern "C" fn scene_will_connect(
|
|
|
365
365
|
// configuration. The renderer keys off device.features() (see
|
|
366
366
|
// renderer/mod.rs), so it transparently falls back to the non-RT
|
|
367
367
|
// path when ray-query isn't granted.
|
|
368
|
-
eprintln!("[bloom-ios] request_device with preferred features failed ({e:?}); retrying
|
|
368
|
+
eprintln!("[bloom-ios] request_device with preferred features failed ({e:?}); retrying with adapter limits and no ray-query/experimental features");
|
|
369
|
+
// Request exactly the adapter's reported limits (not wgpu's
|
|
370
|
+
// Limits::default()): some iOS GPUs cap individual limits — e.g.
|
|
371
|
+
// max_inter_stage_shader_variables — below wgpu's defaults, so
|
|
372
|
+
// request_device rejects the default-limits request too. Asking for
|
|
373
|
+
// adapter.limits() can never exceed what the device supports.
|
|
369
374
|
pollster_block_on(adapter.request_device(&wgpu::DeviceDescriptor {
|
|
370
375
|
label: Some("bloom_device"),
|
|
371
376
|
required_features: wgpu::Features::empty(),
|
|
372
|
-
required_limits:
|
|
377
|
+
required_limits: adapter.limits(),
|
|
373
378
|
experimental_features: wgpu::ExperimentalFeatures::disabled(),
|
|
374
379
|
..Default::default()
|
|
375
380
|
})).expect("Failed to create device (minimal fallback)")
|
|
@@ -555,11 +560,16 @@ pub unsafe extern "C" fn perry_scene_will_connect(scene: *const c_void) {
|
|
|
555
560
|
// configuration. The renderer keys off device.features() (see
|
|
556
561
|
// renderer/mod.rs), so it transparently falls back to the non-RT
|
|
557
562
|
// path when ray-query isn't granted.
|
|
558
|
-
eprintln!("[bloom-ios] request_device with preferred features failed ({e:?}); retrying
|
|
563
|
+
eprintln!("[bloom-ios] request_device with preferred features failed ({e:?}); retrying with adapter limits and no ray-query/experimental features");
|
|
564
|
+
// Request exactly the adapter's reported limits (not wgpu's
|
|
565
|
+
// Limits::default()): some iOS GPUs cap individual limits — e.g.
|
|
566
|
+
// max_inter_stage_shader_variables — below wgpu's defaults, so
|
|
567
|
+
// request_device rejects the default-limits request too. Asking for
|
|
568
|
+
// adapter.limits() can never exceed what the device supports.
|
|
559
569
|
pollster_block_on(adapter.request_device(&wgpu::DeviceDescriptor {
|
|
560
570
|
label: Some("bloom_device"),
|
|
561
571
|
required_features: wgpu::Features::empty(),
|
|
562
|
-
required_limits:
|
|
572
|
+
required_limits: adapter.limits(),
|
|
563
573
|
experimental_features: wgpu::ExperimentalFeatures::disabled(),
|
|
564
574
|
..Default::default()
|
|
565
575
|
})).expect("Failed to create device (minimal fallback)")
|
|
@@ -2028,7 +2038,12 @@ pub extern "C" fn bloom_read_file(path_ptr: *const u8) -> *const u8 {
|
|
|
2028
2038
|
ptr
|
|
2029
2039
|
}
|
|
2030
2040
|
}
|
|
2031
|
-
|
|
2041
|
+
// A null pointer would NaN-box into a string-typed JS value pointing at
|
|
2042
|
+
// address 0; `.length`/`.charCodeAt` then dereference the header at a
|
|
2043
|
+
// negative offset and segfault. Return a valid empty Perry string so
|
|
2044
|
+
// callers that probe via `data.length === 0` (e.g. level discovery)
|
|
2045
|
+
// are safe. Mirrors the macOS native crate.
|
|
2046
|
+
Err(_) => alloc_perry_string(""),
|
|
2032
2047
|
}
|
|
2033
2048
|
}
|
|
2034
2049
|
|