summary refs log tree commit diff
path: root/src/graphics/model.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphics/model.rs')
-rw-r--r--src/graphics/model.rs25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/graphics/model.rs b/src/graphics/model.rs
index b691d99..bda064c 100644
--- a/src/graphics/model.rs
+++ b/src/graphics/model.rs
@@ -1,8 +1,6 @@
 #![deny(unsafe_code)]
 use crate::error::*;
-use crate::graphics::permanent::{
-  PermanentGraphicsState, GraphicsStateForReinit
-};
+use crate::graphics::permanent::PermanentGraphicsState;
 use crate::graphics::render_state::RenderState;
 use crate::graphics::util::init_buffer;
 use crate::graphics::window_dressing::WindowDressing;
@@ -29,25 +27,23 @@ pub struct Model {
 
 impl Model {
   pub fn new(permanent: &PermanentGraphicsState,
-             for_reinit: &GraphicsStateForReinit,
              window_dressing: &WindowDressing)
       -> Result<Self>
   {
     let device = &permanent.device;
     let instance = &permanent.instance;
     let graphics_queue = &permanent.graphics_queue;
-    let physical_device = &for_reinit.physical_device;
     let transient_command_pool = &window_dressing.transient_command_pool;
 
     let (vertices, indices) = load_model()?;
     let index_count = indices.len();
 
     let (vertex_buffer, vertex_buffer_memory)
-            = init_vertex_buffer(vertices, instance, physical_device, device,
-                                 graphics_queue, &transient_command_pool)?;
+            = init_vertex_buffer(vertices, instance, device, graphics_queue,
+                                 &transient_command_pool)?;
     let (index_buffer, index_buffer_memory)
-            = init_index_buffer(indices, instance, physical_device, device,
-                                graphics_queue, &transient_command_pool)?;
+            = init_index_buffer(indices, instance, device, graphics_queue,
+                                &transient_command_pool)?;
 
     Ok(Model {
       vertex_buffer,
@@ -121,21 +117,20 @@ impl Model {
 
 
 fn init_vertex_buffer(vertices: Vec<Vertex<f32>>, instance: &Instance,
-                      physical_device: &vk::PhysicalDevice, device: &Device,
-                      queue: &vk::Queue, command_pool: &vk::CommandPool)
+                      device: &Device, queue: &vk::Queue,
+                      command_pool: &vk::CommandPool)
     -> Result<(vk::Buffer, vk::DeviceMemory)>
 {
-  init_buffer(instance, physical_device, device, queue, command_pool,
+  init_buffer(instance, device, queue, command_pool,
               vk::BufferUsageFlags::VERTEX_BUFFER, &vertices)
 }
 
 
-fn init_index_buffer(indices: Vec<u32>, instance: &Instance,
-                     physical_device: &vk::PhysicalDevice, device: &Device,
+fn init_index_buffer(indices: Vec<u32>, instance: &Instance, device: &Device,
                      queue: &vk::Queue, command_pool: &vk::CommandPool)
     -> Result<(vk::Buffer, vk::DeviceMemory)>
 {
-  init_buffer(instance, physical_device, device, queue, command_pool,
+  init_buffer(instance, device, queue, command_pool,
               vk::BufferUsageFlags::INDEX_BUFFER, &indices)
 }