summaryrefslogtreecommitdiff
path: root/ext/webgpu/01_webgpu.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-01-27 13:36:36 +0100
committerGitHub <noreply@github.com>2022-01-27 13:36:36 +0100
commit884143218fad0e18f7553aaf079d52de703f7601 (patch)
tree9b9e9d30ea647041438ef8fa974b8d4234cabf73 /ext/webgpu/01_webgpu.js
parentdcf8f144ab0516936bfa4e93357d71f1732d880e (diff)
refactor: update runtime code for primordial checks for "instanceof" (#13497)
Diffstat (limited to 'ext/webgpu/01_webgpu.js')
-rw-r--r--ext/webgpu/01_webgpu.js314
1 files changed, 176 insertions, 138 deletions
diff --git a/ext/webgpu/01_webgpu.js b/ext/webgpu/01_webgpu.js
index 45d910c1a..cd1a6e5ad 100644
--- a/ext/webgpu/01_webgpu.js
+++ b/ext/webgpu/01_webgpu.js
@@ -25,6 +25,7 @@
MathMax,
ObjectDefineProperty,
ObjectFreeze,
+ ObjectPrototypeIsPrototypeOf,
Promise,
PromiseAll,
PromisePrototypeCatch,
@@ -42,6 +43,7 @@
SymbolIterator,
TypeError,
Uint32Array,
+ Uint32ArrayPrototype,
Uint8Array,
} = window.__bootstrap.primordials;
@@ -157,6 +159,7 @@
super("device out of memory");
}
}
+ const GPUOutOfMemoryErrorPrototype = GPUOutOfMemoryError.prototype;
class GPUValidationError extends Error {
name = "GPUValidationError";
@@ -183,7 +186,7 @@
* @param {GPURequestAdapterOptions} options
*/
async requestAdapter(options = {}) {
- webidl.assertBranded(this, GPU);
+ webidl.assertBranded(this, GPUPrototype);
options = webidl.converters.GPURequestAdapterOptions(options, {
prefix: "Failed to execute 'requestAdapter' on 'GPU'",
context: "Argument 1",
@@ -205,6 +208,7 @@
return `${this.constructor.name} ${inspect({})}`;
}
}
+ const GPUPrototype = GPU.prototype;
const _name = Symbol("[[name]]");
const _adapter = Symbol("[[adapter]]");
@@ -243,17 +247,17 @@
/** @returns {string} */
get name() {
- webidl.assertBranded(this, GPUAdapter);
+ webidl.assertBranded(this, GPUAdapterPrototype);
return this[_name];
}
/** @returns {GPUSupportedFeatures} */
get features() {
- webidl.assertBranded(this, GPUAdapter);
+ webidl.assertBranded(this, GPUAdapterPrototype);
return this[_adapter].features;
}
/** @returns {GPUSupportedLimits} */
get limits() {
- webidl.assertBranded(this, GPUAdapter);
+ webidl.assertBranded(this, GPUAdapterPrototype);
return this[_adapter].limits;
}
/** @returns {boolean} */
@@ -270,7 +274,7 @@
* @returns {Promise<GPUDevice>}
*/
async requestDevice(descriptor = {}) {
- webidl.assertBranded(this, GPUAdapter);
+ webidl.assertBranded(this, GPUAdapterPrototype);
const prefix = "Failed to execute 'requestDevice' on 'GPUAdapter'";
descriptor = webidl.converters.GPUDeviceDescriptor(descriptor, {
prefix,
@@ -320,6 +324,7 @@
}`;
}
}
+ const GPUAdapterPrototype = GPUAdapter.prototype;
const _limits = Symbol("[[limits]]");
@@ -368,107 +373,107 @@
}
get maxTextureDimension1D() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxTextureDimension1D;
}
get maxTextureDimension2D() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxTextureDimension2D;
}
get maxTextureDimension3D() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxTextureDimension3D;
}
get maxTextureArrayLayers() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxTextureArrayLayers;
}
get maxBindGroups() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxBindGroups;
}
get maxDynamicUniformBuffersPerPipelineLayout() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxDynamicUniformBuffersPerPipelineLayout;
}
get maxDynamicStorageBuffersPerPipelineLayout() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxDynamicStorageBuffersPerPipelineLayout;
}
get maxSampledTexturesPerShaderStage() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxSampledTexturesPerShaderStage;
}
get maxSamplersPerShaderStage() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxSamplersPerShaderStage;
}
get maxStorageBuffersPerShaderStage() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxStorageBuffersPerShaderStage;
}
get maxStorageTexturesPerShaderStage() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxStorageTexturesPerShaderStage;
}
get maxUniformBuffersPerShaderStage() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxUniformBuffersPerShaderStage;
}
get maxUniformBufferBindingSize() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxUniformBufferBindingSize;
}
get maxStorageBufferBindingSize() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxStorageBufferBindingSize;
}
get minUniformBufferOffsetAlignment() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].minUniformBufferOffsetAlignment;
}
get minStorageBufferOffsetAlignment() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].minStorageBufferOffsetAlignment;
}
get maxVertexBuffers() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxVertexBuffers;
}
get maxVertexAttributes() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxVertexAttributes;
}
get maxVertexBufferArrayStride() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxVertexBufferArrayStride;
}
get maxInterStageShaderComponents() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxInterStageShaderComponents;
}
get maxComputeWorkgroupStorageSize() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxComputeWorkgroupStorageSize;
}
get maxComputeInvocationsPerWorkgroup() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxComputeInvocationsPerWorkgroup;
}
get maxComputeWorkgroupSizeX() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxComputeWorkgroupSizeX;
}
get maxComputeWorkgroupSizeY() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxComputeWorkgroupSizeY;
}
get maxComputeWorkgroupSizeZ() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxComputeWorkgroupSizeZ;
}
get maxComputeWorkgroupsPerDimension() {
- webidl.assertBranded(this, GPUSupportedLimits);
+ webidl.assertBranded(this, GPUSupportedLimitsPrototype);
return this[_limits].maxComputeWorkgroupsPerDimension;
}
@@ -476,6 +481,7 @@
return `${this.constructor.name} ${inspect(this[_limits])}`;
}
}
+ const GPUSupportedLimitsPrototype = GPUSupportedLimits.prototype;
const _features = Symbol("[[features]]");
@@ -496,42 +502,42 @@
/** @return {IterableIterator<[string, string]>} */
entries() {
- webidl.assertBranded(this, GPUSupportedFeatures);
+ webidl.assertBranded(this, GPUSupportedFeaturesPrototype);
return SetPrototypeEntries(this[_features]);
}
/** @return {void} */
forEach(callbackfn, thisArg) {
- webidl.assertBranded(this, GPUSupportedFeatures);
+ webidl.assertBranded(this, GPUSupportedFeaturesPrototype);
SetPrototypeForEach(this[_features], callbackfn, thisArg);
}
/** @return {boolean} */
has(value) {
- webidl.assertBranded(this, GPUSupportedFeatures);
+ webidl.assertBranded(this, GPUSupportedFeaturesPrototype);
return SetPrototypeHas(this[_features], value);
}
/** @return {IterableIterator<string>} */
keys() {
- webidl.assertBranded(this, GPUSupportedFeatures);
+ webidl.assertBranded(this, GPUSupportedFeaturesPrototype);
return SetPrototypeKeys(this[_features]);
}
/** @return {IterableIterator<string>} */
values() {
- webidl.assertBranded(this, GPUSupportedFeatures);
+ webidl.assertBranded(this, GPUSupportedFeaturesPrototype);
return SetPrototypeValues(this[_features]);
}
/** @return {number} */
get size() {
- webidl.assertBranded(this, GPUSupportedFeatures);
+ webidl.assertBranded(this, GPUSupportedFeaturesPrototype);
return this[_features].size;
}
[SymbolIterator]() {
- webidl.assertBranded(this, GPUSupportedFeatures);
+ webidl.assertBranded(this, GPUSupportedFeaturesPrototype);
return this[_features][SymbolIterator]();
}
@@ -540,6 +546,8 @@
}
}
+ const GPUSupportedFeaturesPrototype = GPUSupportedFeatures.prototype;
+
const _reason = Symbol("[[reason]]");
const _message = Symbol("[[message]]");
@@ -567,11 +575,11 @@
}
get reason() {
- webidl.assertBranded(this, GPUDeviceLostInfo);
+ webidl.assertBranded(this, GPUDeviceLostInfoPrototype);
return this[_reason];
}
get message() {
- webidl.assertBranded(this, GPUDeviceLostInfo);
+ webidl.assertBranded(this, GPUDeviceLostInfoPrototype);
return this[_message];
}
@@ -582,6 +590,8 @@
}
}
+ const GPUDeviceLostInfoPrototype = GPUDeviceLostInfo.prototype;
+
const _label = Symbol("[[label]]");
/**
@@ -595,14 +605,14 @@
* @return {string | null}
*/
get() {
- webidl.assertBranded(this, type);
+ webidl.assertBranded(this, type.prototype);
return this[_label];
},
/**
* @param {string | null} label
*/
set(label) {
- webidl.assertBranded(this, type);
+ webidl.assertBranded(this, type.prototype);
label = webidl.converters["UVString?"](label, {
prefix: `Failed to set 'label' on '${name}'`,
context: "Argument 1",
@@ -705,7 +715,9 @@
const validationFilteredPromise = PromisePrototypeCatch(
operation,
(err) => {
- if (err instanceof GPUValidationError) return PromiseReject(err);
+ if (ObjectPrototypeIsPrototypeOf.prototype(GPUValidationError, err)) {
+ return PromiseReject(err);
+ }
return PromiseResolve();
},
);
@@ -728,7 +740,9 @@
);
const oomScope = oomStack[oomStack.length - 1];
const oomFilteredPromise = PromisePrototypeCatch(operation, (err) => {
- if (err instanceof GPUOutOfMemoryError) return PromiseReject(err);
+ if (ObjectPrototypeIsPrototypeOf(GPUOutOfMemoryErrorPrototype, err)) {
+ return PromiseReject(err);
+ }
return PromiseResolve();
});
if (oomScope) {
@@ -784,15 +798,15 @@
}
get features() {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
return this[_device].features;
}
get limits() {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
return this[_device].limits;
}
get queue() {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
return this[_queue];
}
@@ -802,7 +816,7 @@
}
destroy() {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
this[_cleanup]();
}
@@ -811,7 +825,7 @@
* @returns {GPUBuffer}
*/
createBuffer(descriptor) {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
const prefix = "Failed to execute 'createBuffer' on 'GPUDevice'";
webidl.requiredArguments(arguments.length, 1, { prefix });
descriptor = webidl.converters.GPUBufferDescriptor(descriptor, {
@@ -858,7 +872,7 @@
* @returns {GPUTexture}
*/
createTexture(descriptor) {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
const prefix = "Failed to execute 'createTexture' on 'GPUDevice'";
webidl.requiredArguments(arguments.length, 1, { prefix });
descriptor = webidl.converters.GPUTextureDescriptor(descriptor, {
@@ -887,7 +901,7 @@
* @returns {GPUSampler}
*/
createSampler(descriptor = {}) {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
const prefix = "Failed to execute 'createSampler' on 'GPUDevice'";
descriptor = webidl.converters.GPUSamplerDescriptor(descriptor, {
prefix,
@@ -914,7 +928,7 @@
* @returns {GPUBindGroupLayout}
*/
createBindGroupLayout(descriptor) {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
const prefix = "Failed to execute 'createBindGroupLayout' on 'GPUDevice'";
webidl.requiredArguments(arguments.length, 1, { prefix });
descriptor = webidl.converters.GPUBindGroupLayoutDescriptor(descriptor, {
@@ -957,7 +971,7 @@
* @returns {GPUPipelineLayout}
*/
createPipelineLayout(descriptor) {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
const prefix = "Failed to execute 'createPipelineLayout' on 'GPUDevice'";
webidl.requiredArguments(arguments.length, 1, { prefix });
descriptor = webidl.converters.GPUPipelineLayoutDescriptor(descriptor, {
@@ -999,7 +1013,7 @@
* @returns {GPUBindGroup}
*/
createBindGroup(descriptor) {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
const prefix = "Failed to execute 'createBindGroup' on 'GPUDevice'";
webidl.requiredArguments(arguments.length, 1, { prefix });
descriptor = webidl.converters.GPUBindGroupDescriptor(descriptor, {
@@ -1019,7 +1033,7 @@
const entries = ArrayPrototypeMap(descriptor.entries, (entry, i) => {
const context = `entry ${i + 1}`;
const resource = entry.resource;
- if (resource instanceof GPUSampler) {
+ if (ObjectPrototypeIsPrototypeOf(GPUSamplerPrototype, resource)) {
const rid = assertResource(resource, {
prefix,
context,
@@ -1034,7 +1048,9 @@
kind: "GPUSampler",
resource: rid,
};
- } else if (resource instanceof GPUTextureView) {
+ } else if (
+ ObjectPrototypeIsPrototypeOf(GPUTextureViewPrototype, resource)
+ ) {
const rid = assertResource(resource, {
prefix,
context,
@@ -1091,7 +1107,7 @@
* @param {GPUShaderModuleDescriptor} descriptor
*/
createShaderModule(descriptor) {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
const prefix = "Failed to execute 'createShaderModule' on 'GPUDevice'";
webidl.requiredArguments(arguments.length, 1, { prefix });
descriptor = webidl.converters.GPUShaderModuleDescriptor(descriptor, {
@@ -1124,7 +1140,7 @@
* @returns {GPUComputePipeline}
*/
createComputePipeline(descriptor) {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
const prefix = "Failed to execute 'createComputePipeline' on 'GPUDevice'";
webidl.requiredArguments(arguments.length, 1, { prefix });
descriptor = webidl.converters.GPUComputePipelineDescriptor(descriptor, {
@@ -1181,7 +1197,7 @@
* @returns {GPURenderPipeline}
*/
createRenderPipeline(descriptor) {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
const prefix = "Failed to execute 'createRenderPipeline' on 'GPUDevice'";
webidl.requiredArguments(arguments.length, 1, { prefix });
descriptor = webidl.converters.GPURenderPipelineDescriptor(descriptor, {
@@ -1266,7 +1282,7 @@
* @returns {GPUCommandEncoder}
*/
createCommandEncoder(descriptor = {}) {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
const prefix = "Failed to execute 'createCommandEncoder' on 'GPUDevice'";
descriptor = webidl.converters.GPUCommandEncoderDescriptor(descriptor, {
prefix,
@@ -1293,7 +1309,7 @@
* @returns {GPURenderBundleEncoder}
*/
createRenderBundleEncoder(descriptor) {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
const prefix =
"Failed to execute 'createRenderBundleEncoder' on 'GPUDevice'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -1328,7 +1344,7 @@
* @returns {GPUQuerySet}
*/
createQuerySet(descriptor) {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
const prefix = "Failed to execute 'createQuerySet' on 'GPUDevice'";
webidl.requiredArguments(arguments.length, 1, { prefix });
descriptor = webidl.converters.GPUQuerySetDescriptor(
@@ -1356,7 +1372,7 @@
}
get lost() {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
const device = this[_device];
if (!device) {
return PromiseResolve(true);
@@ -1371,7 +1387,7 @@
* @param {GPUErrorFilter} filter
*/
pushErrorScope(filter) {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
const prefix = "Failed to execute 'pushErrorScope' on 'GPUDevice'";
webidl.requiredArguments(arguments.length, 1, { prefix });
filter = webidl.converters.GPUErrorFilter(filter, {
@@ -1387,7 +1403,7 @@
*/
// deno-lint-ignore require-await
async popErrorScope() {
- webidl.assertBranded(this, GPUDevice);
+ webidl.assertBranded(this, GPUDevicePrototype);
const prefix = "Failed to execute 'popErrorScope' on 'GPUDevice'";
const device = assertDevice(this, { prefix, context: "this" });
if (device.isLost) {
@@ -1420,6 +1436,7 @@
}
}
GPUObjectBaseMixin("GPUDevice", GPUDevice);
+ const GPUDevicePrototype = GPUDevice.prototype;
/**
* @param {string | null} label
@@ -1446,7 +1463,7 @@
* @param {GPUCommandBuffer[]} commandBuffers
*/
submit(commandBuffers) {
- webidl.assertBranded(this, GPUQueue);
+ webidl.assertBranded(this, GPUQueue.prototype);
const prefix = "Failed to execute 'submit' on 'GPUQueue'";
webidl.requiredArguments(arguments.length, 1, {
prefix,
@@ -1477,7 +1494,7 @@
}
onSubmittedWorkDone() {
- webidl.assertBranded(this, GPUQueue);
+ webidl.assertBranded(this, GPUQueue.prototype);
return PromiseResolve();
}
@@ -1489,7 +1506,7 @@
* @param {number} [size]
*/
writeBuffer(buffer, bufferOffset, data, dataOffset = 0, size) {
- webidl.assertBranded(this, GPUQueue);
+ webidl.assertBranded(this, GPUQueue.prototype);
const prefix = "Failed to execute 'writeBuffer' on 'GPUQueue'";
webidl.requiredArguments(arguments.length, 3, { prefix });
buffer = webidl.converters["GPUBuffer"](buffer, {
@@ -1545,7 +1562,7 @@
* @param {GPUExtent3D} size
*/
writeTexture(destination, data, dataLayout, size) {
- webidl.assertBranded(this, GPUQueue);
+ webidl.assertBranded(this, GPUQueue.prototype);
const prefix = "Failed to execute 'writeTexture' on 'GPUQueue'";
webidl.requiredArguments(arguments.length, 4, { prefix });
destination = webidl.converters.GPUImageCopyTexture(destination, {
@@ -1702,7 +1719,7 @@
* @param {number} [size]
*/
async mapAsync(mode, offset = 0, size) {
- webidl.assertBranded(this, GPUBuffer);
+ webidl.assertBranded(this, GPUBuffer.prototype);
const prefix = "Failed to execute 'mapAsync' on 'GPUBuffer'";
webidl.requiredArguments(arguments.length, 1, { prefix });
mode = webidl.converters.GPUMapModeFlags(mode, {
@@ -1804,7 +1821,7 @@
* @param {number} size
*/
getMappedRange(offset = 0, size) {
- webidl.assertBranded(this, GPUBuffer);
+ webidl.assertBranded(this, GPUBuffer.prototype);
const prefix = "Failed to execute 'getMappedRange' on 'GPUBuffer'";
offset = webidl.converters.GPUSize64(offset, {
prefix,
@@ -1861,7 +1878,7 @@
}
unmap() {
- webidl.assertBranded(this, GPUBuffer);
+ webidl.assertBranded(this, GPUBuffer.prototype);
const prefix = "Failed to execute 'unmap' on 'GPUBuffer'";
const device = assertDevice(this, { prefix, context: "this" });
const bufferRid = assertResource(this, { prefix, context: "this" });
@@ -1917,7 +1934,7 @@
}
destroy() {
- webidl.assertBranded(this, GPUBuffer);
+ webidl.assertBranded(this, GPUBuffer.prototype);
this[_cleanup]();
}
@@ -2031,7 +2048,7 @@
* @param {GPUTextureViewDescriptor} descriptor
*/
createView(descriptor = {}) {
- webidl.assertBranded(this, GPUTexture);
+ webidl.assertBranded(this, GPUTexture.prototype);
const prefix = "Failed to execute 'createView' on 'GPUTexture'";
webidl.requiredArguments(arguments.length, 0, { prefix });
descriptor = webidl.converters.GPUTextureViewDescriptor(descriptor, {
@@ -2056,7 +2073,7 @@
}
destroy() {
- webidl.assertBranded(this, GPUTexture);
+ webidl.assertBranded(this, GPUTexture.prototype);
this[_cleanup]();
}
@@ -2136,7 +2153,7 @@
}
}
GPUObjectBaseMixin("GPUTextureView", GPUTextureView);
-
+ const GPUTextureViewPrototype = GPUTextureView.prototype;
/**
* @param {string | null} label
* @param {InnerGPUDevice} device
@@ -2179,7 +2196,7 @@
}
}
GPUObjectBaseMixin("GPUSampler", GPUSampler);
-
+ const GPUSamplerPrototype = GPUSampler.prototype;
/**
* @param {string | null} label
* @param {InnerGPUDevice} device
@@ -2412,7 +2429,7 @@
* @returns {GPUBindGroupLayout}
*/
getBindGroupLayout(index) {
- webidl.assertBranded(this, GPUComputePipeline);
+ webidl.assertBranded(this, GPUComputePipelinePrototype);
const prefix =
"Failed to execute 'getBindGroupLayout' on 'GPUComputePipeline'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -2449,6 +2466,7 @@
}
}
GPUObjectBaseMixin("GPUComputePipeline", GPUComputePipeline);
+ const GPUComputePipelinePrototype = GPUComputePipeline.prototype;
/**
* @param {string | null} label
@@ -2487,7 +2505,7 @@
* @param {number} index
*/
getBindGroupLayout(index) {
- webidl.assertBranded(this, GPURenderPipeline);
+ webidl.assertBranded(this, GPURenderPipelinePrototype);
const prefix =
"Failed to execute 'getBindGroupLayout' on 'GPURenderPipeline'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -2524,6 +2542,7 @@
}
}
GPUObjectBaseMixin("GPURenderPipeline", GPURenderPipeline);
+ const GPURenderPipelinePrototype = GPURenderPipeline.prototype;
class GPUColorWrite {
constructor() {
@@ -2597,7 +2616,7 @@
* @return {GPURenderPassEncoder}
*/
beginRenderPass(descriptor) {
- webidl.assertBranded(this, GPUCommandEncoder);
+ webidl.assertBranded(this, GPUCommandEncoderPrototype);
const prefix =
"Failed to execute 'beginRenderPass' on 'GPUCommandEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -2747,7 +2766,7 @@
* @param {GPUComputePassDescriptor} descriptor
*/
beginComputePass(descriptor = {}) {
- webidl.assertBranded(this, GPUCommandEncoder);
+ webidl.assertBranded(this, GPUCommandEncoderPrototype);
const prefix =
"Failed to execute 'beginComputePass' on 'GPUCommandEncoder'";
descriptor = webidl.converters.GPUComputePassDescriptor(descriptor, {
@@ -2792,7 +2811,7 @@
destinationOffset,
size,
) {
- webidl.assertBranded(this, GPUCommandEncoder);
+ webidl.assertBranded(this, GPUCommandEncoderPrototype);
const prefix =
"Failed to execute 'copyBufferToBuffer' on 'GPUCommandEncoder'";
webidl.requiredArguments(arguments.length, 5, { prefix });
@@ -2860,7 +2879,7 @@
* @param {GPUExtent3D} copySize
*/
copyBufferToTexture(source, destination, copySize) {
- webidl.assertBranded(this, GPUCommandEncoder);
+ webidl.assertBranded(this, GPUCommandEncoderPrototype);
const prefix =
"Failed to execute 'copyBufferToTexture' on 'GPUCommandEncoder'";
webidl.requiredArguments(arguments.length, 3, { prefix });
@@ -2928,7 +2947,7 @@
* @param {GPUExtent3D} copySize
*/
copyTextureToBuffer(source, destination, copySize) {
- webidl.assertBranded(this, GPUCommandEncoder);
+ webidl.assertBranded(this, GPUCommandEncoderPrototype);
const prefix =
"Failed to execute 'copyTextureToBuffer' on 'GPUCommandEncoder'";
webidl.requiredArguments(arguments.length, 3, { prefix });
@@ -2995,7 +3014,7 @@
* @param {GPUExtent3D} copySize
*/
copyTextureToTexture(source, destination, copySize) {
- webidl.assertBranded(this, GPUCommandEncoder);
+ webidl.assertBranded(this, GPUCommandEncoderPrototype);
const prefix =
"Failed to execute 'copyTextureToTexture' on 'GPUCommandEncoder'";
webidl.requiredArguments(arguments.length, 3, { prefix });
@@ -3066,7 +3085,7 @@
* @param {GPUSize64} size
*/
clearBuffer(destination, destinationOffset, size) {
- webidl.assertBranded(this, GPUCommandEncoder);
+ webidl.assertBranded(this, GPUCommandEncoderPrototype);
const prefix = "Failed to execute 'clearBuffer' on 'GPUCommandEncoder'";
webidl.requiredArguments(arguments.length, 3, { prefix });
destination = webidl.converters.GPUBuffer(destination, {
@@ -3106,7 +3125,7 @@
* @param {string} groupLabel
*/
pushDebugGroup(groupLabel) {
- webidl.assertBranded(this, GPUCommandEncoder);
+ webidl.assertBranded(this, GPUCommandEncoderPrototype);
const prefix =
"Failed to execute 'pushDebugGroup' on 'GPUCommandEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -3130,7 +3149,7 @@
}
popDebugGroup() {
- webidl.assertBranded(this, GPUCommandEncoder);
+ webidl.assertBranded(this, GPUCommandEncoderPrototype);
const prefix = "Failed to execute 'popDebugGroup' on 'GPUCommandEncoder'";
const device = assertDevice(this, { prefix, context: "this" });
const commandEncoderRid = assertResource(this, {
@@ -3150,7 +3169,7 @@
* @param {string} markerLabel
*/
insertDebugMarker(markerLabel) {
- webidl.assertBranded(this, GPUCommandEncoder);
+ webidl.assertBranded(this, GPUCommandEncoderPrototype);
const prefix =
"Failed to execute 'insertDebugMarker' on 'GPUCommandEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -3178,7 +3197,7 @@
* @param {number} queryIndex
*/
writeTimestamp(querySet, queryIndex) {
- webidl.assertBranded(this, GPUCommandEncoder);
+ webidl.assertBranded(this, GPUCommandEncoderPrototype);
const prefix =
"Failed to execute 'writeTimestamp' on 'GPUCommandEncoder'";
webidl.requiredArguments(arguments.length, 2, { prefix });
@@ -3229,7 +3248,7 @@
destination,
destinationOffset,
) {
- webidl.assertBranded(this, GPUCommandEncoder);
+ webidl.assertBranded(this, GPUCommandEncoderPrototype);
const prefix =
"Failed to execute 'resolveQuerySet' on 'GPUCommandEncoder'";
webidl.requiredArguments(arguments.length, 5, { prefix });
@@ -3295,7 +3314,7 @@
* @returns {GPUCommandBuffer}
*/
finish(descriptor = {}) {
- webidl.assertBranded(this, GPUCommandEncoder);
+ webidl.assertBranded(this, GPUCommandEncoderPrototype);
const prefix = "Failed to execute 'finish' on 'GPUCommandEncoder'";
descriptor = webidl.converters.GPUCommandBufferDescriptor(descriptor, {
prefix,
@@ -3332,6 +3351,7 @@
}
}
GPUObjectBaseMixin("GPUCommandEncoder", GPUCommandEncoder);
+ const GPUCommandEncoderPrototype = GPUCommandEncoder.prototype;
const _encoder = Symbol("[[encoder]]");
@@ -3378,7 +3398,7 @@
* @param {number} maxDepth
*/
setViewport(x, y, width, height, minDepth, maxDepth) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'setViewport' on 'GPUComputePassEncoder'";
webidl.requiredArguments(arguments.length, 6, { prefix });
@@ -3424,7 +3444,7 @@
* @param {number} height
*/
setScissorRect(x, y, width, height) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'setScissorRect' on 'GPUComputePassEncoder'";
webidl.requiredArguments(arguments.length, 4, { prefix });
@@ -3466,7 +3486,7 @@
* @param {GPUColor} color
*/
setBlendConstant(color) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'setBlendConstant' on 'GPUComputePassEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -3493,7 +3513,7 @@
* @param {number} reference
*/
setStencilReference(reference) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'setStencilReference' on 'GPUComputePassEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -3529,7 +3549,7 @@
* @param {number} queryIndex
*/
beginPipelineStatisticsQuery(querySet, queryIndex) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'beginPipelineStatisticsQuery' on 'GPURenderPassEncoder'";
webidl.requiredArguments(arguments.length, 2, { prefix });
@@ -3567,7 +3587,7 @@
}
endPipelineStatisticsQuery() {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'endPipelineStatisticsQuery' on 'GPURenderPassEncoder'";
assertDevice(this[_encoder], {
@@ -3589,7 +3609,7 @@
* @param {number} queryIndex
*/
writeTimestamp(querySet, queryIndex) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'writeTimestamp' on 'GPURenderPassEncoder'";
webidl.requiredArguments(arguments.length, 2, { prefix });
@@ -3630,7 +3650,7 @@
* @param {GPURenderBundle[]} bundles
*/
executeBundles(bundles) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'executeBundles' on 'GPURenderPassEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -3664,7 +3684,7 @@
}
endPass() {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix = "Failed to execute 'endPass' on 'GPURenderPassEncoder'";
const device = assertDevice(this[_encoder], {
prefix,
@@ -3691,7 +3711,7 @@
dynamicOffsetsDataStart,
dynamicOffsetsDataLength,
) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'setBindGroup' on 'GPURenderPassEncoder'";
const device = assertDevice(this[_encoder], {
@@ -3712,7 +3732,12 @@
resourceContext: "Argument 2",
selfContext: "this",
});
- if (!(dynamicOffsetsData instanceof Uint32Array)) {
+ if (
+ !(ObjectPrototypeIsPrototypeOf(
+ Uint32ArrayPrototype,
+ dynamicOffsetsData,
+ ))
+ ) {
dynamicOffsetsData = new Uint32Array(dynamicOffsetsData ?? []);
dynamicOffsetsDataStart = 0;
dynamicOffsetsDataLength = dynamicOffsetsData.length;
@@ -3731,7 +3756,7 @@
* @param {string} groupLabel
*/
pushDebugGroup(groupLabel) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'pushDebugGroup' on 'GPURenderPassEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -3755,7 +3780,7 @@
}
popDebugGroup() {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'popDebugGroup' on 'GPURenderPassEncoder'";
assertDevice(this[_encoder], {
@@ -3776,7 +3801,7 @@
* @param {string} markerLabel
*/
insertDebugMarker(markerLabel) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'insertDebugMarker' on 'GPURenderPassEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -3803,7 +3828,7 @@
* @param {GPURenderPipeline} pipeline
*/
setPipeline(pipeline) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'setPipeline' on 'GPURenderPassEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -3842,7 +3867,7 @@
* @param {number} size
*/
setIndexBuffer(buffer, indexFormat, offset = 0, size) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'setIndexBuffer' on 'GPURenderPassEncoder'";
webidl.requiredArguments(arguments.length, 2, { prefix });
@@ -3898,7 +3923,7 @@
* @param {number} size
*/
setVertexBuffer(slot, buffer, offset = 0, size) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'setVertexBuffer' on 'GPURenderPassEncoder'";
webidl.requiredArguments(arguments.length, 2, { prefix });
@@ -3954,7 +3979,7 @@
* @param {number} firstInstance
*/
draw(vertexCount, instanceCount = 1, firstVertex = 0, firstInstance = 0) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix = "Failed to execute 'draw' on 'GPURenderPassEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
vertexCount = webidl.converters.GPUSize32(vertexCount, {
@@ -4005,7 +4030,7 @@
baseVertex = 0,
firstInstance = 0,
) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'drawIndexed' on 'GPURenderPassEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -4053,7 +4078,7 @@
* @param {number} indirectOffset
*/
drawIndirect(indirectBuffer, indirectOffset) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'drawIndirect' on 'GPURenderPassEncoder'";
webidl.requiredArguments(arguments.length, 2, { prefix });
@@ -4095,7 +4120,7 @@
* @param {number} indirectOffset
*/
drawIndexedIndirect(indirectBuffer, indirectOffset) {
- webidl.assertBranded(this, GPURenderPassEncoder);
+ webidl.assertBranded(this, GPURenderPassEncoderPrototype);
const prefix =
"Failed to execute 'drawIndirect' on 'GPURenderPassEncoder'";
webidl.requiredArguments(arguments.length, 2, { prefix });
@@ -4141,6 +4166,7 @@
}
}
GPUObjectBaseMixin("GPURenderPassEncoder", GPURenderPassEncoder);
+ const GPURenderPassEncoderPrototype = GPURenderPassEncoder.prototype;
/**
* @param {string | null} label
@@ -4181,7 +4207,7 @@
* @param {GPUComputePipeline} pipeline
*/
setPipeline(pipeline) {
- webidl.assertBranded(this, GPUComputePassEncoder);
+ webidl.assertBranded(this, GPUComputePassEncoderPrototype);
const prefix =
"Failed to execute 'setPipeline' on 'GPUComputePassEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -4219,7 +4245,7 @@
* @param {number} z
*/
dispatch(x, y = 1, z = 1) {
- webidl.assertBranded(this, GPUComputePassEncoder);
+ webidl.assertBranded(this, GPUComputePassEncoderPrototype);
const prefix = "Failed to execute 'dispatch' on 'GPUComputePassEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
x = webidl.converters.GPUSize32(x, { prefix, context: "Argument 1" });
@@ -4247,7 +4273,7 @@
* @param {number} indirectOffset
*/
dispatchIndirect(indirectBuffer, indirectOffset) {
- webidl.assertBranded(this, GPUComputePassEncoder);
+ webidl.assertBranded(this, GPUComputePassEncoderPrototype);
const prefix =
"Failed to execute 'dispatchIndirect' on 'GPUComputePassEncoder'";
webidl.requiredArguments(arguments.length, 2, { prefix });
@@ -4289,7 +4315,7 @@
* @param {number} queryIndex
*/
beginPipelineStatisticsQuery(querySet, queryIndex) {
- webidl.assertBranded(this, GPUComputePassEncoder);
+ webidl.assertBranded(this, GPUComputePassEncoderPrototype);
const prefix =
"Failed to execute 'beginPipelineStatisticsQuery' on 'GPUComputePassEncoder'";
webidl.requiredArguments(arguments.length, 2, { prefix });
@@ -4330,7 +4356,7 @@
}
endPipelineStatisticsQuery() {
- webidl.assertBranded(this, GPUComputePassEncoder);
+ webidl.assertBranded(this, GPUComputePassEncoderPrototype);
const prefix =
"Failed to execute 'endPipelineStatisticsQuery' on 'GPUComputePassEncoder'";
assertDevice(this[_encoder], {
@@ -4352,7 +4378,7 @@
* @param {number} queryIndex
*/
writeTimestamp(querySet, queryIndex) {
- webidl.assertBranded(this, GPUComputePassEncoder);
+ webidl.assertBranded(this, GPUComputePassEncoderPrototype);
const prefix =
"Failed to execute 'writeTimestamp' on 'GPUComputePassEncoder'";
webidl.requiredArguments(arguments.length, 2, { prefix });
@@ -4390,7 +4416,7 @@
}
endPass() {
- webidl.assertBranded(this, GPUComputePassEncoder);
+ webidl.assertBranded(this, GPUComputePassEncoderPrototype);
const prefix = "Failed to execute 'endPass' on 'GPUComputePassEncoder'";
const device = assertDevice(this[_encoder], {
prefix,
@@ -4417,7 +4443,7 @@
dynamicOffsetsDataStart,
dynamicOffsetsDataLength,
) {
- webidl.assertBranded(this, GPUComputePassEncoder);
+ webidl.assertBranded(this, GPUComputePassEncoderPrototype);
const prefix =
"Failed to execute 'setBindGroup' on 'GPUComputePassEncoder'";
const device = assertDevice(this[_encoder], {
@@ -4438,7 +4464,12 @@
resourceContext: "Argument 2",
selfContext: "this",
});
- if (!(dynamicOffsetsData instanceof Uint32Array)) {
+ if (
+ !(ObjectPrototypeIsPrototypeOf(
+ Uint32ArrayPrototype,
+ dynamicOffsetsData,
+ ))
+ ) {
dynamicOffsetsData = new Uint32Array(dynamicOffsetsData ?? []);
dynamicOffsetsDataStart = 0;
dynamicOffsetsDataLength = dynamicOffsetsData.length;
@@ -4457,7 +4488,7 @@
* @param {string} groupLabel
*/
pushDebugGroup(groupLabel) {
- webidl.assertBranded(this, GPUComputePassEncoder);
+ webidl.assertBranded(this, GPUComputePassEncoderPrototype);
const prefix =
"Failed to execute 'pushDebugGroup' on 'GPUComputePassEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -4481,7 +4512,7 @@
}
popDebugGroup() {
- webidl.assertBranded(this, GPUComputePassEncoder);
+ webidl.assertBranded(this, GPUComputePassEncoderPrototype);
const prefix =
"Failed to execute 'popDebugGroup' on 'GPUComputePassEncoder'";
assertDevice(this[_encoder], {
@@ -4502,7 +4533,7 @@
* @param {string} markerLabel
*/
insertDebugMarker(markerLabel) {
- webidl.assertBranded(this, GPUComputePassEncoder);
+ webidl.assertBranded(this, GPUComputePassEncoderPrototype);
const prefix =
"Failed to execute 'insertDebugMarker' on 'GPUComputePassEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -4534,6 +4565,7 @@
}
}
GPUObjectBaseMixin("GPUComputePassEncoder", GPUComputePassEncoder);
+ const GPUComputePassEncoderPrototype = GPUComputePassEncoder.prototype;
/**
* @param {string | null} label
@@ -4617,7 +4649,7 @@
* @param {GPURenderBundleDescriptor} descriptor
*/
finish(descriptor = {}) {
- webidl.assertBranded(this, GPURenderBundleEncoder);
+ webidl.assertBranded(this, GPURenderBundleEncoder.prototype);
const prefix = "Failed to execute 'finish' on 'GPURenderBundleEncoder'";
descriptor = webidl.converters.GPURenderBundleDescriptor(descriptor, {
prefix,
@@ -4655,7 +4687,7 @@
dynamicOffsetsDataStart,
dynamicOffsetsDataLength,
) {
- webidl.assertBranded(this, GPURenderBundleEncoder);
+ webidl.assertBranded(this, GPURenderBundleEncoder.prototype);
const prefix =
"Failed to execute 'setBindGroup' on 'GPURenderBundleEncoder'";
const device = assertDevice(this, { prefix, context: "this" });
@@ -4672,7 +4704,12 @@
resourceContext: "Argument 2",
selfContext: "this",
});
- if (!(dynamicOffsetsData instanceof Uint32Array)) {
+ if (
+ !(ObjectPrototypeIsPrototypeOf(
+ Uint32ArrayPrototype,
+ dynamicOffsetsData,
+ ))
+ ) {
dynamicOffsetsData = new Uint32Array(dynamicOffsetsData ?? []);
dynamicOffsetsDataStart = 0;
dynamicOffsetsDataLength = dynamicOffsetsData.length;
@@ -4691,7 +4728,7 @@
* @param {string} groupLabel
*/
pushDebugGroup(groupLabel) {
- webidl.assertBranded(this, GPURenderBundleEncoder);
+ webidl.assertBranded(this, GPURenderBundleEncoder.prototype);
const prefix =
"Failed to execute 'pushDebugGroup' on 'GPURenderBundleEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -4711,7 +4748,7 @@
}
popDebugGroup() {
- webidl.assertBranded(this, GPURenderBundleEncoder);
+ webidl.assertBranded(this, GPURenderBundleEncoder.prototype);
const prefix =
"Failed to execute 'popDebugGroup' on 'GPURenderBundleEncoder'";
assertDevice(this, { prefix, context: "this" });
@@ -4728,7 +4765,7 @@
* @param {string} markerLabel
*/
insertDebugMarker(markerLabel) {
- webidl.assertBranded(this, GPURenderBundleEncoder);
+ webidl.assertBranded(this, GPURenderBundleEncoder.prototype);
const prefix =
"Failed to execute 'insertDebugMarker' on 'GPURenderBundleEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -4751,7 +4788,7 @@
* @param {GPURenderPipeline} pipeline
*/
setPipeline(pipeline) {
- webidl.assertBranded(this, GPURenderBundleEncoder);
+ webidl.assertBranded(this, GPURenderBundleEncoder.prototype);
const prefix =
"Failed to execute 'setPipeline' on 'GPURenderBundleEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -4786,7 +4823,7 @@
* @param {number} size
*/
setIndexBuffer(buffer, indexFormat, offset = 0, size = 0) {
- webidl.assertBranded(this, GPURenderBundleEncoder);
+ webidl.assertBranded(this, GPURenderBundleEncoder.prototype);
const prefix =
"Failed to execute 'setIndexBuffer' on 'GPURenderBundleEncoder'";
webidl.requiredArguments(arguments.length, 2, { prefix });
@@ -4836,7 +4873,7 @@
* @param {number} size
*/
setVertexBuffer(slot, buffer, offset = 0, size = 0) {
- webidl.assertBranded(this, GPURenderBundleEncoder);
+ webidl.assertBranded(this, GPURenderBundleEncoder.prototype);
const prefix =
"Failed to execute 'setVertexBuffer' on 'GPURenderBundleEncoder'";
webidl.requiredArguments(arguments.length, 2, { prefix });
@@ -4886,7 +4923,7 @@
* @param {number} firstInstance
*/
draw(vertexCount, instanceCount = 1, firstVertex = 0, firstInstance = 0) {
- webidl.assertBranded(this, GPURenderBundleEncoder);
+ webidl.assertBranded(this, GPURenderBundleEncoder.prototype);
const prefix = "Failed to execute 'draw' on 'GPURenderBundleEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
vertexCount = webidl.converters.GPUSize32(vertexCount, {
@@ -4933,7 +4970,7 @@
baseVertex = 0,
firstInstance = 0,
) {
- webidl.assertBranded(this, GPURenderBundleEncoder);
+ webidl.assertBranded(this, GPURenderBundleEncoder.prototype);
const prefix =
"Failed to execute 'drawIndexed' on 'GPURenderBundleEncoder'";
webidl.requiredArguments(arguments.length, 1, { prefix });
@@ -4977,7 +5014,7 @@
* @param {number} indirectOffset
*/
drawIndirect(indirectBuffer, indirectOffset) {
- webidl.assertBranded(this, GPURenderBundleEncoder);
+ webidl.assertBranded(this, GPURenderBundleEncoder.prototype);
const prefix =
"Failed to execute 'drawIndirect' on 'GPURenderBundleEncoder'";
webidl.requiredArguments(arguments.length, 2, { prefix });
@@ -5108,7 +5145,7 @@
}
destroy() {
- webidl.assertBranded(this, GPUQuerySet);
+ webidl.assertBranded(this, GPUQuerySetPrototype);
this[_cleanup]();
}
@@ -5121,6 +5158,7 @@
}
}
GPUObjectBaseMixin("GPUQuerySet", GPUQuerySet);
+ const GPUQuerySetPrototype = GPUQuerySet.prototype;
window.__bootstrap.webgpu = {
gpu: webidl.createBranded(GPU),