Skip to content

Commit

Permalink
refactor: add default compilation option to the state creation
Browse files Browse the repository at this point in the history
  • Loading branch information
imrn99 committed May 3, 2024
1 parent 88d6674 commit bb96532
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion honeycomb-render/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ async fn inner<T: CoordsFloat>(
};
// put a hard cap on the rendering speed
std::thread::sleep(std::time::Duration::from_millis(
(MS_PER_FRAME - start.elapsed().as_millis()) as u64,
(MS_PER_FRAME.saturating_sub(start.elapsed().as_millis()))
as u64,
));
}
WindowEvent::CloseRequested => target.exit(),
Expand Down
4 changes: 3 additions & 1 deletion honeycomb-render/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use honeycomb_core::{CMap2, CoordsFloat};
// extern
use std::borrow::Cow;
use wgpu::util::DeviceExt;
use wgpu::PrimitiveTopology;
use wgpu::{PipelineCompilationOptions, PrimitiveTopology};
use winit::dpi::PhysicalSize;
use winit::event::{ElementState, KeyEvent};
use winit::event_loop::ActiveEventLoop;
Expand Down Expand Up @@ -194,11 +194,13 @@ async fn inner(
module: &shader,
entry_point: "vs_main",
buffers: &[Coords2Shader::desc()],
compilation_options: PipelineCompilationOptions::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
targets: &[Some(swapchain_format.into())],
compilation_options: PipelineCompilationOptions::default(),
}),
primitive: wgpu::PrimitiveState {
topology: PrimitiveTopology::TriangleList,
Expand Down

0 comments on commit bb96532

Please sign in to comment.