Skip to content

Commit

Permalink
Merge pull request #2014 from hannobraun/render
Browse files Browse the repository at this point in the history
Be more relaxed about what GPU configs to accept
  • Loading branch information
hannobraun authored Sep 7, 2023
2 parents 0374669 + 7728514 commit d410ff2
Showing 1 changed file with 7 additions and 5 deletions.
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

0 comments on commit d410ff2

Please sign in to comment.