From 30f1b685a91d9857a13b0f5a05ac785ec7c1bce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Marleau?= <59572972+shoebe@users.noreply.github.com> Date: Sun, 10 Jul 2022 18:15:52 -0400 Subject: [PATCH] fix deduplication not taking into account render bundles (#2867) --- CHANGELOG.md | 1 + wgpu-core/src/command/mod.rs | 3 +++ wgpu-core/src/command/render.rs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a02fac589a..f38aacf9b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ Bottom level categories: - Allow running `get_texture_format_features` on unsupported texture formats (returning no flags) by @cwfitzgerald in [#2856](https://github.com/gfx-rs/wgpu/pull/2856) - Allow multi-sampled textures that are supported by the device but not WebGPU if `TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES` is enabled by @cwfitzgerald in [#2856](https://github.com/gfx-rs/wgpu/pull/2856) - `get_texture_format_features` only lists the COPY_* usages if the adapter actually supports that usage by @cwfitzgerald in [#2856](https://github.com/gfx-rs/wgpu/pull/2856) +- Fix bind group / pipeline deduplication not taking into account RenderBundle execution resetting these values by @shoebe [#2867](https://github.com/gfx-rs/wgpu/pull/2867) #### DX12 - `DownlevelCapabilities::default()` now returns the `ANISOTROPIC_FILTERING` flag set to true so DX12 lists `ANISOTROPIC_FILTERING` as true again by @cwfitzgerald in [#2851](https://github.com/gfx-rs/wgpu/pull/2851) diff --git a/wgpu-core/src/command/mod.rs b/wgpu-core/src/command/mod.rs index 99378fd08a..b8246b054f 100644 --- a/wgpu-core/src/command/mod.rs +++ b/wgpu-core/src/command/mod.rs @@ -529,6 +529,9 @@ impl BindGroupStateChange { } false } + fn reset(&mut self) { + self.last_states = [StateChange::new(); hal::MAX_BIND_GROUPS]; + } } impl Default for BindGroupStateChange { diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 50975782bb..df235565f1 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -2454,5 +2454,7 @@ pub mod render_ffi { .commands .push(RenderCommand::ExecuteBundle(bundle_id)); } + pass.current_pipeline.reset(); + pass.current_bind_groups.reset(); } }