Skip to content

Commit

Permalink
Minor Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Snowiiii committed Jan 28, 2024
1 parent 35a6f2e commit 61a9e78
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 53 deletions.
62 changes: 31 additions & 31 deletions Cargo.lock

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

6 changes: 2 additions & 4 deletions crates/vent-assets/src/model/gltf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ use std::{
};

use ash::vk;
use gltf::{
mesh::Mode,
texture::Sampler,
};
use gltf::{mesh::Mode, texture::Sampler};
use image::DynamicImage;
use vent_rendering::{image::VulkanImage, instance::VulkanInstance, Vertex3D};

Expand Down Expand Up @@ -247,6 +244,7 @@ impl GLTFLoader {
}

#[must_use]
#[allow(dead_code)]
const fn conv_primitive_mode(mode: Mode) -> vk::PrimitiveTopology {
match mode {
Mode::Points => vk::PrimitiveTopology::POINT_LIST,
Expand Down
2 changes: 1 addition & 1 deletion crates/vent-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
winit = "0.29.9"
winit = "0.29"
sysinfo = "0.30"
chrono = "0.4"

Expand Down
2 changes: 1 addition & 1 deletion crates/vent-ecs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
winit = { version = "0.29.9", default-features = false }
winit = { version = "0.29", default-features = false }
2 changes: 1 addition & 1 deletion crates/vent-editor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ash = { version= "0.37.3", default-features = false, features = ["linked", "debu
egui = "0.25"
egui_dock = "0.10"

winit = "0.29.9"
winit = "0.29"
pollster = "0.3.0"

log = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion crates/vent-rendering/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ash = { version= "0.37.3", default-features = false, features = ["linked", "debu

image = "0.24.7"

winit = "0.29.9"
winit = "0.29"
raw-window-handle = "0.6"
log = "0.4"

Expand Down
7 changes: 1 addition & 6 deletions crates/vent-rendering/src/buffer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use std::{
mem::{align_of},
os::raw::c_void,
};
use std::{mem::align_of, os::raw::c_void};

use ash::vk;

Expand Down Expand Up @@ -53,7 +50,6 @@ impl VulkanBuffer {
allocator: &MemoryAllocator,
image: vk::Image,
) -> vk::DeviceMemory {

allocator.allocate_image(device, image, vk::MemoryPropertyFlags::DEVICE_LOCAL)
}

Expand Down Expand Up @@ -85,7 +81,6 @@ impl VulkanBuffer {

pub fn map(&self, device: &ash::Device, size: vk::DeviceSize) -> *mut c_void {
unsafe {

device
.map_memory(self.buffer_memory, 0, size, vk::MemoryMapFlags::empty())
.unwrap()
Expand Down
2 changes: 1 addition & 1 deletion crates/vent-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ vent-ecs = { path = "../vent-ecs"}

ash = { version= "0.37.3", default-features = false, features = ["linked", "debug"] }

winit = "0.29.9"
winit = "0.29"
pollster = "0.3.0"
log = "0.4"

Expand Down
12 changes: 6 additions & 6 deletions crates/vent-runtime/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use fs_extra::dir::CopyOptions;

use std::{
env::var,
ffi::OsStr,
fs,
path::{Path, PathBuf},
process::{Command, Output},
Expand Down Expand Up @@ -48,11 +47,12 @@ fn compile_shaders(dir: &Path) {
fn compile_shader(file: &DirEntry) {
if file.file_type().unwrap().is_file() {
let path = file.path();
if path.extension() == Some(OsStr::new("spv"))
|| path.extension() == Some(OsStr::new("wgsl"))
{
return;
if let Some(ext) = path.extension() {
if ext == "spv" || ext == "wgsl" {
return;
}
}

let name = path.file_name().unwrap().to_str().unwrap();
let output_name = format!("{}.spv", &name);
println!("Found file {:?}.\nCompiling...", path.as_os_str());
Expand All @@ -71,7 +71,7 @@ fn compile_shader(file: &DirEntry) {
}

fn get_shader_source_dir_path() -> PathBuf {
let path = get_root_path().join("res").join("shaders");
let path = get_root_path().join("res/shaders");
println!("Shader source directory: {:?}", path.as_os_str());
path
}
Expand Down
2 changes: 1 addition & 1 deletion crates/vent-runtime/src/render/camera/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ impl Camera3D {
#[inline]
#[must_use]
fn direction(&self) -> Vec3 {
let (sin_pitch, cos_pitch) = self.rotation.y.sin_cos();
let (sin_yaw, cos_yaw) = self.rotation.x.sin_cos();
let (sin_pitch, cos_pitch) = self.rotation.y.sin_cos();

glam::vec3(cos_pitch * cos_yaw, sin_pitch, cos_pitch * sin_yaw).normalize()
}
Expand Down

0 comments on commit 61a9e78

Please sign in to comment.