-
Notifications
You must be signed in to change notification settings - Fork 3.4k
WebGPU: roll header and generated changes in from Dawn #20880
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
Conversation
I've noticed Chrome expects "float32-filterable" instead of "float32filterable". If I change it manually in library_webgpu.js I can sample float32 textures on web with no problem. Could this be incorporated in this PR? |
Nice catch! Yes, I'll incorporate it into that Dawn change and this PR. |
Rolls to dawn revision: https://dawn.googlesource.com/dawn/+log/ad853f80af9b236fa3aa6be6dcd2facb26430565 and fixes library_webgpu.js where necessary. Also adds several files to match Dawn, so that Emscripten mirrors Dawn's generated files directly, requiring less manual intervention.
@beaufortfrancois PTAL |
These functions can't be implemented in JS because the signatures are too long. They need to be implemented with a C(++) shim over JS but this will happen in a forthcoming PR.
These instructions are truly out of hand. I will work on this soon :) I also had to revert some small bits to fix failing compile tests:
@beaufortfrancois PTAL |
@sbc100 PTAL as well, I think this is very close to ready to land. |
Oh I just realized François has review privileges here, so maybe that won't be necessary? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits
@@ -1227,6 +1227,12 @@ | |||
"size", | |||
"mappedAtCreation" | |||
], | |||
"WGPUBufferMapCallbackInfo": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this should not be there because MapAsyncF
is not as well?
Does this means all Future related stuff below should be removed also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chose not to remove those things adding them back will increase the size of the next roll. So I just removed the minimum needed to make it build (I did this manually, not in dawn.json).
"WGPUFuture": [ | ||
"id" | ||
], | ||
"WGPUInstanceFeatures": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this implemented in Emscripten?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not yet, but it will be soon.
'pending', | ||
'mapped', | ||
], | ||
BufferMapState: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use leading undefined
in some cases about but map in other cases like this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quirk of the code generator, it's because CompareFunction[0]
is expected to be used ever while BufferMapState[0]
is not. I was thinking of smoothing this over in the generator along with other generation cleanups (like hopefully moving some generated code into separate files so we can get rid of "please copy-paste" steps)
@@ -0,0 +1,161 @@ | |||
// Copyright 2017 The Dawn & Tint Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the date here correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment hasn't been updated in a long time but I'll fix this upstream in Dawn first.
#include "webgpu/webgpu_cpp.h" | ||
|
||
#ifdef __GNUC__ | ||
#if defined(__GNUC__) || defined(__clang__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC, clang defines __GNUC__
so this should not be needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will propose this change to Dawn first as well.
@@ -1,6 +1,9 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing copyright header?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, this needs to be fixed upstream. In the meantime let me add the header we have in the template since this one is more important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it really is from 2017 then this is fine.. I didn't realize webgpu went back that far :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, and this the enum class bitmasks utility probably hasn't even changed much since then. tbd if I update that.
The generated headers will have 2024 in them because the date is written at generation time, so I put those in as 2024.
Rolls to dawn revision:
https://dawn.googlesource.com/dawn/+log/ad853f80af9b236fa3aa6be6dcd2facb26430565
except skips a few entrypoints that can't be implemented in JS (require a C++ shim)
and fixes library_webgpu.js where necessary (function stubs, several of which are going to change before being implemented)
Also adds several files to match Dawn, so that Emscripten mirrors Dawn's generated files directly, requiring less manual intervention, but there is more work to do here.