|
1 | 1 | --- a/28_generating_mipmaps.rs
|
2 | 2 | +++ b/29_multisampling.rs
|
3 |
| -@@ -85,8 +85,6 @@ use vulkano::descriptor::descriptor_set::{ |
| 3 | +@@ -86,8 +86,6 @@ use vulkano::descriptor::descriptor_set::{ |
4 | 4 | use vulkano::sampler::{
|
5 | 5 | Sampler,
|
6 | 6 | Filter,
|
7 | 7 | - MipmapMode,
|
8 | 8 | - SamplerAddressMode,
|
9 | 9 | };
|
10 |
| - use image::GenericImageView; |
11 | 10 |
|
12 |
| -@@ -183,6 +181,7 @@ struct HelloTriangleApplication { |
| 11 | + use image::GenericImageView; |
| 12 | +@@ -193,6 +191,7 @@ struct HelloTriangleApplication { |
13 | 13 | command_buffers: Vec<Arc<AutoCommandBuffer>>,
|
14 | 14 |
|
15 | 15 | depth_format: Format,
|
16 | 16 | + sample_count: u32,
|
17 | 17 |
|
18 | 18 | previous_frame_end: Option<Box<GpuFuture>>,
|
19 | 19 | recreate_swap_chain: bool,
|
20 |
| -@@ -203,14 +202,16 @@ impl HelloTriangleApplication { |
| 20 | +@@ -213,14 +212,16 @@ impl HelloTriangleApplication { |
21 | 21 | let (swap_chain, swap_chain_images) = Self::create_swap_chain(&instance, &surface, physical_device_index,
|
22 | 22 | &device, &graphics_queue, &present_queue, None);
|
23 | 23 |
|
|
37 | 37 |
|
38 | 38 | let start_time = Instant::now();
|
39 | 39 |
|
40 |
| -@@ -258,6 +259,7 @@ impl HelloTriangleApplication { |
| 40 | +@@ -268,6 +269,7 @@ impl HelloTriangleApplication { |
41 | 41 | command_buffers: vec![],
|
42 | 42 |
|
43 | 43 | depth_format,
|
44 | 44 | + sample_count,
|
45 | 45 |
|
46 | 46 | previous_frame_end,
|
47 | 47 | recreate_swap_chain: false,
|
48 |
| -@@ -444,42 +446,61 @@ impl HelloTriangleApplication { |
| 48 | +@@ -454,42 +456,61 @@ impl HelloTriangleApplication { |
49 | 49 | (swap_chain, images)
|
50 | 50 | }
|
51 | 51 |
|
|
118 | 118 | }
|
119 | 119 | ).unwrap())
|
120 | 120 | }
|
121 |
| -@@ -538,15 +559,21 @@ impl HelloTriangleApplication { |
| 121 | +@@ -548,15 +569,21 @@ impl HelloTriangleApplication { |
122 | 122 | }
|
123 | 123 |
|
124 | 124 | fn create_framebuffers(
|
|
142 | 142 | .build().unwrap());
|
143 | 143 | fba
|
144 | 144 | }
|
145 |
| -@@ -642,25 +669,7 @@ impl HelloTriangleApplication { |
| 145 | +@@ -652,25 +679,7 @@ impl HelloTriangleApplication { |
146 | 146 | }
|
147 | 147 |
|
148 | 148 | fn create_image_sampler(device: &Arc<Device>) -> Arc<Sampler> {
|
|
169 | 169 | }
|
170 | 170 |
|
171 | 171 | fn load_model() -> (Vec<Vertex>, Vec<u32>) {
|
172 |
| -@@ -789,7 +798,7 @@ impl HelloTriangleApplication { |
| 172 | +@@ -799,7 +808,7 @@ impl HelloTriangleApplication { |
173 | 173 | .unwrap()
|
174 | 174 | .update_buffer(self.uniform_buffers[i].clone(), Self::update_uniform_buffer(self.start_time, dimensions))
|
175 | 175 | .unwrap()
|
|
178 | 178 | .unwrap()
|
179 | 179 | .draw_indexed(
|
180 | 180 | self.graphics_pipeline.clone(),
|
181 |
| -@@ -967,16 +976,16 @@ impl HelloTriangleApplication { |
| 181 | +@@ -971,16 +980,16 @@ impl HelloTriangleApplication { |
182 | 182 | let (swap_chain, images) = Self::create_swap_chain(&self.instance, &self.surface, self.physical_device_index,
|
183 | 183 | &self.device, &self.graphics_queue, &self.present_queue, Some(self.swap_chain.clone()));
|
184 | 184 |
|
|
0 commit comments