mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-28 09:09:19 +01:00
Optimize submit() for no command buffers
This commit is contained in:
1 parent
42a8dc5b34
commit
b84301110c
2 files changed
+4
-1
No files matched your search
@@ -294,6 +294,9 @@ impl GlobalPlay for wgc::hub::Global<IdentityPassThroughFactory> {
|
||||
self.queue_write_texture::<B>(device, &to, &bin, &layout, &size)
|
||||
.unwrap();
|
||||
}
|
||||
A::Submit(_index, ref commands) if commands.is_empty() => {
|
||||
self.queue_submit::<B>(device, &[]).unwrap();
|
||||
}
|
||||
A::Submit(_index, commands) => {
|
||||
let (encoder, error) = self.device_create_command_encoder::<B>(
|
||||
device,
|
||||
|
||||
@@ -483,7 +483,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let (mut swap_chain_guard, mut token) = hub.swap_chains.write(&mut token);
|
||||
let (mut command_buffer_guard, mut token) = hub.command_buffers.write(&mut token);
|
||||
|
||||
{
|
||||
if !command_buffer_ids.is_empty() {
|
||||
let (bind_group_guard, mut token) = hub.bind_groups.read(&mut token);
|
||||
let (compute_pipe_guard, mut token) = hub.compute_pipelines.read(&mut token);
|
||||
let (render_pipe_guard, mut token) = hub.render_pipelines.read(&mut token);
|
||||
|
||||
Reference in new issue
Block a user