mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-25 08:51:05 +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
@@ -1931,7 +1931,14 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
unsafe {
|
||||
raw.draw(first_vertex, vertex_count, first_instance, instance_count);
|
||||
if instance_count > 0 && vertex_count > 0 {
|
||||
raw.draw(
|
||||
first_vertex,
|
||||
vertex_count,
|
||||
first_instance,
|
||||
instance_count,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
RenderCommand::DrawIndexed {
|
||||
@@ -1972,13 +1979,15 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
unsafe {
|
||||
raw.draw_indexed(
|
||||
first_index,
|
||||
index_count,
|
||||
base_vertex,
|
||||
first_instance,
|
||||
instance_count,
|
||||
);
|
||||
if instance_count > 0 && index_count > 0 {
|
||||
raw.draw_indexed(
|
||||
first_index,
|
||||
index_count,
|
||||
base_vertex,
|
||||
first_instance,
|
||||
instance_count,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
RenderCommand::MultiDrawIndirect {
|
||||
|
||||
Reference in new issue
Block a user