From b52d1be4302e452a45a03595f8c70411a061f920 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Mon, 17 Aug 2026 01:41:16 -0700 Subject: move the texture binding to a push descriptor with a descriptor update template, even yay this also moves us to a minimum Vulkan version of 1.4, which we understand to be widely deployed. in theory, push descriptors and update templates were available via extensions in earlier versions, but it doesn't seem worth doing the work to switch out whether we use the extensions based on the version, so we don't. Force-Push: yes Change-Id: I26db8771abf5626d9614630c66e019ea99babcac --- src/graphics/scene.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/graphics/scene.rs') diff --git a/src/graphics/scene.rs b/src/graphics/scene.rs index f73ebf2..9631dba 100644 --- a/src/graphics/scene.rs +++ b/src/graphics/scene.rs @@ -61,8 +61,24 @@ pub fn generate_scene_commands<'a>(image_index: usize, time: f32, render.pipeline) }; + // Please notice the magic constant 0. This is a zero-based index into + // the array of descriptor set layouts passed to create_pipeline_layout() + // in init_pipeline() in render.rs. + unsafe { + device.cmd_bind_descriptor_sets(*command_buffer, + vk::PipelineBindPoint::GRAPHICS, + render.pipeline_layout, + 0, + &[*descriptor_set], + &[]) + }; + + if let Some(texture) = &render.texture { + texture.make_active(device, render, command_buffer); + } + if let Some(model) = &render.model { - model.render(time, device, render, command_buffer, descriptor_set); + model.render(time, device, render, command_buffer); } unsafe { device.cmd_end_render_pass(*command_buffer) }; -- cgit 1.4.1