Skip to content

Commit

Permalink
allow non-compliant adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Jan 8, 2025
1 parent 0698ed6 commit 48824b0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions crates/viewer/re_viewer_context/src/test_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,19 @@ fn init_shared_renderer_setup() -> SharedWgpuResources {
// * lives mostly in re_renderer and is shared with viewer & renderer examples
// * can be told to prefer software rendering
// * can be told to match a specific device tier
// For the moment we just use wgpu defaults.

let instance = wgpu::Instance::default();

let mut adapters = instance.enumerate_adapters(wgpu::Backends::VULKAN | wgpu::Backends::METAL);
// We don't test on GL & DX12 right now (and don't want to do so by mistake!).
let backends = wgpu::Backends::VULKAN | wgpu::Backends::METAL;
let flags = (wgpu::InstanceFlags::ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER
| wgpu::InstanceFlags::VALIDATION
| wgpu::InstanceFlags::GPU_BASED_VALIDATION)
.with_env(); // Allow overwriting flags via env vars.
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends,
flags,
..Default::default()
});
let mut adapters = instance.enumerate_adapters(backends);
assert!(!adapters.is_empty(), "No graphics adapter found!");
re_log::info!("Found the following adapters:");
for adapter in &adapters {
Expand Down

0 comments on commit 48824b0

Please sign in to comment.