2021-09-03 17:23:35 +00:00
|
|
|
interface mixin GPUObjectBase {
|
2022-05-24 07:01:19 +00:00
|
|
|
attribute USVString label;
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUObjectDescriptorBase {
|
2023-10-04 04:25:56 +00:00
|
|
|
USVString label = "";
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUSupportedLimits {
|
|
|
|
readonly attribute unsigned long maxTextureDimension1D;
|
|
|
|
readonly attribute unsigned long maxTextureDimension2D;
|
|
|
|
readonly attribute unsigned long maxTextureDimension3D;
|
|
|
|
readonly attribute unsigned long maxTextureArrayLayers;
|
|
|
|
readonly attribute unsigned long maxBindGroups;
|
2023-01-14 16:07:46 +00:00
|
|
|
readonly attribute unsigned long maxBindingsPerBindGroup;
|
2021-09-03 17:23:35 +00:00
|
|
|
readonly attribute unsigned long maxDynamicUniformBuffersPerPipelineLayout;
|
|
|
|
readonly attribute unsigned long maxDynamicStorageBuffersPerPipelineLayout;
|
|
|
|
readonly attribute unsigned long maxSampledTexturesPerShaderStage;
|
|
|
|
readonly attribute unsigned long maxSamplersPerShaderStage;
|
|
|
|
readonly attribute unsigned long maxStorageBuffersPerShaderStage;
|
|
|
|
readonly attribute unsigned long maxStorageTexturesPerShaderStage;
|
|
|
|
readonly attribute unsigned long maxUniformBuffersPerShaderStage;
|
|
|
|
readonly attribute unsigned long long maxUniformBufferBindingSize;
|
|
|
|
readonly attribute unsigned long long maxStorageBufferBindingSize;
|
|
|
|
readonly attribute unsigned long minUniformBufferOffsetAlignment;
|
|
|
|
readonly attribute unsigned long minStorageBufferOffsetAlignment;
|
|
|
|
readonly attribute unsigned long maxVertexBuffers;
|
2022-09-20 16:06:12 +00:00
|
|
|
readonly attribute unsigned long long maxBufferSize;
|
2021-09-03 17:23:35 +00:00
|
|
|
readonly attribute unsigned long maxVertexAttributes;
|
|
|
|
readonly attribute unsigned long maxVertexBufferArrayStride;
|
|
|
|
readonly attribute unsigned long maxInterStageShaderComponents;
|
2024-04-02 18:36:04 +00:00
|
|
|
readonly attribute unsigned long maxColorAttachments;
|
|
|
|
readonly attribute unsigned long maxColorAttachmentBytesPerSample;
|
2021-09-03 17:23:35 +00:00
|
|
|
readonly attribute unsigned long maxComputeWorkgroupStorageSize;
|
|
|
|
readonly attribute unsigned long maxComputeInvocationsPerWorkgroup;
|
|
|
|
readonly attribute unsigned long maxComputeWorkgroupSizeX;
|
|
|
|
readonly attribute unsigned long maxComputeWorkgroupSizeY;
|
|
|
|
readonly attribute unsigned long maxComputeWorkgroupSizeZ;
|
|
|
|
readonly attribute unsigned long maxComputeWorkgroupsPerDimension;
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUSupportedFeatures {
|
|
|
|
readonly setlike<DOMString>;
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2022-05-24 07:01:19 +00:00
|
|
|
interface GPUAdapterInfo {
|
2022-07-26 03:31:58 +00:00
|
|
|
readonly attribute DOMString vendor;
|
|
|
|
readonly attribute DOMString architecture;
|
|
|
|
readonly attribute DOMString device;
|
|
|
|
readonly attribute DOMString description;
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
interface mixin NavigatorGPU {
|
2021-11-26 21:05:16 +00:00
|
|
|
[SameObject, SecureContext] readonly attribute GPU gpu;
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
Navigator includes NavigatorGPU;
|
|
|
|
WorkerNavigator includes NavigatorGPU;
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPU {
|
|
|
|
Promise<GPUAdapter?> requestAdapter(optional GPURequestAdapterOptions options = {});
|
2024-04-02 18:36:04 +00:00
|
|
|
GPUTextureFormat getPreferredCanvasFormat();
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPURequestAdapterOptions {
|
|
|
|
GPUPowerPreference powerPreference;
|
|
|
|
boolean forceFallbackAdapter = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUPowerPreference {
|
|
|
|
"low-power",
|
2023-06-06 15:08:32 +00:00
|
|
|
"high-performance",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUAdapter {
|
|
|
|
[SameObject] readonly attribute GPUSupportedFeatures features;
|
|
|
|
[SameObject] readonly attribute GPUSupportedLimits limits;
|
|
|
|
readonly attribute boolean isFallbackAdapter;
|
|
|
|
|
|
|
|
Promise<GPUDevice> requestDevice(optional GPUDeviceDescriptor descriptor = {});
|
2024-04-02 18:36:04 +00:00
|
|
|
Promise<GPUAdapterInfo> requestAdapterInfo();
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUDeviceDescriptor
|
|
|
|
: GPUObjectDescriptorBase {
|
2021-09-03 17:23:35 +00:00
|
|
|
sequence<GPUFeatureName> requiredFeatures = [];
|
|
|
|
record<DOMString, GPUSize64> requiredLimits = {};
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUFeatureName {
|
2023-03-03 17:09:17 +00:00
|
|
|
// api
|
2021-11-29 02:22:15 +00:00
|
|
|
"depth-clip-control",
|
2023-03-03 17:09:17 +00:00
|
|
|
// texture formats
|
2021-09-03 17:23:35 +00:00
|
|
|
"depth32float-stencil8",
|
|
|
|
"texture-compression-bc",
|
2021-11-26 21:05:16 +00:00
|
|
|
"texture-compression-etc2",
|
|
|
|
"texture-compression-astc",
|
2023-06-06 15:08:32 +00:00
|
|
|
// api
|
|
|
|
"timestamp-query",
|
|
|
|
"indirect-first-instance",
|
|
|
|
// shader
|
|
|
|
"shader-f16",
|
2023-04-19 11:34:29 +00:00
|
|
|
"rg11b10ufloat-renderable",
|
2023-10-13 10:07:11 +00:00
|
|
|
"bgra8unorm-storage",
|
2023-12-04 13:23:13 +00:00
|
|
|
"float32-filterable",
|
2023-03-03 17:09:17 +00:00
|
|
|
|
|
|
|
// extended from spec
|
|
|
|
|
|
|
|
// texture formats
|
|
|
|
"texture-format-16-bit-norm",
|
|
|
|
"texture-compression-astc-hdr",
|
|
|
|
"texture-adapter-specific-format-features",
|
|
|
|
// api
|
|
|
|
"pipeline-statistics-query",
|
|
|
|
"timestamp-query-inside-passes",
|
|
|
|
"mappable-primary-buffers",
|
|
|
|
"texture-binding-array",
|
|
|
|
"buffer-binding-array",
|
|
|
|
"storage-resource-binding-array",
|
|
|
|
"sampled-texture-and-storage-buffer-array-non-uniform-indexing",
|
|
|
|
"uniform-buffer-and-storage-texture-array-non-uniform-indexing",
|
|
|
|
"partially-bound-binding-array",
|
|
|
|
"multi-draw-indirect",
|
|
|
|
"multi-draw-indirect-count",
|
|
|
|
"push-constants",
|
|
|
|
"address-mode-clamp-to-zero",
|
|
|
|
"address-mode-clamp-to-border",
|
|
|
|
"polygon-mode-line",
|
|
|
|
"polygon-mode-point",
|
|
|
|
"conservative-rasterization",
|
|
|
|
"vertex-writable-storage",
|
|
|
|
"clear-texture",
|
|
|
|
"spirv-shader-passthrough",
|
|
|
|
"multiview",
|
|
|
|
"vertex-attribute-64-bit",
|
|
|
|
// shader
|
|
|
|
"shader-f64",
|
|
|
|
"shader-i16",
|
|
|
|
"shader-primitive-index",
|
|
|
|
"shader-early-depth-test",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUDevice : EventTarget {
|
|
|
|
[SameObject] readonly attribute GPUSupportedFeatures features;
|
|
|
|
[SameObject] readonly attribute GPUSupportedLimits limits;
|
|
|
|
|
|
|
|
[SameObject] readonly attribute GPUQueue queue;
|
|
|
|
|
|
|
|
undefined destroy();
|
|
|
|
|
|
|
|
GPUBuffer createBuffer(GPUBufferDescriptor descriptor);
|
|
|
|
GPUTexture createTexture(GPUTextureDescriptor descriptor);
|
|
|
|
GPUSampler createSampler(optional GPUSamplerDescriptor descriptor = {});
|
|
|
|
|
|
|
|
GPUBindGroupLayout createBindGroupLayout(GPUBindGroupLayoutDescriptor descriptor);
|
|
|
|
GPUPipelineLayout createPipelineLayout(GPUPipelineLayoutDescriptor descriptor);
|
|
|
|
GPUBindGroup createBindGroup(GPUBindGroupDescriptor descriptor);
|
|
|
|
|
|
|
|
GPUShaderModule createShaderModule(GPUShaderModuleDescriptor descriptor);
|
|
|
|
GPUComputePipeline createComputePipeline(GPUComputePipelineDescriptor descriptor);
|
|
|
|
GPURenderPipeline createRenderPipeline(GPURenderPipelineDescriptor descriptor);
|
|
|
|
Promise<GPUComputePipeline> createComputePipelineAsync(GPUComputePipelineDescriptor descriptor);
|
|
|
|
Promise<GPURenderPipeline> createRenderPipelineAsync(GPURenderPipelineDescriptor descriptor);
|
|
|
|
|
|
|
|
GPUCommandEncoder createCommandEncoder(optional GPUCommandEncoderDescriptor descriptor = {});
|
|
|
|
GPURenderBundleEncoder createRenderBundleEncoder(GPURenderBundleEncoderDescriptor descriptor);
|
|
|
|
|
|
|
|
GPUQuerySet createQuerySet(GPUQuerySetDescriptor descriptor);
|
|
|
|
};
|
|
|
|
GPUDevice includes GPUObjectBase;
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUBuffer {
|
2023-06-06 15:08:32 +00:00
|
|
|
readonly attribute GPUSize64Out size;
|
|
|
|
readonly attribute GPUFlagsConstant usage;
|
2022-09-20 16:06:12 +00:00
|
|
|
|
|
|
|
readonly attribute GPUBufferMapState mapState;
|
|
|
|
|
2021-09-03 17:23:35 +00:00
|
|
|
Promise<undefined> mapAsync(GPUMapModeFlags mode, optional GPUSize64 offset = 0, optional GPUSize64 size);
|
|
|
|
ArrayBuffer getMappedRange(optional GPUSize64 offset = 0, optional GPUSize64 size);
|
|
|
|
undefined unmap();
|
|
|
|
|
|
|
|
undefined destroy();
|
|
|
|
};
|
|
|
|
GPUBuffer includes GPUObjectBase;
|
|
|
|
|
2022-09-20 16:06:12 +00:00
|
|
|
enum GPUBufferMapState {
|
|
|
|
"unmapped",
|
|
|
|
"pending",
|
2023-06-06 15:08:32 +00:00
|
|
|
"mapped",
|
2022-09-20 16:06:12 +00:00
|
|
|
};
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUBufferDescriptor
|
|
|
|
: GPUObjectDescriptorBase {
|
2021-09-03 17:23:35 +00:00
|
|
|
required GPUSize64 size;
|
|
|
|
required GPUBufferUsageFlags usage;
|
|
|
|
boolean mappedAtCreation = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef [EnforceRange] unsigned long GPUBufferUsageFlags;
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2022-05-24 07:01:19 +00:00
|
|
|
namespace GPUBufferUsage {
|
2021-09-03 17:23:35 +00:00
|
|
|
const GPUFlagsConstant MAP_READ = 0x0001;
|
|
|
|
const GPUFlagsConstant MAP_WRITE = 0x0002;
|
|
|
|
const GPUFlagsConstant COPY_SRC = 0x0004;
|
|
|
|
const GPUFlagsConstant COPY_DST = 0x0008;
|
|
|
|
const GPUFlagsConstant INDEX = 0x0010;
|
|
|
|
const GPUFlagsConstant VERTEX = 0x0020;
|
|
|
|
const GPUFlagsConstant UNIFORM = 0x0040;
|
|
|
|
const GPUFlagsConstant STORAGE = 0x0080;
|
|
|
|
const GPUFlagsConstant INDIRECT = 0x0100;
|
|
|
|
const GPUFlagsConstant QUERY_RESOLVE = 0x0200;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef [EnforceRange] unsigned long GPUMapModeFlags;
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2022-05-24 07:01:19 +00:00
|
|
|
namespace GPUMapMode {
|
2021-09-03 17:23:35 +00:00
|
|
|
const GPUFlagsConstant READ = 0x0001;
|
|
|
|
const GPUFlagsConstant WRITE = 0x0002;
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUTexture {
|
|
|
|
GPUTextureView createView(optional GPUTextureViewDescriptor descriptor = {});
|
|
|
|
|
|
|
|
undefined destroy();
|
2022-07-26 03:31:58 +00:00
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
readonly attribute GPUIntegerCoordinateOut width;
|
|
|
|
readonly attribute GPUIntegerCoordinateOut height;
|
|
|
|
readonly attribute GPUIntegerCoordinateOut depthOrArrayLayers;
|
|
|
|
readonly attribute GPUIntegerCoordinateOut mipLevelCount;
|
|
|
|
readonly attribute GPUSize32Out sampleCount;
|
2022-07-26 03:31:58 +00:00
|
|
|
readonly attribute GPUTextureDimension dimension;
|
|
|
|
readonly attribute GPUTextureFormat format;
|
2023-06-06 15:08:32 +00:00
|
|
|
readonly attribute GPUFlagsConstant usage;
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
GPUTexture includes GPUObjectBase;
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUTextureDescriptor
|
|
|
|
: GPUObjectDescriptorBase {
|
2021-09-03 17:23:35 +00:00
|
|
|
required GPUExtent3D size;
|
|
|
|
GPUIntegerCoordinate mipLevelCount = 1;
|
|
|
|
GPUSize32 sampleCount = 1;
|
|
|
|
GPUTextureDimension dimension = "2d";
|
|
|
|
required GPUTextureFormat format;
|
|
|
|
required GPUTextureUsageFlags usage;
|
2023-01-18 21:03:56 +00:00
|
|
|
sequence<GPUTextureFormat> viewFormats = [];
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUTextureDimension {
|
|
|
|
"1d",
|
|
|
|
"2d",
|
2023-06-06 15:08:32 +00:00
|
|
|
"3d",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef [EnforceRange] unsigned long GPUTextureUsageFlags;
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2022-05-24 07:01:19 +00:00
|
|
|
namespace GPUTextureUsage {
|
2021-09-03 17:23:35 +00:00
|
|
|
const GPUFlagsConstant COPY_SRC = 0x01;
|
|
|
|
const GPUFlagsConstant COPY_DST = 0x02;
|
|
|
|
const GPUFlagsConstant TEXTURE_BINDING = 0x04;
|
|
|
|
const GPUFlagsConstant STORAGE_BINDING = 0x08;
|
|
|
|
const GPUFlagsConstant RENDER_ATTACHMENT = 0x10;
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUTextureView {
|
|
|
|
};
|
|
|
|
GPUTextureView includes GPUObjectBase;
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUTextureViewDescriptor
|
|
|
|
: GPUObjectDescriptorBase {
|
2021-09-03 17:23:35 +00:00
|
|
|
GPUTextureFormat format;
|
|
|
|
GPUTextureViewDimension dimension;
|
|
|
|
GPUTextureAspect aspect = "all";
|
|
|
|
GPUIntegerCoordinate baseMipLevel = 0;
|
|
|
|
GPUIntegerCoordinate mipLevelCount;
|
|
|
|
GPUIntegerCoordinate baseArrayLayer = 0;
|
|
|
|
GPUIntegerCoordinate arrayLayerCount;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUTextureViewDimension {
|
|
|
|
"1d",
|
|
|
|
"2d",
|
|
|
|
"2d-array",
|
|
|
|
"cube",
|
|
|
|
"cube-array",
|
2023-06-06 15:08:32 +00:00
|
|
|
"3d",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUTextureAspect {
|
|
|
|
"all",
|
|
|
|
"stencil-only",
|
2023-06-06 15:08:32 +00:00
|
|
|
"depth-only",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUTextureFormat {
|
|
|
|
// 8-bit formats
|
|
|
|
"r8unorm",
|
|
|
|
"r8snorm",
|
|
|
|
"r8uint",
|
|
|
|
"r8sint",
|
|
|
|
|
|
|
|
// 16-bit formats
|
|
|
|
"r16uint",
|
|
|
|
"r16sint",
|
|
|
|
"r16float",
|
|
|
|
"rg8unorm",
|
|
|
|
"rg8snorm",
|
|
|
|
"rg8uint",
|
|
|
|
"rg8sint",
|
|
|
|
|
|
|
|
// 32-bit formats
|
|
|
|
"r32uint",
|
|
|
|
"r32sint",
|
|
|
|
"r32float",
|
|
|
|
"rg16uint",
|
|
|
|
"rg16sint",
|
|
|
|
"rg16float",
|
|
|
|
"rgba8unorm",
|
|
|
|
"rgba8unorm-srgb",
|
|
|
|
"rgba8snorm",
|
|
|
|
"rgba8uint",
|
|
|
|
"rgba8sint",
|
|
|
|
"bgra8unorm",
|
|
|
|
"bgra8unorm-srgb",
|
|
|
|
// Packed 32-bit formats
|
|
|
|
"rgb9e5ufloat",
|
2024-04-02 18:36:04 +00:00
|
|
|
"rgb10a2uint",
|
2021-09-03 17:23:35 +00:00
|
|
|
"rgb10a2unorm",
|
|
|
|
"rg11b10ufloat",
|
|
|
|
|
|
|
|
// 64-bit formats
|
|
|
|
"rg32uint",
|
|
|
|
"rg32sint",
|
|
|
|
"rg32float",
|
|
|
|
"rgba16uint",
|
|
|
|
"rgba16sint",
|
|
|
|
"rgba16float",
|
|
|
|
|
|
|
|
// 128-bit formats
|
|
|
|
"rgba32uint",
|
|
|
|
"rgba32sint",
|
|
|
|
"rgba32float",
|
|
|
|
|
2022-03-19 05:31:10 +00:00
|
|
|
// Depth/stencil formats
|
2021-09-03 17:23:35 +00:00
|
|
|
"stencil8",
|
|
|
|
"depth16unorm",
|
|
|
|
"depth24plus",
|
|
|
|
"depth24plus-stencil8",
|
|
|
|
"depth32float",
|
|
|
|
|
2022-03-19 05:31:10 +00:00
|
|
|
// "depth32float-stencil8" feature
|
|
|
|
"depth32float-stencil8",
|
|
|
|
|
2021-09-03 17:23:35 +00:00
|
|
|
// BC compressed formats usable if "texture-compression-bc" is both
|
|
|
|
// supported by the device/user agent and enabled in requestDevice.
|
|
|
|
"bc1-rgba-unorm",
|
|
|
|
"bc1-rgba-unorm-srgb",
|
|
|
|
"bc2-rgba-unorm",
|
|
|
|
"bc2-rgba-unorm-srgb",
|
|
|
|
"bc3-rgba-unorm",
|
|
|
|
"bc3-rgba-unorm-srgb",
|
|
|
|
"bc4-r-unorm",
|
|
|
|
"bc4-r-snorm",
|
|
|
|
"bc5-rg-unorm",
|
|
|
|
"bc5-rg-snorm",
|
|
|
|
"bc6h-rgb-ufloat",
|
|
|
|
"bc6h-rgb-float",
|
|
|
|
"bc7-rgba-unorm",
|
|
|
|
"bc7-rgba-unorm-srgb",
|
|
|
|
|
2021-11-26 21:05:16 +00:00
|
|
|
// ETC2 compressed formats usable if "texture-compression-etc2" is both
|
|
|
|
// supported by the device/user agent and enabled in requestDevice.
|
|
|
|
"etc2-rgb8unorm",
|
|
|
|
"etc2-rgb8unorm-srgb",
|
|
|
|
"etc2-rgb8a1unorm",
|
|
|
|
"etc2-rgb8a1unorm-srgb",
|
|
|
|
"etc2-rgba8unorm",
|
|
|
|
"etc2-rgba8unorm-srgb",
|
|
|
|
"eac-r11unorm",
|
|
|
|
"eac-r11snorm",
|
|
|
|
"eac-rg11unorm",
|
|
|
|
"eac-rg11snorm",
|
|
|
|
|
|
|
|
// ASTC compressed formats usable if "texture-compression-astc" is both
|
|
|
|
// supported by the device/user agent and enabled in requestDevice.
|
|
|
|
"astc-4x4-unorm",
|
|
|
|
"astc-4x4-unorm-srgb",
|
|
|
|
"astc-5x4-unorm",
|
|
|
|
"astc-5x4-unorm-srgb",
|
|
|
|
"astc-5x5-unorm",
|
|
|
|
"astc-5x5-unorm-srgb",
|
|
|
|
"astc-6x5-unorm",
|
|
|
|
"astc-6x5-unorm-srgb",
|
|
|
|
"astc-6x6-unorm",
|
|
|
|
"astc-6x6-unorm-srgb",
|
|
|
|
"astc-8x5-unorm",
|
|
|
|
"astc-8x5-unorm-srgb",
|
|
|
|
"astc-8x6-unorm",
|
|
|
|
"astc-8x6-unorm-srgb",
|
|
|
|
"astc-8x8-unorm",
|
|
|
|
"astc-8x8-unorm-srgb",
|
|
|
|
"astc-10x5-unorm",
|
|
|
|
"astc-10x5-unorm-srgb",
|
|
|
|
"astc-10x6-unorm",
|
|
|
|
"astc-10x6-unorm-srgb",
|
|
|
|
"astc-10x8-unorm",
|
|
|
|
"astc-10x8-unorm-srgb",
|
|
|
|
"astc-10x10-unorm",
|
|
|
|
"astc-10x10-unorm-srgb",
|
|
|
|
"astc-12x10-unorm",
|
|
|
|
"astc-12x10-unorm-srgb",
|
|
|
|
"astc-12x12-unorm",
|
2023-06-06 15:08:32 +00:00
|
|
|
"astc-12x12-unorm-srgb",
|
2022-07-26 03:31:58 +00:00
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUSampler {
|
|
|
|
};
|
|
|
|
GPUSampler includes GPUObjectBase;
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUSamplerDescriptor
|
|
|
|
: GPUObjectDescriptorBase {
|
2021-09-03 17:23:35 +00:00
|
|
|
GPUAddressMode addressModeU = "clamp-to-edge";
|
|
|
|
GPUAddressMode addressModeV = "clamp-to-edge";
|
|
|
|
GPUAddressMode addressModeW = "clamp-to-edge";
|
|
|
|
GPUFilterMode magFilter = "nearest";
|
|
|
|
GPUFilterMode minFilter = "nearest";
|
2022-05-24 07:01:19 +00:00
|
|
|
GPUMipmapFilterMode mipmapFilter = "nearest";
|
2021-09-03 17:23:35 +00:00
|
|
|
float lodMinClamp = 0;
|
|
|
|
float lodMaxClamp = 32;
|
|
|
|
GPUCompareFunction compare;
|
|
|
|
[Clamp] unsigned short maxAnisotropy = 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUAddressMode {
|
|
|
|
"clamp-to-edge",
|
|
|
|
"repeat",
|
2023-06-06 15:08:32 +00:00
|
|
|
"mirror-repeat",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUFilterMode {
|
|
|
|
"nearest",
|
2023-06-06 15:08:32 +00:00
|
|
|
"linear",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2022-05-24 07:01:19 +00:00
|
|
|
enum GPUMipmapFilterMode {
|
|
|
|
"nearest",
|
2023-06-06 15:08:32 +00:00
|
|
|
"linear",
|
2022-05-24 07:01:19 +00:00
|
|
|
};
|
|
|
|
|
2021-09-03 17:23:35 +00:00
|
|
|
enum GPUCompareFunction {
|
|
|
|
"never",
|
|
|
|
"less",
|
|
|
|
"equal",
|
|
|
|
"less-equal",
|
|
|
|
"greater",
|
|
|
|
"not-equal",
|
|
|
|
"greater-equal",
|
2023-06-06 15:08:32 +00:00
|
|
|
"always",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUBindGroupLayout {
|
|
|
|
};
|
|
|
|
GPUBindGroupLayout includes GPUObjectBase;
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUBindGroupLayoutDescriptor
|
|
|
|
: GPUObjectDescriptorBase {
|
2021-09-03 17:23:35 +00:00
|
|
|
required sequence<GPUBindGroupLayoutEntry> entries;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUBindGroupLayoutEntry {
|
|
|
|
required GPUIndex32 binding;
|
|
|
|
required GPUShaderStageFlags visibility;
|
|
|
|
|
|
|
|
GPUBufferBindingLayout buffer;
|
|
|
|
GPUSamplerBindingLayout sampler;
|
|
|
|
GPUTextureBindingLayout texture;
|
|
|
|
GPUStorageTextureBindingLayout storageTexture;
|
|
|
|
};
|
|
|
|
|
2022-05-24 07:01:19 +00:00
|
|
|
typedef [EnforceRange] unsigned long GPUShaderStageFlags;
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2022-05-24 07:01:19 +00:00
|
|
|
namespace GPUShaderStage {
|
|
|
|
const GPUFlagsConstant VERTEX = 0x1;
|
|
|
|
const GPUFlagsConstant FRAGMENT = 0x2;
|
|
|
|
const GPUFlagsConstant COMPUTE = 0x4;
|
|
|
|
};
|
|
|
|
|
2021-09-03 17:23:35 +00:00
|
|
|
enum GPUBufferBindingType {
|
|
|
|
"uniform",
|
|
|
|
"storage",
|
2023-06-06 15:08:32 +00:00
|
|
|
"read-only-storage",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUBufferBindingLayout {
|
|
|
|
GPUBufferBindingType type = "uniform";
|
|
|
|
boolean hasDynamicOffset = false;
|
|
|
|
GPUSize64 minBindingSize = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUSamplerBindingType {
|
|
|
|
"filtering",
|
|
|
|
"non-filtering",
|
2023-06-06 15:08:32 +00:00
|
|
|
"comparison",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUSamplerBindingLayout {
|
|
|
|
GPUSamplerBindingType type = "filtering";
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUTextureSampleType {
|
2021-11-26 21:05:16 +00:00
|
|
|
"float",
|
|
|
|
"unfilterable-float",
|
|
|
|
"depth",
|
|
|
|
"sint",
|
2023-06-06 15:08:32 +00:00
|
|
|
"uint",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUTextureBindingLayout {
|
|
|
|
GPUTextureSampleType sampleType = "float";
|
|
|
|
GPUTextureViewDimension viewDimension = "2d";
|
|
|
|
boolean multisampled = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUStorageTextureAccess {
|
2023-06-06 15:08:32 +00:00
|
|
|
"write-only",
|
2024-04-02 18:36:04 +00:00
|
|
|
"read-only",
|
|
|
|
"read-write",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUStorageTextureBindingLayout {
|
|
|
|
GPUStorageTextureAccess access = "write-only";
|
|
|
|
required GPUTextureFormat format;
|
|
|
|
GPUTextureViewDimension viewDimension = "2d";
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUBindGroup {
|
|
|
|
};
|
|
|
|
GPUBindGroup includes GPUObjectBase;
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUBindGroupDescriptor
|
|
|
|
: GPUObjectDescriptorBase {
|
2021-09-03 17:23:35 +00:00
|
|
|
required GPUBindGroupLayout layout;
|
|
|
|
required sequence<GPUBindGroupEntry> entries;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef (GPUSampler or GPUTextureView or GPUBufferBinding) GPUBindingResource;
|
|
|
|
|
|
|
|
dictionary GPUBindGroupEntry {
|
|
|
|
required GPUIndex32 binding;
|
|
|
|
required GPUBindingResource resource;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUBufferBinding {
|
|
|
|
required GPUBuffer buffer;
|
|
|
|
GPUSize64 offset = 0;
|
|
|
|
GPUSize64 size;
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUPipelineLayout {
|
|
|
|
};
|
|
|
|
GPUPipelineLayout includes GPUObjectBase;
|
|
|
|
|
2023-10-04 04:25:56 +00:00
|
|
|
dictionary GPUPipelineLayoutDescriptor
|
|
|
|
: GPUObjectDescriptorBase {
|
2021-09-03 17:23:35 +00:00
|
|
|
required sequence<GPUBindGroupLayout> bindGroupLayouts;
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUShaderModule {
|
|
|
|
};
|
|
|
|
GPUShaderModule includes GPUObjectBase;
|
|
|
|
|
2023-10-04 04:25:56 +00:00
|
|
|
dictionary GPUShaderModuleDescriptor
|
|
|
|
: GPUObjectDescriptorBase {
|
2021-09-03 17:23:35 +00:00
|
|
|
required USVString code;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUCompilationMessageType {
|
|
|
|
"error",
|
|
|
|
"warning",
|
2023-06-06 15:08:32 +00:00
|
|
|
"info",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), Serializable, SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUCompilationMessage {
|
|
|
|
readonly attribute DOMString message;
|
|
|
|
readonly attribute GPUCompilationMessageType type;
|
|
|
|
readonly attribute unsigned long long lineNum;
|
|
|
|
readonly attribute unsigned long long linePos;
|
|
|
|
readonly attribute unsigned long long offset;
|
|
|
|
readonly attribute unsigned long long length;
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), Serializable, SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUCompilationInfo {
|
|
|
|
readonly attribute FrozenArray<GPUCompilationMessage> messages;
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext, Serializable]
|
|
|
|
interface GPUPipelineError : DOMException {
|
|
|
|
constructor(optional DOMString message = "", GPUPipelineErrorInit options);
|
|
|
|
readonly attribute GPUPipelineErrorReason reason;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUPipelineErrorInit {
|
|
|
|
required GPUPipelineErrorReason reason;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUPipelineErrorReason {
|
|
|
|
"validation",
|
|
|
|
"internal",
|
|
|
|
};
|
|
|
|
|
2022-07-20 16:47:10 +00:00
|
|
|
enum GPUAutoLayoutMode {
|
2023-06-06 15:08:32 +00:00
|
|
|
"auto",
|
2022-07-20 16:47:10 +00:00
|
|
|
};
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUPipelineDescriptorBase
|
|
|
|
: GPUObjectDescriptorBase {
|
2022-07-20 16:47:10 +00:00
|
|
|
required (GPUPipelineLayout or GPUAutoLayoutMode) layout;
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
interface mixin GPUPipelineBase {
|
2022-05-24 07:01:19 +00:00
|
|
|
[NewObject] GPUBindGroupLayout getBindGroupLayout(unsigned long index);
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUProgrammableStage {
|
|
|
|
required GPUShaderModule module;
|
2024-04-02 18:36:04 +00:00
|
|
|
USVString entryPoint;
|
2021-09-03 17:23:35 +00:00
|
|
|
record<USVString, GPUPipelineConstantValue> constants;
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
typedef double GPUPipelineConstantValue; // May represent WGSL's bool, f32, i32, u32, and f16 if enabled.
|
2021-09-03 17:23:35 +00:00
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUComputePipeline {
|
|
|
|
};
|
|
|
|
GPUComputePipeline includes GPUObjectBase;
|
|
|
|
GPUComputePipeline includes GPUPipelineBase;
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUComputePipelineDescriptor
|
|
|
|
: GPUPipelineDescriptorBase {
|
2021-09-03 17:23:35 +00:00
|
|
|
required GPUProgrammableStage compute;
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPURenderPipeline {
|
|
|
|
};
|
|
|
|
GPURenderPipeline includes GPUObjectBase;
|
|
|
|
GPURenderPipeline includes GPUPipelineBase;
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPURenderPipelineDescriptor
|
|
|
|
: GPUPipelineDescriptorBase {
|
2021-09-03 17:23:35 +00:00
|
|
|
required GPUVertexState vertex;
|
|
|
|
GPUPrimitiveState primitive = {};
|
|
|
|
GPUDepthStencilState depthStencil;
|
|
|
|
GPUMultisampleState multisample = {};
|
|
|
|
GPUFragmentState fragment;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUPrimitiveState {
|
|
|
|
GPUPrimitiveTopology topology = "triangle-list";
|
|
|
|
GPUIndexFormat stripIndexFormat;
|
|
|
|
GPUFrontFace frontFace = "ccw";
|
|
|
|
GPUCullMode cullMode = "none";
|
|
|
|
|
2021-11-29 02:22:15 +00:00
|
|
|
// Requires "depth-clip-control" feature.
|
|
|
|
boolean unclippedDepth = false;
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2022-05-24 07:01:19 +00:00
|
|
|
enum GPUPrimitiveTopology {
|
|
|
|
"point-list",
|
|
|
|
"line-list",
|
|
|
|
"line-strip",
|
|
|
|
"triangle-list",
|
2023-06-06 15:08:32 +00:00
|
|
|
"triangle-strip",
|
2022-05-24 07:01:19 +00:00
|
|
|
};
|
|
|
|
|
2021-09-03 17:23:35 +00:00
|
|
|
enum GPUFrontFace {
|
|
|
|
"ccw",
|
2023-06-06 15:08:32 +00:00
|
|
|
"cw",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUCullMode {
|
|
|
|
"none",
|
|
|
|
"front",
|
2023-06-06 15:08:32 +00:00
|
|
|
"back",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUMultisampleState {
|
|
|
|
GPUSize32 count = 1;
|
|
|
|
GPUSampleMask mask = 0xFFFFFFFF;
|
|
|
|
boolean alphaToCoverageEnabled = false;
|
|
|
|
};
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUFragmentState
|
|
|
|
: GPUProgrammableStage {
|
2022-06-27 23:10:18 +00:00
|
|
|
required sequence<GPUColorTargetState?> targets;
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUColorTargetState {
|
|
|
|
required GPUTextureFormat format;
|
|
|
|
|
|
|
|
GPUBlendState blend;
|
|
|
|
GPUColorWriteFlags writeMask = 0xF; // GPUColorWrite.ALL
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUBlendState {
|
|
|
|
required GPUBlendComponent color;
|
|
|
|
required GPUBlendComponent alpha;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef [EnforceRange] unsigned long GPUColorWriteFlags;
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2022-05-24 07:01:19 +00:00
|
|
|
namespace GPUColorWrite {
|
2021-09-03 17:23:35 +00:00
|
|
|
const GPUFlagsConstant RED = 0x1;
|
|
|
|
const GPUFlagsConstant GREEN = 0x2;
|
|
|
|
const GPUFlagsConstant BLUE = 0x4;
|
|
|
|
const GPUFlagsConstant ALPHA = 0x8;
|
|
|
|
const GPUFlagsConstant ALL = 0xF;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUBlendComponent {
|
2021-11-26 21:05:16 +00:00
|
|
|
GPUBlendOperation operation = "add";
|
2021-09-03 17:23:35 +00:00
|
|
|
GPUBlendFactor srcFactor = "one";
|
|
|
|
GPUBlendFactor dstFactor = "zero";
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUBlendFactor {
|
|
|
|
"zero",
|
|
|
|
"one",
|
|
|
|
"src",
|
|
|
|
"one-minus-src",
|
|
|
|
"src-alpha",
|
|
|
|
"one-minus-src-alpha",
|
|
|
|
"dst",
|
|
|
|
"one-minus-dst",
|
|
|
|
"dst-alpha",
|
|
|
|
"one-minus-dst-alpha",
|
|
|
|
"src-alpha-saturated",
|
|
|
|
"constant",
|
2023-06-06 15:08:32 +00:00
|
|
|
"one-minus-constant",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUBlendOperation {
|
|
|
|
"add",
|
|
|
|
"subtract",
|
|
|
|
"reverse-subtract",
|
|
|
|
"min",
|
2023-06-06 15:08:32 +00:00
|
|
|
"max",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUDepthStencilState {
|
|
|
|
required GPUTextureFormat format;
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
required boolean depthWriteEnabled;
|
|
|
|
required GPUCompareFunction depthCompare;
|
2021-09-03 17:23:35 +00:00
|
|
|
|
|
|
|
GPUStencilFaceState stencilFront = {};
|
|
|
|
GPUStencilFaceState stencilBack = {};
|
|
|
|
|
|
|
|
GPUStencilValue stencilReadMask = 0xFFFFFFFF;
|
|
|
|
GPUStencilValue stencilWriteMask = 0xFFFFFFFF;
|
|
|
|
|
|
|
|
GPUDepthBias depthBias = 0;
|
|
|
|
float depthBiasSlopeScale = 0;
|
|
|
|
float depthBiasClamp = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUStencilFaceState {
|
|
|
|
GPUCompareFunction compare = "always";
|
|
|
|
GPUStencilOperation failOp = "keep";
|
|
|
|
GPUStencilOperation depthFailOp = "keep";
|
|
|
|
GPUStencilOperation passOp = "keep";
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUStencilOperation {
|
|
|
|
"keep",
|
|
|
|
"zero",
|
|
|
|
"replace",
|
|
|
|
"invert",
|
|
|
|
"increment-clamp",
|
|
|
|
"decrement-clamp",
|
|
|
|
"increment-wrap",
|
2023-06-06 15:08:32 +00:00
|
|
|
"decrement-wrap",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUIndexFormat {
|
|
|
|
"uint16",
|
2023-06-06 15:08:32 +00:00
|
|
|
"uint32",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUVertexFormat {
|
|
|
|
"uint8x2",
|
|
|
|
"uint8x4",
|
|
|
|
"sint8x2",
|
|
|
|
"sint8x4",
|
|
|
|
"unorm8x2",
|
|
|
|
"unorm8x4",
|
|
|
|
"snorm8x2",
|
|
|
|
"snorm8x4",
|
|
|
|
"uint16x2",
|
|
|
|
"uint16x4",
|
|
|
|
"sint16x2",
|
|
|
|
"sint16x4",
|
|
|
|
"unorm16x2",
|
|
|
|
"unorm16x4",
|
|
|
|
"snorm16x2",
|
|
|
|
"snorm16x4",
|
|
|
|
"float16x2",
|
|
|
|
"float16x4",
|
|
|
|
"float32",
|
|
|
|
"float32x2",
|
|
|
|
"float32x3",
|
|
|
|
"float32x4",
|
|
|
|
"uint32",
|
|
|
|
"uint32x2",
|
|
|
|
"uint32x3",
|
|
|
|
"uint32x4",
|
|
|
|
"sint32",
|
|
|
|
"sint32x2",
|
|
|
|
"sint32x3",
|
2023-06-06 15:08:32 +00:00
|
|
|
"sint32x4",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUVertexStepMode {
|
|
|
|
"vertex",
|
2023-06-06 15:08:32 +00:00
|
|
|
"instance",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUVertexState
|
|
|
|
: GPUProgrammableStage {
|
2021-09-03 17:23:35 +00:00
|
|
|
sequence<GPUVertexBufferLayout?> buffers = [];
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUVertexBufferLayout {
|
|
|
|
required GPUSize64 arrayStride;
|
|
|
|
GPUVertexStepMode stepMode = "vertex";
|
|
|
|
required sequence<GPUVertexAttribute> attributes;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUVertexAttribute {
|
|
|
|
required GPUVertexFormat format;
|
|
|
|
required GPUSize64 offset;
|
|
|
|
|
|
|
|
required GPUIndex32 shaderLocation;
|
|
|
|
};
|
|
|
|
|
2022-12-03 17:35:10 +00:00
|
|
|
dictionary GPUImageDataLayout {
|
|
|
|
GPUSize64 offset = 0;
|
|
|
|
GPUSize32 bytesPerRow;
|
|
|
|
GPUSize32 rowsPerImage;
|
|
|
|
};
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUImageCopyBuffer
|
|
|
|
: GPUImageDataLayout {
|
2022-12-03 17:35:10 +00:00
|
|
|
required GPUBuffer buffer;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUImageCopyTexture {
|
|
|
|
required GPUTexture texture;
|
|
|
|
GPUIntegerCoordinate mipLevel = 0;
|
|
|
|
GPUOrigin3D origin = {};
|
|
|
|
GPUTextureAspect aspect = "all";
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUCommandBuffer {
|
|
|
|
};
|
|
|
|
GPUCommandBuffer includes GPUObjectBase;
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUCommandBufferDescriptor
|
|
|
|
: GPUObjectDescriptorBase {
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2022-03-19 05:31:10 +00:00
|
|
|
interface mixin GPUCommandsMixin {
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUCommandEncoder {
|
|
|
|
GPURenderPassEncoder beginRenderPass(GPURenderPassDescriptor descriptor);
|
|
|
|
GPUComputePassEncoder beginComputePass(optional GPUComputePassDescriptor descriptor = {});
|
|
|
|
|
|
|
|
undefined copyBufferToBuffer(
|
|
|
|
GPUBuffer source,
|
|
|
|
GPUSize64 sourceOffset,
|
|
|
|
GPUBuffer destination,
|
|
|
|
GPUSize64 destinationOffset,
|
|
|
|
GPUSize64 size);
|
|
|
|
|
|
|
|
undefined copyBufferToTexture(
|
|
|
|
GPUImageCopyBuffer source,
|
|
|
|
GPUImageCopyTexture destination,
|
|
|
|
GPUExtent3D copySize);
|
|
|
|
|
|
|
|
undefined copyTextureToBuffer(
|
|
|
|
GPUImageCopyTexture source,
|
|
|
|
GPUImageCopyBuffer destination,
|
|
|
|
GPUExtent3D copySize);
|
|
|
|
|
|
|
|
undefined copyTextureToTexture(
|
|
|
|
GPUImageCopyTexture source,
|
|
|
|
GPUImageCopyTexture destination,
|
|
|
|
GPUExtent3D copySize);
|
|
|
|
|
2021-12-02 17:19:47 +00:00
|
|
|
undefined clearBuffer(
|
2022-03-19 05:31:10 +00:00
|
|
|
GPUBuffer buffer,
|
|
|
|
optional GPUSize64 offset = 0,
|
|
|
|
optional GPUSize64 size);
|
2021-09-03 17:23:35 +00:00
|
|
|
|
|
|
|
undefined writeTimestamp(GPUQuerySet querySet, GPUSize32 queryIndex);
|
|
|
|
|
|
|
|
undefined resolveQuerySet(
|
|
|
|
GPUQuerySet querySet,
|
|
|
|
GPUSize32 firstQuery,
|
|
|
|
GPUSize32 queryCount,
|
|
|
|
GPUBuffer destination,
|
|
|
|
GPUSize64 destinationOffset);
|
|
|
|
|
|
|
|
GPUCommandBuffer finish(optional GPUCommandBufferDescriptor descriptor = {});
|
|
|
|
};
|
|
|
|
GPUCommandEncoder includes GPUObjectBase;
|
2022-03-19 05:31:10 +00:00
|
|
|
GPUCommandEncoder includes GPUCommandsMixin;
|
|
|
|
GPUCommandEncoder includes GPUDebugCommandsMixin;
|
2021-09-03 17:23:35 +00:00
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUCommandEncoderDescriptor
|
|
|
|
: GPUObjectDescriptorBase {
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2022-05-24 07:01:19 +00:00
|
|
|
interface mixin GPUBindingCommandsMixin {
|
2021-09-03 17:23:35 +00:00
|
|
|
undefined setBindGroup(GPUIndex32 index, GPUBindGroup bindGroup,
|
2022-07-26 03:31:58 +00:00
|
|
|
optional sequence<GPUBufferDynamicOffset> dynamicOffsets = []);
|
2021-09-03 17:23:35 +00:00
|
|
|
|
|
|
|
undefined setBindGroup(GPUIndex32 index, GPUBindGroup bindGroup,
|
2022-07-26 03:31:58 +00:00
|
|
|
Uint32Array dynamicOffsetsData,
|
|
|
|
GPUSize64 dynamicOffsetsDataStart,
|
|
|
|
GPUSize32 dynamicOffsetsDataLength);
|
2022-03-19 05:31:10 +00:00
|
|
|
};
|
2021-09-03 17:23:35 +00:00
|
|
|
|
2022-03-19 05:31:10 +00:00
|
|
|
interface mixin GPUDebugCommandsMixin {
|
2021-09-03 17:23:35 +00:00
|
|
|
undefined pushDebugGroup(USVString groupLabel);
|
|
|
|
undefined popDebugGroup();
|
|
|
|
undefined insertDebugMarker(USVString markerLabel);
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUComputePassEncoder {
|
|
|
|
undefined setPipeline(GPUComputePipeline pipeline);
|
2022-04-21 04:28:56 +00:00
|
|
|
undefined dispatchWorkgroups(GPUSize32 workgroupCountX, optional GPUSize32 workgroupCountY = 1, optional GPUSize32 workgroupCountZ = 1);
|
|
|
|
undefined dispatchWorkgroupsIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);
|
2021-09-03 17:23:35 +00:00
|
|
|
|
2022-03-19 05:31:10 +00:00
|
|
|
undefined end();
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
GPUComputePassEncoder includes GPUObjectBase;
|
2022-03-19 05:31:10 +00:00
|
|
|
GPUComputePassEncoder includes GPUCommandsMixin;
|
|
|
|
GPUComputePassEncoder includes GPUDebugCommandsMixin;
|
2022-05-24 07:01:19 +00:00
|
|
|
GPUComputePassEncoder includes GPUBindingCommandsMixin;
|
2021-09-03 17:23:35 +00:00
|
|
|
|
2023-10-04 04:25:56 +00:00
|
|
|
dictionary GPUComputePassTimestampWrites {
|
|
|
|
required GPUQuerySet querySet;
|
|
|
|
GPUSize32 beginningOfPassWriteIndex;
|
|
|
|
GPUSize32 endOfPassWriteIndex;
|
|
|
|
};
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUComputePassDescriptor
|
|
|
|
: GPUObjectDescriptorBase {
|
2023-10-04 04:25:56 +00:00
|
|
|
GPUComputePassTimestampWrites timestampWrites;
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPURenderPassEncoder {
|
|
|
|
undefined setViewport(float x, float y,
|
2022-07-26 03:31:58 +00:00
|
|
|
float width, float height,
|
|
|
|
float minDepth, float maxDepth);
|
2021-09-03 17:23:35 +00:00
|
|
|
|
|
|
|
undefined setScissorRect(GPUIntegerCoordinate x, GPUIntegerCoordinate y,
|
|
|
|
GPUIntegerCoordinate width, GPUIntegerCoordinate height);
|
|
|
|
|
|
|
|
undefined setBlendConstant(GPUColor color);
|
|
|
|
undefined setStencilReference(GPUStencilValue reference);
|
|
|
|
|
2023-10-04 04:25:56 +00:00
|
|
|
undefined beginOcclusionQuery(GPUSize32 queryIndex);
|
|
|
|
undefined endOcclusionQuery();
|
2021-09-03 17:23:35 +00:00
|
|
|
|
|
|
|
undefined executeBundles(sequence<GPURenderBundle> bundles);
|
2022-03-19 05:31:10 +00:00
|
|
|
undefined end();
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
GPURenderPassEncoder includes GPUObjectBase;
|
2022-03-19 05:31:10 +00:00
|
|
|
GPURenderPassEncoder includes GPUCommandsMixin;
|
|
|
|
GPURenderPassEncoder includes GPUDebugCommandsMixin;
|
2022-05-24 07:01:19 +00:00
|
|
|
GPURenderPassEncoder includes GPUBindingCommandsMixin;
|
|
|
|
GPURenderPassEncoder includes GPURenderCommandsMixin;
|
2021-09-03 17:23:35 +00:00
|
|
|
|
2023-10-04 04:25:56 +00:00
|
|
|
dictionary GPURenderPassTimestampWrites {
|
|
|
|
required GPUQuerySet querySet;
|
|
|
|
GPUSize32 beginningOfPassWriteIndex;
|
|
|
|
GPUSize32 endOfPassWriteIndex;
|
|
|
|
};
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPURenderPassDescriptor
|
|
|
|
: GPUObjectDescriptorBase {
|
2022-06-27 23:10:18 +00:00
|
|
|
required sequence<GPURenderPassColorAttachment?> colorAttachments;
|
2021-09-03 17:23:35 +00:00
|
|
|
GPURenderPassDepthStencilAttachment depthStencilAttachment;
|
2023-08-02 19:05:59 +00:00
|
|
|
GPUQuerySet occlusionQuerySet;
|
2023-10-04 04:25:56 +00:00
|
|
|
GPURenderPassTimestampWrites timestampWrites;
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPURenderPassColorAttachment {
|
|
|
|
required GPUTextureView view;
|
|
|
|
GPUTextureView resolveTarget;
|
|
|
|
|
2022-03-19 05:31:10 +00:00
|
|
|
GPUColor clearValue;
|
|
|
|
required GPULoadOp loadOp;
|
2021-09-03 17:23:35 +00:00
|
|
|
required GPUStoreOp storeOp;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPURenderPassDepthStencilAttachment {
|
|
|
|
required GPUTextureView view;
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
float depthClearValue;
|
2022-03-19 05:31:10 +00:00
|
|
|
GPULoadOp depthLoadOp;
|
|
|
|
GPUStoreOp depthStoreOp;
|
2021-09-03 17:23:35 +00:00
|
|
|
boolean depthReadOnly = false;
|
|
|
|
|
2022-03-19 05:31:10 +00:00
|
|
|
GPUStencilValue stencilClearValue = 0;
|
|
|
|
GPULoadOp stencilLoadOp;
|
|
|
|
GPUStoreOp stencilStoreOp;
|
2021-09-03 17:23:35 +00:00
|
|
|
boolean stencilReadOnly = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPULoadOp {
|
2021-11-26 21:05:16 +00:00
|
|
|
"load",
|
2023-06-06 15:08:32 +00:00
|
|
|
"clear",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUStoreOp {
|
|
|
|
"store",
|
2023-06-06 15:08:32 +00:00
|
|
|
"discard",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPURenderPassLayout
|
|
|
|
: GPUObjectDescriptorBase {
|
2022-06-27 23:10:18 +00:00
|
|
|
required sequence<GPUTextureFormat?> colorFormats;
|
2021-09-03 17:23:35 +00:00
|
|
|
GPUTextureFormat depthStencilFormat;
|
|
|
|
GPUSize32 sampleCount = 1;
|
|
|
|
};
|
|
|
|
|
2022-05-24 07:01:19 +00:00
|
|
|
interface mixin GPURenderCommandsMixin {
|
|
|
|
undefined setPipeline(GPURenderPipeline pipeline);
|
|
|
|
|
|
|
|
undefined setIndexBuffer(GPUBuffer buffer, GPUIndexFormat indexFormat, optional GPUSize64 offset = 0, optional GPUSize64 size);
|
|
|
|
undefined setVertexBuffer(GPUIndex32 slot, GPUBuffer buffer, optional GPUSize64 offset = 0, optional GPUSize64 size);
|
|
|
|
|
|
|
|
undefined draw(GPUSize32 vertexCount, optional GPUSize32 instanceCount = 1,
|
2022-09-20 16:06:12 +00:00
|
|
|
optional GPUSize32 firstVertex = 0, optional GPUSize32 firstInstance = 0);
|
2022-05-24 07:01:19 +00:00
|
|
|
undefined drawIndexed(GPUSize32 indexCount, optional GPUSize32 instanceCount = 1,
|
2022-09-20 16:06:12 +00:00
|
|
|
optional GPUSize32 firstIndex = 0,
|
|
|
|
optional GPUSignedOffset32 baseVertex = 0,
|
|
|
|
optional GPUSize32 firstInstance = 0);
|
2022-05-24 07:01:19 +00:00
|
|
|
|
|
|
|
undefined drawIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);
|
|
|
|
undefined drawIndexedIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPURenderBundle {
|
|
|
|
};
|
|
|
|
GPURenderBundle includes GPUObjectBase;
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPURenderBundleDescriptor
|
|
|
|
: GPUObjectDescriptorBase {
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPURenderBundleEncoder {
|
|
|
|
GPURenderBundle finish(optional GPURenderBundleDescriptor descriptor = {});
|
|
|
|
};
|
|
|
|
GPURenderBundleEncoder includes GPUObjectBase;
|
2022-03-19 05:31:10 +00:00
|
|
|
GPURenderBundleEncoder includes GPUCommandsMixin;
|
|
|
|
GPURenderBundleEncoder includes GPUDebugCommandsMixin;
|
2022-05-24 07:01:19 +00:00
|
|
|
GPURenderBundleEncoder includes GPUBindingCommandsMixin;
|
|
|
|
GPURenderBundleEncoder includes GPURenderCommandsMixin;
|
2021-09-03 17:23:35 +00:00
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPURenderBundleEncoderDescriptor
|
|
|
|
: GPURenderPassLayout {
|
2021-09-03 17:23:35 +00:00
|
|
|
boolean depthReadOnly = false;
|
|
|
|
boolean stencilReadOnly = false;
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUQueue {
|
|
|
|
undefined submit(sequence<GPUCommandBuffer> commandBuffers);
|
|
|
|
|
|
|
|
Promise<undefined> onSubmittedWorkDone();
|
|
|
|
|
|
|
|
undefined writeBuffer(
|
|
|
|
GPUBuffer buffer,
|
|
|
|
GPUSize64 bufferOffset,
|
|
|
|
[AllowShared] BufferSource data,
|
|
|
|
optional GPUSize64 dataOffset = 0,
|
|
|
|
optional GPUSize64 size);
|
|
|
|
|
|
|
|
undefined writeTexture(
|
2021-11-26 21:05:16 +00:00
|
|
|
GPUImageCopyTexture destination,
|
|
|
|
[AllowShared] BufferSource data,
|
|
|
|
GPUImageDataLayout dataLayout,
|
|
|
|
GPUExtent3D size);
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
GPUQueue includes GPUObjectBase;
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUQuerySet {
|
|
|
|
undefined destroy();
|
2022-07-26 03:31:58 +00:00
|
|
|
|
|
|
|
readonly attribute GPUQueryType type;
|
2023-06-06 15:08:32 +00:00
|
|
|
readonly attribute GPUSize32Out count;
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
GPUQuerySet includes GPUObjectBase;
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
dictionary GPUQuerySetDescriptor
|
|
|
|
: GPUObjectDescriptorBase {
|
2021-09-03 17:23:35 +00:00
|
|
|
required GPUQueryType type;
|
|
|
|
required GPUSize32 count;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUQueryType {
|
|
|
|
"occlusion",
|
2023-06-06 15:08:32 +00:00
|
|
|
"timestamp",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2023-01-09 15:44:20 +00:00
|
|
|
interface GPUCanvasContext {
|
2023-01-14 16:07:46 +00:00
|
|
|
readonly attribute (HTMLCanvasElement or OffscreenCanvas) canvas;
|
|
|
|
|
2023-01-09 15:44:20 +00:00
|
|
|
undefined configure(GPUCanvasConfiguration configuration);
|
|
|
|
undefined unconfigure();
|
|
|
|
|
|
|
|
GPUTexture getCurrentTexture();
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUCanvasAlphaMode {
|
|
|
|
"opaque",
|
2023-06-06 15:08:32 +00:00
|
|
|
"premultiplied",
|
2023-01-09 15:44:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUCanvasConfiguration {
|
|
|
|
required GPUDevice device;
|
|
|
|
required GPUTextureFormat format;
|
|
|
|
GPUTextureUsageFlags usage = 0x10; // GPUTextureUsage.RENDER_ATTACHMENT
|
2023-01-25 21:04:41 +00:00
|
|
|
sequence<GPUTextureFormat> viewFormats = [];
|
2023-06-06 15:08:32 +00:00
|
|
|
GPUCanvasAlphaMode alphaMode = "opaque";
|
2023-01-09 15:44:20 +00:00
|
|
|
};
|
|
|
|
|
2021-09-03 17:23:35 +00:00
|
|
|
enum GPUDeviceLostReason {
|
2023-06-06 15:08:32 +00:00
|
|
|
"unknown",
|
|
|
|
"destroyed",
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2021-09-03 17:23:35 +00:00
|
|
|
interface GPUDeviceLostInfo {
|
2023-06-06 15:08:32 +00:00
|
|
|
readonly attribute GPUDeviceLostReason reason;
|
2021-09-03 17:23:35 +00:00
|
|
|
readonly attribute DOMString message;
|
|
|
|
};
|
|
|
|
|
|
|
|
partial interface GPUDevice {
|
|
|
|
readonly attribute Promise<GPUDeviceLostInfo> lost;
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2022-05-24 07:01:19 +00:00
|
|
|
interface GPUError {
|
|
|
|
readonly attribute DOMString message;
|
2021-09-03 17:23:35 +00:00
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2023-06-06 15:08:32 +00:00
|
|
|
interface GPUValidationError
|
|
|
|
: GPUError {
|
2021-09-03 17:23:35 +00:00
|
|
|
constructor(DOMString message);
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
2023-06-06 15:08:32 +00:00
|
|
|
interface GPUOutOfMemoryError
|
|
|
|
: GPUError {
|
2022-05-24 07:01:19 +00:00
|
|
|
constructor(DOMString message);
|
|
|
|
};
|
2021-09-03 17:23:35 +00:00
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
|
|
|
interface GPUInternalError
|
|
|
|
: GPUError {
|
|
|
|
constructor(DOMString message);
|
|
|
|
};
|
|
|
|
|
2022-09-20 16:06:12 +00:00
|
|
|
enum GPUErrorFilter {
|
|
|
|
"validation",
|
2023-06-06 15:08:32 +00:00
|
|
|
"out-of-memory",
|
2024-04-02 18:36:04 +00:00
|
|
|
"internal",
|
2022-09-20 16:06:12 +00:00
|
|
|
};
|
|
|
|
|
2021-09-03 17:23:35 +00:00
|
|
|
partial interface GPUDevice {
|
|
|
|
undefined pushErrorScope(GPUErrorFilter filter);
|
|
|
|
Promise<GPUError?> popErrorScope();
|
|
|
|
};
|
|
|
|
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker), SecureContext]
|
|
|
|
interface GPUUncapturedErrorEvent : Event {
|
|
|
|
constructor(
|
|
|
|
DOMString type,
|
|
|
|
GPUUncapturedErrorEventInit gpuUncapturedErrorEventInitDict
|
|
|
|
);
|
|
|
|
[SameObject] readonly attribute GPUError error;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUUncapturedErrorEventInit : EventInit {
|
|
|
|
required GPUError error;
|
|
|
|
};
|
|
|
|
|
2021-09-03 17:23:35 +00:00
|
|
|
partial interface GPUDevice {
|
2024-04-02 18:36:04 +00:00
|
|
|
[Exposed=(Window, Worker)]
|
2021-09-03 17:23:35 +00:00
|
|
|
attribute EventHandler onuncapturederror;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef [EnforceRange] unsigned long GPUBufferDynamicOffset;
|
|
|
|
typedef [EnforceRange] unsigned long GPUStencilValue;
|
|
|
|
typedef [EnforceRange] unsigned long GPUSampleMask;
|
|
|
|
typedef [EnforceRange] long GPUDepthBias;
|
|
|
|
|
|
|
|
typedef [EnforceRange] unsigned long long GPUSize64;
|
|
|
|
typedef [EnforceRange] unsigned long GPUIntegerCoordinate;
|
|
|
|
typedef [EnforceRange] unsigned long GPUIndex32;
|
|
|
|
typedef [EnforceRange] unsigned long GPUSize32;
|
|
|
|
typedef [EnforceRange] long GPUSignedOffset32;
|
|
|
|
|
2023-06-06 15:08:32 +00:00
|
|
|
typedef unsigned long long GPUSize64Out;
|
|
|
|
typedef unsigned long GPUIntegerCoordinateOut;
|
|
|
|
typedef unsigned long GPUSize32Out;
|
|
|
|
|
2021-09-03 17:23:35 +00:00
|
|
|
typedef unsigned long GPUFlagsConstant;
|
|
|
|
|
|
|
|
dictionary GPUColorDict {
|
|
|
|
required double r;
|
|
|
|
required double g;
|
|
|
|
required double b;
|
|
|
|
required double a;
|
|
|
|
};
|
|
|
|
typedef (sequence<double> or GPUColorDict) GPUColor;
|
|
|
|
|
|
|
|
dictionary GPUOrigin2DDict {
|
|
|
|
GPUIntegerCoordinate x = 0;
|
|
|
|
GPUIntegerCoordinate y = 0;
|
|
|
|
};
|
|
|
|
typedef (sequence<GPUIntegerCoordinate> or GPUOrigin2DDict) GPUOrigin2D;
|
|
|
|
|
|
|
|
dictionary GPUOrigin3DDict {
|
|
|
|
GPUIntegerCoordinate x = 0;
|
|
|
|
GPUIntegerCoordinate y = 0;
|
|
|
|
GPUIntegerCoordinate z = 0;
|
|
|
|
};
|
|
|
|
typedef (sequence<GPUIntegerCoordinate> or GPUOrigin3DDict) GPUOrigin3D;
|
|
|
|
|
|
|
|
dictionary GPUExtent3DDict {
|
|
|
|
required GPUIntegerCoordinate width;
|
|
|
|
GPUIntegerCoordinate height = 1;
|
|
|
|
GPUIntegerCoordinate depthOrArrayLayers = 1;
|
|
|
|
};
|
|
|
|
typedef (sequence<GPUIntegerCoordinate> or GPUExtent3DDict) GPUExtent3D;
|