From 32f74cc619fc3a7955f16e9417a9279c8b5fe1f9 Mon Sep 17 00:00:00 2001 From: maik klein Date: Sun, 25 Dec 2016 14:38:26 +0100 Subject: [PATCH] Restructure examples --- examples/{triangle => }/Cargo.lock | 2 +- examples/{triangle => }/Cargo.toml | 4 +- examples/{triangle => }/shader/frag.spv | Bin examples/{triangle => }/shader/triangle.frag | 0 examples/{triangle => }/shader/triangle.vert | 0 examples/{triangle => }/shader/vert.spv | Bin .../src/main.rs => src/bin/texture.rs} | 0 examples/src/bin/triangle.rs | 516 ++++++++ examples/src/lib.rs | 596 ++++++++++ examples/texture/Cargo.lock | 428 ------- examples/texture/Cargo.toml | 9 - examples/texture/rust.png | Bin 38310 -> 0 bytes examples/texture/shader/frag.spv | Bin 880 -> 0 bytes examples/texture/shader/triangle.frag | 18 - examples/texture/shader/triangle.vert | 13 - examples/texture/shader/vert.spv | Bin 948 -> 0 bytes examples/triangle/src/main.rs | 1045 ----------------- 17 files changed, 1115 insertions(+), 1516 deletions(-) rename examples/{triangle => }/Cargo.lock (99%) rename examples/{triangle => }/Cargo.toml (69%) rename examples/{triangle => }/shader/frag.spv (100%) rename examples/{triangle => }/shader/triangle.frag (100%) rename examples/{triangle => }/shader/triangle.vert (100%) rename examples/{triangle => }/shader/vert.spv (100%) rename examples/{texture/src/main.rs => src/bin/texture.rs} (100%) create mode 100644 examples/src/bin/triangle.rs create mode 100644 examples/src/lib.rs delete mode 100644 examples/texture/Cargo.lock delete mode 100644 examples/texture/Cargo.toml delete mode 100644 examples/texture/rust.png delete mode 100644 examples/texture/shader/frag.spv delete mode 100644 examples/texture/shader/triangle.frag delete mode 100644 examples/texture/shader/triangle.vert delete mode 100644 examples/texture/shader/vert.spv delete mode 100644 examples/triangle/src/main.rs diff --git a/examples/triangle/Cargo.lock b/examples/Cargo.lock similarity index 99% rename from examples/triangle/Cargo.lock rename to examples/Cargo.lock index 5653577..b0a5cbf 100644 --- a/examples/triangle/Cargo.lock +++ b/examples/Cargo.lock @@ -1,5 +1,5 @@ [root] -name = "example" +name = "examples" version = "0.1.0" dependencies = [ "ash 0.2.0", diff --git a/examples/triangle/Cargo.toml b/examples/Cargo.toml similarity index 69% rename from examples/triangle/Cargo.toml rename to examples/Cargo.toml index 1b850c4..84b7820 100644 --- a/examples/triangle/Cargo.toml +++ b/examples/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "example" +name = "examples" version = "0.1.0" authors = ["maik klein "] [dependencies] glfw = "0.9.1" winit = "0.5.6" -ash = { version = "*", path = "../../"} +ash = { version = "*", path = "../"} diff --git a/examples/triangle/shader/frag.spv b/examples/shader/frag.spv similarity index 100% rename from examples/triangle/shader/frag.spv rename to examples/shader/frag.spv diff --git a/examples/triangle/shader/triangle.frag b/examples/shader/triangle.frag similarity index 100% rename from examples/triangle/shader/triangle.frag rename to examples/shader/triangle.frag diff --git a/examples/triangle/shader/triangle.vert b/examples/shader/triangle.vert similarity index 100% rename from examples/triangle/shader/triangle.vert rename to examples/shader/triangle.vert diff --git a/examples/triangle/shader/vert.spv b/examples/shader/vert.spv similarity index 100% rename from examples/triangle/shader/vert.spv rename to examples/shader/vert.spv diff --git a/examples/texture/src/main.rs b/examples/src/bin/texture.rs similarity index 100% rename from examples/texture/src/main.rs rename to examples/src/bin/texture.rs diff --git a/examples/src/bin/triangle.rs b/examples/src/bin/triangle.rs new file mode 100644 index 0000000..7fd27a2 --- /dev/null +++ b/examples/src/bin/triangle.rs @@ -0,0 +1,516 @@ +#![allow(dead_code)] +#[macro_use] +extern crate ash; +extern crate winit; +extern crate examples; + +use ash::vk; +use std::default::Default; +use ash::entry::Entry; +use ash::instance::Instance; +use ash::extensions::{Swapchain, XlibSurface, Surface, DebugReport}; +use ash::device::Device; +use std::ptr; +use std::ffi::{CStr, CString}; +use std::mem; +use std::path::Path; +use std::fs::File; +use std::io::Read; +use winit::os::unix::WindowExt; +use examples::*; + +#[derive(Clone, Debug, Copy)] +struct Vertex { + pos: [f32; 4], + color: [f32; 4], +} + +fn main() { + unsafe { + let base = ExampleBase::new(1920, 1080); + let fence_create_info = vk::FenceCreateInfo { + s_type: vk::StructureType::FenceCreateInfo, + p_next: ptr::null(), + flags: vk::FenceCreateFlags::empty(), + }; + let command_buffer_begin_info = vk::CommandBufferBeginInfo { + s_type: vk::StructureType::CommandBufferBeginInfo, + p_next: ptr::null(), + p_inheritance_info: ptr::null(), + flags: vk::COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT, + }; + let renderpass_attachments = + [vk::AttachmentDescription { + format: base.surface_format.format, + flags: vk::AttachmentDescriptionFlags::empty(), + samples: vk::SAMPLE_COUNT_1_BIT, + load_op: vk::AttachmentLoadOp::Clear, + store_op: vk::AttachmentStoreOp::Store, + stencil_load_op: vk::AttachmentLoadOp::DontCare, + stencil_store_op: vk::AttachmentStoreOp::DontCare, + initial_layout: vk::ImageLayout::Undefined, + final_layout: vk::ImageLayout::PresentSrcKhr, + }, + vk::AttachmentDescription { + format: vk::Format::D16Unorm, + flags: vk::AttachmentDescriptionFlags::empty(), + samples: vk::SAMPLE_COUNT_1_BIT, + load_op: vk::AttachmentLoadOp::Clear, + store_op: vk::AttachmentStoreOp::DontCare, + stencil_load_op: vk::AttachmentLoadOp::DontCare, + stencil_store_op: vk::AttachmentStoreOp::DontCare, + initial_layout: vk::ImageLayout::DepthStencilAttachmentOptimal, + final_layout: vk::ImageLayout::DepthStencilAttachmentOptimal, + }]; + let color_attachment_ref = vk::AttachmentReference { + attachment: 0, + layout: vk::ImageLayout::ColorAttachmentOptimal, + }; + let depth_attachment_ref = vk::AttachmentReference { + attachment: 1, + layout: vk::ImageLayout::DepthStencilAttachmentOptimal, + }; + let dependency = vk::SubpassDependency { + dependency_flags: Default::default(), + src_subpass: vk::VK_SUBPASS_EXTERNAL, + dst_subpass: Default::default(), + src_stage_mask: vk::PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, + src_access_mask: Default::default(), + dst_access_mask: vk::ACCESS_COLOR_ATTACHMENT_READ_BIT | + vk::ACCESS_COLOR_ATTACHMENT_WRITE_BIT, + dst_stage_mask: vk::PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, + }; + let subpass = vk::SubpassDescription { + color_attachment_count: 1, + p_color_attachments: &color_attachment_ref, + p_depth_stencil_attachment: &depth_attachment_ref, + // TODO: Why is there no wrapper? + flags: Default::default(), + pipeline_bind_point: vk::PipelineBindPoint::Graphics, + input_attachment_count: 0, + p_input_attachments: ptr::null(), + p_resolve_attachments: ptr::null(), + preserve_attachment_count: 0, + p_preserve_attachments: ptr::null(), + }; + let renderpass_create_info = vk::RenderPassCreateInfo { + s_type: vk::StructureType::RenderPassCreateInfo, + flags: Default::default(), + p_next: ptr::null(), + attachment_count: renderpass_attachments.len() as u32, + p_attachments: renderpass_attachments.as_ptr(), + subpass_count: 1, + p_subpasses: &subpass, + dependency_count: 1, + p_dependencies: &dependency, + }; + let renderpass = base.device.create_render_pass(&renderpass_create_info).unwrap(); + let framebuffers: Vec = base.present_image_views + .iter() + .map(|&present_image_view| { + let framebuffer_attachments = [present_image_view, base.depth_image_view]; + let frame_buffer_create_info = vk::FramebufferCreateInfo { + s_type: vk::StructureType::FramebufferCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + render_pass: renderpass, + attachment_count: framebuffer_attachments.len() as u32, + p_attachments: framebuffer_attachments.as_ptr(), + width: base.surface_resolution.width, + height: base.surface_resolution.height, + layers: 1, + }; + base.device.create_framebuffer(&frame_buffer_create_info).unwrap() + }) + .collect(); + let index_buffer_data = [0u32, 1, 2]; + let index_buffer_info = vk::BufferCreateInfo { + s_type: vk::StructureType::BufferCreateInfo, + p_next: ptr::null(), + flags: vk::BufferCreateFlags::empty(), + size: std::mem::size_of_val(&index_buffer_data) as u64, + usage: vk::BUFFER_USAGE_INDEX_BUFFER_BIT, + sharing_mode: vk::SharingMode::Exclusive, + queue_family_index_count: 0, + p_queue_family_indices: ptr::null(), + }; + let index_buffer = base.device.create_buffer(&index_buffer_info).unwrap(); + let index_buffer_memory_req = base.device.get_buffer_memory_requirements(index_buffer); + let index_buffer_memory_index = find_memorytype_index(&index_buffer_memory_req, + &base.device_memory_properties, + vk::MEMORY_PROPERTY_HOST_VISIBLE_BIT) + .expect("Unable to find suitable memorytype for the index buffer."); + let index_allocate_info = vk::MemoryAllocateInfo { + s_type: vk::StructureType::MemoryAllocateInfo, + p_next: ptr::null(), + allocation_size: index_buffer_memory_req.size, + memory_type_index: index_buffer_memory_index, + }; + let index_buffer_memory = base.device.allocate_memory(&index_allocate_info).unwrap(); + let index_slice = base.device + .map_memory::(index_buffer_memory, + 0, + index_buffer_info.size, + vk::MemoryMapFlags::empty()) + .unwrap(); + index_slice.copy_from_slice(&index_buffer_data); + base.device.unmap_memory(index_buffer_memory); + base.device.bind_buffer_memory(index_buffer, index_buffer_memory, 0).unwrap(); + + let vertex_input_buffer_info = vk::BufferCreateInfo { + s_type: vk::StructureType::BufferCreateInfo, + p_next: ptr::null(), + flags: vk::BufferCreateFlags::empty(), + size: 3 * std::mem::size_of::() as u64, + usage: vk::BUFFER_USAGE_VERTEX_BUFFER_BIT, + sharing_mode: vk::SharingMode::Exclusive, + queue_family_index_count: 0, + p_queue_family_indices: ptr::null(), + }; + let vertex_input_buffer = base.device.create_buffer(&vertex_input_buffer_info).unwrap(); + let vertex_input_buffer_memory_req = base.device + .get_buffer_memory_requirements(vertex_input_buffer); + let vertex_input_buffer_memory_index = + find_memorytype_index(&vertex_input_buffer_memory_req, + &base.device_memory_properties, + vk::MEMORY_PROPERTY_HOST_VISIBLE_BIT) + .expect("Unable to find suitable memorytype for the vertex buffer."); + + let vertex_buffer_allocate_info = vk::MemoryAllocateInfo { + s_type: vk::StructureType::MemoryAllocateInfo, + p_next: ptr::null(), + allocation_size: vertex_input_buffer_memory_req.size, + memory_type_index: vertex_input_buffer_memory_index, + }; + let vertex_input_buffer_memory = base.device + .allocate_memory(&vertex_buffer_allocate_info) + .unwrap(); + let vertices = [Vertex { + pos: [-1.0, 1.0, 0.0, 1.0], + color: [0.0, 1.0, 0.0, 1.0], + }, + Vertex { + pos: [1.0, 1.0, 0.0, 1.0], + color: [0.0, 0.0, 1.0, 1.0], + }, + Vertex { + pos: [0.0, -1.0, 0.0, 1.0], + color: [1.0, 0.0, 0.0, 1.0], + }]; + let slice = base.device + .map_memory::(vertex_input_buffer_memory, + 0, + vertex_input_buffer_info.size, + vk::MemoryMapFlags::empty()) + .unwrap(); + slice.copy_from_slice(&vertices); + base.device.unmap_memory(vertex_input_buffer_memory); + base.device.bind_buffer_memory(vertex_input_buffer, vertex_input_buffer_memory, 0).unwrap(); + let vertex_spv_file = File::open(Path::new("shader/vert.spv")) + .expect("Could not find vert.spv."); + let frag_spv_file = File::open(Path::new("shader/frag.spv")) + .expect("Could not find frag.spv."); + + let vertex_bytes: Vec = vertex_spv_file.bytes().filter_map(|byte| byte.ok()).collect(); + let vertex_shader_info = vk::ShaderModuleCreateInfo { + s_type: vk::StructureType::ShaderModuleCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + code_size: vertex_bytes.len(), + p_code: vertex_bytes.as_ptr() as *const u32, + }; + let frag_bytes: Vec = frag_spv_file.bytes().filter_map(|byte| byte.ok()).collect(); + let frag_shader_info = vk::ShaderModuleCreateInfo { + s_type: vk::StructureType::ShaderModuleCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + code_size: frag_bytes.len(), + p_code: frag_bytes.as_ptr() as *const u32, + }; + let vertex_shader_module = base.device + .create_shader_module(&vertex_shader_info) + .expect("Vertex shader module error"); + + let fragment_shader_module = base.device + .create_shader_module(&frag_shader_info) + .expect("Fragment shader module error"); + + let layout_create_info = vk::PipelineLayoutCreateInfo { + s_type: vk::StructureType::PipelineLayoutCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + set_layout_count: 0, + p_set_layouts: ptr::null(), + push_constant_range_count: 0, + p_push_constant_ranges: ptr::null(), + }; + + let pipeline_layout = base.device.create_pipeline_layout(&layout_create_info).unwrap(); + + let shader_entry_name = CString::new("main").unwrap(); + let shader_stage_create_infos = + [vk::PipelineShaderStageCreateInfo { + s_type: vk::StructureType::PipelineShaderStageCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + module: vertex_shader_module, + p_name: shader_entry_name.as_ptr(), + p_specialization_info: ptr::null(), + stage: vk::SHADER_STAGE_VERTEX_BIT, + }, + vk::PipelineShaderStageCreateInfo { + s_type: vk::StructureType::PipelineShaderStageCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + module: fragment_shader_module, + p_name: shader_entry_name.as_ptr(), + p_specialization_info: ptr::null(), + stage: vk::SHADER_STAGE_FRAGMENT_BIT, + }]; + let vertex_input_binding_descriptions = [vk::VertexInputBindingDescription { + binding: 0, + stride: mem::size_of::() as u32, + input_rate: vk::VertexInputRate::Vertex, + }]; + let vertex_input_attribute_descriptions = [vk::VertexInputAttributeDescription { + location: 0, + binding: 0, + format: vk::Format::R32g32b32a32Sfloat, + offset: offset_of!(Vertex, pos) as u32, + }, + vk::VertexInputAttributeDescription { + location: 1, + binding: 0, + format: vk::Format::R32g32b32a32Sfloat, + offset: offset_of!(Vertex, color) as u32, + }]; + let vertex_input_state_info = vk::PipelineVertexInputStateCreateInfo { + s_type: vk::StructureType::PipelineVertexInputStateCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + vertex_attribute_description_count: vertex_input_attribute_descriptions.len() as u32, + p_vertex_attribute_descriptions: vertex_input_attribute_descriptions.as_ptr(), + vertex_binding_description_count: vertex_input_binding_descriptions.len() as u32, + p_vertex_binding_descriptions: vertex_input_binding_descriptions.as_ptr(), + }; + let vertex_input_assembly_state_info = vk::PipelineInputAssemblyStateCreateInfo { + s_type: vk::StructureType::PipelineInputAssemblyStateCreateInfo, + flags: Default::default(), + p_next: ptr::null(), + primitive_restart_enable: 0, + topology: vk::PrimitiveTopology::TriangleList, + }; + let viewports = [vk::Viewport { + x: 0.0, + y: 0.0, + width: base.surface_resolution.width as f32, + height: base.surface_resolution.height as f32, + min_depth: 0.0, + max_depth: 1.0, + }]; + let scissors = [vk::Rect2D { + offset: vk::Offset2D { x: 0, y: 0 }, + extent: base.surface_resolution.clone(), + }]; + let viewport_state_info = vk::PipelineViewportStateCreateInfo { + s_type: vk::StructureType::PipelineViewportStateCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + scissor_count: scissors.len() as u32, + p_scissors: scissors.as_ptr(), + viewport_count: viewports.len() as u32, + p_viewports: viewports.as_ptr(), + }; + let rasterization_info = vk::PipelineRasterizationStateCreateInfo { + s_type: vk::StructureType::PipelineRasterizationStateCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + cull_mode: vk::CULL_MODE_NONE, + depth_bias_clamp: 0.0, + depth_bias_constant_factor: 0.0, + depth_bias_enable: 0, + depth_bias_slope_factor: 0.0, + depth_clamp_enable: 0, + front_face: vk::FrontFace::CounterClockwise, + line_width: 1.0, + polygon_mode: vk::PolygonMode::Fill, + rasterizer_discard_enable: 0, + }; + let multisample_state_info = vk::PipelineMultisampleStateCreateInfo { + s_type: vk::StructureType::PipelineMultisampleStateCreateInfo, + flags: Default::default(), + p_next: ptr::null(), + rasterization_samples: vk::SAMPLE_COUNT_1_BIT, + sample_shading_enable: 0, + min_sample_shading: 0.0, + p_sample_mask: ptr::null(), + alpha_to_one_enable: 0, + alpha_to_coverage_enable: 0, + }; + let noop_stencil_state = vk::StencilOpState { + fail_op: vk::StencilOp::Keep, + pass_op: vk::StencilOp::Keep, + depth_fail_op: vk::StencilOp::Keep, + compare_op: vk::CompareOp::Always, + compare_mask: 0, + write_mask: 0, + reference: 0, + }; + let depth_state_info = vk::PipelineDepthStencilStateCreateInfo { + s_type: vk::StructureType::PipelineDepthStencilStateCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + depth_test_enable: 1, + depth_write_enable: 1, + depth_compare_op: vk::CompareOp::LessOrEqual, + depth_bounds_test_enable: 0, + stencil_test_enable: 0, + front: noop_stencil_state.clone(), + back: noop_stencil_state.clone(), + max_depth_bounds: 1.0, + min_depth_bounds: 0.0, + }; + let color_blend_attachment_states = [vk::PipelineColorBlendAttachmentState { + blend_enable: 0, + src_color_blend_factor: vk::BlendFactor::SrcColor, + dst_color_blend_factor: + vk::BlendFactor::OneMinusDstColor, + color_blend_op: vk::BlendOp::Add, + src_alpha_blend_factor: vk::BlendFactor::Zero, + dst_alpha_blend_factor: vk::BlendFactor::Zero, + alpha_blend_op: vk::BlendOp::Add, + color_write_mask: vk::ColorComponentFlags::all(), + }]; + let color_blend_state = vk::PipelineColorBlendStateCreateInfo { + s_type: vk::StructureType::PipelineColorBlendStateCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + logic_op_enable: 0, + logic_op: vk::LogicOp::Clear, + attachment_count: color_blend_attachment_states.len() as u32, + p_attachments: color_blend_attachment_states.as_ptr(), + blend_constants: [0.0, 0.0, 0.0, 0.0], + }; + let dynamic_state = [vk::DynamicState::Viewport, vk::DynamicState::Scissor]; + let dynamic_state_info = vk::PipelineDynamicStateCreateInfo { + s_type: vk::StructureType::PipelineDynamicStateCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + dynamic_state_count: dynamic_state.len() as u32, + p_dynamic_states: dynamic_state.as_ptr(), + }; + let graphic_pipeline_info = vk::GraphicsPipelineCreateInfo { + s_type: vk::StructureType::GraphicsPipelineCreateInfo, + p_next: ptr::null(), + flags: vk::PipelineCreateFlags::empty(), + stage_count: shader_stage_create_infos.len() as u32, + p_stages: shader_stage_create_infos.as_ptr(), + p_vertex_input_state: &vertex_input_state_info, + p_input_assembly_state: &vertex_input_assembly_state_info, + p_tessellation_state: ptr::null(), + p_viewport_state: &viewport_state_info, + p_rasterization_state: &rasterization_info, + p_multisample_state: &multisample_state_info, + p_depth_stencil_state: &depth_state_info, + p_color_blend_state: &color_blend_state, + p_dynamic_state: &dynamic_state_info, + layout: pipeline_layout, + render_pass: renderpass, + subpass: 0, + base_pipeline_handle: vk::Pipeline::null(), + base_pipeline_index: 0, + }; + let graphics_pipelines = base.device + .create_graphics_pipelines(vk::PipelineCache::null(), &[graphic_pipeline_info]) + .unwrap(); + + let graphic_pipeline = graphics_pipelines[0]; + + + base.render_loop(|| { + let present_index = base.swapchain_loader + .acquire_next_image_khr(base.swapchain, + std::u64::MAX, + base.present_complete_semaphore, + vk::Fence::null()) + .unwrap(); + record_submit_commandbuffer(&base.device, + base.draw_command_buffer, + base.present_queue, + &[vk::PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT], + &[base.present_complete_semaphore], + &[base.rendering_complete_semaphore], + |device, draw_command_buffer| { + let clear_values = + [vk::ClearValue::new_color(vk::ClearColorValue::new_float32([0.0, 0.0, 0.0, + 0.0])), + vk::ClearValue::new_depth_stencil(vk::ClearDepthStencilValue { + depth: 1.0, + stencil: 0, + })]; + + let render_pass_begin_info = vk::RenderPassBeginInfo { + s_type: vk::StructureType::RenderPassBeginInfo, + p_next: ptr::null(), + render_pass: renderpass, + framebuffer: framebuffers[present_index as usize], + render_area: vk::Rect2D { + offset: vk::Offset2D { x: 0, y: 0 }, + extent: base.surface_resolution.clone(), + }, + clear_value_count: clear_values.len() as u32, + p_clear_values: clear_values.as_ptr(), + }; + device.cmd_begin_render_pass(draw_command_buffer, + &render_pass_begin_info, + vk::SubpassContents::Inline); + device.cmd_bind_pipeline(draw_command_buffer, + vk::PipelineBindPoint::Graphics, + graphic_pipeline); + device.cmd_set_viewport(draw_command_buffer, &viewports); + device.cmd_set_scissor(draw_command_buffer, &scissors); + device.cmd_bind_vertex_buffers(draw_command_buffer, &[vertex_input_buffer], &0); + device.cmd_bind_index_buffer(draw_command_buffer, + index_buffer, + 0, + vk::IndexType::Uint32); + device.cmd_draw_indexed(draw_command_buffer, + index_buffer_data.len() as u32, + 1, + 0, + 0, + 1); + // Or draw without the index buffer + // device.cmd_draw(draw_command_buffer, 3, 1, 0, 0); + device.cmd_end_render_pass(draw_command_buffer); + }); + let mut present_info_err = unsafe { mem::uninitialized() }; + let present_info = vk::PresentInfoKHR { + s_type: vk::StructureType::PresentInfoKhr, + p_next: ptr::null(), + wait_semaphore_count: 1, + p_wait_semaphores: &base.rendering_complete_semaphore, + swapchain_count: 1, + p_swapchains: &base.swapchain, + p_image_indices: &present_index, + p_results: &mut present_info_err, + }; + base.device.queue_present_khr(base.present_queue, &present_info).unwrap(); + }); + + for pipeline in graphics_pipelines { + base.device.destroy_pipeline(pipeline); + } + base.device.destroy_pipeline_layout(pipeline_layout); + base.device.destroy_shader_module(vertex_shader_module); + base.device.destroy_shader_module(fragment_shader_module); + base.device.free_memory(index_buffer_memory); + base.device.destroy_buffer(index_buffer); + base.device.free_memory(vertex_input_buffer_memory); + base.device.destroy_buffer(vertex_input_buffer); + for framebuffer in framebuffers { + base.device.destroy_framebuffer(framebuffer); + } + base.device.destroy_render_pass(renderpass); + } +} diff --git a/examples/src/lib.rs b/examples/src/lib.rs new file mode 100644 index 0000000..2b857e1 --- /dev/null +++ b/examples/src/lib.rs @@ -0,0 +1,596 @@ +#![allow(dead_code)] +#[macro_use] +extern crate ash; +extern crate winit; + +use ash::vk; +use std::default::Default; +use ash::entry::Entry; +use ash::instance::Instance; +use ash::extensions::{Swapchain, XlibSurface, Surface, DebugReport}; +use ash::device::Device; +use std::ptr; +use std::ffi::{CStr, CString}; +use std::mem; +use std::path::Path; +use std::fs::File; +use std::io::Read; +use winit::os::unix::WindowExt; +use std::ops::Drop; + +// Simple offset_of macro akin to C++ offsetof +#[macro_export] +macro_rules! offset_of{ + ($base: path, $field: ident) => { + unsafe{ + let b: $base = mem::uninitialized(); + (&b.$field as *const _ as isize) - (&b as *const _ as isize) + } + } +} + +pub fn record_submit_commandbuffer(device: &Device, + command_buffer: vk::CommandBuffer, + submit_queue: vk::Queue, + wait_mask: &[vk::PipelineStageFlags], + wait_semaphores: &[vk::Semaphore], + signal_semaphores: &[vk::Semaphore], + f: F) { + unsafe { + device.reset_command_buffer(command_buffer, + vk::COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT); + let command_buffer_begin_info = vk::CommandBufferBeginInfo { + s_type: vk::StructureType::CommandBufferBeginInfo, + p_next: ptr::null(), + p_inheritance_info: ptr::null(), + flags: vk::COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT, + }; + device.begin_command_buffer(command_buffer, &command_buffer_begin_info) + .expect("Begin commandbuffer"); + f(device, command_buffer); + device.end_command_buffer(command_buffer).expect("End commandbuffer"); + let fence_create_info = vk::FenceCreateInfo { + s_type: vk::StructureType::FenceCreateInfo, + p_next: ptr::null(), + flags: vk::FenceCreateFlags::empty(), + }; + let submit_fence = device.create_fence(&fence_create_info).unwrap(); + let submit_info = vk::SubmitInfo { + s_type: vk::StructureType::SubmitInfo, + p_next: ptr::null(), + wait_semaphore_count: wait_semaphores.len() as u32, + p_wait_semaphores: wait_semaphores.as_ptr(), + p_wait_dst_stage_mask: wait_mask.as_ptr(), + command_buffer_count: 1, + p_command_buffers: &command_buffer, + signal_semaphore_count: signal_semaphores.len() as u32, + p_signal_semaphores: signal_semaphores.as_ptr(), + }; + device.queue_submit(submit_queue, &[submit_info], submit_fence); + device.wait_for_fences(&[submit_fence], true, std::u64::MAX); + device.destroy_fence(submit_fence); + } +} + +#[cfg(all(unix, not(target_os = "android")))] +fn create_surface(instance: &Instance, + entry: &Entry, + window: &winit::Window) + -> Result { + let x11_display = window.get_xlib_display().unwrap(); + let x11_window = window.get_xlib_window().unwrap(); + let x11_create_info = vk::XlibSurfaceCreateInfoKHR { + s_type: vk::StructureType::XlibSurfaceCreateInfoKhr, + p_next: ptr::null(), + flags: Default::default(), + window: x11_window as vk::Window, + dpy: x11_display as *mut vk::Display, + }; + let xlib_surface_loader = XlibSurface::new(&entry, &instance) + .expect("Unable to load xlib surface"); + xlib_surface_loader.create_xlib_surface_khr(&x11_create_info) +} + +#[cfg(all(unix, not(target_os = "android")))] +fn extension_names() -> Vec { + vec![CString::new("VK_KHR_surface").unwrap(), + CString::new("VK_KHR_xlib_surface").unwrap(), + CString::new("VK_EXT_debug_report").unwrap()] +} + +#[cfg(all(windows))] +fn extension_names() -> Vec { + vec![CString::new("VK_KHR_surface").unwrap(), + CString::new("VK_KHR_win32_surface").unwrap(), + CString::new("VK_EXT_debug_report").unwrap()] +} + +unsafe extern "system" fn vulkan_debug_callback(flags: vk::DebugReportFlagsEXT, + obj_type: vk::DebugReportObjectTypeEXT, + obj: u64, + loc: usize, + message: i32, + p_layer_prefix: *const i8, + p_message: *const i8, + data: *mut ()) + -> u32 { + println!("{:?}", CStr::from_ptr(p_message)); + 1 +} + +pub fn find_memorytype_index(memory_req: &vk::MemoryRequirements, + memory_prop: &vk::PhysicalDeviceMemoryProperties, + flags: vk::MemoryPropertyFlags) + -> Option { + let mut memory_type_bits = memory_req.memory_type_bits; + for (index, ref memory_type) in memory_prop.memory_types.iter().enumerate() { + if (memory_type.property_flags & flags) == flags { + return Some(index as u32); + } + memory_type_bits = memory_type_bits >> 1; + } + None +} +fn resize_callback(width: u32, height: u32) { + println!("Window resized to {}x{}", width, height); +} + +pub struct ExampleBase { + pub entry: Entry, + pub instance: Instance, + pub device: Device, + pub surface_loader: Surface, + pub swapchain_loader: Swapchain, + pub debug_report_loader: DebugReport, + pub window: winit::Window, + pub debug_call_back: vk::DebugReportCallbackEXT, + + pub pdevice: vk::PhysicalDevice, + pub device_memory_properties: vk::PhysicalDeviceMemoryProperties, + pub queue_family_index: u32, + pub present_queue: vk::Queue, + + pub surface: vk::SurfaceKHR, + pub surface_format: vk::SurfaceFormatKHR, + pub surface_resolution: vk::Extent2D, + + pub swapchain: vk::SwapchainKHR, + pub present_images: Vec, + pub present_image_views: Vec, + + pub pool: vk::CommandPool, + pub draw_command_buffer: vk::CommandBuffer, + pub setup_command_buffer: vk::CommandBuffer, + + pub depth_image: vk::Image, + pub depth_image_view: vk::ImageView, + pub depth_image_memory: vk::DeviceMemory, + + pub present_complete_semaphore: vk::Semaphore, + pub rendering_complete_semaphore: vk::Semaphore, +} + +impl ExampleBase { + pub fn render_loop(&self, f: F) { + 'render: loop { + for event in self.window.poll_events() { + match event { + winit::Event::KeyboardInput(_, _, Some(winit::VirtualKeyCode::Escape)) | + winit::Event::Closed => break 'render, + _ => (), + } + } + f(); + } + } + pub fn new(window_width: u32, window_height: u32) -> Self { + unsafe { + let window = winit::WindowBuilder::new() + .with_title("A fantastic window!") + .with_dimensions(window_width, window_height) + .with_window_resize_callback(resize_callback) + .build() + .unwrap(); + let entry = Entry::load_vulkan().unwrap(); + let instance_ext_props = entry.enumerate_instance_extension_properties().unwrap(); + let app_name = CString::new("VulkanTriangle").unwrap(); + let raw_name = app_name.as_ptr(); + + let layer_names = [CString::new("VK_LAYER_LUNARG_standard_validation").unwrap()]; + let layers_names_raw: Vec<*const i8> = layer_names.iter() + .map(|raw_name| raw_name.as_ptr()) + .collect(); + let extension_names = extension_names(); + let extension_names_raw: Vec<*const i8> = extension_names.iter() + .map(|raw_name| raw_name.as_ptr()) + .collect(); + let appinfo = vk::ApplicationInfo { + p_application_name: raw_name, + s_type: vk::StructureType::ApplicationInfo, + p_next: ptr::null(), + application_version: 0, + p_engine_name: raw_name, + engine_version: 0, + api_version: vk_make_version!(1, 0, 36), + }; + let create_info = vk::InstanceCreateInfo { + s_type: vk::StructureType::InstanceCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + p_application_info: &appinfo, + pp_enabled_layer_names: layers_names_raw.as_ptr(), + enabled_layer_count: layers_names_raw.len() as u32, + pp_enabled_extension_names: extension_names_raw.as_ptr(), + enabled_extension_count: extension_names_raw.len() as u32, + }; + let instance: Instance = entry.create_instance(&create_info) + .expect("Instance creation error"); + let debug_info = vk::DebugReportCallbackCreateInfoEXT { + s_type: vk::StructureType::DebugReportCallbackCreateInfoExt, + p_next: ptr::null(), + flags: vk::DEBUG_REPORT_ERROR_BIT_EXT | vk::DEBUG_REPORT_WARNING_BIT_EXT | + vk::DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, + pfn_callback: vulkan_debug_callback, + p_user_data: ptr::null_mut(), + }; + let debug_report_loader = DebugReport::new(&entry, &instance) + .expect("Unable to load debug report"); + let debug_call_back = debug_report_loader.create_debug_report_callback_ext(&debug_info) + .unwrap(); + let surface = create_surface(&instance, &entry, &window).unwrap(); + let pdevices = instance.enumerate_physical_devices().expect("Physical device error"); + let surface_loader = Surface::new(&entry, &instance) + .expect("Unable to load the Surface extension"); + let (pdevice, queue_family_index) = pdevices.iter() + .map(|pdevice| { + instance.get_physical_device_queue_family_properties(*pdevice) + .iter() + .enumerate() + .filter_map(|(index, ref info)| { + let supports_graphic_and_surface = + info.queue_flags.subset(vk::QUEUE_GRAPHICS_BIT) && + surface_loader.get_physical_device_surface_support_khr(*pdevice, + index as u32, + surface); + match supports_graphic_and_surface { + true => Some((*pdevice, index)), + _ => None, + } + }) + .nth(0) + }) + .filter_map(|v| v) + .nth(0) + .expect("Couldn't find suitable device."); + let queue_family_index = queue_family_index as u32; + let device_extension_names = [CString::new("VK_KHR_swapchain").unwrap()]; + let device_extension_names_raw: Vec<*const i8> = device_extension_names.iter() + .map(|raw_name| raw_name.as_ptr()) + .collect(); + let features = + vk::PhysicalDeviceFeatures { shader_clip_distance: 1, ..Default::default() }; + let priorities = [1.0]; + let queue_info = vk::DeviceQueueCreateInfo { + s_type: vk::StructureType::DeviceQueueCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + queue_family_index: queue_family_index as u32, + p_queue_priorities: priorities.as_ptr(), + queue_count: priorities.len() as u32, + }; + let device_create_info = vk::DeviceCreateInfo { + s_type: vk::StructureType::DeviceCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + queue_create_info_count: 1, + p_queue_create_infos: &queue_info, + enabled_layer_count: 0, + pp_enabled_layer_names: ptr::null(), + enabled_extension_count: device_extension_names_raw.len() as u32, + pp_enabled_extension_names: device_extension_names_raw.as_ptr(), + p_enabled_features: &features, + }; + let device: Device = instance.create_device(pdevice, &device_create_info) + .unwrap(); + let present_queue = device.get_device_queue(queue_family_index as u32, 0); + + let surface_formats = + surface_loader.get_physical_device_surface_formats_khr(pdevice, surface) + .unwrap(); + let surface_format = surface_formats.iter() + .map(|sfmt| { + match sfmt.format { + vk::Format::Undefined => { + vk::SurfaceFormatKHR { + format: vk::Format::B8g8r8Unorm, + color_space: sfmt.color_space, + } + } + _ => sfmt.clone(), + } + }) + .nth(0) + .expect("Unable to find suitable surface format."); + let surface_capabilities = + surface_loader.get_physical_device_surface_capabilities_khr(pdevice, surface) + .unwrap(); + let desired_image_count = surface_capabilities.min_image_count + 1; + assert!(surface_capabilities.min_image_count <= desired_image_count && + surface_capabilities.max_image_count >= desired_image_count, + "Image count err"); + let surface_resolution = match surface_capabilities.current_extent.width { + std::u32::MAX => { + vk::Extent2D { + width: window_width, + height: window_height, + } + } + _ => surface_capabilities.current_extent, + }; + + let pre_transform = if surface_capabilities.supported_transforms + .subset(vk::SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { + vk::SURFACE_TRANSFORM_IDENTITY_BIT_KHR + } else { + surface_capabilities.current_transform + }; + let present_modes = + surface_loader.get_physical_device_surface_present_modes_khr(pdevice, surface) + .unwrap(); + let present_mode = present_modes.iter() + .cloned() + .find(|&mode| mode == vk::PresentModeKHR::Mailbox) + .unwrap_or(vk::PresentModeKHR::Fifo); + let swapchain_loader = Swapchain::new(&instance, &device) + .expect("Unable to load swapchain"); + let swapchain_create_info = vk::SwapchainCreateInfoKHR { + s_type: vk::StructureType::SwapchainCreateInfoKhr, + p_next: ptr::null(), + flags: Default::default(), + surface: surface, + min_image_count: desired_image_count, + image_color_space: surface_format.color_space, + image_format: surface_format.format, + image_extent: surface_resolution.clone(), + image_usage: vk::IMAGE_USAGE_COLOR_ATTACHMENT_BIT, + image_sharing_mode: vk::SharingMode::Exclusive, + pre_transform: pre_transform, + composite_alpha: vk::COMPOSITE_ALPHA_OPAQUE_BIT_KHR, + present_mode: present_mode, + clipped: 1, + old_swapchain: vk::SwapchainKHR::null(), + image_array_layers: 1, + p_queue_family_indices: ptr::null(), + queue_family_index_count: 0, + }; + let swapchain = swapchain_loader.create_swapchain_khr(&swapchain_create_info).unwrap(); + let pool_create_info = vk::CommandPoolCreateInfo { + s_type: vk::StructureType::CommandPoolCreateInfo, + p_next: ptr::null(), + flags: vk::COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, + queue_family_index: queue_family_index, + }; + let pool = device.create_command_pool(&pool_create_info).unwrap(); + let command_buffer_allocate_info = vk::CommandBufferAllocateInfo { + s_type: vk::StructureType::CommandBufferAllocateInfo, + p_next: ptr::null(), + command_buffer_count: 2, + command_pool: pool, + level: vk::CommandBufferLevel::Primary, + }; + let command_buffer_allocate_info = vk::CommandBufferAllocateInfo { + s_type: vk::StructureType::CommandBufferAllocateInfo, + p_next: ptr::null(), + command_buffer_count: 2, + command_pool: pool, + level: vk::CommandBufferLevel::Primary, + }; + let command_buffers = device.allocate_command_buffers(&command_buffer_allocate_info) + .unwrap(); + let setup_command_buffer = command_buffers[0]; + let draw_command_buffer = command_buffers[1]; + + let present_images = swapchain_loader.get_swapchain_images_khr(swapchain).unwrap(); + let present_image_views: Vec = present_images.iter() + .map(|&image| { + let create_view_info = vk::ImageViewCreateInfo { + s_type: vk::StructureType::ImageViewCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + view_type: vk::ImageViewType::Type2d, + format: surface_format.format, + components: vk::ComponentMapping { + r: vk::ComponentSwizzle::R, + g: vk::ComponentSwizzle::G, + b: vk::ComponentSwizzle::B, + a: vk::ComponentSwizzle::A, + }, + subresource_range: vk::ImageSubresourceRange { + aspect_mask: vk::IMAGE_ASPECT_COLOR_BIT, + base_mip_level: 0, + level_count: 1, + base_array_layer: 0, + layer_count: 1, + }, + image: image, + }; + device.create_image_view(&create_view_info).unwrap() + }) + .collect(); + let device_memory_properties = instance.get_physical_device_memory_properties(pdevice); + let depth_image_create_info = vk::ImageCreateInfo { + s_type: vk::StructureType::ImageCreateInfo, + p_next: ptr::null(), + flags: vk::IMAGE_CREATE_SPARSE_BINDING_BIT, + image_type: vk::ImageType::Type2d, + format: vk::Format::D16Unorm, + extent: vk::Extent3D { + width: surface_resolution.width, + height: surface_resolution.height, + depth: 1, + }, + mip_levels: 1, + array_layers: 1, + samples: vk::SAMPLE_COUNT_1_BIT, + tiling: vk::ImageTiling::Optimal, + usage: vk::IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, + sharing_mode: vk::SharingMode::Exclusive, + queue_family_index_count: 0, + p_queue_family_indices: ptr::null(), + initial_layout: vk::ImageLayout::Undefined, + }; + let depth_image = device.create_image(&depth_image_create_info).unwrap(); + let depth_image_memory_req = device.get_image_memory_requirements(depth_image); + let depth_image_memory_index = + find_memorytype_index(&depth_image_memory_req, + &device_memory_properties, + vk::MEMORY_PROPERTY_DEVICE_LOCAL_BIT) + .expect("Unable to find suitable memory index for depth image."); + + let depth_image_allocate_info = vk::MemoryAllocateInfo { + s_type: vk::StructureType::MemoryAllocateInfo, + p_next: ptr::null(), + allocation_size: depth_image_memory_req.size, + memory_type_index: depth_image_memory_index, + }; + let depth_image_memory = device.allocate_memory(&depth_image_allocate_info).unwrap(); + device.bind_image_memory(depth_image, depth_image_memory, 0) + .expect("Unable to bind depth image memory"); + + let command_buffer_begin_info = vk::CommandBufferBeginInfo { + s_type: vk::StructureType::CommandBufferBeginInfo, + p_next: ptr::null(), + p_inheritance_info: ptr::null(), + flags: vk::COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT, + }; + device.begin_command_buffer(setup_command_buffer, &command_buffer_begin_info).unwrap(); + let layout_transition_barrier = vk::ImageMemoryBarrier { + s_type: vk::StructureType::ImageMemoryBarrier, + p_next: ptr::null(), + src_access_mask: Default::default(), + dst_access_mask: vk::ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | + vk::ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, + old_layout: vk::ImageLayout::Undefined, + new_layout: vk::ImageLayout::DepthStencilAttachmentOptimal, + src_queue_family_index: vk::VK_QUEUE_FAMILY_IGNORED, + dst_queue_family_index: vk::VK_QUEUE_FAMILY_IGNORED, + image: depth_image, + subresource_range: vk::ImageSubresourceRange { + aspect_mask: vk::IMAGE_ASPECT_DEPTH_BIT, + base_mip_level: 0, + level_count: 1, + base_array_layer: 0, + layer_count: 1, + }, + }; + device.cmd_pipeline_barrier(setup_command_buffer, + vk::PIPELINE_STAGE_TOP_OF_PIPE_BIT, + vk::PIPELINE_STAGE_TOP_OF_PIPE_BIT, + vk::DependencyFlags::empty(), + &[], + &[], + &[layout_transition_barrier]); + let wait_stage_mask = [vk::PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT]; + let fence_create_info = vk::FenceCreateInfo { + s_type: vk::StructureType::FenceCreateInfo, + p_next: ptr::null(), + flags: vk::FenceCreateFlags::empty(), + }; + let submit_fence = device.create_fence(&fence_create_info).unwrap(); + let submit_info = vk::SubmitInfo { + s_type: vk::StructureType::SubmitInfo, + p_next: ptr::null(), + wait_semaphore_count: 0, + p_wait_semaphores: ptr::null(), + signal_semaphore_count: 0, + p_signal_semaphores: ptr::null(), + p_wait_dst_stage_mask: wait_stage_mask.as_ptr(), + command_buffer_count: 1, + p_command_buffers: &setup_command_buffer, + }; + device.end_command_buffer(setup_command_buffer).unwrap(); + device.queue_submit(present_queue, &[submit_info], submit_fence).unwrap(); + device.wait_for_fences(&[submit_fence], true, std::u64::MAX).unwrap(); + let depth_image_view_info = vk::ImageViewCreateInfo { + s_type: vk::StructureType::ImageViewCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + view_type: vk::ImageViewType::Type2d, + format: depth_image_create_info.format, + components: vk::ComponentMapping { + r: vk::ComponentSwizzle::Identity, + g: vk::ComponentSwizzle::Identity, + b: vk::ComponentSwizzle::Identity, + a: vk::ComponentSwizzle::Identity, + }, + subresource_range: vk::ImageSubresourceRange { + aspect_mask: vk::IMAGE_ASPECT_DEPTH_BIT, + base_mip_level: 0, + level_count: 1, + base_array_layer: 0, + layer_count: 1, + }, + image: depth_image, + }; + let depth_image_view = device.create_image_view(&depth_image_view_info).unwrap(); + let semaphore_create_info = vk::SemaphoreCreateInfo { + s_type: vk::StructureType::SemaphoreCreateInfo, + p_next: ptr::null(), + flags: Default::default(), + }; + let present_complete_semaphore = device.create_semaphore(&semaphore_create_info) + .unwrap(); + let rendering_complete_semaphore = device.create_semaphore(&semaphore_create_info) + .unwrap(); + ExampleBase { + entry: entry, + instance: instance, + device: device, + queue_family_index: queue_family_index, + pdevice: pdevice, + device_memory_properties: device_memory_properties, + window: window, + surface_loader: surface_loader, + surface_format: surface_format, + present_queue: present_queue, + surface_resolution: surface_resolution, + swapchain_loader: swapchain_loader, + swapchain: swapchain, + present_images: present_images, + present_image_views: present_image_views, + pool: pool, + draw_command_buffer: draw_command_buffer, + setup_command_buffer: setup_command_buffer, + depth_image: depth_image, + depth_image_view: depth_image_view, + present_complete_semaphore: present_complete_semaphore, + rendering_complete_semaphore: rendering_complete_semaphore, + surface: surface, + debug_call_back: debug_call_back, + debug_report_loader: debug_report_loader, + depth_image_memory: depth_image_memory, + } + } + } +} +impl Drop for ExampleBase { + fn drop(&mut self) { + unsafe { + self.device.device_wait_idle().unwrap(); + self.device.destroy_semaphore(self.present_complete_semaphore); + self.device.destroy_semaphore(self.rendering_complete_semaphore); + self.device.destroy_image_view(self.depth_image_view); + self.device.destroy_image(self.depth_image); + self.device.free_memory(self.depth_image_memory); + for &image_view in self.present_image_views.iter() { + self.device.destroy_image_view(image_view); + } + self.device.destroy_command_pool(self.pool); + self.swapchain_loader.destroy_swapchain_khr(self.swapchain); + self.device.destroy_device(); + self.surface_loader.destroy_surface_khr(self.surface); + self.debug_report_loader.destroy_debug_report_callback_ext(self.debug_call_back); + self.instance.destroy_instance(); + } + } +} diff --git a/examples/texture/Cargo.lock b/examples/texture/Cargo.lock deleted file mode 100644 index ac1e8c9..0000000 --- a/examples/texture/Cargo.lock +++ /dev/null @@ -1,428 +0,0 @@ -[root] -name = "example" -version = "0.1.0" -dependencies = [ - "ash 0.1.0", - "glfw 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "image 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ash" -version = "0.1.0" -dependencies = [ - "shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "sharedlib 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "backtrace" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "backtrace-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "backtrace-sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "gcc 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "bitflags" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "byteorder" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "cfg-if" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "cmake" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "gcc 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "color_quant" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "dbghelp-sys" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "deque" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "enum_primitive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "error-chain" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "flate2" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", - "miniz-sys 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "gcc" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "gif" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "color_quant 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "glfw" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "enum_primitive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glfw-sys 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "num 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", - "semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "glfw-sys" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "glob" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "image" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "enum_primitive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gif 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "jpeg-decoder 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "num-rational 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", - "png 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "scoped_threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "inflate" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "jpeg-decoder" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "lazy_static" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "libc" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "log" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "lzw" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "miniz-sys" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "gcc 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "nom" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "num" -version = "0.1.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-bigint 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", - "num-complex 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", - "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "num-rational 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-bigint" -version = "0.1.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-complex" -version = "0.1.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-traits 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-integer" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-traits 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-iter" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-rational" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-bigint 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", - "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-traits" -version = "0.1.34" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "num_cpus" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "png" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", - "inflate 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rayon" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rustc-serialize" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "scoped_threadpool" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "semver" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "shared_library" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "sharedlib" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "error-chain 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[metadata] -"checksum backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "346d7644f0b5f9bc73082d3b2236b69a05fd35cce0cfa3724e184e6a5c9e2a2f" -"checksum backtrace-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3602e8d8c43336088a8505fa55cae2b3884a9be29440863a11528a42f46f6bb7" -"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" -"checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" -"checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" -"checksum cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "dfcf5bcece56ef953b8ea042509e9dcbdfe97820b7e20d86beb53df30ed94978" -"checksum color_quant 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a475fc4af42d83d28adf72968d9bcfaf035a1a9381642d8e85d8a04957767b0d" -"checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" -"checksum deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1614659040e711785ed8ea24219140654da1729f3ec8a47a9719d041112fe7bf" -"checksum enum_primitive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f79eff5be92a4d7d5bddf7daa7d650717ea71628634efe6ca7bcda85b2183c23" -"checksum error-chain 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bd5c82c815138e278b8dcdeffc49f27ea6ffb528403e9dea4194f2e3dd40b143" -"checksum flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "3eeb481e957304178d2e782f2da1257f1434dfecbae883bafb61ada2a9fea3bb" -"checksum gcc 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)" = "dcb000abd6df9df4c637f75190297ebe56c1d7e66b56bbf3b4aa7aece15f61a2" -"checksum gif 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "01c7c19a035de94bd7afbaa62c241aadfbdf1a70f560b348d2312eafa566ca16" -"checksum glfw 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b14e68c4ccefdf293ecb65390a5761971b83fcfc54d153a5b73d438327633965" -"checksum glfw-sys 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eaff144079cb22d6f17009e29e87c02f5fd6c4669093ce12b0b2faa6027f0d23" -"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" -"checksum image 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)" = "76df2dce95fef56fd35dbc41c36e37b19aede703c6be7739e8b65d5788ffc728" -"checksum inflate 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e7e0062d2dc2f17d2f13750d95316ae8a2ff909af0fda957084f5defd87c43bb" -"checksum jpeg-decoder 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f1a2c12387f1adb21a9a2a096b5bc5f424a21729ea8e535fdf58681d396b6bbe" -"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "49247ec2a285bb3dcb23cbd9c35193c025e7251bfce77c1d5da97e6362dffe7f" -"checksum libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "23e3757828fa702a20072c37ff47938e9dd331b92fac6e223d26d4b7a55f7ee2" -"checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054" -"checksum lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" -"checksum miniz-sys 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d1f4d337a01c32e1f2122510fed46393d53ca35a7f429cb0450abaedfa3ed54" -"checksum nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b8c256fd9471521bcb84c3cdba98921497f1a331cbc15b8030fc63b82050ce" -"checksum num 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "d2ee34a0338c16ae67afb55824aaf8852700eb0f77ccd977807ccb7606b295f6" -"checksum num-bigint 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "fbc450723a2fe91d332a29edd8660e099b937d29e1a3ebe914e0da3f77ac1ad3" -"checksum num-complex 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "8aabbc079e1855ce8415141fee0ebebf171f56505373b3a966e2716ad7c0e555" -"checksum num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "fb24d9bfb3f222010df27995441ded1e954f8f69cd35021f6bef02ca9552fb92" -"checksum num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "287a1c9969a847055e1122ec0ea7a5c5d6f72aad97934e131c83d5c08ab4e45c" -"checksum num-rational 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "48cdcc9ff4ae2a8296805ac15af88b3d88ce62128ded0cb74ffb63a587502a84" -"checksum num-traits 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "95e58eac34596aac30ab134c8a8da9aa2dc99caa4b4b4838e6fc6e298016278f" -"checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3" -"checksum png 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "06208e2ee243e3118a55dda9318f821f206d8563fb8d4df258767f8e62bb0997" -"checksum rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2791d88c6defac799c3f20d74f094ca33b9332612d9aef9078519c82e4fe04a5" -"checksum rayon 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "655df67c314c30fa3055a365eae276eb88aa4f3413a352a1ab32c1320eda41ea" -"checksum rustc-demangle 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1430d286cadb237c17c885e25447c982c97113926bb579f4379c0eca8d9586dc" -"checksum rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "6159e4e6e559c81bd706afe9c8fd68f547d3e851ce12e76b1de7914bab61691b" -"checksum scoped_threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "3ef399c8893e8cb7aa9696e895427fab3a6bf265977bb96e126f24ddd2cda85a" -"checksum semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d5b7638a1f03815d94e88cb3b3c08e87f0db4d683ef499d1836aaf70a45623f" -"checksum shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fb04126b6fcfd2710fb5b6d18f4207b6c535f2850a7e1a43bcd526d44f30a79a" -"checksum sharedlib 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5182b4b49a0ff319bc69d23ca9e9f8e40dfb3b88abb895805a54e69325a092c7" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" diff --git a/examples/texture/Cargo.toml b/examples/texture/Cargo.toml deleted file mode 100644 index 5d38a51..0000000 --- a/examples/texture/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "example" -version = "0.1.0" -authors = ["maik klein "] - -[dependencies] -glfw = "0.9.1" -image = "*" -ash = { version = "0.1.0", path = "../../"} diff --git a/examples/texture/rust.png b/examples/texture/rust.png deleted file mode 100644 index ec71bd0cb87d4ccac8b24b163fe91ef92a752c8e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38310 zcmYhiWmFt(ur-?CZh>IIA-KD{yIXJ=Jh%-OJm}!=?(PyoaCdiicfZ4X&bjNGKeN_! z_hVhPYuB!tP$dOPWCT2fPoF*^OG}BVeEI~z|LN0bIye~cFI3kMx!^A-ClP5iIPk{{ z&h+=EPsE?3#e~(|(@!$o+_BW3`UP2=3hzZQV$p!-;zD6zR9}^pF=-c$hf0qtTaPQ> zoM#)#UFQGX)rRT)=+zhc{8<2{!OGqD~V~nWZEU%5(L+rEn+!>(%UiaapSDde{FtAr+nGy{y7j@7I z5(+|ie>?e4`eW6#d$TO*Va0o6RWRiH{bx76ORRS#OfQXvk6XW_&BDMz`H%JXtc|$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t7704r)S>Ae*HJ8+mkQCWSixrHv7USD z6DZ5pWhLq0)j&5-Rn5MXG;8zLYz3G1S3wdETvw{# z>vu-369$c=`oOh6%vYu9zTkQFXh+>BmiIOPl6>NNgKijKXLOp!j8QQ9loR&Tc}F*~ z>trfl^KL2jcy*^LetJjySKG5~;n8zsP4%VE0Ro)~-q)QSf$6s^Em zS5yEU`HPtd?kvOXfJ46(dFnA2`jR}g;L(HG2^{e?dHz+*LmbSG;HbALPd)IizWHt7 z$gRrL2aa4Y`++;rZt=XEL;klIUmh)c;6Fp(b79`IEaNR;=3SLB>yxt3Rb*)3FI16y TIP}CfWN^fI1NcWTJ(c|emKHx# diff --git a/examples/texture/shader/triangle.frag b/examples/texture/shader/triangle.frag deleted file mode 100644 index a7b3f18..0000000 --- a/examples/texture/shader/triangle.frag +++ /dev/null @@ -1,18 +0,0 @@ -#version 450 -#extension GL_ARB_separate_shader_objects : enable -#extension GL_ARB_shading_language_420pack : enable - -layout (binding = 1) uniform sampler2D samplerColor; - -layout (binding = 0) uniform UBO{ - vec3 color; -} ubo; - - -layout (location = 0) in vec2 o_uv; -layout (location = 0) out vec4 uFragColor; - -void main() { - vec4 color = texture(samplerColor, o_uv); - uFragColor = color; -} diff --git a/examples/texture/shader/triangle.vert b/examples/texture/shader/triangle.vert deleted file mode 100644 index 0c07f3d..0000000 --- a/examples/texture/shader/triangle.vert +++ /dev/null @@ -1,13 +0,0 @@ -#version 450 -#extension GL_ARB_separate_shader_objects : enable -#extension GL_ARB_shading_language_420pack : enable - -layout (location = 0) in vec4 pos; -layout (location = 1) in vec2 uv; - - -layout (location = 0) out vec2 o_uv; -void main() { - o_uv = uv; - gl_Position = pos; -} diff --git a/examples/texture/shader/vert.spv b/examples/texture/shader/vert.spv deleted file mode 100644 index 516de652cc0a46d4217fb120a3bbb1803f9e3907..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 948 zcmY+CTT8=05QW#))_c9*MJhfDBBCOQLRE+leGm)2hFF&xjY&vS5r3Y)$``@&t&P+z z)0uP5?9A-6)ynReF(dknn@#h3=1oP|m?=|t-fMT-`+4!We{_66M#EHHA~~~W!o{Qd zehtDH05c_9l D`c&jUbzxMh*Y;a?mws;3APWlX=TE_-&HUuy*>;Qke~zRu?)gy= z_xeH4`bUQcY0!N!HB}n!38ru2_uu5CSKSPtn%*%lt{3^YHoLc3Vc*HA4|rmn%uwbL!?7<<3iZgNH*=J|7sbNwD2F@5D~js!P1&mQ z^=EMyttmV%PcHn~0P{P*p-;*)U#Wx3nW;A;Onqis)^|g`DdX%7@T_8LYzfcFlMlD8 zh_{qA&@lQg$TI^vbAj1E9DSDLn=Tpzel@S(%4?Fgf4qek%I`Y^zKj diff --git a/examples/triangle/src/main.rs b/examples/triangle/src/main.rs deleted file mode 100644 index 59ff57a..0000000 --- a/examples/triangle/src/main.rs +++ /dev/null @@ -1,1045 +0,0 @@ -#![allow(dead_code)] -#[macro_use] -extern crate ash; -extern crate winit; - -use ash::vk; -use std::default::Default; -use ash::entry::Entry; -use ash::instance::Instance; -use ash::extensions::{Swapchain, XlibSurface, Surface, DebugReport}; -use ash::device::Device; -use std::ptr; -use std::ffi::{CStr, CString}; -use std::mem; -use std::path::Path; -use std::fs::File; -use std::io::Read; -use winit::os::unix::WindowExt; - -// Simple offset_of macro akin to C++ offsetof -macro_rules! offset_of{ - ($base: path, $field: ident) => { - unsafe{ - let b: $base = mem::uninitialized(); - (&b.$field as *const _ as isize) - (&b as *const _ as isize) - } - } -} - -// Cross platform surface creation with GLFW -#[cfg(all(unix, not(target_os = "android")))] -fn create_surface(instance: &Instance, - entry: &Entry, - window: &winit::Window) - -> Result { - let x11_display = window.get_xlib_display().unwrap(); - let x11_window = window.get_xlib_window().unwrap(); - let x11_create_info = vk::XlibSurfaceCreateInfoKHR { - s_type: vk::StructureType::XlibSurfaceCreateInfoKhr, - p_next: ptr::null(), - flags: Default::default(), - window: x11_window as vk::Window, - dpy: x11_display as *mut vk::Display, - }; - let xlib_surface_loader = XlibSurface::new(&entry, &instance) - .expect("Unable to load xlib surface"); - xlib_surface_loader.create_xlib_surface_khr(&x11_create_info) -} - -#[cfg(all(unix, not(target_os = "android")))] -fn extension_names() -> Vec { - vec![CString::new("VK_KHR_surface").unwrap(), - CString::new("VK_KHR_xlib_surface").unwrap(), - CString::new("VK_EXT_debug_report").unwrap()] -} - -#[cfg(all(windows))] -fn extension_names() -> Vec { - vec![CString::new("VK_KHR_surface").unwrap(), - CString::new("VK_KHR_win32_surface").unwrap(), - CString::new("VK_EXT_debug_report").unwrap()] -} - -unsafe extern "system" fn vulkan_debug_callback(flags: vk::DebugReportFlagsEXT, - obj_type: vk::DebugReportObjectTypeEXT, - obj: u64, - loc: usize, - message: i32, - p_layer_prefix: *const i8, - p_message: *const i8, - data: *mut ()) - -> u32 { - println!("{:?}", CStr::from_ptr(p_message)); - 1 -} - -pub fn find_memorytype_index(memory_req: &vk::MemoryRequirements, - memory_prop: &vk::PhysicalDeviceMemoryProperties, - flags: vk::MemoryPropertyFlags) - -> Option { - let mut memory_type_bits = memory_req.memory_type_bits; - for (index, ref memory_type) in memory_prop.memory_types.iter().enumerate() { - if (memory_type.property_flags & flags) == flags { - return Some(index as u32); - } - memory_type_bits = memory_type_bits >> 1; - } - None -} - -#[derive(Clone, Debug, Copy)] -struct Vertex { - pos: [f32; 4], - color: [f32; 4], -} -fn resize_callback(width: u32, height: u32) { - println!("Window resized to {}x{}", width, height); -} - -pub struct ExampleBase { - pub entry: Entry, - pub instance: Instance, - pub device: Device, - pub surface_loader: Surface, - pub swapchain_loader: Swapchain, - pub window: winit::Window, - - pub pdevice: vk::PhysicalDevice, - pub device_memory_properties: vk::PhysicalDeviceMemoryProperties, - pub queue_family_index: u32, - pub present_queue: vk::Queue, - pub surface_format: vk::SurfaceFormatKHR, - pub surface_resolution: vk::Extent2D, - pub swapchain: vk::SwapchainKHR, - - pub present_images: Vec, - pub present_image_views: Vec, - pub pool: vk::CommandPool, - pub draw_command_buffer: vk::CommandBuffer, - pub setup_command_buffer: vk::CommandBuffer, - - pub depth_image: vk::Image, - pub depth_image_view: vk::ImageView, -} - -impl ExampleBase { - pub fn render_loop(&self, f: F) { - 'render: loop { - for event in self.window.poll_events() { - match event { - winit::Event::KeyboardInput(_, _, Some(winit::VirtualKeyCode::Escape)) | - winit::Event::Closed => break 'render, - _ => (), - } - } - f(); - } - } - pub fn new(window_width: u32, window_height: u32) -> Self { - unsafe { - let window = winit::WindowBuilder::new() - .with_title("A fantastic window!") - .with_dimensions(window_width, window_height) - .with_window_resize_callback(resize_callback) - .build() - .unwrap(); - let entry = Entry::load_vulkan().unwrap(); - let instance_ext_props = entry.enumerate_instance_extension_properties().unwrap(); - let app_name = CString::new("VulkanTriangle").unwrap(); - let raw_name = app_name.as_ptr(); - - let layer_names = [CString::new("VK_LAYER_LUNARG_standard_validation").unwrap()]; - let layers_names_raw: Vec<*const i8> = layer_names.iter() - .map(|raw_name| raw_name.as_ptr()) - .collect(); - let extension_names = extension_names(); - let extension_names_raw: Vec<*const i8> = extension_names.iter() - .map(|raw_name| raw_name.as_ptr()) - .collect(); - let appinfo = vk::ApplicationInfo { - p_application_name: raw_name, - s_type: vk::StructureType::ApplicationInfo, - p_next: ptr::null(), - application_version: 0, - p_engine_name: raw_name, - engine_version: 0, - api_version: vk_make_version!(1, 0, 36), - }; - let create_info = vk::InstanceCreateInfo { - s_type: vk::StructureType::InstanceCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - p_application_info: &appinfo, - pp_enabled_layer_names: layers_names_raw.as_ptr(), - enabled_layer_count: layers_names_raw.len() as u32, - pp_enabled_extension_names: extension_names_raw.as_ptr(), - enabled_extension_count: extension_names_raw.len() as u32, - }; - let instance: Instance = entry.create_instance(&create_info) - .expect("Instance creation error"); - let debug_info = vk::DebugReportCallbackCreateInfoEXT { - s_type: vk::StructureType::DebugReportCallbackCreateInfoExt, - p_next: ptr::null(), - flags: vk::DEBUG_REPORT_ERROR_BIT_EXT | vk::DEBUG_REPORT_WARNING_BIT_EXT | - vk::DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, - pfn_callback: vulkan_debug_callback, - p_user_data: ptr::null_mut(), - }; - let debug_report_loader = DebugReport::new(&entry, &instance) - .expect("Unable to load debug report"); - let debug_call_back = debug_report_loader.create_debug_report_callback_ext(&debug_info) - .unwrap(); - let surface = create_surface(&instance, &entry, &window).unwrap(); - let pdevices = instance.enumerate_physical_devices().expect("Physical device error"); - let surface_loader = Surface::new(&entry, &instance) - .expect("Unable to load the Surface extension"); - let (pdevice, queue_family_index) = pdevices.iter() - .map(|pdevice| { - instance.get_physical_device_queue_family_properties(*pdevice) - .iter() - .enumerate() - .filter_map(|(index, ref info)| { - let supports_graphic_and_surface = - info.queue_flags.subset(vk::QUEUE_GRAPHICS_BIT) && - surface_loader.get_physical_device_surface_support_khr(*pdevice, - index as u32, - surface); - match supports_graphic_and_surface { - true => Some((*pdevice, index)), - _ => None, - } - }) - .nth(0) - }) - .filter_map(|v| v) - .nth(0) - .expect("Couldn't find suitable device."); - let queue_family_index = queue_family_index as u32; - let device_extension_names = [CString::new("VK_KHR_swapchain").unwrap()]; - let device_extension_names_raw: Vec<*const i8> = device_extension_names.iter() - .map(|raw_name| raw_name.as_ptr()) - .collect(); - let features = - vk::PhysicalDeviceFeatures { shader_clip_distance: 1, ..Default::default() }; - let priorities = [1.0]; - let queue_info = vk::DeviceQueueCreateInfo { - s_type: vk::StructureType::DeviceQueueCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - queue_family_index: queue_family_index as u32, - p_queue_priorities: priorities.as_ptr(), - queue_count: priorities.len() as u32, - }; - let device_create_info = vk::DeviceCreateInfo { - s_type: vk::StructureType::DeviceCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - queue_create_info_count: 1, - p_queue_create_infos: &queue_info, - enabled_layer_count: 0, - pp_enabled_layer_names: ptr::null(), - enabled_extension_count: device_extension_names_raw.len() as u32, - pp_enabled_extension_names: device_extension_names_raw.as_ptr(), - p_enabled_features: &features, - }; - let device: Device = instance.create_device(pdevice, &device_create_info) - .unwrap(); - let present_queue = device.get_device_queue(queue_family_index as u32, 0); - - let surface_formats = - surface_loader.get_physical_device_surface_formats_khr(pdevice, surface) - .unwrap(); - let surface_format = surface_formats.iter() - .map(|sfmt| { - match sfmt.format { - vk::Format::Undefined => { - vk::SurfaceFormatKHR { - format: vk::Format::B8g8r8Unorm, - color_space: sfmt.color_space, - } - } - _ => sfmt.clone(), - } - }) - .nth(0) - .expect("Unable to find suitable surface format."); - let surface_capabilities = - surface_loader.get_physical_device_surface_capabilities_khr(pdevice, surface) - .unwrap(); - let desired_image_count = surface_capabilities.min_image_count + 1; - assert!(surface_capabilities.min_image_count <= desired_image_count && - surface_capabilities.max_image_count >= desired_image_count, - "Image count err"); - let surface_resolution = match surface_capabilities.current_extent.width { - std::u32::MAX => { - vk::Extent2D { - width: window_width, - height: window_height, - } - } - _ => surface_capabilities.current_extent, - }; - - let pre_transform = if surface_capabilities.supported_transforms - .subset(vk::SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { - vk::SURFACE_TRANSFORM_IDENTITY_BIT_KHR - } else { - surface_capabilities.current_transform - }; - let present_modes = - surface_loader.get_physical_device_surface_present_modes_khr(pdevice, surface) - .unwrap(); - let present_mode = present_modes.iter() - .cloned() - .find(|&mode| mode == vk::PresentModeKHR::Mailbox) - .unwrap_or(vk::PresentModeKHR::Fifo); - let swapchain_loader = Swapchain::new(&instance, &device) - .expect("Unable to load swapchain"); - let swapchain_create_info = vk::SwapchainCreateInfoKHR { - s_type: vk::StructureType::SwapchainCreateInfoKhr, - p_next: ptr::null(), - flags: Default::default(), - surface: surface, - min_image_count: desired_image_count, - image_color_space: surface_format.color_space, - image_format: surface_format.format, - image_extent: surface_resolution.clone(), - image_usage: vk::IMAGE_USAGE_COLOR_ATTACHMENT_BIT, - image_sharing_mode: vk::SharingMode::Exclusive, - pre_transform: pre_transform, - composite_alpha: vk::COMPOSITE_ALPHA_OPAQUE_BIT_KHR, - present_mode: present_mode, - clipped: 1, - old_swapchain: vk::SwapchainKHR::null(), - image_array_layers: 1, - p_queue_family_indices: ptr::null(), - queue_family_index_count: 0, - }; - let swapchain = swapchain_loader.create_swapchain_khr(&swapchain_create_info).unwrap(); - let pool_create_info = vk::CommandPoolCreateInfo { - s_type: vk::StructureType::CommandPoolCreateInfo, - p_next: ptr::null(), - flags: vk::COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, - queue_family_index: queue_family_index, - }; - let pool = device.create_command_pool(&pool_create_info).unwrap(); - let command_buffer_allocate_info = vk::CommandBufferAllocateInfo { - s_type: vk::StructureType::CommandBufferAllocateInfo, - p_next: ptr::null(), - command_buffer_count: 2, - command_pool: pool, - level: vk::CommandBufferLevel::Primary, - }; - let command_buffer_allocate_info = vk::CommandBufferAllocateInfo { - s_type: vk::StructureType::CommandBufferAllocateInfo, - p_next: ptr::null(), - command_buffer_count: 2, - command_pool: pool, - level: vk::CommandBufferLevel::Primary, - }; - let command_buffers = device.allocate_command_buffers(&command_buffer_allocate_info) - .unwrap(); - let setup_command_buffer = command_buffers[0]; - let draw_command_buffer = command_buffers[1]; - - let present_images = swapchain_loader.get_swapchain_images_khr(swapchain).unwrap(); - let present_image_views: Vec = present_images.iter() - .map(|&image| { - let create_view_info = vk::ImageViewCreateInfo { - s_type: vk::StructureType::ImageViewCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - view_type: vk::ImageViewType::Type2d, - format: surface_format.format, - components: vk::ComponentMapping { - r: vk::ComponentSwizzle::R, - g: vk::ComponentSwizzle::G, - b: vk::ComponentSwizzle::B, - a: vk::ComponentSwizzle::A, - }, - subresource_range: vk::ImageSubresourceRange { - aspect_mask: vk::IMAGE_ASPECT_COLOR_BIT, - base_mip_level: 0, - level_count: 1, - base_array_layer: 0, - layer_count: 1, - }, - image: image, - }; - device.create_image_view(&create_view_info).unwrap() - }) - .collect(); - let device_memory_properties = instance.get_physical_device_memory_properties(pdevice); - let depth_image_create_info = vk::ImageCreateInfo { - s_type: vk::StructureType::ImageCreateInfo, - p_next: ptr::null(), - flags: vk::IMAGE_CREATE_SPARSE_BINDING_BIT, - image_type: vk::ImageType::Type2d, - format: vk::Format::D16Unorm, - extent: vk::Extent3D { - width: surface_resolution.width, - height: surface_resolution.height, - depth: 1, - }, - mip_levels: 1, - array_layers: 1, - samples: vk::SAMPLE_COUNT_1_BIT, - tiling: vk::ImageTiling::Optimal, - usage: vk::IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, - sharing_mode: vk::SharingMode::Exclusive, - queue_family_index_count: 0, - p_queue_family_indices: ptr::null(), - initial_layout: vk::ImageLayout::Undefined, - }; - let depth_image = device.create_image(&depth_image_create_info).unwrap(); - let depth_image_memory_req = device.get_image_memory_requirements(depth_image); - let depth_image_memory_index = - find_memorytype_index(&depth_image_memory_req, - &device_memory_properties, - vk::MEMORY_PROPERTY_DEVICE_LOCAL_BIT) - .expect("Unable to find suitable memory index for depth image."); - - let depth_image_allocate_info = vk::MemoryAllocateInfo { - s_type: vk::StructureType::MemoryAllocateInfo, - p_next: ptr::null(), - allocation_size: depth_image_memory_req.size, - memory_type_index: depth_image_memory_index, - }; - let depth_image_memory = device.allocate_memory(&depth_image_allocate_info).unwrap(); - device.bind_image_memory(depth_image, depth_image_memory, 0) - .expect("Unable to bind depth image memory"); - - let command_buffer_begin_info = vk::CommandBufferBeginInfo { - s_type: vk::StructureType::CommandBufferBeginInfo, - p_next: ptr::null(), - p_inheritance_info: ptr::null(), - flags: vk::COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT, - }; - device.begin_command_buffer(setup_command_buffer, &command_buffer_begin_info).unwrap(); - let layout_transition_barrier = vk::ImageMemoryBarrier { - s_type: vk::StructureType::ImageMemoryBarrier, - p_next: ptr::null(), - src_access_mask: Default::default(), - dst_access_mask: vk::ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - vk::ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, - old_layout: vk::ImageLayout::Undefined, - new_layout: vk::ImageLayout::DepthStencilAttachmentOptimal, - src_queue_family_index: vk::VK_QUEUE_FAMILY_IGNORED, - dst_queue_family_index: vk::VK_QUEUE_FAMILY_IGNORED, - image: depth_image, - subresource_range: vk::ImageSubresourceRange { - aspect_mask: vk::IMAGE_ASPECT_DEPTH_BIT, - base_mip_level: 0, - level_count: 1, - base_array_layer: 0, - layer_count: 1, - }, - }; - device.cmd_pipeline_barrier(setup_command_buffer, - vk::PIPELINE_STAGE_TOP_OF_PIPE_BIT, - vk::PIPELINE_STAGE_TOP_OF_PIPE_BIT, - vk::DependencyFlags::empty(), - &[], - &[], - &[layout_transition_barrier]); - let wait_stage_mask = [vk::PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT]; - let fence_create_info = vk::FenceCreateInfo { - s_type: vk::StructureType::FenceCreateInfo, - p_next: ptr::null(), - flags: vk::FenceCreateFlags::empty(), - }; - let submit_fence = device.create_fence(&fence_create_info).unwrap(); - let submit_info = vk::SubmitInfo { - s_type: vk::StructureType::SubmitInfo, - p_next: ptr::null(), - wait_semaphore_count: 0, - p_wait_semaphores: ptr::null(), - signal_semaphore_count: 0, - p_signal_semaphores: ptr::null(), - p_wait_dst_stage_mask: wait_stage_mask.as_ptr(), - command_buffer_count: 1, - p_command_buffers: &setup_command_buffer, - }; - device.end_command_buffer(setup_command_buffer).unwrap(); - device.queue_submit(present_queue, &[submit_info], submit_fence).unwrap(); - device.wait_for_fences(&[submit_fence], true, std::u64::MAX).unwrap(); - let depth_image_view_info = vk::ImageViewCreateInfo { - s_type: vk::StructureType::ImageViewCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - view_type: vk::ImageViewType::Type2d, - format: depth_image_create_info.format, - components: vk::ComponentMapping { - r: vk::ComponentSwizzle::Identity, - g: vk::ComponentSwizzle::Identity, - b: vk::ComponentSwizzle::Identity, - a: vk::ComponentSwizzle::Identity, - }, - subresource_range: vk::ImageSubresourceRange { - aspect_mask: vk::IMAGE_ASPECT_DEPTH_BIT, - base_mip_level: 0, - level_count: 1, - base_array_layer: 0, - layer_count: 1, - }, - image: depth_image, - }; - let depth_image_view = device.create_image_view(&depth_image_view_info).unwrap(); - ExampleBase { - entry: entry, - instance: instance, - device: device, - queue_family_index: queue_family_index, - pdevice: pdevice, - device_memory_properties: device_memory_properties, - window: window, - surface_loader: surface_loader, - surface_format: surface_format, - present_queue: present_queue, - surface_resolution: surface_resolution, - swapchain_loader: swapchain_loader, - swapchain: swapchain, - present_images: present_images, - present_image_views: present_image_views, - pool: pool, - draw_command_buffer: draw_command_buffer, - setup_command_buffer: setup_command_buffer, - depth_image: depth_image, - depth_image_view: depth_image_view, - } - } - } -} -fn main() { - unsafe { - let base = ExampleBase::new(1920, 1080); - let fence_create_info = vk::FenceCreateInfo { - s_type: vk::StructureType::FenceCreateInfo, - p_next: ptr::null(), - flags: vk::FenceCreateFlags::empty(), - }; - let command_buffer_begin_info = vk::CommandBufferBeginInfo { - s_type: vk::StructureType::CommandBufferBeginInfo, - p_next: ptr::null(), - p_inheritance_info: ptr::null(), - flags: vk::COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT, - }; - let renderpass_attachments = - [vk::AttachmentDescription { - format: base.surface_format.format, - flags: vk::AttachmentDescriptionFlags::empty(), - samples: vk::SAMPLE_COUNT_1_BIT, - load_op: vk::AttachmentLoadOp::Clear, - store_op: vk::AttachmentStoreOp::Store, - stencil_load_op: vk::AttachmentLoadOp::DontCare, - stencil_store_op: vk::AttachmentStoreOp::DontCare, - initial_layout: vk::ImageLayout::Undefined, - final_layout: vk::ImageLayout::PresentSrcKhr, - }, - vk::AttachmentDescription { - format: vk::Format::D16Unorm, - flags: vk::AttachmentDescriptionFlags::empty(), - samples: vk::SAMPLE_COUNT_1_BIT, - load_op: vk::AttachmentLoadOp::Clear, - store_op: vk::AttachmentStoreOp::DontCare, - stencil_load_op: vk::AttachmentLoadOp::DontCare, - stencil_store_op: vk::AttachmentStoreOp::DontCare, - initial_layout: vk::ImageLayout::DepthStencilAttachmentOptimal, - final_layout: vk::ImageLayout::DepthStencilAttachmentOptimal, - }]; - let color_attachment_ref = vk::AttachmentReference { - attachment: 0, - layout: vk::ImageLayout::ColorAttachmentOptimal, - }; - let depth_attachment_ref = vk::AttachmentReference { - attachment: 1, - layout: vk::ImageLayout::DepthStencilAttachmentOptimal, - }; - let dependency = vk::SubpassDependency { - dependency_flags: Default::default(), - src_subpass: vk::VK_SUBPASS_EXTERNAL, - dst_subpass: Default::default(), - src_stage_mask: vk::PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - src_access_mask: Default::default(), - dst_access_mask: vk::ACCESS_COLOR_ATTACHMENT_READ_BIT | - vk::ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - dst_stage_mask: vk::PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - }; - let subpass = vk::SubpassDescription { - color_attachment_count: 1, - p_color_attachments: &color_attachment_ref, - p_depth_stencil_attachment: &depth_attachment_ref, - // TODO: Why is there no wrapper? - flags: Default::default(), - pipeline_bind_point: vk::PipelineBindPoint::Graphics, - input_attachment_count: 0, - p_input_attachments: ptr::null(), - p_resolve_attachments: ptr::null(), - preserve_attachment_count: 0, - p_preserve_attachments: ptr::null(), - }; - let renderpass_create_info = vk::RenderPassCreateInfo { - s_type: vk::StructureType::RenderPassCreateInfo, - flags: Default::default(), - p_next: ptr::null(), - attachment_count: renderpass_attachments.len() as u32, - p_attachments: renderpass_attachments.as_ptr(), - subpass_count: 1, - p_subpasses: &subpass, - dependency_count: 1, - p_dependencies: &dependency, - }; - let renderpass = base.device.create_render_pass(&renderpass_create_info).unwrap(); - let framebuffers: Vec = base.present_image_views - .iter() - .map(|&present_image_view| { - let framebuffer_attachments = [present_image_view, base.depth_image_view]; - let frame_buffer_create_info = vk::FramebufferCreateInfo { - s_type: vk::StructureType::FramebufferCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - render_pass: renderpass, - attachment_count: framebuffer_attachments.len() as u32, - p_attachments: framebuffer_attachments.as_ptr(), - width: base.surface_resolution.width, - height: base.surface_resolution.height, - layers: 1, - }; - base.device.create_framebuffer(&frame_buffer_create_info).unwrap() - }) - .collect(); - let index_buffer_data = [0u32, 1, 2]; - let index_buffer_info = vk::BufferCreateInfo { - s_type: vk::StructureType::BufferCreateInfo, - p_next: ptr::null(), - flags: vk::BufferCreateFlags::empty(), - size: std::mem::size_of_val(&index_buffer_data) as u64, - usage: vk::BUFFER_USAGE_INDEX_BUFFER_BIT, - sharing_mode: vk::SharingMode::Exclusive, - queue_family_index_count: 0, - p_queue_family_indices: ptr::null(), - }; - let index_buffer = base.device.create_buffer(&index_buffer_info).unwrap(); - let index_buffer_memory_req = base.device.get_buffer_memory_requirements(index_buffer); - let index_buffer_memory_index = find_memorytype_index(&index_buffer_memory_req, - &base.device_memory_properties, - vk::MEMORY_PROPERTY_HOST_VISIBLE_BIT) - .expect("Unable to find suitable memorytype for the index buffer."); - let index_allocate_info = vk::MemoryAllocateInfo { - s_type: vk::StructureType::MemoryAllocateInfo, - p_next: ptr::null(), - allocation_size: index_buffer_memory_req.size, - memory_type_index: index_buffer_memory_index, - }; - let index_buffer_memory = base.device.allocate_memory(&index_allocate_info).unwrap(); - let index_slice = base.device - .map_memory::(index_buffer_memory, - 0, - index_buffer_info.size, - vk::MemoryMapFlags::empty()) - .unwrap(); - index_slice.copy_from_slice(&index_buffer_data); - base.device.unmap_memory(index_buffer_memory); - base.device.bind_buffer_memory(index_buffer, index_buffer_memory, 0).unwrap(); - - let vertex_input_buffer_info = vk::BufferCreateInfo { - s_type: vk::StructureType::BufferCreateInfo, - p_next: ptr::null(), - flags: vk::BufferCreateFlags::empty(), - size: 3 * std::mem::size_of::() as u64, - usage: vk::BUFFER_USAGE_VERTEX_BUFFER_BIT, - sharing_mode: vk::SharingMode::Exclusive, - queue_family_index_count: 0, - p_queue_family_indices: ptr::null(), - }; - let vertex_input_buffer = base.device.create_buffer(&vertex_input_buffer_info).unwrap(); - let vertex_input_buffer_memory_req = base.device - .get_buffer_memory_requirements(vertex_input_buffer); - let vertex_input_buffer_memory_index = - find_memorytype_index(&vertex_input_buffer_memory_req, - &base.device_memory_properties, - vk::MEMORY_PROPERTY_HOST_VISIBLE_BIT) - .expect("Unable to find suitable memorytype for the vertex buffer."); - - let vertex_buffer_allocate_info = vk::MemoryAllocateInfo { - s_type: vk::StructureType::MemoryAllocateInfo, - p_next: ptr::null(), - allocation_size: vertex_input_buffer_memory_req.size, - memory_type_index: vertex_input_buffer_memory_index, - }; - let vertex_input_buffer_memory = base.device - .allocate_memory(&vertex_buffer_allocate_info) - .unwrap(); - let vertices = [Vertex { - pos: [-1.0, 1.0, 0.0, 1.0], - color: [0.0, 1.0, 0.0, 1.0], - }, - Vertex { - pos: [1.0, 1.0, 0.0, 1.0], - color: [0.0, 0.0, 1.0, 1.0], - }, - Vertex { - pos: [0.0, -1.0, 0.0, 1.0], - color: [1.0, 0.0, 0.0, 1.0], - }]; - let slice = base.device - .map_memory::(vertex_input_buffer_memory, - 0, - vertex_input_buffer_info.size, - vk::MemoryMapFlags::empty()) - .unwrap(); - slice.copy_from_slice(&vertices); - base.device.unmap_memory(vertex_input_buffer_memory); - base.device.bind_buffer_memory(vertex_input_buffer, vertex_input_buffer_memory, 0).unwrap(); - let vertex_spv_file = File::open(Path::new("shader/vert.spv")) - .expect("Could not find vert.spv."); - let frag_spv_file = File::open(Path::new("shader/frag.spv")) - .expect("Could not find frag.spv."); - - let vertex_bytes: Vec = vertex_spv_file.bytes().filter_map(|byte| byte.ok()).collect(); - let vertex_shader_info = vk::ShaderModuleCreateInfo { - s_type: vk::StructureType::ShaderModuleCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - code_size: vertex_bytes.len(), - p_code: vertex_bytes.as_ptr() as *const u32, - }; - let frag_bytes: Vec = frag_spv_file.bytes().filter_map(|byte| byte.ok()).collect(); - let frag_shader_info = vk::ShaderModuleCreateInfo { - s_type: vk::StructureType::ShaderModuleCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - code_size: frag_bytes.len(), - p_code: frag_bytes.as_ptr() as *const u32, - }; - let vertex_shader_module = base.device - .create_shader_module(&vertex_shader_info) - .expect("Vertex shader module error"); - - let fragment_shader_module = base.device - .create_shader_module(&frag_shader_info) - .expect("Fragment shader module error"); - - let layout_create_info = vk::PipelineLayoutCreateInfo { - s_type: vk::StructureType::PipelineLayoutCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - set_layout_count: 0, - p_set_layouts: ptr::null(), - push_constant_range_count: 0, - p_push_constant_ranges: ptr::null(), - }; - - let pipeline_layout = base.device.create_pipeline_layout(&layout_create_info).unwrap(); - - let shader_entry_name = CString::new("main").unwrap(); - let shader_stage_create_infos = - [vk::PipelineShaderStageCreateInfo { - s_type: vk::StructureType::PipelineShaderStageCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - module: vertex_shader_module, - p_name: shader_entry_name.as_ptr(), - p_specialization_info: ptr::null(), - stage: vk::SHADER_STAGE_VERTEX_BIT, - }, - vk::PipelineShaderStageCreateInfo { - s_type: vk::StructureType::PipelineShaderStageCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - module: fragment_shader_module, - p_name: shader_entry_name.as_ptr(), - p_specialization_info: ptr::null(), - stage: vk::SHADER_STAGE_FRAGMENT_BIT, - }]; - let vertex_input_binding_descriptions = [vk::VertexInputBindingDescription { - binding: 0, - stride: mem::size_of::() as u32, - input_rate: vk::VertexInputRate::Vertex, - }]; - let vertex_input_attribute_descriptions = [vk::VertexInputAttributeDescription { - location: 0, - binding: 0, - format: vk::Format::R32g32b32a32Sfloat, - offset: offset_of!(Vertex, pos) as u32, - }, - vk::VertexInputAttributeDescription { - location: 1, - binding: 0, - format: vk::Format::R32g32b32a32Sfloat, - offset: offset_of!(Vertex, color) as u32, - }]; - let vertex_input_state_info = vk::PipelineVertexInputStateCreateInfo { - s_type: vk::StructureType::PipelineVertexInputStateCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - vertex_attribute_description_count: vertex_input_attribute_descriptions.len() as u32, - p_vertex_attribute_descriptions: vertex_input_attribute_descriptions.as_ptr(), - vertex_binding_description_count: vertex_input_binding_descriptions.len() as u32, - p_vertex_binding_descriptions: vertex_input_binding_descriptions.as_ptr(), - }; - let vertex_input_assembly_state_info = vk::PipelineInputAssemblyStateCreateInfo { - s_type: vk::StructureType::PipelineInputAssemblyStateCreateInfo, - flags: Default::default(), - p_next: ptr::null(), - primitive_restart_enable: 0, - topology: vk::PrimitiveTopology::TriangleList, - }; - let viewports = [vk::Viewport { - x: 0.0, - y: 0.0, - width: base.surface_resolution.width as f32, - height: base.surface_resolution.height as f32, - min_depth: 0.0, - max_depth: 1.0, - }]; - let scissors = [vk::Rect2D { - offset: vk::Offset2D { x: 0, y: 0 }, - extent: base.surface_resolution.clone(), - }]; - let viewport_state_info = vk::PipelineViewportStateCreateInfo { - s_type: vk::StructureType::PipelineViewportStateCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - scissor_count: scissors.len() as u32, - p_scissors: scissors.as_ptr(), - viewport_count: viewports.len() as u32, - p_viewports: viewports.as_ptr(), - }; - let rasterization_info = vk::PipelineRasterizationStateCreateInfo { - s_type: vk::StructureType::PipelineRasterizationStateCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - cull_mode: vk::CULL_MODE_NONE, - depth_bias_clamp: 0.0, - depth_bias_constant_factor: 0.0, - depth_bias_enable: 0, - depth_bias_slope_factor: 0.0, - depth_clamp_enable: 0, - front_face: vk::FrontFace::CounterClockwise, - line_width: 1.0, - polygon_mode: vk::PolygonMode::Fill, - rasterizer_discard_enable: 0, - }; - let multisample_state_info = vk::PipelineMultisampleStateCreateInfo { - s_type: vk::StructureType::PipelineMultisampleStateCreateInfo, - flags: Default::default(), - p_next: ptr::null(), - rasterization_samples: vk::SAMPLE_COUNT_1_BIT, - sample_shading_enable: 0, - min_sample_shading: 0.0, - p_sample_mask: ptr::null(), - alpha_to_one_enable: 0, - alpha_to_coverage_enable: 0, - }; - let noop_stencil_state = vk::StencilOpState { - fail_op: vk::StencilOp::Keep, - pass_op: vk::StencilOp::Keep, - depth_fail_op: vk::StencilOp::Keep, - compare_op: vk::CompareOp::Always, - compare_mask: 0, - write_mask: 0, - reference: 0, - }; - let depth_state_info = vk::PipelineDepthStencilStateCreateInfo { - s_type: vk::StructureType::PipelineDepthStencilStateCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - depth_test_enable: 1, - depth_write_enable: 1, - depth_compare_op: vk::CompareOp::LessOrEqual, - depth_bounds_test_enable: 0, - stencil_test_enable: 0, - front: noop_stencil_state.clone(), - back: noop_stencil_state.clone(), - max_depth_bounds: 1.0, - min_depth_bounds: 0.0, - }; - let color_blend_attachment_states = [vk::PipelineColorBlendAttachmentState { - blend_enable: 0, - src_color_blend_factor: vk::BlendFactor::SrcColor, - dst_color_blend_factor: - vk::BlendFactor::OneMinusDstColor, - color_blend_op: vk::BlendOp::Add, - src_alpha_blend_factor: vk::BlendFactor::Zero, - dst_alpha_blend_factor: vk::BlendFactor::Zero, - alpha_blend_op: vk::BlendOp::Add, - color_write_mask: vk::ColorComponentFlags::all(), - }]; - let color_blend_state = vk::PipelineColorBlendStateCreateInfo { - s_type: vk::StructureType::PipelineColorBlendStateCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - logic_op_enable: 0, - logic_op: vk::LogicOp::Clear, - attachment_count: color_blend_attachment_states.len() as u32, - p_attachments: color_blend_attachment_states.as_ptr(), - blend_constants: [0.0, 0.0, 0.0, 0.0], - }; - let dynamic_state = [vk::DynamicState::Viewport, vk::DynamicState::Scissor]; - let dynamic_state_info = vk::PipelineDynamicStateCreateInfo { - s_type: vk::StructureType::PipelineDynamicStateCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - dynamic_state_count: dynamic_state.len() as u32, - p_dynamic_states: dynamic_state.as_ptr(), - }; - let graphic_pipeline_info = vk::GraphicsPipelineCreateInfo { - s_type: vk::StructureType::GraphicsPipelineCreateInfo, - p_next: ptr::null(), - flags: vk::PipelineCreateFlags::empty(), - stage_count: shader_stage_create_infos.len() as u32, - p_stages: shader_stage_create_infos.as_ptr(), - p_vertex_input_state: &vertex_input_state_info, - p_input_assembly_state: &vertex_input_assembly_state_info, - p_tessellation_state: ptr::null(), - p_viewport_state: &viewport_state_info, - p_rasterization_state: &rasterization_info, - p_multisample_state: &multisample_state_info, - p_depth_stencil_state: &depth_state_info, - p_color_blend_state: &color_blend_state, - p_dynamic_state: &dynamic_state_info, - layout: pipeline_layout, - render_pass: renderpass, - subpass: 0, - base_pipeline_handle: vk::Pipeline::null(), - base_pipeline_index: 0, - }; - let graphics_pipelines = base.device - .create_graphics_pipelines(vk::PipelineCache::null(), &[graphic_pipeline_info]) - .unwrap(); - - let graphic_pipeline = graphics_pipelines[0]; - - let semaphore_create_info = vk::SemaphoreCreateInfo { - s_type: vk::StructureType::SemaphoreCreateInfo, - p_next: ptr::null(), - flags: Default::default(), - }; - let present_complete_semaphore = - base.device.create_semaphore(&semaphore_create_info).unwrap(); - let rendering_complete_semaphore = - base.device.create_semaphore(&semaphore_create_info).unwrap(); - - let draw_fence = base.device.create_fence(&fence_create_info).unwrap(); - base.render_loop(|| { - let present_index = base.swapchain_loader - .acquire_next_image_khr(base.swapchain, - std::u64::MAX, - present_complete_semaphore, - vk::Fence::null()) - .unwrap(); - base.device.reset_command_buffer(base.draw_command_buffer, Default::default()).unwrap(); - base.device - .begin_command_buffer(base.draw_command_buffer, &command_buffer_begin_info) - .unwrap(); - let clear_values = - [vk::ClearValue::new_color(vk::ClearColorValue::new_float32([0.0, 0.0, 0.0, 0.0])), - vk::ClearValue::new_depth_stencil(vk::ClearDepthStencilValue { - depth: 1.0, - stencil: 0, - })]; - - let render_pass_begin_info = vk::RenderPassBeginInfo { - s_type: vk::StructureType::RenderPassBeginInfo, - p_next: ptr::null(), - render_pass: renderpass, - framebuffer: framebuffers[present_index as usize], - render_area: vk::Rect2D { - offset: vk::Offset2D { x: 0, y: 0 }, - extent: base.surface_resolution.clone(), - }, - clear_value_count: clear_values.len() as u32, - p_clear_values: clear_values.as_ptr(), - }; - base.device.cmd_begin_render_pass(base.draw_command_buffer, - &render_pass_begin_info, - vk::SubpassContents::Inline); - base.device.cmd_bind_pipeline(base.draw_command_buffer, - vk::PipelineBindPoint::Graphics, - graphic_pipeline); - base.device.cmd_set_viewport(base.draw_command_buffer, &viewports); - base.device.cmd_set_scissor(base.draw_command_buffer, &scissors); - base.device - .cmd_bind_vertex_buffers(base.draw_command_buffer, &[vertex_input_buffer], &0); - base.device.cmd_bind_index_buffer(base.draw_command_buffer, - index_buffer, - 0, - vk::IndexType::Uint32); - base.device.cmd_draw_indexed(base.draw_command_buffer, - index_buffer_data.len() as u32, - 1, - 0, - 0, - 1); - // Or draw without the index buffer - // device.cmd_draw(draw_command_buffer, 3, 1, 0, 0); - base.device.cmd_end_render_pass(base.draw_command_buffer); - base.device.end_command_buffer(base.draw_command_buffer).unwrap(); - let wait_render_mask = [vk::PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT]; - let submit_info = vk::SubmitInfo { - s_type: vk::StructureType::SubmitInfo, - p_next: ptr::null(), - wait_semaphore_count: 1, - p_wait_semaphores: &present_complete_semaphore, - p_wait_dst_stage_mask: wait_render_mask.as_ptr(), - command_buffer_count: 1, - p_command_buffers: &base.draw_command_buffer, - signal_semaphore_count: 1, - p_signal_semaphores: &rendering_complete_semaphore, - }; - base.device - .queue_submit(base.present_queue, &[submit_info], draw_fence) - .unwrap(); - let mut present_info_err = unsafe { mem::uninitialized() }; - let present_info = vk::PresentInfoKHR { - s_type: vk::StructureType::PresentInfoKhr, - p_next: ptr::null(), - wait_semaphore_count: 1, - p_wait_semaphores: &rendering_complete_semaphore, - swapchain_count: 1, - p_swapchains: &base.swapchain, - p_image_indices: &present_index, - p_results: &mut present_info_err, - }; - base.device.queue_present_khr(base.present_queue, &present_info).unwrap(); - base.device - .wait_for_fences(&[draw_fence], true, std::u64::MAX) - .unwrap(); - base.device.reset_fences(&[draw_fence]).unwrap(); - }); - - // device.device_wait_idle().unwrap(); - // device.destroy_semaphore(present_complete_semaphore); - // device.destroy_semaphore(rendering_complete_semaphore); - // for pipeline in graphics_pipelines { - // device.destroy_pipeline(pipeline); - // } - // device.destroy_pipeline_layout(pipeline_layout); - // device.destroy_shader_module(vertex_shader_module); - // device.destroy_shader_module(fragment_shader_module); - // device.free_memory(index_buffer_memory); - // device.destroy_buffer(index_buffer); - // device.free_memory(vertex_input_buffer_memory); - // device.destroy_buffer(vertex_input_buffer); - // for framebuffer in framebuffers { - // device.destroy_framebuffer(framebuffer); - // } - // device.destroy_render_pass(renderpass); - // device.destroy_image_view(depth_image_view); - // device.destroy_fence(submit_fence); - // device.destroy_fence(draw_fence); - // device.free_memory(depth_image_memory); - // device.destroy_image(depth_image); - // for image_view in present_image_views { - // device.destroy_image_view(image_view); - // } - // device.destroy_command_pool(pool); - // swapchain_loader.destroy_swapchain_khr(swapchain); - // device.destroy_device(); - // surface_loader.destroy_surface_khr(surface); - // debug_report_loader.destroy_debug_report_callback_ext(debug_call_back); - // instance.destroy_instance(); - } -}