Compare commits
2 commits
b8b9bf40a3
...
933b4a5979
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
933b4a5979 | ||
|
|
a297dd94da |
|
|
@ -631,7 +631,6 @@ pub fn egui_pass(
|
||||||
|
|
||||||
let record: Box<RecordFn> = Box::new({
|
let record: Box<RecordFn> = Box::new({
|
||||||
let pipeline = egui_state.pipeline.clone();
|
let pipeline = egui_state.pipeline.clone();
|
||||||
let pipeline_layout = egui_state.pipeline_layout.clone();
|
|
||||||
let descriptor_set = egui_state.descriptor_set;
|
let descriptor_set = egui_state.descriptor_set;
|
||||||
let screen_rect = egui.screen_rect();
|
let screen_rect = egui.screen_rect();
|
||||||
|
|
||||||
|
|
@ -733,7 +732,7 @@ pub fn egui_pass(
|
||||||
cmd.bind_indices(indices.raw(), 0, vk::IndexType::UINT32);
|
cmd.bind_indices(indices.raw(), 0, vk::IndexType::UINT32);
|
||||||
cmd.bind_vertex_buffers(&[vertices.raw()], &[0]);
|
cmd.bind_vertex_buffers(&[vertices.raw()], &[0]);
|
||||||
cmd.push_constants(
|
cmd.push_constants(
|
||||||
&pipeline_layout,
|
pipeline.layout(),
|
||||||
vk::ShaderStageFlags::VERTEX,
|
vk::ShaderStageFlags::VERTEX,
|
||||||
0,
|
0,
|
||||||
bytemuck::cast_slice(
|
bytemuck::cast_slice(
|
||||||
|
|
@ -741,7 +740,7 @@ pub fn egui_pass(
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
cmd.bind_descriptor_sets(
|
cmd.bind_descriptor_sets(
|
||||||
&pipeline_layout,
|
pipeline.layout(),
|
||||||
vk::PipelineBindPoint::GRAPHICS,
|
vk::PipelineBindPoint::GRAPHICS,
|
||||||
&[descriptor_set],
|
&[descriptor_set],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -690,7 +690,6 @@ pub struct EguiState {
|
||||||
descriptor_set: vk::DescriptorSet,
|
descriptor_set: vk::DescriptorSet,
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
descriptor_layout: pipeline::DescriptorSetLayout,
|
descriptor_layout: pipeline::DescriptorSetLayout,
|
||||||
pipeline_layout: Arc<pipeline::PipelineLayout>,
|
|
||||||
pipeline: Arc<pipeline::Pipeline>,
|
pipeline: Arc<pipeline::Pipeline>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -789,7 +788,7 @@ impl EguiState {
|
||||||
Result::Ok((descriptor_pool, descriptor_layout, sets))
|
Result::Ok((descriptor_pool, descriptor_layout, sets))
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let pipeline_layout = pipeline::PipelineLayout::new(
|
let pipeline_layout = Arc::new(pipeline::PipelineLayout::new(
|
||||||
device.clone(),
|
device.clone(),
|
||||||
pipeline::PipelineLayoutDesc {
|
pipeline::PipelineLayoutDesc {
|
||||||
descriptor_set_layouts: &[&descriptor_layout],
|
descriptor_set_layouts: &[&descriptor_layout],
|
||||||
|
|
@ -800,7 +799,7 @@ impl EguiState {
|
||||||
}],
|
}],
|
||||||
name: Some("egui-pipeline-layout".into()),
|
name: Some("egui-pipeline-layout".into()),
|
||||||
},
|
},
|
||||||
)?;
|
)?);
|
||||||
|
|
||||||
let frag_shader = pipeline::ShaderModule::new_from_path(
|
let frag_shader = pipeline::ShaderModule::new_from_path(
|
||||||
device.clone(),
|
device.clone(),
|
||||||
|
|
@ -831,7 +830,7 @@ impl EguiState {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
render_pass: None,
|
render_pass: None,
|
||||||
layout: &pipeline_layout,
|
layout: pipeline_layout,
|
||||||
subpass: None,
|
subpass: None,
|
||||||
base_pipeline: None,
|
base_pipeline: None,
|
||||||
vertex_input: Some(pipeline::VertexInputState {
|
vertex_input: Some(pipeline::VertexInputState {
|
||||||
|
|
@ -915,7 +914,6 @@ impl EguiState {
|
||||||
descriptor_layout,
|
descriptor_layout,
|
||||||
descriptor_set: sets[0],
|
descriptor_set: sets[0],
|
||||||
pipeline: Arc::new(pipeline),
|
pipeline: Arc::new(pipeline),
|
||||||
pipeline_layout: Arc::new(pipeline_layout),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -773,6 +773,9 @@ impl Pipeline {
|
||||||
pub fn bind_point(&self) -> vk::PipelineBindPoint {
|
pub fn bind_point(&self) -> vk::PipelineBindPoint {
|
||||||
self.bind_point
|
self.bind_point
|
||||||
}
|
}
|
||||||
|
pub fn layout(&self) -> &Arc<PipelineLayout> {
|
||||||
|
&self.layout
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) mod pipeline_cache {
|
pub(crate) mod pipeline_cache {
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
device::DeviceOwned,
|
device::DeviceOwned,
|
||||||
|
pipeline::Pipeline,
|
||||||
render_graph::recorder::{CommandRecorder, SideEffectMap},
|
render_graph::recorder::{CommandRecorder, SideEffectMap},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -318,18 +319,26 @@ impl Command for EndRendering {
|
||||||
fn apply(self, _recorder: &mut CommandRecorder) {}
|
fn apply(self, _recorder: &mut CommandRecorder) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct BindPipeline;
|
pub struct BindPipeline<'cmd>(pub &'cmd Pipeline);
|
||||||
|
|
||||||
impl Command for BindPipeline {
|
impl<'cmd> Command for BindPipeline<'cmd> {
|
||||||
fn side_effects(&self, _map: SideEffectMap) {
|
fn side_effects(&self, _map: SideEffectMap) {
|
||||||
// No resource access, but affects the pipeline state
|
// No resource access, but affects the pipeline state
|
||||||
}
|
}
|
||||||
|
|
||||||
fn apply(self, _recorder: &mut CommandRecorder) {}
|
fn apply(self, recorder: &mut CommandRecorder) {
|
||||||
|
let cmd = recorder.cmd_buffer();
|
||||||
|
let dev = &cmd.device().raw;
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
dev.cmd_bind_pipeline(cmd.raw(), self.0.bind_point(), self.0.raw());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct BindVertexBuffers {
|
pub struct BindVertexBuffers {
|
||||||
pub buffers: Vec<BufferSlice>,
|
pub buffers: Vec<BufferSlice>,
|
||||||
|
pub first_binding: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Command for BindVertexBuffers {
|
impl Command for BindVertexBuffers {
|
||||||
|
|
@ -343,7 +352,26 @@ impl Command for BindVertexBuffers {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn apply(self, _recorder: &mut CommandRecorder) {}
|
fn apply(self, recorder: &mut CommandRecorder) {
|
||||||
|
let cmd = recorder.cmd_buffer();
|
||||||
|
let dev = &cmd.device().raw;
|
||||||
|
|
||||||
|
let buffers = self
|
||||||
|
.buffers
|
||||||
|
.iter()
|
||||||
|
.map(|buffer| recorder.get_buffer_handle(buffer.id()))
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
let offsets = self
|
||||||
|
.buffers
|
||||||
|
.iter()
|
||||||
|
.map(|buffer| buffer.range.offset)
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
dev.cmd_bind_vertex_buffers(cmd.raw(), self.first_binding, &buffers, &offsets);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct BindIndexBuffer(pub BufferSlice, pub IndexFormat);
|
pub struct BindIndexBuffer(pub BufferSlice, pub IndexFormat);
|
||||||
|
|
@ -354,17 +382,50 @@ impl Command for BindIndexBuffer {
|
||||||
.side_effect(map.reborrow(), vk::AccessFlags2::INDEX_READ, None);
|
.side_effect(map.reborrow(), vk::AccessFlags2::INDEX_READ, None);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn apply(self, _recorder: &mut CommandRecorder) {}
|
fn apply(self, recorder: &mut CommandRecorder) {
|
||||||
|
let cmd = recorder.cmd_buffer();
|
||||||
|
let dev = &cmd.device().raw;
|
||||||
|
|
||||||
|
let buffer = recorder.get_buffer_handle(self.0.id());
|
||||||
|
let index_type = match self.1 {
|
||||||
|
IndexFormat::Uint8 => vk::IndexType::UINT8_KHR,
|
||||||
|
IndexFormat::Uint16 => vk::IndexType::UINT16,
|
||||||
|
IndexFormat::Uint32 => vk::IndexType::UINT32,
|
||||||
|
};
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
dev.cmd_bind_index_buffer(cmd.raw(), buffer, self.0.range.offset, index_type);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct BindDescriptorSets;
|
pub struct BindDescriptorSets {
|
||||||
|
pub first_set: u32,
|
||||||
|
pub pipeline_layout: vk::PipelineLayout,
|
||||||
|
pub bind_point: vk::PipelineBindPoint,
|
||||||
|
pub sets: Vec<vk::DescriptorSet>,
|
||||||
|
}
|
||||||
|
|
||||||
impl Command for BindDescriptorSets {
|
impl Command for BindDescriptorSets {
|
||||||
fn side_effects(&self, _map: SideEffectMap) {
|
fn side_effects(&self, _map: SideEffectMap) {
|
||||||
// No resource access, but affects the descriptor set state
|
// No resource access, but affects the descriptor set state
|
||||||
}
|
}
|
||||||
|
|
||||||
fn apply(self, _recorder: &mut CommandRecorder) {}
|
fn apply(self, recorder: &mut CommandRecorder) {
|
||||||
|
let cmd = recorder.cmd_buffer();
|
||||||
|
let dev = &cmd.device().raw;
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
dev.cmd_bind_descriptor_sets(
|
||||||
|
cmd.raw(),
|
||||||
|
self.bind_point,
|
||||||
|
self.pipeline_layout,
|
||||||
|
self.first_set,
|
||||||
|
&self.sets,
|
||||||
|
&[],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SetViewport {
|
pub struct SetViewport {
|
||||||
|
|
@ -399,14 +460,32 @@ impl Command for SetScissor {
|
||||||
fn apply(self, _recorder: &mut CommandRecorder) {}
|
fn apply(self, _recorder: &mut CommandRecorder) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct PushConstants;
|
pub struct PushConstants {
|
||||||
|
pub pipeline_layout: vk::PipelineLayout,
|
||||||
|
pub stage_flags: vk::ShaderStageFlags,
|
||||||
|
pub offset: u32,
|
||||||
|
pub data: Vec<u8>,
|
||||||
|
}
|
||||||
|
|
||||||
impl Command for PushConstants {
|
impl Command for PushConstants {
|
||||||
fn side_effects(&self, _map: SideEffectMap) {
|
fn side_effects(&self, _map: SideEffectMap) {
|
||||||
// No resource access, but affects the push constant state
|
// No resource access, but affects the push constant state
|
||||||
}
|
}
|
||||||
|
|
||||||
fn apply(self, _recorder: &mut CommandRecorder) {}
|
fn apply(self, recorder: &mut CommandRecorder) {
|
||||||
|
let cmd = recorder.cmd_buffer();
|
||||||
|
let dev = &cmd.device().raw;
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
dev.cmd_push_constants(
|
||||||
|
cmd.raw(),
|
||||||
|
self.pipeline_layout,
|
||||||
|
self.stage_flags,
|
||||||
|
self.offset,
|
||||||
|
&self.data,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct DrawData {
|
pub struct DrawData {
|
||||||
|
|
@ -523,8 +602,8 @@ impl<T: Resource, U: Resource> OutsideRenderPass for Copy<T, U> {}
|
||||||
impl OutsideRenderPass for ClearTexture {}
|
impl OutsideRenderPass for ClearTexture {}
|
||||||
impl OutsideRenderPass for UpdateBuffer {}
|
impl OutsideRenderPass for UpdateBuffer {}
|
||||||
|
|
||||||
impl InsideRenderPass for BindPipeline {}
|
impl InsideRenderPass for BindPipeline<'_> {}
|
||||||
impl OutsideRenderPass for BindPipeline {}
|
impl OutsideRenderPass for BindPipeline<'_> {}
|
||||||
impl InsideRenderPass for BindVertexBuffers {}
|
impl InsideRenderPass for BindVertexBuffers {}
|
||||||
impl OutsideRenderPass for BindVertexBuffers {}
|
impl OutsideRenderPass for BindVertexBuffers {}
|
||||||
impl InsideRenderPass for BindIndexBuffer {}
|
impl InsideRenderPass for BindIndexBuffer {}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use std::{
|
use std::{
|
||||||
collections::{BTreeMap, BTreeSet},
|
collections::{BTreeMap, BTreeSet},
|
||||||
|
marker::PhantomData,
|
||||||
mem::{MaybeUninit, size_of},
|
mem::{MaybeUninit, size_of},
|
||||||
ptr::NonNull,
|
ptr::NonNull,
|
||||||
};
|
};
|
||||||
|
|
@ -96,37 +97,40 @@ impl<'a> SideEffectMap<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct CommandList {
|
pub struct CommandList<'cmd> {
|
||||||
command_bytes: Vec<MaybeUninit<u8>>,
|
command_bytes: Vec<MaybeUninit<u8>>,
|
||||||
cursor: usize,
|
cursor: usize,
|
||||||
// each command that accesses a resource adds an entry to this map (id, command_index) -> access
|
// each command that accesses a resource adds an entry to this map (id, command_index) -> access
|
||||||
// during command recording, we fold accesses to the same resource as commands are recorded, and when a command reads a resource, we check for any previous writes to be made available/visible
|
// during command recording, we fold accesses to the same resource as commands are recorded, and when a command reads a resource, we check for any previous writes to be made available/visible
|
||||||
side_effects: SideEffects,
|
side_effects: SideEffects,
|
||||||
num_commands: u32,
|
num_commands: u32,
|
||||||
|
|
||||||
|
_pd: PhantomData<fn(&'cmd ())>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub struct RenderPass<'a> {
|
pub struct RenderPass<'cmd, 'a> {
|
||||||
cmd_list: &'a mut CommandList,
|
cmd_list: &'a mut CommandList<'cmd>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> RenderPass<'a> {
|
impl<'cmd, 'a> RenderPass<'cmd, 'a> {
|
||||||
pub fn finalise(self) {
|
pub fn finalise(self) {
|
||||||
self.cmd_list.push_inner(super::commands::EndRendering);
|
self.cmd_list.push_inner(super::commands::EndRendering);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn push<C: Command + InsideRenderPass>(&mut self, command: C) {
|
pub fn push<C: Command + InsideRenderPass + 'cmd>(&mut self, command: C) {
|
||||||
self.cmd_list.push_inner(command);
|
self.cmd_list.push_inner(command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CommandList {
|
impl<'cmd> CommandList<'cmd> {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
command_bytes: Vec::new(),
|
command_bytes: Vec::new(),
|
||||||
cursor: 0,
|
cursor: 0,
|
||||||
side_effects: SideEffects::default(),
|
side_effects: SideEffects::default(),
|
||||||
num_commands: 0,
|
num_commands: 0,
|
||||||
|
_pd: PhantomData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,7 +141,7 @@ impl CommandList {
|
||||||
stencil_attachment: Option<TextureRegion>,
|
stencil_attachment: Option<TextureRegion>,
|
||||||
area: (u32, u32),
|
area: (u32, u32),
|
||||||
layers: u32,
|
layers: u32,
|
||||||
) -> RenderPass<'_> {
|
) -> RenderPass<'cmd, '_> {
|
||||||
self.push(super::commands::BeginRendering {
|
self.push(super::commands::BeginRendering {
|
||||||
color_attachments,
|
color_attachments,
|
||||||
depth_attachment,
|
depth_attachment,
|
||||||
|
|
@ -148,7 +152,7 @@ impl CommandList {
|
||||||
RenderPass { cmd_list: self }
|
RenderPass { cmd_list: self }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn push<C: Command + OutsideRenderPass>(&mut self, command: C) {
|
pub fn push<C: Command + OutsideRenderPass + 'cmd>(&mut self, command: C) {
|
||||||
self.push_inner(command);
|
self.push_inner(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -258,9 +258,6 @@ mod impls {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Pipeline;
|
|
||||||
pub struct DescriptorSet;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||||
pub struct ResourceId(pub u32);
|
pub struct ResourceId(pub u32);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ pub struct Wireframe {
|
||||||
num_indices: u32,
|
num_indices: u32,
|
||||||
colors: Arc<Buffer>,
|
colors: Arc<Buffer>,
|
||||||
pipeline: Arc<pipeline::Pipeline>,
|
pipeline: Arc<pipeline::Pipeline>,
|
||||||
layout: Arc<pipeline::PipelineLayout>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Wireframe {
|
impl Wireframe {
|
||||||
|
|
@ -168,7 +167,7 @@ impl Wireframe {
|
||||||
Arc::new(sync::Fence::from_pool(&dev.pools.fences, None)?),
|
Arc::new(sync::Fence::from_pool(&dev.pools.fences, None)?),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let (pipeline, layout) = Self::create_pipeline(dev.clone())?;
|
let pipeline = Self::create_pipeline(dev.clone())?;
|
||||||
|
|
||||||
future.await;
|
future.await;
|
||||||
|
|
||||||
|
|
@ -177,13 +176,12 @@ impl Wireframe {
|
||||||
indices: Arc::new(indices),
|
indices: Arc::new(indices),
|
||||||
colors: Arc::new(colors),
|
colors: Arc::new(colors),
|
||||||
pipeline: Arc::new(pipeline),
|
pipeline: Arc::new(pipeline),
|
||||||
layout: Arc::new(layout),
|
|
||||||
num_indices,
|
num_indices,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_pipeline(device: Device) -> Result<(pipeline::Pipeline, pipeline::PipelineLayout)> {
|
fn create_pipeline(device: Device) -> Result<pipeline::Pipeline> {
|
||||||
let pipeline_layout = pipeline::PipelineLayout::new(
|
let pipeline_layout = Arc::new(pipeline::PipelineLayout::new(
|
||||||
device.clone(),
|
device.clone(),
|
||||||
pipeline::PipelineLayoutDesc {
|
pipeline::PipelineLayoutDesc {
|
||||||
descriptor_set_layouts: &[],
|
descriptor_set_layouts: &[],
|
||||||
|
|
@ -194,7 +192,7 @@ impl Wireframe {
|
||||||
}],
|
}],
|
||||||
name: Some("wireframe-pipeline-layout".into()),
|
name: Some("wireframe-pipeline-layout".into()),
|
||||||
},
|
},
|
||||||
)?;
|
)?);
|
||||||
|
|
||||||
let shader = pipeline::ShaderModule::new_from_path(
|
let shader = pipeline::ShaderModule::new_from_path(
|
||||||
device.clone(),
|
device.clone(),
|
||||||
|
|
@ -221,7 +219,7 @@ impl Wireframe {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
render_pass: None,
|
render_pass: None,
|
||||||
layout: &pipeline_layout,
|
layout: pipeline_layout,
|
||||||
subpass: None,
|
subpass: None,
|
||||||
base_pipeline: None,
|
base_pipeline: None,
|
||||||
vertex_input: Some(pipeline::VertexInputState {
|
vertex_input: Some(pipeline::VertexInputState {
|
||||||
|
|
@ -301,7 +299,7 @@ impl Wireframe {
|
||||||
},
|
},
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
Ok((pipeline, pipeline_layout))
|
Ok(pipeline)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn pass(&self, rg: &mut RenderGraph, target: GraphResourceId) -> Result<()> {
|
pub fn pass(&self, rg: &mut RenderGraph, target: GraphResourceId) -> Result<()> {
|
||||||
|
|
@ -315,7 +313,6 @@ impl Wireframe {
|
||||||
let num_indices = self.num_indices;
|
let num_indices = self.num_indices;
|
||||||
|
|
||||||
let pipeline = self.pipeline.clone();
|
let pipeline = self.pipeline.clone();
|
||||||
let layout = self.layout.clone();
|
|
||||||
|
|
||||||
move |ctx: &RenderContext| -> Result<()> {
|
move |ctx: &RenderContext| -> Result<()> {
|
||||||
let target = ctx.get_image(target).unwrap();
|
let target = ctx.get_image(target).unwrap();
|
||||||
|
|
@ -361,7 +358,7 @@ impl Wireframe {
|
||||||
cmd.bind_indices(indices.raw(), 0, vk::IndexType::UINT32);
|
cmd.bind_indices(indices.raw(), 0, vk::IndexType::UINT32);
|
||||||
cmd.bind_vertex_buffers(&[positions.raw(), colors.raw()], &[0, 0]);
|
cmd.bind_vertex_buffers(&[positions.raw(), colors.raw()], &[0, 0]);
|
||||||
cmd.push_constants(
|
cmd.push_constants(
|
||||||
&layout,
|
&pipeline.layout(),
|
||||||
vk::ShaderStageFlags::VERTEX,
|
vk::ShaderStageFlags::VERTEX,
|
||||||
0,
|
0,
|
||||||
bytemuck::cast_slice(&[to_clip]),
|
bytemuck::cast_slice(&[to_clip]),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue