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

Non uniform transmission samples #10674

Merged

Conversation

robtfm
Copy link
Contributor

@robtfm robtfm commented Nov 21, 2023

Objective

fix webgpu+chrome(119) textureSample in non-uniform control flow error

Solution

modify view transmission texture sampling to use textureSampleLevel. there are no mips for the view transmission texture, so this doesn't change the result, but it removes the need for the samples to be in uniform control flow.

note: in future we may add a mipchain to the transmission texture to improve the blur effect. if uniformity analysis hasn't improved, this would require switching to manual derivative calculations (which is something we plan to do anyway).

@robtfm robtfm added A-Rendering Drawing game state to the screen P-Crash A sudden unexpected crash O-WebGPU Specific to the WebGPU render API labels Nov 21, 2023
@robtfm robtfm added this to the 0.12.1 milestone Nov 21, 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 Nov 21, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Nov 22, 2023
Merged via the queue into bevyengine:main with commit ea01c3e Nov 22, 2023
27 checks passed
cart pushed a commit that referenced this pull request Nov 30, 2023
# Objective

fix webgpu+chrome(119) textureSample in non-uniform control flow error

## Solution

modify view transmission texture sampling to use textureSampleLevel.
there are no mips for the view transmission texture, so this doesn't
change the result, but it removes the need for the samples to be in
uniform control flow.

note: in future we may add a mipchain to the transmission texture to
improve the blur effect. if uniformity analysis hasn't improved, this
would require switching to manual derivative calculations (which is
something we plan to do anyway).
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
# Objective

fix webgpu+chrome(119) textureSample in non-uniform control flow error

## Solution

modify view transmission texture sampling to use textureSampleLevel.
there are no mips for the view transmission texture, so this doesn't
change the result, but it removes the need for the samples to be in
uniform control flow.

note: in future we may add a mipchain to the transmission texture to
improve the blur effect. if uniformity analysis hasn't improved, this
would require switching to manual derivative calculations (which is
something we plan to do anyway).
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 O-WebGPU Specific to the WebGPU render API P-Crash A sudden unexpected crash 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.

4 participants