diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-08-09 17:36:41 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-08-09 17:53:43 -0700 |
| commit | d672e147db0df6186c528262367770dcde9d75fc (patch) | |
| tree | 58d590891fffec7d5db47e8adf9beb677a5a1356 /src/graphics/model.rs | |
| parent | 4158fed109ae789cb3ca7ff53c2790797a3b4087 (diff) | |
rename and reexport a bunch of graphics state types
the word "graphics" is part of the module name, so it does not need to be part of the struct name the fact that an object holds state is... not strictly implied by the fact it's a struct, but it happens that ALL our objects exist primarily to hold state, so we remove that word as well Force-Push: yes Change-Id: I1b3e2ac0f1c29304e75a190172463aabfba4b3a4
Diffstat (limited to 'src/graphics/model.rs')
| -rw-r--r-- | src/graphics/model.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/graphics/model.rs b/src/graphics/model.rs index 7b912b6..9c62d51 100644 --- a/src/graphics/model.rs +++ b/src/graphics/model.rs @@ -1,7 +1,6 @@ #![deny(unsafe_code)] use crate::error::*; -use crate::graphics::permanent::PermanentGraphicsState; -use crate::graphics::render_state::RenderState; +use crate::graphics::{ Permanent, Render }; use crate::graphics::util::init_buffer; use crate::linear_algebra::{ Vec3, Vec4, Transformation }; use crate::shader_data::{ Vertex, VertexPushBlock }; @@ -25,7 +24,7 @@ pub struct Model { impl Model { pub fn new(vertices: Vec<Vertex<f32>>, indices: Vec<u32>, - permanent: &PermanentGraphicsState) + permanent: &Permanent) -> Result<Self> { let device = &permanent.device; @@ -61,7 +60,7 @@ impl Model { } #[allow(unsafe_code)] - pub fn render(&self, time: f32, device: &Device, render_state: &RenderState, + pub fn render(&self, time: f32, device: &Device, render: &Render, command_buffer: &vk::CommandBuffer, descriptor_set: &vk::DescriptorSet) { @@ -78,7 +77,7 @@ impl Model { unsafe { device.cmd_bind_descriptor_sets(*command_buffer, vk::PipelineBindPoint::GRAPHICS, - render_state.pipeline_layout, + render.pipeline_layout, 0, &[*descriptor_set], &[]) @@ -99,7 +98,7 @@ impl Model { }; unsafe { - device.cmd_push_constants(*command_buffer, render_state.pipeline_layout, + device.cmd_push_constants(*command_buffer, render.pipeline_layout, vk::ShaderStageFlags::VERTEX, 0, push_block_bytes) |