summaryrefslogtreecommitdiff
path: root/ext/webgpu/01_webgpu.js
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2023-02-23 19:05:50 +0100
committerGitHub <noreply@github.com>2023-02-23 19:05:50 +0100
commit451b45ee3a26ed6e393c3deba86937e1a6dc5649 (patch)
tree8ac88074ae0bdaaaa634ab2b2f0b86fc1dcfc018 /ext/webgpu/01_webgpu.js
parent6233c0aff0dc9e58b02dfc9499048385bbf836c6 (diff)
fix(webgpu): don't default to 0 for setVertexBuffer.size & properly use webidl.setlike (#17800)
Diffstat (limited to 'ext/webgpu/01_webgpu.js')
-rw-r--r--ext/webgpu/01_webgpu.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/ext/webgpu/01_webgpu.js b/ext/webgpu/01_webgpu.js
index 3e8e3161e..a310eac2f 100644
--- a/ext/webgpu/01_webgpu.js
+++ b/ext/webgpu/01_webgpu.js
@@ -618,11 +618,12 @@ function createGPUSupportedFeatures(features) {
/** @type {GPUSupportedFeatures} */
const supportedFeatures = webidl.createBranded(GPUSupportedFeatures);
supportedFeatures[webidl.setlikeInner] = new Set(features);
- return webidl.setlike(
+ webidl.setlike(
supportedFeatures,
GPUSupportedFeaturesPrototype,
true,
);
+ return supportedFeatures;
}
class GPUSupportedFeatures {
@@ -4903,14 +4904,14 @@ class GPURenderBundleEncoder {
* @param {number} offset
* @param {number} size
*/
- setVertexBuffer(slot, buffer, offset = 0, size = 0) {
+ setVertexBuffer(slot, buffer, offset = 0, size) {
webidl.assertBranded(this, GPURenderBundleEncoderPrototype);
const prefix =
"Failed to execute 'setVertexBuffer' on 'GPURenderBundleEncoder'";
webidl.requiredArguments(arguments.length, 2, { prefix });
slot = webidl.converters.GPUSize32(slot, {
prefix,
- context: "Argument 2",
+ context: "Argument 1",
});
buffer = webidl.converters.GPUBuffer(buffer, {
prefix,
@@ -4920,10 +4921,12 @@ class GPURenderBundleEncoder {
prefix,
context: "Argument 3",
});
- size = webidl.converters.GPUSize64(size, {
- prefix,
- context: "Argument 4",
- });
+ if (size !== undefined) {
+ size = webidl.converters.GPUSize64(size, {
+ prefix,
+ context: "Argument 4",
+ });
+ }
const device = assertDevice(this, { prefix, context: "this" });
const renderBundleEncoderRid = assertResource(this, {
prefix,