50 lines
1.4 KiB
Rust
50 lines
1.4 KiB
Rust
|
use anyhow::Result;
|
||
|
use vulkan_rs::prelude::*;
|
||
|
|
||
|
use std::sync::Arc;
|
||
|
|
||
|
pub struct RaytracerDesciptorLayouts;
|
||
|
|
||
|
impl RaytracerDesciptorLayouts {
|
||
|
// Animation Layouts
|
||
|
pub fn descriptor_layout(device: Arc<Device>) -> Result<Arc<DescriptorSetLayout>> {
|
||
|
DescriptorSetLayout::builder()
|
||
|
.add_layout_binding(
|
||
|
0,
|
||
|
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
|
||
|
VK_SHADER_STAGE_COMPUTE_BIT,
|
||
|
0,
|
||
|
)
|
||
|
.add_layout_binding(
|
||
|
1,
|
||
|
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
|
||
|
VK_SHADER_STAGE_COMPUTE_BIT,
|
||
|
0,
|
||
|
)
|
||
|
.build(device)
|
||
|
}
|
||
|
|
||
|
pub fn bone_descriptor_layout(device: Arc<Device>) -> Result<Arc<DescriptorSetLayout>> {
|
||
|
DescriptorSetLayout::builder()
|
||
|
.add_layout_binding(
|
||
|
0,
|
||
|
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
|
||
|
VK_SHADER_STAGE_COMPUTE_BIT,
|
||
|
0,
|
||
|
)
|
||
|
.add_layout_binding(
|
||
|
1,
|
||
|
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
|
||
|
VK_SHADER_STAGE_COMPUTE_BIT,
|
||
|
0,
|
||
|
)
|
||
|
.add_layout_binding(
|
||
|
2,
|
||
|
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
|
||
|
VK_SHADER_STAGE_COMPUTE_BIT,
|
||
|
0,
|
||
|
)
|
||
|
.build(device)
|
||
|
}
|
||
|
}
|