Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken rendering in examples on intel graphics #8037

Open
KategoryBee opened this issue Mar 11, 2023 · 14 comments · Fixed by gfx-rs/wgpu#4602
Open

Broken rendering in examples on intel graphics #8037

KategoryBee opened this issue Mar 11, 2023 · 14 comments · Fixed by gfx-rs/wgpu#4602
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Regression Functionality that used to work but no longer does. Add a test for this!

Comments

@KategoryBee
Copy link

KategoryBee commented Mar 11, 2023

Bevy version

v0.10.0

[Optional] Relevant system information

The system is a Dell XPS 13 7390 2-in-1 running windows.

2023-03-11T05:22:43.409198Z  INFO bevy_winit::system: Creating new window "Bevy App" (0v0)
2023-03-11T05:22:44.121756Z  INFO bevy_render::renderer: AdapterInfo { name: "Intel(R) Iris(R) Plus Graphics", vendor: 32902, device: 35410, device_type: IntegratedGpu, driver: "Intel Corporation", driver_info: "Intel driver", backend: Vulkan }
2023-03-11T05:22:45.181282Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 11 Home", kernel: "22621", cpu: "Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz", core_count: "4", memory: "7.8 GiB" }

What you did

Ran cargo run --example breakout.

Also occurs with other examples, and in release builds, but the breakout one seems to be the most interesting broken output.

What went wrong

The blocks, paddle, and ball don't render, but the score does. The game plays as normal, with score going up and with correct sound.

A few other examples i've tried only render a grey screen, but some seem to work

image

Additional Information

Possibly related to #6746 ? Am happy to try and debug on my end by running tools etc.

Additionally, a simple game I was testing/building on my own computer seems to render correctly

@ZeeQyu
Copy link

ZeeQyu commented Mar 11, 2023

The same issue presents on my machine.
Running sprite and breakout on 0.9 looks normal, but on 0.10 everything I think is a sprite is just gone.
Game logic still seems to be fine, sounds play and the score counter increments.

In my own game project, egui-based menus are rendering fine, but sprites aren't, regardless of if they have textures or not.

HP Elitebook 840 G8
i5-1145G7
Intel Iris Xe Graphics

Some images for comparing 0.9.1 and 0.10.0 behaviour

Bevy 0.10 breakout: https://user-images.githubusercontent.com/4976122/224508322-50e96e0b-ff4f-4cff-8787-8c734383dbcf.PNG

Bevy 0.10 sprite: https://user-images.githubusercontent.com/4976122/224508323-2ad6d212-cc2a-48e6-b936-bc9e469d2a14.PNG

Bevy 0.9 breakout: https://user-images.githubusercontent.com/4976122/224508324-49cb497a-a327-4412-a9ca-8c11280da577.PNG

Bevy 0.10 sprite: https://user-images.githubusercontent.com/4976122/224508325-92dd6d56-7b8d-4676-a226-a72ad5e4055c.PNG

@KategoryBee
Copy link
Author

Played around with it more. Changing to the Dx12 backend via $Env:WGPU_BACKEND="dx12" fixes the breakout example, and gets visuals in all other examples I tested.

Sometimes they're a bit broken, though:

Odd shadows in shapes example

Should I report this upstream to wgpu?

@KategoryBee
Copy link
Author

Updating graphics drivers fixed the issue. Apologies.

@ZeeQyu
Copy link

ZeeQyu commented Mar 12, 2023

I disagree with the closing of this issue. If something worked for a specific version of a graphics driver in 0.9, and it doesn't work in 0.10, that's a regression, and something that can bother players of our games that don't necessarily know how to update their drivers. If there was a way for bevy to work for these driver versions on 0.9, there will be a way for bevy to work for these driver versions on 0.10.

@TheoDulka
Copy link

TheoDulka commented Mar 12, 2023

I also had this issue and I agree it shouldn't be closed for the same reasons @ZeeQyu states.
I narrowed the regression down to the commit bfd1d4b where it updates wgpu from 0.14.0 to 0.15.0

But the issue isn't with wgpu, as I can run wgpu's examples with no problems in both versions (using Vulkan backend).
Though I don't know why the commit breaks wgpu's rendering while using an older intel graphics driver.

After updating my graphics drivers, the problem was fixed.

@KategoryBee
Copy link
Author

Agree, I shouldn't have closed it

There's something very wrong with shadowing on the intel drivers, which perhaps is related. Even though the sprite base examples work, shadows don't in the vulkan backend in the 3d_shapes and shadow_biases examples. In the dx12 backend the shadows seem very corrupted

In 0.9.0, the shadows worked in the vulkan backend, but had the same corruption in dx12

@KategoryBee KategoryBee reopened this Mar 12, 2023
@ZeeQyu
Copy link

ZeeQyu commented Mar 14, 2023

I'm staying on old intel drivers to allow reproducing and testing fixes, I am here and ready to help if someone with a better understanding of the problem and the libraries than I have needs hardware.

(This also means I'm deferring update to bevy 0.10 to be able to keep developing my project. That project would benefit from the new scheduling structure, so I'm doing this at some degree of cost, but nothing I can't maintain for a couple of weeks.)

@ZeeQyu
Copy link

ZeeQyu commented Mar 14, 2023

Unlike @TheoDulka , on my computer there's a difference between wgpu versions.

In wgpu 0.14.2, the boids example is running with frame times of about 16.6 ms.
In wgpu 0.15.0, 0.15.1 and 0.15.2, the boids example is running with frame times of about 1.3 ms, 10 times faster. The boids are moving faster in a way that seems similar to the speedup.

Clearly, something that affects at least my computer changed between these releases, since the contents of the example folder is almost the same, and if I change them to be exactly the same, there is still the same difference in behaviour between versions.

Next step is probably creating a ticket at wgpu, and I will unless someone does it before me. For now I'll dump my testing results here, cause while it is still on the wrong repo, it's at least better here than locally on my computer.

wgpu 0.14.2 vs wgpu 0.15.1 examples comparison:

  • boids: 16.6 ms frametimes on 14.2, 1.3 ms framtimes on 0.15.1
  • bunnymark: Same frametime diff as in boids, both versions only have a blank fillcolor, and the icon in the screenshot does not appear in either version.
  • capture: Behaviour seems to be the same on both, example finishes without error, but no png is created.
  • conservative-raster: Same frame time diff as boids, otherwise the same.
  • cube: Same frame time diff.
  • hello: On 0.14.2, a bunch of adapter info is printed. On 0.15.1, there is no output.
  • hello-compute: Same output on both.
  • hello-triangle; Same red triangle on green background on both.
  • hello-windows: Same set of windows on both.
  • mipmap: 0.14.2 fails due to features "WRITE_TIMESTAMP_INSIDE_PASSES" not enabled on device. 0.15.1 works and looks like the included screenshot, although with 1.3ish ms frame times.
  • msaa-line: Same output, but same frame time diff.
  • shadow: 0.14.2 looks like the included screenshot. 0.15.1 is missing all the cubes and all the shadows.
  • skybox: Looks the same on both. Same frame time diff.
  • texture-arrays: Looks the same on both. Similar frame time diff, though 3ms instead of 1.3 ms
  • water: Looks the same on both, Similar frame time diff, though 3ms instead of 1.3 ms.

@nicopap nicopap added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen labels Jun 20, 2023
@Selene-Amanita Selene-Amanita added the C-Regression Functionality that used to work but no longer does. Add a test for this! label Aug 2, 2023
@DGriffin91
Copy link
Contributor

Just reproduced this on current bevy main d6e95e9
Is probably a duplicate of #8395
Bisect pointed to upgrading to wgpu 0.15: #8395 (comment)

@Kakusakov
Copy link

Kakusakov commented Oct 11, 2023

I have the same issue on bevy 0.11.3, but I didn't have it on bevy 0.9.1
SystemInfo { os: "Windows 10 Home", kernel: "19045", cpu: "11th Gen Intel(R) Core(TM) i5-11500 @ 2.70GHz", core_count: "6", memory: "31.8 GiB" }
AdapterInfo { name: "Intel(R) UHD Graphics 750", vendor: 32902, device: 19594, device_type: IntegratedGpu, driver: "Intel Corporation", driver_info: "Intel driver", backend: Vulkan }

switching to to DirectX12 seems to sometimes fix the problem

github-merge-queue bot pushed a commit that referenced this issue Oct 29, 2023
…0304)

# Objective

- On MacOS M1 WebGL2 the deferred lighting ID depth comparison is
failing for some values (including 1, the default)
Note: this issue is just with WebGL2, native on MacOS M1 is working with
current bevy main.

## Solution

- Use Depth16Unorm for lighting pass id format.

This format is aliasing to the same value consistently (in
[copy_deferred_lighting_id](https://github.com/bevyengine/bevy/blob/main/crates/bevy_core_pipeline/src/deferred/copy_deferred_lighting_id.wgsl#L15)
and
[deferred_lighting](https://github.com/bevyengine/bevy/blob/main/crates/bevy_pbr/src/deferred/deferred_lighting.wgsl#L39))
on MacOS M1 WebGL, and appears to be supported across WebGL2, WebGPU,
DX12, OpenGL 3.3, Vulkan.

Successfully tested all 256 ids on:

- MacOS M1 native and WebGL2
- Window RTX3060 Vulkan/DX12/WebGL2
- Windows Intel UHD Graphics 630 IGP DX12/WebGL2 
(bevy w/ Vulkan doesn't work on this IGP in general
#8037)
ameknite pushed a commit to ameknite/bevy that referenced this issue Nov 6, 2023
…vyengine#10304)

# Objective

- On MacOS M1 WebGL2 the deferred lighting ID depth comparison is
failing for some values (including 1, the default)
Note: this issue is just with WebGL2, native on MacOS M1 is working with
current bevy main.

## Solution

- Use Depth16Unorm for lighting pass id format.

This format is aliasing to the same value consistently (in
[copy_deferred_lighting_id](https://github.com/bevyengine/bevy/blob/main/crates/bevy_core_pipeline/src/deferred/copy_deferred_lighting_id.wgsl#L15)
and
[deferred_lighting](https://github.com/bevyengine/bevy/blob/main/crates/bevy_pbr/src/deferred/deferred_lighting.wgsl#L39))
on MacOS M1 WebGL, and appears to be supported across WebGL2, WebGPU,
DX12, OpenGL 3.3, Vulkan.

Successfully tested all 256 ids on:

- MacOS M1 native and WebGL2
- Window RTX3060 Vulkan/DX12/WebGL2
- Windows Intel UHD Graphics 630 IGP DX12/WebGL2 
(bevy w/ Vulkan doesn't work on this IGP in general
bevyengine#8037)
@juzi5201314
Copy link

I am using Intel Arc a750 gpu, driver 31.0.101.4952 (2023/10/31), and this problem still exists.

rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this issue Jan 9, 2024
…vyengine#10304)

# Objective

- On MacOS M1 WebGL2 the deferred lighting ID depth comparison is
failing for some values (including 1, the default)
Note: this issue is just with WebGL2, native on MacOS M1 is working with
current bevy main.

## Solution

- Use Depth16Unorm for lighting pass id format.

This format is aliasing to the same value consistently (in
[copy_deferred_lighting_id](https://github.com/bevyengine/bevy/blob/main/crates/bevy_core_pipeline/src/deferred/copy_deferred_lighting_id.wgsl#L15)
and
[deferred_lighting](https://github.com/bevyengine/bevy/blob/main/crates/bevy_pbr/src/deferred/deferred_lighting.wgsl#L39))
on MacOS M1 WebGL, and appears to be supported across WebGL2, WebGPU,
DX12, OpenGL 3.3, Vulkan.

Successfully tested all 256 ids on:

- MacOS M1 native and WebGL2
- Window RTX3060 Vulkan/DX12/WebGL2
- Windows Intel UHD Graphics 630 IGP DX12/WebGL2 
(bevy w/ Vulkan doesn't work on this IGP in general
bevyengine#8037)
@Elabajaba
Copy link
Contributor

I believe this should be fixed in bevy 0.13. Could people with intel GPUs effected by this test to see if it's fixed?

@ZeeQyu
Copy link

ZeeQyu commented Feb 19, 2024

Tried it on the same machine I mentioned above. 0.9.0 works, 0.10.0 is broken, 0.12.0 is broken, 0.13.0 works. Since I retested the 0.9.0 and 0.10.0 it seems unlikely I've had any driver updates that could invalidate the result.

So yes, it strongly looks like 0.12->0.13 fixed the issue, at least for my specific hardware!

@ZeeQyu
Copy link

ZeeQyu commented Feb 19, 2024

(To be specific, I only tested the breakout example.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Regression Functionality that used to work but no longer does. Add a test for this!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants