upgraded Ash and Vulkan versions

main
Nathan Buck 11 months ago
parent 1d23169dcc
commit a6caf232d9

@ -5,7 +5,7 @@ edition = "2021"
[dependencies] [dependencies]
winit = "0.20.0" winit = "0.20.0"
ash = "0.29.0" ash = "0.37.3"
num = "0.2" num = "0.2"
cgmath = "0.17.0" cgmath = "0.17.0"
image = "0.22" image = "0.22"

@ -7,9 +7,8 @@ use crate::{
utility::structures::*, utility::structures::*,
}; };
use ash::version::DeviceV1_0; use ash::{vk, Entry};
use ash::version::InstanceV1_0; use vk::*;
use ash::vk;
use memoffset::offset_of; use memoffset::offset_of;
use winit::event::{Event, VirtualKeyCode, ElementState, KeyboardInput, WindowEvent}; use winit::event::{Event, VirtualKeyCode, ElementState, KeyboardInput, WindowEvent};
use winit::event_loop::{EventLoop, ControlFlow}; use winit::event_loop::{EventLoop, ControlFlow};
@ -118,7 +117,7 @@ impl VulkanApp {
let window = utility::window::init_window(event_loop, WINDOW_TITLE, WINDOW_WIDTH, WINDOW_HEIGHT); let window = utility::window::init_window(event_loop, WINDOW_TITLE, WINDOW_WIDTH, WINDOW_HEIGHT);
// init vulkan stuff // init vulkan stuff
let entry = ash::Entry::new().unwrap(); let entry = unsafe { Entry::load().unwrap() };
let instance = share::create_instance( let instance = share::create_instance(
&entry, &entry,
WINDOW_TITLE, WINDOW_TITLE,
@ -544,7 +543,7 @@ impl VulkanApp {
let color_blend_attachment_states = [vk::PipelineColorBlendAttachmentState { let color_blend_attachment_states = [vk::PipelineColorBlendAttachmentState {
blend_enable: vk::FALSE, blend_enable: vk::FALSE,
color_write_mask: vk::ColorComponentFlags::all(), color_write_mask: vk::ColorComponentFlags::RGBA,
src_color_blend_factor: vk::BlendFactor::ONE, src_color_blend_factor: vk::BlendFactor::ONE,
dst_color_blend_factor: vk::BlendFactor::ZERO, dst_color_blend_factor: vk::BlendFactor::ZERO,
color_blend_op: vk::BlendOp::ADD, color_blend_op: vk::BlendOp::ADD,
@ -860,7 +859,7 @@ impl VulkanApp {
self.draw_frame(); self.draw_frame();
tick_counter.tick_frame(); tick_counter.tick_frame();
if IS_PAINT_FPS_COUNTER { if true {
print!("FPS: {}\r", tick_counter.fps()); print!("FPS: {}\r", tick_counter.fps());
} }
}, },

@ -1,12 +1,12 @@
use crate::utility::debug::ValidationInfo; use crate::utility::debug::ValidationInfo;
use crate::utility::structures::DeviceExtension; use crate::utility::structures::DeviceExtension;
use ash::vk_make_version; use ash::vk::make_api_version;
use std::os::raw::c_char; use std::os::raw::c_char;
pub const APPLICATION_VERSION: u32 = vk_make_version!(1, 0, 0); pub const APPLICATION_VERSION: u32 = make_api_version(1, 0, 0, 0);
pub const ENGINE_VERSION: u32 = vk_make_version!(1, 0, 0); pub const ENGINE_VERSION: u32 = make_api_version(1, 0, 0, 0);
pub const API_VERSION: u32 = vk_make_version!(1, 0, 92); pub const API_VERSION: u32 = make_api_version(1, 3, 251, 0);
pub const WINDOW_WIDTH: u32 = 800; pub const WINDOW_WIDTH: u32 = 800;
pub const WINDOW_HEIGHT: u32 = 600; pub const WINDOW_HEIGHT: u32 = 600;

@ -1,5 +1,5 @@
use ash::version::EntryV1_0;
use ash::vk; use ash::vk;
use vk::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::os::raw::c_void; use std::os::raw::c_void;

@ -1,5 +1,4 @@
use ash::version::{EntryV1_0, InstanceV1_0}; use ash::{vk, Entry, Instance};
use ash::vk;
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
use ash::extensions::khr::Win32Surface; use ash::extensions::khr::Win32Surface;
@ -51,9 +50,9 @@ pub fn required_extension_names() -> Vec<*const i8> {
// create surface --------------------------------------------------------- // create surface ---------------------------------------------------------
#[cfg(all(unix, not(target_os = "android"), not(target_os = "macos")))] #[cfg(all(unix, not(target_os = "android"), not(target_os = "macos")))]
pub unsafe fn create_surface<E: EntryV1_0, I: InstanceV1_0>( pub unsafe fn create_surface(
entry: &E, entry: &Entry,
instance: &I, instance: &Instance,
window: &winit::window::Window, window: &winit::window::Window,
) -> Result<vk::SurfaceKHR, vk::Result> { ) -> Result<vk::SurfaceKHR, vk::Result> {
use std::ptr; use std::ptr;
@ -73,9 +72,9 @@ pub unsafe fn create_surface<E: EntryV1_0, I: InstanceV1_0>(
} }
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
pub unsafe fn create_surface<E: EntryV1_0, I: InstanceV1_0>( pub unsafe fn create_surface(
entry: &E, entry: &Entry,
instance: &I, instance: &Instance,
window: &winit::window::Window, window: &winit::window::Window,
) -> Result<vk::SurfaceKHR, vk::Result> { ) -> Result<vk::SurfaceKHR, vk::Result> {
use std::mem; use std::mem;
@ -109,9 +108,9 @@ pub unsafe fn create_surface<E: EntryV1_0, I: InstanceV1_0>(
} }
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
pub unsafe fn create_surface<E: EntryV1_0, I: InstanceV1_0>( pub unsafe fn create_surface(
entry: &E, entry: &Entry,
instance: &I, instance: &Instance,
window: &winit::window::Window, window: &winit::window::Window,
) -> Result<vk::SurfaceKHR, vk::Result> { ) -> Result<vk::SurfaceKHR, vk::Result> {
use std::os::raw::c_void; use std::os::raw::c_void;

@ -206,7 +206,7 @@ pub mod v1 {
let color_blend_attachment_states = [vk::PipelineColorBlendAttachmentState { let color_blend_attachment_states = [vk::PipelineColorBlendAttachmentState {
blend_enable: vk::FALSE, blend_enable: vk::FALSE,
color_write_mask: vk::ColorComponentFlags::all(), color_write_mask: vk::ColorComponentFlags::empty(),
src_color_blend_factor: vk::BlendFactor::ONE, src_color_blend_factor: vk::BlendFactor::ONE,
dst_color_blend_factor: vk::BlendFactor::ZERO, dst_color_blend_factor: vk::BlendFactor::ZERO,
color_blend_op: vk::BlendOp::ADD, color_blend_op: vk::BlendOp::ADD,
@ -1371,9 +1371,6 @@ pub mod v2 {
} }
} }
use ash::version::DeviceV1_0;
use ash::version::EntryV1_0;
use ash::version::InstanceV1_0;
use ash::vk; use ash::vk;
use std::ffi::CString; use std::ffi::CString;
@ -1641,7 +1638,7 @@ pub fn find_queue_family(
physical_device, physical_device,
index as u32, index as u32,
surface_stuff.surface, surface_stuff.surface,
) ).unwrap()
}; };
if queue_family.queue_count > 0 && is_present_support { if queue_family.queue_count > 0 && is_present_support {
queue_family_indices.present_family = Some(index); queue_family_indices.present_family = Some(index);

Loading…
Cancel
Save