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

Fix deferred lighting pass values not all working on M1 in WebGL2 #10304

Merged
merged 1 commit into from
Oct 29, 2023

Conversation

DGriffin91
Copy link
Contributor

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 and deferred_lighting) on MacOS M1 WebGL, and appears to be supported across WebGL2, WebGPU, DX12, OpenGL 3.3, Vulkan.

Successfully tested all 256 ids on:

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen O-MacOS Specific to the MacOS (Apple) desktop operating system labels Oct 29, 2023
@alice-i-cecile alice-i-cecile added this to the 0.12 milestone Oct 29, 2023
@mockersf mockersf added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Oct 29, 2023
@mockersf mockersf added this pull request to the merge queue Oct 29, 2023
Merged via the queue into bevyengine:main with commit d3e41e2 Oct 29, 2023
26 checks passed
ameknite pushed a commit to ameknite/bevy that referenced this pull request 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)
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request 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)
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 O-MacOS Specific to the MacOS (Apple) desktop operating system S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants