-
Notifications
You must be signed in to change notification settings - Fork 46
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
In/out extensibility of WGPULimits and WGPUInstanceFeatures #260
Comments
Jan 25 meeting:
|
Looks like the Please let me know if a separate issue is required, I'd be happy to create one. Sample: // clang -g -O0 -fno-omit-frame-pointer -fsanitize=memory main.c
#include <dlfcn.h>
#include <stdlib.h>
#define WGPU_SKIP_DECLARATIONS
#include "webgpu.h"
int main(int argc, char **argv) {
void *lib =
dlopen("./build/build/dawn/src/dawn/native/libwebgpu_dawn.so", RTLD_LAZY);
WGPUProcCreateInstance wgpuCreateInstance =
(WGPUProcCreateInstance)dlsym(lib, "wgpuCreateInstance");
WGPUProcInstanceRelease wgpuInstanceRelease =
(WGPUProcInstanceRelease)dlsym(lib, "wgpuInstanceRelease");
WGPUInstance instance;
WGPUInstanceDescriptor desc = {};
desc.nextInChain = NULL;
instance = wgpuCreateInstance(&desc);
wgpuInstanceRelease(instance);
return EXIT_SUCCESS;
} Error log:
|
This repo isn't currently in-sync with any implementation. Since you're using Dawn, for now you need to stick with the webgpu.h provided by Dawn. We're still working through all the decided-but-not-implemented changes, separately in Dawn/wgpu-native/webgpu-headers and they won't be in sync for a while longer. |
I see, will wait until they are all in sync. |
Renames WGPUWGSLFeatureName to WGPUWGSLLanguageFeatureName (the JS API uses "wgslLanguageFeatures" to emphasize that they are language features and not hardware features). TODO: need to resolve the conflict between: - Using the same chain for both supported and requested webgpu-native#260 (comment) - Making it part of GetInstanceFeatures webgpu-native#265 (comment) Fixes: 265 CC: 252
Renames WGPUWGSLFeatureName to WGPUWGSLLanguageFeatureName (the JS API uses "wgslLanguageFeatures" to emphasize that they are language features and not hardware features). TODO: need to resolve the conflict between: - Using the same chain for both supported and requested webgpu-native#260 (comment) - Making it part of GetInstanceFeatures webgpu-native#265 (comment) Fixes: 265 CC: 252
It should be possible to ask wgpuGetInstanceFeatures for more info by adding structs to the chain. As written out here:
#199 (comment)
this is not possible because
nextInChain
isconst *
.We can fix this by mirroring what we have already for WGPURequiredLimits/WGPUSupportedLimits:
Unfortunately for both this and WGPULimits, we need to duplicate stuff for every extension, like:
(Dawn is actually currently missing an equivalent of the latter. I suspect this is because we're abusing "limits" for what are really adapter properties?)
Note the JS API has a similar "problem" except it doesn't have to deal with extension structs.
A totally different option could be to use an array of structs instead of a chain of structs, kind of a key-value-pair system vaguely like what JS uses. We could use this for both. Example for limits:
Or we could go all the way to what JS has with a real key-value interface, which is much simpler to write out - though probably not easier to use, and unfortunately a much more breaking change.
Related to #216.
cc @lokokung
The text was updated successfully, but these errors were encountered: