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

Fix issue on my new AMD GPU #437

Merged
merged 4 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
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: 6 additions & 6 deletions fj-app/src/graphics/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl Renderer {
format: color_format,
width: window.width(),
height: window.height(),
present_mode: wgpu::PresentMode::Fifo,
present_mode: wgpu::PresentMode::Mailbox,
};
surface.configure(&device, &surface_config);

Expand Down Expand Up @@ -300,24 +300,24 @@ impl Renderer {

#[derive(Error, Debug)]
pub enum InitError {
#[error("I/O error")]
#[error("I/O error: {0}")]
Io(#[from] io::Error),

#[error("Error request adapter")]
RequestAdapter,

#[error("Error requesting device")]
#[error("Error requesting device: {0}")]
RequestDevice(#[from] wgpu::RequestDeviceError),

#[error("Error loading font")]
#[error("Error loading font: {0}")]
InvalidFont(#[from] InvalidFont),
}

#[derive(Error, Debug)]
pub enum DrawError {
#[error("Error acquiring output surface")]
#[error("Error acquiring output surface: {0}")]
Surface(#[from] wgpu::SurfaceError),

#[error("Error drawing text")]
#[error("Error drawing text: {0}")]
Text(String),
}
9 changes: 3 additions & 6 deletions fj-app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use fj_kernel::algorithms::triangulate;
use fj_math::{Aabb, Scalar, Triangle};
use fj_operations::ToShape as _;
use futures::executor::block_on;
use tracing::trace;
use tracing::{trace, warn};
use tracing_subscriber::fmt::format;
use tracing_subscriber::EnvFilter;
use winit::{
Expand Down Expand Up @@ -224,11 +224,8 @@ fn main() -> anyhow::Result<()> {
if let (Some(shape), Some(camera)) = (&shape, &mut camera) {
camera.update_planes(&shape.aabb);

match renderer.draw(camera, &draw_config) {
Ok(()) => {}
Err(err) => {
panic!("Draw error: {}", err);
}
if let Err(err) = renderer.draw(camera, &draw_config) {
warn!("Draw error: {}", err);
}
}
}
Expand Down