Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be more relaxed about what GPU configs to accept #2014

Merged
merged 4 commits into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions crates/fj-viewer/src/graphics/renderer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{io, mem::size_of, vec};

use thiserror::Error;
use tracing::debug;
use tracing::{debug, trace};
use wgpu::util::DeviceExt as _;

use crate::{
Expand Down Expand Up @@ -41,7 +41,7 @@ impl Renderer {
/// Returns a new `Renderer`.
pub async fn new(screen: &impl Screen) -> Result<Self, RendererInitError> {
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: wgpu::Backends::PRIMARY,
backends: wgpu::Backends::all(),
..Default::default()
});

Expand All @@ -50,13 +50,15 @@ impl Renderer {

let adapter = instance
.request_adapter(&wgpu::RequestAdapterOptions {
power_preference: wgpu::PowerPreference::HighPerformance,
power_preference: wgpu::PowerPreference::None,
force_fallback_adapter: false,
compatible_surface: Some(&surface),
})
.await
.ok_or(RendererInitError::RequestAdapter)?;

debug!("Using adapter: {:?}", adapter.get_info());

let features = {
let desired_features = wgpu::Features::POLYGON_MODE_LINE;
let available_features = adapter.features();
Expand Down Expand Up @@ -325,10 +327,10 @@ impl Renderer {
let command_buffer = encoder.finish();
self.queue.submit(Some(command_buffer));

debug!("Presenting...");
trace!("Presenting...");
surface_texture.present();

debug!("Finished drawing.");
trace!("Finished drawing.");
Ok(())
}

Expand Down