-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proxy webgpu calls back to the main thread. NFC
Until we have real multi-threaded webgpu support this is probable the best we can do. I tested these locally. I don't think we actually have WebGPU support in our CI yet, but that is something else I'm working on. Fixes: #19645
- Loading branch information
Showing
5 changed files
with
40 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
#include <emscripten.h> | ||
#include <stdio.h> | ||
|
||
#include <emscripten/em_asm.h> | ||
#include <emscripten/html5_webgpu.h> | ||
|
||
int main() { | ||
__attribute__((constructor)) void init() { | ||
EM_ASM({ | ||
Module['preinitializedWebGPUDevice'] = { this_is: 'a_dummy_object' }; | ||
}); | ||
emscripten_webgpu_get_device(); | ||
} | ||
|
||
int main() { | ||
WGPUDevice d = emscripten_webgpu_get_device(); | ||
printf("emscripten_webgpu_get_device: %p\n", d); | ||
return 0; | ||
} |