@bloomengine/engine 0.4.6 → 0.4.8
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 +52 -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,31 @@ 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 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.
|
|
374
|
+
pollster_block_on(adapter.request_device(&wgpu::DeviceDescriptor {
|
|
375
|
+
label: Some("bloom_device"),
|
|
376
|
+
required_features: wgpu::Features::empty(),
|
|
377
|
+
required_limits: adapter.limits(),
|
|
378
|
+
experimental_features: wgpu::ExperimentalFeatures::disabled(),
|
|
379
|
+
..Default::default()
|
|
380
|
+
})).expect("Failed to create device (minimal fallback)")
|
|
381
|
+
}
|
|
382
|
+
};
|
|
359
383
|
|
|
360
384
|
let surface_caps = surface.get_capabilities(&adapter);
|
|
361
385
|
let format = surface_caps.formats.iter()
|
|
@@ -518,7 +542,7 @@ pub unsafe extern "C" fn perry_scene_will_connect(scene: *const c_void) {
|
|
|
518
542
|
required_limits = required_limits
|
|
519
543
|
.using_minimum_supported_acceleration_structure_values();
|
|
520
544
|
}
|
|
521
|
-
let (device, queue) = pollster_block_on(adapter.request_device(
|
|
545
|
+
let (device, queue) = match pollster_block_on(adapter.request_device(
|
|
522
546
|
&wgpu::DeviceDescriptor {
|
|
523
547
|
label: Some("bloom_device"),
|
|
524
548
|
required_features,
|
|
@@ -526,7 +550,31 @@ pub unsafe extern "C" fn perry_scene_will_connect(scene: *const c_void) {
|
|
|
526
550
|
experimental_features,
|
|
527
551
|
..Default::default()
|
|
528
552
|
},
|
|
529
|
-
))
|
|
553
|
+
)) {
|
|
554
|
+
Ok(dq) => dq,
|
|
555
|
+
Err(e) => {
|
|
556
|
+
// Some real devices (e.g. iPhone 16 Pro / A18) advertise
|
|
557
|
+
// EXPERIMENTAL_RAY_QUERY on the adapter but reject it at device
|
|
558
|
+
// creation through wgpu's Metal backend, which would otherwise
|
|
559
|
+
// abort the app on launch. Retry with a minimal, always-supported
|
|
560
|
+
// configuration. The renderer keys off device.features() (see
|
|
561
|
+
// renderer/mod.rs), so it transparently falls back to the non-RT
|
|
562
|
+
// path when ray-query isn't granted.
|
|
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.
|
|
569
|
+
pollster_block_on(adapter.request_device(&wgpu::DeviceDescriptor {
|
|
570
|
+
label: Some("bloom_device"),
|
|
571
|
+
required_features: wgpu::Features::empty(),
|
|
572
|
+
required_limits: adapter.limits(),
|
|
573
|
+
experimental_features: wgpu::ExperimentalFeatures::disabled(),
|
|
574
|
+
..Default::default()
|
|
575
|
+
})).expect("Failed to create device (minimal fallback)")
|
|
576
|
+
}
|
|
577
|
+
};
|
|
530
578
|
|
|
531
579
|
let surface_caps = surface.get_capabilities(&adapter);
|
|
532
580
|
let format = surface_caps.formats.iter()
|