mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-23 16:01:04 +01:00
[wgpu] make vertex buffer slots optional
This commit is contained in:
1 parent
35fd939877
commit
67b4f3c7e5
28 files changed
+143
-126
No files matched your search
@@ -438,11 +438,11 @@ impl crate::framework::Example for Example {
|
||||
});
|
||||
|
||||
let vertex_attr = wgpu::vertex_attr_array![0 => Sint8x4, 1 => Sint8x4];
|
||||
let vb_desc = wgpu::VertexBufferLayout {
|
||||
let vertex_buffers = [Some(wgpu::VertexBufferLayout {
|
||||
array_stride: vertex_size as wgpu::BufferAddress,
|
||||
step_mode: wgpu::VertexStepMode::Vertex,
|
||||
attributes: &vertex_attr,
|
||||
};
|
||||
})];
|
||||
|
||||
let shader = device.create_shader_module(wgpu::include_wgsl!("shader.wgsl"));
|
||||
|
||||
@@ -494,7 +494,7 @@ impl crate::framework::Example for Example {
|
||||
module: &shader,
|
||||
entry_point: Some("vs_bake"),
|
||||
compilation_options: Default::default(),
|
||||
buffers: std::slice::from_ref(&vb_desc),
|
||||
buffers: &vertex_buffers,
|
||||
},
|
||||
fragment: None,
|
||||
primitive: wgpu::PrimitiveState {
|
||||
@@ -628,7 +628,7 @@ impl crate::framework::Example for Example {
|
||||
module: &shader,
|
||||
entry_point: Some("vs_main"),
|
||||
compilation_options: Default::default(),
|
||||
buffers: &[vb_desc],
|
||||
buffers: &vertex_buffers,
|
||||
},
|
||||
fragment: Some(wgpu::FragmentState {
|
||||
module: &shader,
|
||||
|
||||
Reference in new issue
Block a user