fixes vertice and index creation in geometry shader mode

This commit is contained in:
zomseffen 2024-06-02 15:44:38 +02:00
parent a9d4aae1bc
commit 0f2747293f
3 changed files with 5 additions and 2 deletions

View file

@ -53,4 +53,6 @@ pub struct AppData {
pub color_image_memory: vk::DeviceMemory,
pub color_image_view: vk::ImageView,
pub use_geometry_shader: bool,
pub topology: vk::PrimitiveTopology,
}

View file

@ -162,7 +162,7 @@ impl App {
let loader = LibloadingLoader::new(LIBRARY)?;
let entry = Entry::new(loader).map_err(|b| anyhow!("{}", b))?;
let mut data = app_data::AppData::default();
data.use_geometry_shader = false;
data.use_geometry_shader = true;
let mut scene_handler = scene::Scene::default();
//load_model::load_model(&mut data)?;
@ -676,6 +676,7 @@ unsafe fn create_pipeline(device: &Device, data: &mut app_data::AppData) -> Resu
if data.use_geometry_shader {
topology = vk::PrimitiveTopology::POINT_LIST;
}
data.topology = topology;
let input_assembly_state = vk::PipelineInputAssemblyStateCreateInfo::builder()
.topology(topology)

View file

@ -37,7 +37,7 @@ impl Scene {
tex_coord: vec2(0.0, 0.0)
};
cube.draw(&vk::PrimitiveTopology::TRIANGLE_LIST, index, self);
cube.draw(&data.topology, index, self);
}
}