Various fixes

This commit is contained in:
Pierre Krieger 2016-10-16 20:37:32 +02:00
parent b9f4f8f2cf
commit 479a60fe8b
3 changed files with 8 additions and 18 deletions

View File

@ -125,21 +125,6 @@ fn main() {
depth: (vulkano::format::D16Unorm, 1)
}).unwrap();
let descriptor_pool = vulkano::descriptor::descriptor_set::DescriptorPool::new(&device);
mod pipeline_layout {
pipeline_layout!{
set0: {
uniforms: UniformBuffer<::vs::ty::Data>
}
}
}
let pipeline_layout = pipeline_layout::CustomPipeline::new(&device).unwrap();
let set = pipeline_layout::set0::Set::new(&descriptor_pool, &pipeline_layout, &pipeline_layout::set0::Descriptors {
uniforms: &uniform_buffer
});
let pipeline = vulkano::pipeline::GraphicsPipeline::new(&device, vulkano::pipeline::GraphicsPipelineParams {
vertex_input: vulkano::pipeline::vertex::TwoBuffersDefinition::new(),
vertex_shader: vs.main_entry_point(),
@ -161,10 +146,13 @@ fn main() {
fragment_shader: fs.main_entry_point(),
depth_stencil: vulkano::pipeline::depth_stencil::DepthStencil::simple_depth_test(),
blend: vulkano::pipeline::blend::Blend::pass_through(),
layout: &pipeline_layout,
render_pass: vulkano::framebuffer::Subpass::from(&renderpass, 0).unwrap(),
}).unwrap();
let set = simple_descriptor_set!(&pipeline, 0, {
uniforms: &uniform_buffer
});
let framebuffers = images.iter().map(|image| {
let attachments = renderpass::AList {
color: image.clone(),

View File

@ -66,7 +66,7 @@ pub fn write_descriptor_sets(doc: &parse::Spirv) -> String {
format!("({set}, {binding}) => Some(DescriptorDesc {{
ty: {desc_ty},
array_count: 1,
stages: stages.clone(),
stages: self.0.clone(),
readonly: {readonly},
}}),", set = d.set, binding = d.binding, desc_ty = d.desc_ty,
readonly = if d.readonly { "true" } else { "false" })

View File

@ -76,7 +76,9 @@ unsafe impl<R, S> TrackedDescriptorSet<S> for SimpleDescriptorSet<R>
#[macro_export]
macro_rules! simple_descriptor_set {
($layout:expr, $set_num:expr, {$($name:ident: $val:expr),*$(,)*}) => ({
use $crate::descriptor_set::SimpleDescriptorSetBufferExt;
use $crate::descriptor::descriptor_set::SimpleDescriptorSetBuilder;
use $crate::descriptor::descriptor_set::SimpleDescriptorSetBufferExt;
let builder = SimpleDescriptorSetBuilder::new($layout, $set_num);
$(