Closed kainino0x closed 5 months ago
Oh note: I did not update the generator, so these changes are in dist/
only.
(Actually, this reduces the textual diff with the generator output, which was only generating one non-branded interface
instead of a branded interface
and a declare var
.)
-interface GPUBufferUsage {
+declare var GPUBufferUsage: {
readonly MAP_READ: GPUFlagsConstant;
readonly MAP_WRITE: GPUFlagsConstant;
readonly COPY_SRC: GPUFlagsConstant;
readonly COPY_DST: GPUFlagsConstant;
readonly INDEX: GPUFlagsConstant;
readonly VERTEX: GPUFlagsConstant;
readonly UNIFORM: GPUFlagsConstant;
readonly STORAGE: GPUFlagsConstant;
readonly INDIRECT: GPUFlagsConstant;
readonly QUERY_RESOLVE: GPUFlagsConstant;
-}
+};
-interface GPUColorWrite {
+declare var GPUColorWrite: {
readonly RED: GPUFlagsConstant;
readonly GREEN: GPUFlagsConstant;
readonly BLUE: GPUFlagsConstant;
readonly ALPHA: GPUFlagsConstant;
readonly ALL: GPUFlagsConstant;
-}
+};
-interface GPUMapMode {
+declare var GPUMapMode: {
readonly READ: GPUFlagsConstant;
readonly WRITE: GPUFlagsConstant;
-}
+};
-interface GPUShaderStage {
+declare var GPUShaderStage: {
readonly VERTEX: GPUFlagsConstant;
readonly FRAGMENT: GPUFlagsConstant;
readonly COMPUTE: GPUFlagsConstant;
-}
+};
-interface GPUTextureUsage {
+declare var GPUTextureUsage: {
readonly COPY_SRC: GPUFlagsConstant;
readonly COPY_DST: GPUFlagsConstant;
readonly TEXTURE_BINDING: GPUFlagsConstant;
readonly STORAGE_BINDING: GPUFlagsConstant;
readonly RENDER_ATTACHMENT: GPUFlagsConstant;
-}
+};
A constructor is needed in GPUAdapterInfo for
instanceof GPUAdapterInfo
to work (https://github.com/gpuweb/cts/pull/3679/files#diff-b1c3098d2cfb3e28e1d76d21e07c37131894fe5eeb3f55f0646c15b0f3db2b02R25).Also, after the spec switch from IDL
interface
s tonamespace
s for bitflags, there are no longer prototypes or constructors on those objects, at least according to Chromium:GPUBufferUsage instanceof Function
is false'prototype' in GPUBufferUsage
is falseGPUBufferUsage.__proto__ === ({}).__proto__
And they don't name types so I've removed the TS
interface
s too. Associated CTS fixes in https://github.com/gpuweb/cts/pull/3770