Skip to content

Commit

Permalink
Add support for meshes with skin
Browse files Browse the repository at this point in the history
  • Loading branch information
voxelias committed Aug 27, 2024
1 parent ea1a220 commit fd9af50
Show file tree
Hide file tree
Showing 9 changed files with 528 additions and 390 deletions.
4 changes: 4 additions & 0 deletions demo/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ impl dotrix::Application for Demo {
&self.application_name
}

fn device_type_request(&self) -> Option<dotrix::DeviceType> {
Some(dotrix::DeviceType::Integrated)
}

fn startup(
self,
scheduler: &dotrix::tasks::Scheduler,
Expand Down
9 changes: 5 additions & 4 deletions src/graphics/vulkan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ impl Display {
let extensions_names = [
ash::khr::swapchain::NAME.as_ptr(),
#[cfg(any(target_os = "macos", target_os = "ios"))]
ash::vk::KhrPortabilitySubsetFn::NAME.as_ptr(),
ash::khr::portability_subset::NAME.as_ptr(),
];

let device_create_info = vk::DeviceCreateInfo::default()
Expand Down Expand Up @@ -1298,9 +1298,9 @@ impl Display {

#[cfg(any(target_os = "macos", target_os = "ios"))]
{
extensions.push(vk::KhrPortabilityEnumerationFn::NAME.as_ptr());
extensions.push(ash::khr::portability_enumeration::NAME.as_ptr());
// Enabling this extension is a requirement when using `VK_KHR_portability_subset`
extensions.push(vk::KhrGetPhysicalDeviceProperties2Fn::NAME.as_ptr());
extensions.push(ash::khr::get_physical_device_properties2::NAME.as_ptr());
}

let app_name = CString::new(desc.app_name).ok().unwrap();
Expand Down Expand Up @@ -1718,7 +1718,7 @@ impl Buffer {
gpu: &Gpu,
offset: u64,
data: &[T],
) {
) -> u64 {
let align = std::mem::align_of::<T>() as u64;
let size = (data.len() * std::mem::size_of::<T>()) as u64;

Expand All @@ -1734,6 +1734,7 @@ impl Buffer {
let mut index_slice = ash::util::Align::new(memory_ptr, align, size);
index_slice.copy_from_slice(data);
gpu.unmap_memory(self.device_memory);
size
}

pub unsafe fn free_memory_and_destroy(&self, gpu: &Gpu) {
Expand Down
Loading

0 comments on commit fd9af50

Please sign in to comment.