Skip to content

Commit

Permalink
Update wgpu (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Dec 29, 2023
1 parent 17d3b15 commit 9c4fc3c
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 28 deletions.
134 changes: 109 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ rayon = "1"
anyhow = "1"
env_logger = "0.10"
gif = "0.12"
wgpu = { version = "0.17", features = ["webgl"] }
wgpu = { version = "0.18", features = ["webgl"] }
fancy_slice = { version = "0.1", features = [] }
winit = { version = "0.29", features = ["rwh_05"] }
winit_input_helper = "0.15"
Expand Down
5 changes: 4 additions & 1 deletion src/renderer/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::mem;

use cgmath::{InnerSpace, Matrix4, MetricSpace, Quaternion, Rad, SquareMatrix, Vector3};
use wgpu::util::DeviceExt;
use wgpu::StoreOp;

use crate::high_level_fighter::{CollisionBoxValues, Extent, HighLevelSubaction};
use crate::renderer::app::state::InvulnerableType;
Expand Down Expand Up @@ -87,11 +88,13 @@ pub(crate) fn draw_frame(
},
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(state.background_color),
store: true,
store: StoreOp::Store,
},
})],
depth_stencil_attachment: None,
label: None,
timestamp_writes: None,
occlusion_query_set: None,
});
if wireframe {
rpass.set_pipeline(&state.render_pipeline_line);
Expand Down
4 changes: 3 additions & 1 deletion src/renderer/wgpu_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::num::NonZeroU64;

use bytemuck::{Pod, Zeroable};
use cgmath::Matrix4;
use wgpu::util::DeviceExt;
use wgpu::{util::DeviceExt, InstanceFlags};

// TODO: Detect by capability or something
#[cfg(not(target_arch = "wasm32"))]
Expand Down Expand Up @@ -43,6 +43,8 @@ impl WgpuState {
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: wgpu::Backends::PRIMARY,
dx12_shader_compiler: wgpu::Dx12Compiler::default(),
flags: InstanceFlags::from_build_config(),
gles_minor_version: wgpu::Gles3MinorVersion::Automatic,
});
WgpuState::new(
instance,
Expand Down

0 comments on commit 9c4fc3c

Please sign in to comment.