diff --git a/spec/index.bs b/spec/index.bs index 9cc87d6bbe..e29382ba8e 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -41,6 +41,14 @@ dictionary GPUExtent3D { required u32 height; required u32 depth; }; + +interface GPUObjectBase { + DOMString? label; +}; + +dictionary GPUObjectDescriptorBase { + DOMString? label; +}; Buffers {#buffers} @@ -61,12 +69,12 @@ interface GPUBufferUsage { const u32 STORAGE = 128; }; -dictionary GPUBufferDescriptor { +dictionary GPUBufferDescriptor : GPUObjectDescriptorBase { required u64 size; required GPUBufferUsageFlags usage; }; -interface GPUBuffer { +interface GPUBuffer : GPUObjectBase { Promise mapReadAsync(); Promise mapWriteAsync(); void unmap(); @@ -167,7 +175,7 @@ interface GPUTextureUsage { const u32 OUTPUT_ATTACHMENT = 16; }; -dictionary GPUTextureDescriptor { +dictionary GPUTextureDescriptor : GPUObjectDescriptorBase { required GPUExtent3D size; u32 arrayLayerCount = 1; u32 mipLevelCount = 1; @@ -193,7 +201,7 @@ enum GPUTextureAspect { "depth-only" }; -dictionary GPUTextureViewDescriptor { +dictionary GPUTextureViewDescriptor : GPUObjectDescriptorBase { required GPUTextureFormat format; required GPUTextureViewDimension dimension; required GPUTextureAspect aspect; @@ -203,10 +211,10 @@ dictionary GPUTextureViewDescriptor { u32 arrayLayerCount = 1; }; -interface GPUTextureView { +interface GPUTextureView : GPUObjectBase { }; -interface GPUTexture { +interface GPUTexture : GPUObjectBase { GPUTextureView createView(GPUTextureViewDescriptor desc); GPUTextureView createDefaultView(); @@ -240,7 +248,7 @@ enum GPUCompareFunction { "always" }; -dictionary GPUSamplerDescriptor { +dictionary GPUSamplerDescriptor : GPUObjectDescriptorBase { GPUAddressMode addressModeU = "clamp-to-edge"; GPUAddressMode addressModeV = "clamp-to-edge"; GPUAddressMode addressModeW = "clamp-to-edge"; @@ -252,7 +260,7 @@ dictionary GPUSamplerDescriptor { GPUCompareFunction compareFunction = "never"; }; -interface GPUSampler { +interface GPUSampler : GPUObjectBase { }; @@ -285,18 +293,18 @@ dictionary GPUBindGroupLayoutBinding { required GPUBindingType type; }; -dictionary GPUBindGroupLayoutDescriptor { +dictionary GPUBindGroupLayoutDescriptor : GPUObjectDescriptorBase { required sequence bindings; }; -interface GPUBindGroupLayout { +interface GPUBindGroupLayout : GPUObjectBase { }; -dictionary GPUPipelineLayoutDescriptor { +dictionary GPUPipelineLayoutDescriptor : GPUObjectDescriptorBase { required sequence bindGroupLayouts; }; -interface GPUPipelineLayout { +interface GPUPipelineLayout : GPUObjectBase { }; dictionary GPUBufferBinding { @@ -312,12 +320,12 @@ dictionary GPUBindGroupBinding { required GPUBindingResource resource; }; -dictionary GPUBindGroupDescriptor { +dictionary GPUBindGroupDescriptor : GPUObjectDescriptorBase { required GPUBindGroupLayout layout; required sequence bindings; }; -interface GPUBindGroup { +interface GPUBindGroup : GPUObjectBase { }; @@ -330,11 +338,11 @@ Shader Module {#shader} // text and binary input. typedef (ArrayBuffer or DOMString) ArrayBufferOrDOMString; -dictionary GPUShaderModuleDescriptor { +dictionary GPUShaderModuleDescriptor : GPUObjectDescriptorBase { required ArrayBufferOrDOMString code; }; -interface GPUShaderModule { +interface GPUShaderModule : GPUObjectBase { }; @@ -531,7 +539,7 @@ dictionary GPUPipelineStageDescriptor { // TODO other stuff like specialization constants? }; -dictionary GPUPipelineDescriptorBase { +dictionary GPUPipelineDescriptorBase : GPUObjectDescriptorBase { required GPUPipelineLayout layout; }; @@ -544,7 +552,7 @@ dictionary GPUComputePipelineDescriptor : GPUPipelineDescriptorBase { required GPUPipelineStageDescriptor computeStage; }; -interface GPUComputePipeline { +interface GPUComputePipeline : GPUObjectBase { }; @@ -575,7 +583,7 @@ dictionary GPURenderPipelineDescriptor : GPUPipelineDescriptorBase { // TODO other properties }; -interface GPURenderPipeline { +interface GPURenderPipeline : GPUObjectBase { }; @@ -583,11 +591,16 @@ Command Recording {#command-recording} ====================================== @@ -710,11 +729,11 @@ Fences {#fences} ================ @@ -768,7 +787,7 @@ dictionary GPULimits { }; // Device -interface GPUDevice { +interface GPUDevice : GPUObjectBase { readonly attribute GPUExtensions extensions; readonly attribute GPULimits limits; readonly attribute GPUAdapter adapter; @@ -792,14 +811,14 @@ interface GPUDevice { GPUQueue getQueue(); }; -dictionary GPUDeviceDescriptor { +dictionary GPUDeviceDescriptor : GPUObjectDescriptorBase { GPUExtensions extensions; GPULimits limits; // TODO are other things configurable like queues? }; -interface GPUAdapter { +interface GPUAdapter : GPUObjectBase { readonly attribute DOMString name; readonly attribute GPUExtensions extensions; //readonly attribute GPULimits limits; Don't expose higher limits for now. @@ -899,50 +918,3 @@ partial interface GPUDevice : EventTarget { attribute EventHandler onuncapturederror; }; - -Debugging Assistance {#debugging} -================================= - -