-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix(ext/webgpu): GPUDevice.createTexture
works when the argument descriptor.size
is an Array
#23413
fix(ext/webgpu): GPUDevice.createTexture
works when the argument descriptor.size
is an Array
#23413
Conversation
in this case, yes we should add validation in |
I don't see how this patch would fix the issue, since you are just moving the normalization out of the object definition after the spread to be redefined on the object itself, this shouldnt change any behaviour |
In this Lines 2249 to 2251 in ebc22d9
Here is an example and result. My patch guarantees the const adapter = await navigator.gpu.requestAdapter();
const device = await adapter.requestDevice();
const texture = device.createTexture({
label: "Capture",
size: [256, 256],
format: "rgba8unorm-srgb",
usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_SRC,
});
console.log(texture) deno --version
deno 1.42.3 (release, aarch64-apple-darwin)
v8 12.3.219.9
typescript 5.4.3
user@user deno % deno run --unstable-webgpu texture.ts
GPUTexture {
label: "Capture",
width: undefined,
height: undefined,
depthOrArrayLayers: undefined,
mipLevelCount: 1,
sampleCount: 1,
dimension: "2d",
format: "rgba8unorm-srgb",
usage: 17
}
user@user deno % target/debug/deno run --unstable-webgpu texture.ts
GPUTexture {
label: "Capture",
width: 256,
height: 256,
depthOrArrayLayers: 1,
mipLevelCount: 1,
sampleCount: 1,
dimension: "2d",
format: "rgba8unorm-srgb",
usage: 17
} |
Oh i see, i misunderstood the patch, my bad |
Thanks! |
we don't currently run web platform tests for webgpu, so for now adding a test in |
also, could you revert the wpt submodule update? |
Never mind! This behavior is hard to read a little, so I'll add a comment.
sure.
Oops. I'll fix it. |
Hi @crowlKats, I added some commits! Please check it.
BTW, it seems that the title of this PR might be widen the context when I created🤔 |
@Hajime-san apologies about the delay on this! I don't think the changes related to |
This reverts commit 7c72843.
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, thanks!
fixes #22733
validation
BTW, Should we implement according to the spec?
The spec indicates
GPUDevice.createTexture
needs validations likevalidate GPUExtent3D shape(descriptor.size).
and other.Here is a minimal example of the validation example.
It runs on Google Chrome(122.0.6261.112), then console shows the message as follows.
And, same JavaScript code throws no error by
deno 1.42.3
.