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 WebGPUTextures #25249

Merged
merged 1 commit into from
Jan 6, 2023
Merged

Fix WebGPUTextures #25249

merged 1 commit into from
Jan 6, 2023

Conversation

LeviPesin
Copy link
Contributor

@LeviPesin LeviPesin commented Jan 6, 2023

Related issue: -

Description

Without this fix small DataTextures render white in WebGPU. Example: https://jsfiddle.net/3jb9eka0/ (compare to WebGL version: https://jsfiddle.net/3jb9eka0/1/) -- the texture should render green but renders white. With this PR it renders red (see https://jsfiddle.net/3jb9eka0/2/) due to another bug -- I will file an issue for it after this PR will be merged.

They produce the following error:

Required size for texture data layout (264) exceeds the linear data size (16) with offset (0).
    at ValidateLinearTextureData (..\..\third_party\dawn\src\dawn\native\CommandValidation.cpp:257)
    at ValidateWriteTexture (..\..\third_party\dawn\src\dawn\native\Queue.cpp:517)
    at WriteTextureInternal (..\..\third_party\dawn\src\dawn\native\Queue.cpp:323)

I think it occurs due to miscalculation of bytesPerRow (and therefore required buffer size, see https://gpuweb.github.io/gpuweb/#abstract-opdef-validating-linear-texture-data). Not sure why this formula was used instead of more simpler and (I think) more correct one? (It was introduced in 317bd1c with the support for DataTextures in WebGPU.)

/ping @sunag @Mugen87

@sunag sunag added this to the r149 milestone Jan 6, 2023
@sunag sunag merged commit 0790e3a into mrdoob:dev Jan 6, 2023
@LeviPesin LeviPesin deleted the patch-2 branch January 6, 2023 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants