Build: support both emdawnwebgpu callback generations (WGPUQueueWorkDoneCallback) - #3
Open
octopusburrow wants to merge 1 commit into
Open
Build: support both emdawnwebgpu callback generations (WGPUQueueWorkDoneCallback)#3octopusburrow wants to merge 1 commit into
octopusburrow wants to merge 1 commit into
Conversation
…acros Newer emdawnwebgpu packages add a WGPUStringView message parameter to WGPUQueueWorkDoneCallback (4 params: status, message, userdata1, userdata2); earlier packages use 3 (no message). The signature is a property of the Dawn package each emsdk release pins, so no clean version macro exists — and macro PRESENCE does not discriminate: both generations define WGPU_STRLEN/WGPUStringView (verified against Dawn v20260423.175430 [4-param] and the earlier package in this fork's deploy toolchain [3-param]). So: provide both signatures as overloads of _fence_work_done_callback and let the assignment to the port's own WGPUQueueWorkDoneCallback typedef select the matching one. The 4-param overload is additionally guarded on WGPU_STRING_VIEW_INIT for hypothetical pre-StringView headers. The dispatch pattern compiles against both package generations (verified standalone on both toolchains); a full engine build is verified on the 3-param toolchain. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Newer emdawnwebgpu changed
WGPUQueueWorkDoneCallbackfrom 3 parameters to 4 (adding aWGPUStringViewmessage), which breaks the build on one generation or the other. Macropresence can't discriminate the two (both define the obvious candidates), so this defines
both signatures as overloads and lets assignment to the port's own callback typedef select
the match at compile time. Both functions are
static(single TU — no ODR exposure), andthis is the only callback typedef that differs between the generations; the file's other
callbacks already carried
WGPUStringViewin both.Verified by compiling a minimal reproduction against both toolchains (emsdk 4.0.10 — the
fork's deploy toolchain — and 6.x): the base's single 3-param callback fails on 6.x with
"invalid conversion"; the overload set compiles clean on both, each picking its match.