2021-03-01 05:31:13 -05:00
|
|
|
interface mixin GPUObjectBase {
|
|
|
|
attribute USVString? label;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUObjectDescriptorBase {
|
|
|
|
USVString label;
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUAdapterLimits {
|
2021-05-06 10:48:45 -04:00
|
|
|
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;
|
|
|
|
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 maxUniformBufferBindingSize;
|
|
|
|
readonly attribute unsigned long maxStorageBufferBindingSize;
|
|
|
|
readonly attribute unsigned long maxVertexBuffers;
|
|
|
|
readonly attribute unsigned long maxVertexAttributes;
|
|
|
|
readonly attribute unsigned long maxVertexBufferArrayStride;
|
2021-03-01 05:31:13 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
[Exposed=Window]
|
2021-05-06 10:48:45 -04:00
|
|
|
interface GPUSupportedFeatures {
|
|
|
|
readonly setlike<DOMString>;
|
2021-03-01 05:31:13 -05:00
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
interface mixin NavigatorGPU {
|
2021-03-01 05:31:13 -05:00
|
|
|
[SameObject] readonly attribute GPU gpu;
|
|
|
|
};
|
2021-05-06 10:48:45 -04:00
|
|
|
Navigator includes NavigatorGPU;
|
|
|
|
WorkerNavigator includes NavigatorGPU;
|
2021-03-01 05:31:13 -05:00
|
|
|
|
|
|
|
[Exposed=(Window, DedicatedWorker)]
|
|
|
|
interface GPU {
|
|
|
|
Promise<GPUAdapter?> requestAdapter(optional GPURequestAdapterOptions options = {});
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPURequestAdapterOptions {
|
|
|
|
GPUPowerPreference powerPreference;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUPowerPreference {
|
|
|
|
"low-power",
|
|
|
|
"high-performance"
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUAdapter {
|
|
|
|
readonly attribute DOMString name;
|
2021-05-06 10:48:45 -04:00
|
|
|
[SameObject] readonly attribute GPUSupportedFeatures features;
|
2021-03-01 05:31:13 -05:00
|
|
|
[SameObject] readonly attribute GPUAdapterLimits limits;
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
Promise<GPUDevice> requestDevice(optional GPUDeviceDescriptor descriptor = {});
|
2021-03-01 05:31:13 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUDeviceDescriptor : GPUObjectDescriptorBase {
|
|
|
|
sequence<GPUFeatureName> nonGuaranteedFeatures = [];
|
|
|
|
record<DOMString, GPUSize32> nonGuaranteedLimits = {};
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUFeatureName {
|
|
|
|
"depth-clamping",
|
|
|
|
"depth24unorm-stencil8",
|
|
|
|
"depth32float-stencil8",
|
|
|
|
"pipeline-statistics-query",
|
|
|
|
"texture-compression-bc",
|
|
|
|
"timestamp-query",
|
|
|
|
};
|
|
|
|
|
|
|
|
[Exposed=(Window, DedicatedWorker), Serializable]
|
|
|
|
interface GPUDevice : EventTarget {
|
2021-05-06 10:48:45 -04:00
|
|
|
[SameObject] readonly attribute GPUSupportedFeatures features;
|
2021-03-01 05:31:13 -05:00
|
|
|
readonly attribute object 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;
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window, Serializable]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUBuffer {
|
|
|
|
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;
|
|
|
|
|
|
|
|
dictionary GPUBufferDescriptor : GPUObjectDescriptorBase {
|
|
|
|
required GPUSize64 size;
|
|
|
|
required GPUBufferUsageFlags usage;
|
|
|
|
boolean mappedAtCreation = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef [EnforceRange] unsigned long GPUBufferUsageFlags;
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUBufferUsage {
|
|
|
|
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;
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUMapMode {
|
|
|
|
const GPUFlagsConstant READ = 0x0001;
|
|
|
|
const GPUFlagsConstant WRITE = 0x0002;
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window, Serializable]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUTexture {
|
|
|
|
GPUTextureView createView(optional GPUTextureViewDescriptor descriptor = {});
|
|
|
|
|
|
|
|
undefined destroy();
|
|
|
|
};
|
|
|
|
GPUTexture includes GPUObjectBase;
|
|
|
|
|
|
|
|
dictionary GPUTextureDescriptor : GPUObjectDescriptorBase {
|
|
|
|
required GPUExtent3D size;
|
|
|
|
GPUIntegerCoordinate mipLevelCount = 1;
|
|
|
|
GPUSize32 sampleCount = 1;
|
|
|
|
GPUTextureDimension dimension = "2d";
|
|
|
|
required GPUTextureFormat format;
|
|
|
|
required GPUTextureUsageFlags usage;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUTextureDimension {
|
|
|
|
"1d",
|
|
|
|
"2d",
|
|
|
|
"3d",
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef [EnforceRange] unsigned long GPUTextureUsageFlags;
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUTextureUsage {
|
|
|
|
const GPUFlagsConstant COPY_SRC = 0x01;
|
|
|
|
const GPUFlagsConstant COPY_DST = 0x02;
|
|
|
|
const GPUFlagsConstant SAMPLED = 0x04;
|
|
|
|
const GPUFlagsConstant STORAGE = 0x08;
|
|
|
|
const GPUFlagsConstant RENDER_ATTACHMENT = 0x10;
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUTextureView {
|
|
|
|
};
|
|
|
|
GPUTextureView includes GPUObjectBase;
|
|
|
|
|
|
|
|
dictionary GPUTextureViewDescriptor : GPUObjectDescriptorBase {
|
|
|
|
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",
|
|
|
|
"3d"
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUTextureAspect {
|
|
|
|
"all",
|
|
|
|
"stencil-only",
|
|
|
|
"depth-only"
|
|
|
|
};
|
|
|
|
|
|
|
|
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",
|
|
|
|
"rgb10a2unorm",
|
|
|
|
"rg11b10ufloat",
|
|
|
|
|
|
|
|
// 64-bit formats
|
|
|
|
"rg32uint",
|
|
|
|
"rg32sint",
|
|
|
|
"rg32float",
|
|
|
|
"rgba16uint",
|
|
|
|
"rgba16sint",
|
|
|
|
"rgba16float",
|
|
|
|
|
|
|
|
// 128-bit formats
|
|
|
|
"rgba32uint",
|
|
|
|
"rgba32sint",
|
|
|
|
"rgba32float",
|
|
|
|
|
|
|
|
// Depth and stencil formats
|
|
|
|
"stencil8",
|
|
|
|
"depth16unorm",
|
|
|
|
"depth24plus",
|
|
|
|
"depth24plus-stencil8",
|
|
|
|
"depth32float",
|
|
|
|
|
|
|
|
// 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",
|
|
|
|
|
|
|
|
// "depth24unorm-stencil8" feature
|
|
|
|
"depth24unorm-stencil8",
|
|
|
|
|
|
|
|
// "depth32float-stencil8" feature
|
|
|
|
"depth32float-stencil8",
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUSampler {
|
|
|
|
};
|
|
|
|
GPUSampler includes GPUObjectBase;
|
|
|
|
|
|
|
|
dictionary GPUSamplerDescriptor : GPUObjectDescriptorBase {
|
|
|
|
GPUAddressMode addressModeU = "clamp-to-edge";
|
|
|
|
GPUAddressMode addressModeV = "clamp-to-edge";
|
|
|
|
GPUAddressMode addressModeW = "clamp-to-edge";
|
|
|
|
GPUFilterMode magFilter = "nearest";
|
|
|
|
GPUFilterMode minFilter = "nearest";
|
|
|
|
GPUFilterMode mipmapFilter = "nearest";
|
|
|
|
float lodMinClamp = 0;
|
|
|
|
float lodMaxClamp = 0xffffffff; // TODO: What should this be? Was Number.MAX_VALUE.
|
|
|
|
GPUCompareFunction compare;
|
|
|
|
[Clamp] unsigned short maxAnisotropy = 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUAddressMode {
|
|
|
|
"clamp-to-edge",
|
|
|
|
"repeat",
|
|
|
|
"mirror-repeat"
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUFilterMode {
|
|
|
|
"nearest",
|
|
|
|
"linear"
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUCompareFunction {
|
|
|
|
"never",
|
|
|
|
"less",
|
|
|
|
"equal",
|
|
|
|
"less-equal",
|
|
|
|
"greater",
|
|
|
|
"not-equal",
|
|
|
|
"greater-equal",
|
|
|
|
"always"
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window, Serializable]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUBindGroupLayout {
|
|
|
|
};
|
|
|
|
GPUBindGroupLayout includes GPUObjectBase;
|
|
|
|
|
|
|
|
dictionary GPUBindGroupLayoutDescriptor : GPUObjectDescriptorBase {
|
|
|
|
required sequence<GPUBindGroupLayoutEntry> entries;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef [EnforceRange] unsigned long GPUShaderStageFlags;
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUShaderStage {
|
|
|
|
const GPUFlagsConstant VERTEX = 0x1;
|
|
|
|
const GPUFlagsConstant FRAGMENT = 0x2;
|
|
|
|
const GPUFlagsConstant COMPUTE = 0x4;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUBindGroupLayoutEntry {
|
|
|
|
required GPUIndex32 binding;
|
|
|
|
required GPUShaderStageFlags visibility;
|
|
|
|
|
|
|
|
GPUBufferBindingLayout buffer;
|
|
|
|
GPUSamplerBindingLayout sampler;
|
|
|
|
GPUTextureBindingLayout texture;
|
|
|
|
GPUStorageTextureBindingLayout storageTexture;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUBufferBindingType {
|
|
|
|
"uniform",
|
|
|
|
"storage",
|
|
|
|
"read-only-storage",
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUBufferBindingLayout {
|
|
|
|
GPUBufferBindingType type = "uniform";
|
|
|
|
boolean hasDynamicOffset = false;
|
|
|
|
GPUSize64 minBindingSize = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUSamplerBindingType {
|
|
|
|
"filtering",
|
|
|
|
"non-filtering",
|
|
|
|
"comparison",
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUSamplerBindingLayout {
|
|
|
|
GPUSamplerBindingType type = "filtering";
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUTextureSampleType {
|
|
|
|
"float",
|
|
|
|
"unfilterable-float",
|
|
|
|
"depth",
|
|
|
|
"sint",
|
|
|
|
"uint",
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUTextureBindingLayout {
|
|
|
|
GPUTextureSampleType sampleType = "float";
|
|
|
|
GPUTextureViewDimension viewDimension = "2d";
|
|
|
|
boolean multisampled = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUStorageTextureAccess {
|
|
|
|
"read-only",
|
|
|
|
"write-only",
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUStorageTextureBindingLayout {
|
|
|
|
required GPUStorageTextureAccess access;
|
|
|
|
required GPUTextureFormat format;
|
|
|
|
GPUTextureViewDimension viewDimension = "2d";
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUBindGroup {
|
|
|
|
};
|
|
|
|
GPUBindGroup includes GPUObjectBase;
|
|
|
|
|
|
|
|
dictionary GPUBindGroupDescriptor : GPUObjectDescriptorBase {
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window, Serializable]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUPipelineLayout {
|
|
|
|
};
|
|
|
|
GPUPipelineLayout includes GPUObjectBase;
|
|
|
|
|
|
|
|
dictionary GPUPipelineLayoutDescriptor : GPUObjectDescriptorBase {
|
|
|
|
required sequence<GPUBindGroupLayout> bindGroupLayouts;
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window, Serializable]
|
|
|
|
interface GPUShaderModule {
|
|
|
|
Promise<GPUCompilationInfo> compilationInfo();
|
|
|
|
};
|
|
|
|
GPUShaderModule includes GPUObjectBase;
|
|
|
|
|
|
|
|
dictionary GPUShaderModuleDescriptor : GPUObjectDescriptorBase {
|
|
|
|
required USVString code;
|
|
|
|
object sourceMap;
|
|
|
|
};
|
|
|
|
|
2021-03-01 05:31:13 -05:00
|
|
|
enum GPUCompilationMessageType {
|
|
|
|
"error",
|
|
|
|
"warning",
|
|
|
|
"info"
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window, Serializable]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUCompilationMessage {
|
|
|
|
readonly attribute DOMString message;
|
|
|
|
readonly attribute GPUCompilationMessageType type;
|
|
|
|
readonly attribute unsigned long long lineNum;
|
|
|
|
readonly attribute unsigned long long linePos;
|
2021-05-06 10:48:45 -04:00
|
|
|
readonly attribute unsigned long long offset;
|
|
|
|
readonly attribute unsigned long long length;
|
2021-03-01 05:31:13 -05:00
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window, Serializable]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUCompilationInfo {
|
|
|
|
readonly attribute FrozenArray<GPUCompilationMessage> messages;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUPipelineDescriptorBase : GPUObjectDescriptorBase {
|
|
|
|
GPUPipelineLayout layout;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface mixin GPUPipelineBase {
|
|
|
|
GPUBindGroupLayout getBindGroupLayout(unsigned long index);
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUProgrammableStage {
|
|
|
|
required GPUShaderModule module;
|
|
|
|
required USVString entryPoint;
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window, Serializable]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUComputePipeline {
|
|
|
|
};
|
|
|
|
GPUComputePipeline includes GPUObjectBase;
|
|
|
|
GPUComputePipeline includes GPUPipelineBase;
|
|
|
|
|
|
|
|
dictionary GPUComputePipelineDescriptor : GPUPipelineDescriptorBase {
|
|
|
|
required GPUProgrammableStage compute;
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window, Serializable]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPURenderPipeline {
|
|
|
|
};
|
|
|
|
GPURenderPipeline includes GPUObjectBase;
|
|
|
|
GPURenderPipeline includes GPUPipelineBase;
|
|
|
|
|
|
|
|
dictionary GPURenderPipelineDescriptor : GPUPipelineDescriptorBase {
|
|
|
|
required GPUVertexState vertex;
|
|
|
|
GPUPrimitiveState primitive = {};
|
|
|
|
GPUDepthStencilState depthStencil;
|
|
|
|
GPUMultisampleState multisample = {};
|
|
|
|
GPUFragmentState fragment;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUPrimitiveTopology {
|
|
|
|
"point-list",
|
|
|
|
"line-list",
|
|
|
|
"line-strip",
|
|
|
|
"triangle-list",
|
|
|
|
"triangle-strip"
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUPrimitiveState {
|
|
|
|
GPUPrimitiveTopology topology = "triangle-list";
|
|
|
|
GPUIndexFormat stripIndexFormat;
|
|
|
|
GPUFrontFace frontFace = "ccw";
|
|
|
|
GPUCullMode cullMode = "none";
|
2021-05-06 10:48:45 -04:00
|
|
|
|
|
|
|
// Enable depth clamping (requires "depth-clamping" feature)
|
|
|
|
boolean clampDepth = false;
|
2021-03-01 05:31:13 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUFrontFace {
|
|
|
|
"ccw",
|
|
|
|
"cw"
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUCullMode {
|
|
|
|
"none",
|
|
|
|
"front",
|
|
|
|
"back"
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUMultisampleState {
|
|
|
|
GPUSize32 count = 1;
|
|
|
|
GPUSampleMask mask = 0xFFFFFFFF;
|
|
|
|
boolean alphaToCoverageEnabled = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUFragmentState: GPUProgrammableStage {
|
|
|
|
required sequence<GPUColorTargetState> targets;
|
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUColorWrite {
|
|
|
|
const GPUFlagsConstant RED = 0x1;
|
|
|
|
const GPUFlagsConstant GREEN = 0x2;
|
|
|
|
const GPUFlagsConstant BLUE = 0x4;
|
|
|
|
const GPUFlagsConstant ALPHA = 0x8;
|
|
|
|
const GPUFlagsConstant ALL = 0xF;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUBlendComponent {
|
|
|
|
GPUBlendFactor srcFactor = "one";
|
|
|
|
GPUBlendFactor dstFactor = "zero";
|
|
|
|
GPUBlendOperation operation = "add";
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUBlendFactor {
|
|
|
|
"zero",
|
|
|
|
"one",
|
2021-05-06 10:48:45 -04:00
|
|
|
"src",
|
|
|
|
"one-minus-src",
|
2021-03-01 05:31:13 -05:00
|
|
|
"src-alpha",
|
|
|
|
"one-minus-src-alpha",
|
2021-05-06 10:48:45 -04:00
|
|
|
"dst",
|
|
|
|
"one-minus-dst",
|
2021-03-01 05:31:13 -05:00
|
|
|
"dst-alpha",
|
|
|
|
"one-minus-dst-alpha",
|
|
|
|
"src-alpha-saturated",
|
2021-05-06 10:48:45 -04:00
|
|
|
"constant",
|
|
|
|
"one-minus-constant"
|
2021-03-01 05:31:13 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUBlendOperation {
|
|
|
|
"add",
|
|
|
|
"subtract",
|
|
|
|
"reverse-subtract",
|
|
|
|
"min",
|
|
|
|
"max"
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUDepthStencilState {
|
|
|
|
required GPUTextureFormat format;
|
|
|
|
|
|
|
|
boolean depthWriteEnabled = false;
|
|
|
|
GPUCompareFunction depthCompare = "always";
|
|
|
|
|
|
|
|
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",
|
|
|
|
"decrement-wrap"
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUIndexFormat {
|
|
|
|
"uint16",
|
|
|
|
"uint32"
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUVertexFormat {
|
2021-05-06 10:48:45 -04:00
|
|
|
"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",
|
|
|
|
"sint32x4",
|
2021-03-01 05:31:13 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUInputStepMode {
|
|
|
|
"vertex",
|
|
|
|
"instance"
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUVertexState: GPUProgrammableStage {
|
|
|
|
sequence<GPUVertexBufferLayout?> buffers = [];
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUVertexBufferLayout {
|
|
|
|
required GPUSize64 arrayStride;
|
|
|
|
GPUInputStepMode stepMode = "vertex";
|
|
|
|
required sequence<GPUVertexAttribute> attributes;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUVertexAttribute {
|
|
|
|
required GPUVertexFormat format;
|
|
|
|
required GPUSize64 offset;
|
|
|
|
|
|
|
|
required GPUIndex32 shaderLocation;
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUCommandBuffer {
|
|
|
|
readonly attribute Promise<double> executionTime;
|
|
|
|
};
|
|
|
|
GPUCommandBuffer includes GPUObjectBase;
|
|
|
|
|
|
|
|
dictionary GPUCommandBufferDescriptor : GPUObjectDescriptorBase {
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05: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);
|
|
|
|
|
|
|
|
undefined pushDebugGroup(USVString groupLabel);
|
|
|
|
undefined popDebugGroup();
|
|
|
|
undefined insertDebugMarker(USVString markerLabel);
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
dictionary GPUCommandEncoderDescriptor : GPUObjectDescriptorBase {
|
|
|
|
boolean measureExecutionTime = false;
|
|
|
|
|
|
|
|
// TODO: reusability flag?
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUImageDataLayout {
|
|
|
|
GPUSize64 offset = 0;
|
|
|
|
GPUSize32 bytesPerRow;
|
|
|
|
GPUSize32 rowsPerImage;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUImageCopyBuffer : GPUImageDataLayout {
|
|
|
|
required GPUBuffer buffer;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUImageCopyTexture {
|
|
|
|
required GPUTexture texture;
|
|
|
|
GPUIntegerCoordinate mipLevel = 0;
|
|
|
|
GPUOrigin3D origin = {};
|
|
|
|
GPUTextureAspect aspect = "all";
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
dictionary GPUImageCopyExternalImage {
|
|
|
|
required (ImageBitmap or HTMLCanvasElement or OffscreenCanvas) source;
|
|
|
|
GPUOrigin2D origin = {};
|
|
|
|
};
|
|
|
|
|
2021-03-01 05:31:13 -05:00
|
|
|
interface mixin GPUProgrammablePassEncoder {
|
|
|
|
undefined setBindGroup(GPUIndex32 index, GPUBindGroup bindGroup,
|
|
|
|
optional sequence<GPUBufferDynamicOffset> dynamicOffsets = []);
|
|
|
|
|
|
|
|
undefined setBindGroup(GPUIndex32 index, GPUBindGroup bindGroup,
|
|
|
|
Uint32Array dynamicOffsetsData,
|
|
|
|
GPUSize64 dynamicOffsetsDataStart,
|
|
|
|
GPUSize32 dynamicOffsetsDataLength);
|
|
|
|
|
|
|
|
undefined pushDebugGroup(USVString groupLabel);
|
|
|
|
undefined popDebugGroup();
|
|
|
|
undefined insertDebugMarker(USVString markerLabel);
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUComputePassEncoder {
|
|
|
|
undefined setPipeline(GPUComputePipeline pipeline);
|
|
|
|
undefined dispatch(GPUSize32 x, optional GPUSize32 y = 1, optional GPUSize32 z = 1);
|
|
|
|
undefined dispatchIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);
|
|
|
|
|
|
|
|
undefined beginPipelineStatisticsQuery(GPUQuerySet querySet, GPUSize32 queryIndex);
|
|
|
|
undefined endPipelineStatisticsQuery();
|
|
|
|
|
|
|
|
undefined writeTimestamp(GPUQuerySet querySet, GPUSize32 queryIndex);
|
|
|
|
|
|
|
|
undefined endPass();
|
|
|
|
};
|
|
|
|
GPUComputePassEncoder includes GPUObjectBase;
|
|
|
|
GPUComputePassEncoder includes GPUProgrammablePassEncoder;
|
|
|
|
|
|
|
|
dictionary GPUComputePassDescriptor : GPUObjectDescriptorBase {
|
|
|
|
};
|
|
|
|
|
|
|
|
interface mixin GPURenderEncoderBase {
|
|
|
|
undefined setPipeline(GPURenderPipeline pipeline);
|
|
|
|
|
|
|
|
undefined setIndexBuffer(GPUBuffer buffer, GPUIndexFormat indexFormat, optional GPUSize64 offset = 0, optional GPUSize64 size = 0);
|
|
|
|
undefined setVertexBuffer(GPUIndex32 slot, GPUBuffer buffer, optional GPUSize64 offset = 0, optional GPUSize64 size = 0);
|
|
|
|
|
|
|
|
undefined draw(GPUSize32 vertexCount, optional GPUSize32 instanceCount = 1,
|
|
|
|
optional GPUSize32 firstVertex = 0, optional GPUSize32 firstInstance = 0);
|
|
|
|
undefined drawIndexed(GPUSize32 indexCount, optional GPUSize32 instanceCount = 1,
|
|
|
|
optional GPUSize32 firstIndex = 0,
|
|
|
|
optional GPUSignedOffset32 baseVertex = 0,
|
|
|
|
optional GPUSize32 firstInstance = 0);
|
|
|
|
|
|
|
|
undefined drawIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);
|
|
|
|
undefined drawIndexedIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPURenderPassEncoder {
|
|
|
|
undefined setViewport(float x, float y,
|
|
|
|
float width, float height,
|
|
|
|
float minDepth, float maxDepth);
|
|
|
|
|
|
|
|
undefined setScissorRect(GPUIntegerCoordinate x, GPUIntegerCoordinate y,
|
|
|
|
GPUIntegerCoordinate width, GPUIntegerCoordinate height);
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
undefined setBlendConstant(GPUColor color);
|
2021-03-01 05:31:13 -05:00
|
|
|
undefined setStencilReference(GPUStencilValue reference);
|
|
|
|
|
|
|
|
undefined beginOcclusionQuery(GPUSize32 queryIndex);
|
|
|
|
undefined endOcclusionQuery();
|
|
|
|
|
|
|
|
undefined beginPipelineStatisticsQuery(GPUQuerySet querySet, GPUSize32 queryIndex);
|
|
|
|
undefined endPipelineStatisticsQuery();
|
|
|
|
|
|
|
|
undefined writeTimestamp(GPUQuerySet querySet, GPUSize32 queryIndex);
|
|
|
|
|
|
|
|
undefined executeBundles(sequence<GPURenderBundle> bundles);
|
|
|
|
undefined endPass();
|
|
|
|
};
|
|
|
|
GPURenderPassEncoder includes GPUObjectBase;
|
|
|
|
GPURenderPassEncoder includes GPUProgrammablePassEncoder;
|
|
|
|
GPURenderPassEncoder includes GPURenderEncoderBase;
|
|
|
|
|
|
|
|
dictionary GPURenderPassDescriptor : GPUObjectDescriptorBase {
|
|
|
|
required sequence<GPURenderPassColorAttachment> colorAttachments;
|
|
|
|
GPURenderPassDepthStencilAttachment depthStencilAttachment;
|
|
|
|
GPUQuerySet occlusionQuerySet;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPURenderPassColorAttachment {
|
|
|
|
required GPUTextureView view;
|
|
|
|
GPUTextureView resolveTarget;
|
|
|
|
|
|
|
|
required (GPULoadOp or GPUColor) loadValue;
|
2021-05-06 10:48:45 -04:00
|
|
|
required GPUStoreOp storeOp;
|
2021-03-01 05:31:13 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPURenderPassDepthStencilAttachment {
|
|
|
|
required GPUTextureView view;
|
|
|
|
|
|
|
|
required (GPULoadOp or float) depthLoadValue;
|
|
|
|
required GPUStoreOp depthStoreOp;
|
|
|
|
boolean depthReadOnly = false;
|
|
|
|
|
|
|
|
required (GPULoadOp or GPUStencilValue) stencilLoadValue;
|
|
|
|
required GPUStoreOp stencilStoreOp;
|
|
|
|
boolean stencilReadOnly = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPULoadOp {
|
|
|
|
"load"
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUStoreOp {
|
|
|
|
"store",
|
|
|
|
"clear"
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPURenderBundle {
|
|
|
|
};
|
|
|
|
GPURenderBundle includes GPUObjectBase;
|
|
|
|
|
|
|
|
dictionary GPURenderBundleDescriptor : GPUObjectDescriptorBase {
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPURenderBundleEncoder {
|
|
|
|
GPURenderBundle finish(optional GPURenderBundleDescriptor descriptor = {});
|
|
|
|
};
|
|
|
|
GPURenderBundleEncoder includes GPUObjectBase;
|
|
|
|
GPURenderBundleEncoder includes GPUProgrammablePassEncoder;
|
|
|
|
GPURenderBundleEncoder includes GPURenderEncoderBase;
|
|
|
|
|
|
|
|
dictionary GPURenderBundleEncoderDescriptor : GPUObjectDescriptorBase {
|
|
|
|
required sequence<GPUTextureFormat> colorFormats;
|
|
|
|
GPUTextureFormat depthStencilFormat;
|
|
|
|
GPUSize32 sampleCount = 1;
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05: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(
|
|
|
|
GPUImageCopyTexture destination,
|
|
|
|
[AllowShared] BufferSource data,
|
|
|
|
GPUImageDataLayout dataLayout,
|
|
|
|
GPUExtent3D size);
|
2021-05-06 10:48:45 -04:00
|
|
|
|
|
|
|
undefined copyExternalImageToTexture(
|
|
|
|
GPUImageCopyExternalImage source,
|
|
|
|
GPUImageCopyTexture destination,
|
|
|
|
GPUExtent3D copySize);
|
2021-03-01 05:31:13 -05:00
|
|
|
};
|
|
|
|
GPUQueue includes GPUObjectBase;
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUQuerySet {
|
|
|
|
undefined destroy();
|
|
|
|
};
|
|
|
|
GPUQuerySet includes GPUObjectBase;
|
|
|
|
|
|
|
|
dictionary GPUQuerySetDescriptor : GPUObjectDescriptorBase {
|
|
|
|
required GPUQueryType type;
|
|
|
|
required GPUSize32 count;
|
|
|
|
sequence<GPUPipelineStatisticName> pipelineStatistics = [];
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUQueryType {
|
|
|
|
"occlusion",
|
|
|
|
"pipeline-statistics",
|
|
|
|
"timestamp"
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUPipelineStatisticName {
|
|
|
|
"vertex-shader-invocations",
|
|
|
|
"clipper-invocations",
|
|
|
|
"clipper-primitives-out",
|
|
|
|
"fragment-shader-invocations",
|
|
|
|
"compute-shader-invocations"
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
|
|
|
interface GPUCanvasContext {
|
|
|
|
GPUSwapChain configureSwapChain(GPUSwapChainDescriptor descriptor);
|
|
|
|
|
|
|
|
GPUTextureFormat getSwapChainPreferredFormat(GPUAdapter adapter);
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUCanvasCompositingAlphaMode {
|
|
|
|
"opaque",
|
|
|
|
"premultiplied",
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUSwapChainDescriptor : GPUObjectDescriptorBase {
|
|
|
|
required GPUDevice device;
|
|
|
|
required GPUTextureFormat format;
|
|
|
|
GPUTextureUsageFlags usage = 0x10; // GPUTextureUsage.RENDER_ATTACHMENT
|
|
|
|
GPUCanvasCompositingAlphaMode compositingAlphaMode = "opaque";
|
|
|
|
};
|
|
|
|
|
|
|
|
[Exposed=Window]
|
|
|
|
interface GPUSwapChain {
|
|
|
|
GPUTexture getCurrentTexture();
|
|
|
|
};
|
|
|
|
GPUSwapChain includes GPUObjectBase;
|
|
|
|
|
2021-03-01 05:31:13 -05:00
|
|
|
enum GPUDeviceLostReason {
|
|
|
|
"destroyed",
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUDeviceLostInfo {
|
|
|
|
readonly attribute (GPUDeviceLostReason or undefined) reason;
|
|
|
|
readonly attribute DOMString message;
|
|
|
|
};
|
|
|
|
|
|
|
|
partial interface GPUDevice {
|
|
|
|
readonly attribute Promise<GPUDeviceLostInfo> lost;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GPUErrorFilter {
|
|
|
|
"out-of-memory",
|
|
|
|
"validation"
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUOutOfMemoryError {
|
|
|
|
constructor();
|
|
|
|
};
|
|
|
|
|
2021-05-06 10:48:45 -04:00
|
|
|
[Exposed=Window]
|
2021-03-01 05:31:13 -05:00
|
|
|
interface GPUValidationError {
|
|
|
|
constructor(DOMString message);
|
|
|
|
readonly attribute DOMString message;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef (GPUOutOfMemoryError or GPUValidationError) GPUError;
|
|
|
|
|
|
|
|
partial interface GPUDevice {
|
|
|
|
undefined pushErrorScope(GPUErrorFilter filter);
|
|
|
|
Promise<GPUError?> popErrorScope();
|
|
|
|
};
|
|
|
|
|
|
|
|
[
|
|
|
|
Exposed=(Window, DedicatedWorker)
|
|
|
|
]
|
|
|
|
interface GPUUncapturedErrorEvent : Event {
|
|
|
|
constructor(
|
|
|
|
DOMString type,
|
|
|
|
GPUUncapturedErrorEventInit gpuUncapturedErrorEventInitDict
|
|
|
|
);
|
|
|
|
[SameObject] readonly attribute GPUError error;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary GPUUncapturedErrorEventInit : EventInit {
|
|
|
|
required GPUError error;
|
|
|
|
};
|
|
|
|
|
|
|
|
partial interface GPUDevice {
|
|
|
|
[Exposed=(Window, DedicatedWorker)]
|
|
|
|
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;
|
|
|
|
|
|
|
|
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 {
|
2021-05-06 10:48:45 -04:00
|
|
|
required GPUIntegerCoordinate width;
|
2021-03-01 05:31:13 -05:00
|
|
|
GPUIntegerCoordinate height = 1;
|
|
|
|
GPUIntegerCoordinate depthOrArrayLayers = 1;
|
|
|
|
};
|
|
|
|
typedef (sequence<GPUIntegerCoordinate> or GPUExtent3DDict) GPUExtent3D;
|