Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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