Skip to content

Commit 205ae64

Browse files
authored
Force serial command encoding on Linux/amdvlk (#18368)
# Objective Fixes #18366 which seems to have a similar underlying cause than the already closed (but not fixed) #16185. ## Solution For Windows with the AMD vulkan driver, there was already a hack to force serial command encoding, which prevented these issues. The Linux version of the AMD vulkan driver seems to have similar issues than its Windows counterpart, so I extended the hack to also cover AMD on Linux. I also removed the mention of `wgpu` since it was already outdated, and doesn't seem to be relevant to the core issue (the AMD driver being buggy). ## Testing - Did you test these changes? If so, how? - I ran the `3d_scene` example, which on `main` produced the flickering shadows on Linux with the amdvlk driver, while it no longer does with the workaround applied. - Are there any parts that need more testing? - Not sure. - How can other people (reviewers) test your changes? Is there anything specific they need to know? - Requires a Linux system with an AMD card and the AMDVLK driver. - If relevant, what platforms did you test these changes on, and are there any important ones you can't test? - My change should only affect Linux, where I did test it.
1 parent ce392fa commit 205ae64

File tree

1 file changed

+3
-2
lines changed
  • crates/bevy_render/src/renderer

1 file changed

+3
-2
lines changed

crates/bevy_render/src/renderer/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,12 +391,13 @@ impl<'w> RenderContext<'w> {
391391
adapter_info: AdapterInfo,
392392
diagnostics_recorder: Option<DiagnosticsRecorder>,
393393
) -> Self {
394-
// HACK: Parallel command encoding is currently bugged on AMD + Windows + Vulkan with wgpu 0.19.1
395-
#[cfg(target_os = "windows")]
394+
// HACK: Parallel command encoding is currently bugged on AMD + Windows/Linux + Vulkan
395+
#[cfg(any(target_os = "windows", target_os = "linux"))]
396396
let force_serial =
397397
adapter_info.driver.contains("AMD") && adapter_info.backend == wgpu::Backend::Vulkan;
398398
#[cfg(not(any(
399399
target_os = "windows",
400+
target_os = "linux",
400401
all(target_arch = "wasm32", target_feature = "atomics")
401402
)))]
402403
let force_serial = {

0 commit comments

Comments
 (0)