Skip to content

Commit

Permalink
Added multiframe resources for descriptors.
Browse files Browse the repository at this point in the history
facundo-villa committed Feb 5, 2024
1 parent 8481d18 commit 0b5ea1e
Showing 3 changed files with 164 additions and 121 deletions.
33 changes: 30 additions & 3 deletions src/ghi/graphics_hardware_interface.rs
Original file line number Diff line number Diff line change
@@ -399,8 +399,35 @@ impl ShaderBindingDescriptor {

/// Configuration for which features to request from the underlying API.
pub struct Features {
pub validation: bool,
pub ray_tracing: bool,
pub(crate) validation: bool,
/// Prints all API calls to the console.
pub(crate) api_dump: bool,
pub(crate) ray_tracing: bool,
}

impl Features {
pub fn new() -> Self {
Self {
validation: false,
api_dump: false,
ray_tracing: false,
}
}

pub fn validation(mut self, value: bool) -> Self {
self.validation = value;
self
}

pub fn api_dump(mut self, value: bool) -> Self {
self.api_dump = value;
self
}

pub fn ray_tracing(mut self, value: bool) -> Self {
self.ray_tracing = value;
self
}
}

pub struct BufferSplitter<'a> {
@@ -1890,7 +1917,7 @@ pub(super) mod tests {
assert!(!renderer.has_errors())
}

pub(crate) fn multiframe_resources(renderer: &mut dyn GraphicsHardwareInterface,) {
pub(crate) fn multiframe_resources(renderer: &mut dyn GraphicsHardwareInterface,) { // TODO: test multiframe resources for combined image samplers
let compute_shader_string = "
#version 450
#pragma shader_stage(compute)
2 changes: 1 addition & 1 deletion src/ghi/mod.rs
Original file line number Diff line number Diff line change
@@ -9,5 +9,5 @@ pub mod vulkan_ghi;
pub use crate::ghi::graphics_hardware_interface::*;

pub fn create() -> impl GraphicsHardwareInterface {
vulkan_ghi::VulkanGHI::new(&graphics_hardware_interface::Features{ validation: true, ray_tracing: false }).expect("Failed to create VulkanGHI")
vulkan_ghi::VulkanGHI::new(&graphics_hardware_interface::Features::new().validation(true)).expect("Failed to create VulkanGHI")
}
Loading

0 comments on commit 0b5ea1e

Please sign in to comment.