@bloomengine/engine 0.4.6 → 0.4.7
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 +42 -4
- package/package.json +1 -1
package/native/ios/src/lib.rs
CHANGED
|
@@ -347,7 +347,7 @@ unsafe extern "C" fn scene_will_connect(
|
|
|
347
347
|
required_limits = required_limits
|
|
348
348
|
.using_minimum_supported_acceleration_structure_values();
|
|
349
349
|
}
|
|
350
|
-
let (device, queue) = pollster_block_on(adapter.request_device(
|
|
350
|
+
let (device, queue) = match pollster_block_on(adapter.request_device(
|
|
351
351
|
&wgpu::DeviceDescriptor {
|
|
352
352
|
label: Some("bloom_device"),
|
|
353
353
|
required_features,
|
|
@@ -355,7 +355,26 @@ unsafe extern "C" fn scene_will_connect(
|
|
|
355
355
|
experimental_features,
|
|
356
356
|
..Default::default()
|
|
357
357
|
},
|
|
358
|
-
))
|
|
358
|
+
)) {
|
|
359
|
+
Ok(dq) => dq,
|
|
360
|
+
Err(e) => {
|
|
361
|
+
// Some real devices (e.g. iPhone 16 Pro / A18) advertise
|
|
362
|
+
// EXPERIMENTAL_RAY_QUERY on the adapter but reject it at device
|
|
363
|
+
// creation through wgpu's Metal backend, which would otherwise
|
|
364
|
+
// abort the app on launch. Retry with a minimal, always-supported
|
|
365
|
+
// configuration. The renderer keys off device.features() (see
|
|
366
|
+
// renderer/mod.rs), so it transparently falls back to the non-RT
|
|
367
|
+
// path when ray-query isn't granted.
|
|
368
|
+
eprintln!("[bloom-ios] request_device with preferred features failed ({e:?}); retrying without ray-query/experimental features");
|
|
369
|
+
pollster_block_on(adapter.request_device(&wgpu::DeviceDescriptor {
|
|
370
|
+
label: Some("bloom_device"),
|
|
371
|
+
required_features: wgpu::Features::empty(),
|
|
372
|
+
required_limits: wgpu::Limits::default(),
|
|
373
|
+
experimental_features: wgpu::ExperimentalFeatures::disabled(),
|
|
374
|
+
..Default::default()
|
|
375
|
+
})).expect("Failed to create device (minimal fallback)")
|
|
376
|
+
}
|
|
377
|
+
};
|
|
359
378
|
|
|
360
379
|
let surface_caps = surface.get_capabilities(&adapter);
|
|
361
380
|
let format = surface_caps.formats.iter()
|
|
@@ -518,7 +537,7 @@ pub unsafe extern "C" fn perry_scene_will_connect(scene: *const c_void) {
|
|
|
518
537
|
required_limits = required_limits
|
|
519
538
|
.using_minimum_supported_acceleration_structure_values();
|
|
520
539
|
}
|
|
521
|
-
let (device, queue) = pollster_block_on(adapter.request_device(
|
|
540
|
+
let (device, queue) = match pollster_block_on(adapter.request_device(
|
|
522
541
|
&wgpu::DeviceDescriptor {
|
|
523
542
|
label: Some("bloom_device"),
|
|
524
543
|
required_features,
|
|
@@ -526,7 +545,26 @@ pub unsafe extern "C" fn perry_scene_will_connect(scene: *const c_void) {
|
|
|
526
545
|
experimental_features,
|
|
527
546
|
..Default::default()
|
|
528
547
|
},
|
|
529
|
-
))
|
|
548
|
+
)) {
|
|
549
|
+
Ok(dq) => dq,
|
|
550
|
+
Err(e) => {
|
|
551
|
+
// Some real devices (e.g. iPhone 16 Pro / A18) advertise
|
|
552
|
+
// EXPERIMENTAL_RAY_QUERY on the adapter but reject it at device
|
|
553
|
+
// creation through wgpu's Metal backend, which would otherwise
|
|
554
|
+
// abort the app on launch. Retry with a minimal, always-supported
|
|
555
|
+
// configuration. The renderer keys off device.features() (see
|
|
556
|
+
// renderer/mod.rs), so it transparently falls back to the non-RT
|
|
557
|
+
// path when ray-query isn't granted.
|
|
558
|
+
eprintln!("[bloom-ios] request_device with preferred features failed ({e:?}); retrying without ray-query/experimental features");
|
|
559
|
+
pollster_block_on(adapter.request_device(&wgpu::DeviceDescriptor {
|
|
560
|
+
label: Some("bloom_device"),
|
|
561
|
+
required_features: wgpu::Features::empty(),
|
|
562
|
+
required_limits: wgpu::Limits::default(),
|
|
563
|
+
experimental_features: wgpu::ExperimentalFeatures::disabled(),
|
|
564
|
+
..Default::default()
|
|
565
|
+
})).expect("Failed to create device (minimal fallback)")
|
|
566
|
+
}
|
|
567
|
+
};
|
|
530
568
|
|
|
531
569
|
let surface_caps = surface.get_capabilities(&adapter);
|
|
532
570
|
let format = surface_caps.formats.iter()
|