Skip to content

Update WebGPU vertex/index buffer binding methods#15693

Merged
kripken merged 1 commit into
emscripten-core:mainfrom
sessamekesh:main
Dec 2, 2021
Merged

Update WebGPU vertex/index buffer binding methods#15693
kripken merged 1 commit into
emscripten-core:mainfrom
sessamekesh:main

Conversation

@sessamekesh
Copy link
Copy Markdown
Contributor

I've also been running into #15237 - I'm using this fix on my development branch, and would like to merge it upstream.

I have a couple concerns, since this is my first contribution to Emscripten's code base and I want to make sure everything is in order:

I only included this commit from Dawn - there's probably a lot others that I didn't include, I didn't bother to check the rest (I'm not confident I would have been able to update all of them appropriately).

Thee bug in makeU64ToNumberWithSentinelAsUndefined is that 0xFFFFFFFF in JavaScript is evaluated as a Number (not as an Int32) to 2^32-1, but lowName and highName were evaluated from that same bitset as Int32s. I could also compare as ((${highName} === (0xFFFFFFFF | 0))) to force evaluation of 0xFFFFFFFF as an Int32 as well (compare apples to apples), but === -1 is a bit less crypitc IMO.

Thanks!

makeU64ToNumberWithSentinelAsUndefined should consider that the high and low bits are passed in as signed 32-bit integers (per JavaScript behavior) - 0xFFFFFFFF expressed as an i32 is -1, current behavior expresses 0xFFFFFFFF as a JavaScript number in the signed double range.

Update webgpu_cpp.h to reflect deprecation of size=0 default in Dawn: see https://dawn.googlesource.com/dawn/+/2be4b8483c745794971fad323f956d5c0392c878
Update webgpu_basic_rendering test to use defaults
@sessamekesh sessamekesh changed the title Update WebGPU vertex/index buffer binding methods Update WebGPU vertex/index buffer binding methods (issue #15237) Dec 2, 2021
@sessamekesh sessamekesh changed the title Update WebGPU vertex/index buffer binding methods (issue #15237) Update WebGPU vertex/index buffer binding methods Dec 2, 2021
@kainino0x kainino0x self-requested a review December 2, 2021 03:06
@kainino0x kainino0x linked an issue Dec 2, 2021 that may be closed by this pull request
Copy link
Copy Markdown
Collaborator

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for this contribution! Sorry that I let the bug sit for so long.

Including just the changes from that one Dawn commit is a good idea. Next time we "roll" to match Dawn we'll certainly roll past that commit so it'll be no problem.

LGTM!

@kainino0x
Copy link
Copy Markdown
Collaborator

I've linked this PR so it will close #15237. But I did still have the other PR open for it (#15244) which fixes a number of other problems. That PR will have to stay open for now, but if you are perhaps interested in reviving it please let me know!

@kripken kripken merged commit 3ac9656 into emscripten-core:main Dec 2, 2021
mmarczell-graphisoft pushed a commit to GRAPHISOFT/emscripten that referenced this pull request Jan 5, 2022
)

makeU64ToNumberWithSentinelAsUndefined should consider that the high and
low bits are passed in as signed 32-bit integers (per JavaScript behavior) -
0xFFFFFFFF expressed as an i32 is -1, current behavior expresses 0xFFFFFFFF
as a JavaScript number in the signed double range.

Update webgpu_cpp.h to reflect deprecation of size=0 default in Dawn: see
https://dawn.googlesource.com/dawn/+/2be4b8483c745794971fad323f956d5c0392c878

Update webgpu_basic_rendering test to use defaults
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wgpuRenderPassEncoderSetIndexBuffer(..., WGPU_WHOLE_SIZE) error

3 participants