mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-24 08:21:25 +01:00
Discard draws when the instance/vertex/index count is zero (#5137)
This commit is contained in:
1 parent
efb35d4fa1
commit
d47534ed9a
2 files changed
+30
-15
No files matched your search
@@ -514,9 +514,12 @@ impl RenderBundleEncoder {
|
||||
})
|
||||
.map_pass_err(scope);
|
||||
}
|
||||
commands.extend(state.flush_vertices());
|
||||
commands.extend(state.flush_binds(used_bind_groups, base.dynamic_offsets));
|
||||
commands.push(command);
|
||||
|
||||
if instance_count > 0 && vertex_count > 0 {
|
||||
commands.extend(state.flush_vertices());
|
||||
commands.extend(state.flush_binds(used_bind_groups, base.dynamic_offsets));
|
||||
commands.push(command);
|
||||
}
|
||||
}
|
||||
RenderCommand::DrawIndexed {
|
||||
index_count,
|
||||
@@ -556,10 +559,13 @@ impl RenderBundleEncoder {
|
||||
})
|
||||
.map_pass_err(scope);
|
||||
}
|
||||
commands.extend(state.flush_index());
|
||||
commands.extend(state.flush_vertices());
|
||||
commands.extend(state.flush_binds(used_bind_groups, base.dynamic_offsets));
|
||||
commands.push(command);
|
||||
|
||||
if instance_count > 0 && index_count > 0 {
|
||||
commands.extend(state.flush_index());
|
||||
commands.extend(state.flush_vertices());
|
||||
commands.extend(state.flush_binds(used_bind_groups, base.dynamic_offsets));
|
||||
commands.push(command);
|
||||
}
|
||||
}
|
||||
RenderCommand::MultiDrawIndirect {
|
||||
buffer_id,
|
||||
|
||||
Reference in new issue
Block a user