Remove duplicate call to set_vertex_buffer(0, ...) in shader_instancing example (#3738)

## Objective

The [`DrawMeshInstanced`] command in the example sets vertex buffer 0 twice, with two identical calls to:

```rs
pass.set_vertex_buffer(0, gpu_mesh.vertex_buffer.slice(..));
```

## Solution

Remove the second call as it is unecessary.

[`DrawMeshInstanced`]: f3de12bc5e/examples/shader/shader_instancing.rs (L217-L258)
This commit is contained in:
Gwen 2022-02-04 03:37:40 +00:00
parent b7dfe1677f
commit b11ee3ffb8

View File

@ -239,7 +239,6 @@ impl EntityRenderCommand for DrawMeshInstanced {
pass.set_vertex_buffer(0, gpu_mesh.vertex_buffer.slice(..));
pass.set_vertex_buffer(1, instance_buffer.buffer.slice(..));
pass.set_vertex_buffer(0, gpu_mesh.vertex_buffer.slice(..));
match &gpu_mesh.buffer_info {
GpuBufferInfo::Indexed {
buffer,
@ -250,7 +249,7 @@ impl EntityRenderCommand for DrawMeshInstanced {
pass.draw_indexed(0..*count, 0, 0..instance_buffer.length as u32);
}
GpuBufferInfo::NonIndexed { vertex_count } => {
pass.draw_indexed(0..*vertex_count, 0, 0..instance_buffer.length as u32);
pass.draw(0..*vertex_count, 0..instance_buffer.length as u32);
}
}
RenderCommandResult::Success