impl: 3D Rendering

This commit is contained in:
zack 2025-04-01 21:41:24 -04:00
parent dbf9544e80
commit 70176bb86a
No known key found for this signature in database
GPG key ID: EE8A2B709E2401D1
18 changed files with 862 additions and 185 deletions

View file

@ -63,6 +63,10 @@ pub enum GfxHalError {
/// Placeholder for other specific errors.
#[error("An unexpected error occurred: {0}")]
Other(String),
/// Size for Buffer is invalid.
#[error("Buffer size is invalid.")]
BufferSizeInvalid,
}
pub type Result<T, E = GfxHalError> = std::result::Result<T, E>;

View file

@ -6,3 +6,12 @@ pub mod queue;
pub mod surface;
pub mod swapchain;
pub mod sync;
pub use device::*;
pub use error::*;
pub use instance::*;
pub use physical_device::*;
pub use queue::*;
pub use surface::*;
pub use swapchain::*;
pub use sync::*;

View file

@ -65,18 +65,6 @@ impl Queue {
submits: &[vk::SubmitInfo],
signal_fence: Option<&Fence>,
) -> Result<()> {
debug_assert!(
self.device.raw().handle() == submit_device_raw.handle(),
"Queue::submit called with an ash::Device from a different logical VkDevice than the queue belongs to!"
);
// Optional: Check fence device consistency
if let Some(fence) = signal_fence {
debug_assert!(
fence.device().raw().handle() == submit_device_raw.handle(),
"Fence passed to Queue::submit belongs to a different logical device than submit_device_raw!"
);
}
let fence_handle = signal_fence.map_or(vk::Fence::null(), |f| f.handle());
// Keep the lock for thread-safety on the VkQueue object itself

View file

@ -10,6 +10,7 @@ use crate::{
/// Wraps a `vk::Fence`, used for CPU-GPU synchronization.
///
/// Owns the `vk::Fence` handle.
#[derive(Clone)]
pub struct Fence {
device: Arc<Device>,
fence: vk::Fence,