From b27896f875dfea2a7787ee284efee6f1b4c50efe Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Thu, 4 Apr 2024 12:20:19 -0700 Subject: [PATCH] Disable RAY_QUERY and RAY_TRACING_ACCELERATION_STRUCTURE by default (#12862) # Objective See https://github.com/gfx-rs/wgpu/issues/5488 for context and rationale. ## Solution - Disables `wgpu::Features::RAY_QUERY` and `wgpu::Features::RAY_TRACING_ACCELERATION_STRUCTURE` by default. They must be explicitly opted into now. --- ## Changelog - Disables `wgpu::Features::RAY_QUERY` and `wgpu::Features::RAY_TRACING_ACCELERATION_STRUCTURE` by default. They must be explicitly opted into now. ## Migration Guide - If you need `wgpu::Features::RAY_QUERY` or `wgpu::Features::RAY_TRACING_ACCELERATION_STRUCTURE`, enable them explicitly using `WgpuSettings::features` --- crates/bevy_render/src/renderer/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/bevy_render/src/renderer/mod.rs b/crates/bevy_render/src/renderer/mod.rs index 3f1620ae87..23ad14c136 100644 --- a/crates/bevy_render/src/renderer/mod.rs +++ b/crates/bevy_render/src/renderer/mod.rs @@ -209,6 +209,15 @@ pub async fn initialize_renderer( // integrated GPUs. features -= wgpu::Features::MAPPABLE_PRIMARY_BUFFERS; } + + // RAY_QUERY and RAY_TRACING_ACCELERATION STRUCTURE will sometimes cause DeviceLost failures on platforms + // that report them as supported: + // + // WGPU also currently doesn't actually support these features yet, so we should disable + // them until they are safe to enable. + features -= wgpu::Features::RAY_QUERY; + features -= wgpu::Features::RAY_TRACING_ACCELERATION_STRUCTURE; + limits = adapter.limits(); }