mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 16:24:24 +00:00
Optimize submit() for no command buffers
This commit is contained in:
parent
42a8dc5b34
commit
b84301110c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user