summaryrefslogtreecommitdiffstats
path: root/src/wgpuctx
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-04-30 10:06:32 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-04-30 10:06:32 -0400
commit961f8c6d405c9c6fcf9aaf4fb6f199b0e5c60d88 (patch)
treea26797d6314fa8c193a459e988427c7bfe7f19a7 /src/wgpuctx
parent25255a8b9147d27aa40b28d6aadb62c0ab275d32 (diff)
downloadsystemic4x-961f8c6d405c9c6fcf9aaf4fb6f199b0e5c60d88.tar.gz
systemic4x-961f8c6d405c9c6fcf9aaf4fb6f199b0e5c60d88.tar.bz2
systemic4x-961f8c6d405c9c6fcf9aaf4fb6f199b0e5c60d88.zip
add orbit rendering for bodies
Diffstat (limited to 'src/wgpuctx')
-rw-r--r--src/wgpuctx/pipeline.rs19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/wgpuctx/pipeline.rs b/src/wgpuctx/pipeline.rs
index 0811800..d698ac4 100644
--- a/src/wgpuctx/pipeline.rs
+++ b/src/wgpuctx/pipeline.rs
@@ -14,7 +14,8 @@ pub struct RenderPipelineBuilder<'a>
vertex_buffer_layouts: Vec<wgpu::VertexBufferLayout<'a>>,
- cull_mode: Option<wgpu::Face>
+ cull_mode: Option<wgpu::Face>,
+ primitive_topology: wgpu::PrimitiveTopology
}
impl<'a> RenderPipelineBuilder<'a>
@@ -34,7 +35,8 @@ impl<'a> RenderPipelineBuilder<'a>
vertex_buffer_layouts: Vec::new(),
- cull_mode: Some(wgpu::Face::Back)
+ cull_mode: Some(wgpu::Face::Back),
+ primitive_topology: wgpu::PrimitiveTopology::TriangleList
}
}
@@ -61,6 +63,13 @@ impl<'a> RenderPipelineBuilder<'a>
self.cull_mode = mode; self
}
+ pub fn primitive_topology(
+ mut self,
+ topology: wgpu::PrimitiveTopology
+ ) -> Self {
+ self.primitive_topology = topology; self
+ }
+
pub fn build(
self,
label: Option<&'static str>,
@@ -109,8 +118,10 @@ impl<'a> RenderPipelineBuilder<'a>
})],
}),
primitive: wgpu::PrimitiveState {
- topology: wgpu::PrimitiveTopology::TriangleList,
- strip_index_format: None,
+ topology: self.primitive_topology,
+ strip_index_format: if self.primitive_topology.is_strip() {
+ Some(wgpu::IndexFormat::Uint32) } else {
+ None },
front_face: wgpu::FrontFace::Ccw,
cull_mode: self.cull_mode,
polygon_mode: wgpu::PolygonMode::Fill,