mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Use Device limits and features provided by user
Spec update
This commit is contained in:
parent
cd73193efe
commit
3661aa3d8c
16 changed files with 210 additions and 57 deletions
|
@ -18,8 +18,12 @@ dictionary GPUDeviceDescriptor : GPUObjectDescriptorBase {
|
|||
};
|
||||
|
||||
enum GPUExtensionName {
|
||||
"depth-clamping",
|
||||
"depth24unorm-stencil8",
|
||||
"depth32float-stencil8",
|
||||
"pipeline-statistics-query",
|
||||
"texture-compression-bc",
|
||||
"pipeline-statistics-query"
|
||||
"timestamp-query",
|
||||
};
|
||||
|
||||
dictionary GPULimits {
|
||||
|
|
|
@ -16,11 +16,10 @@ dictionary GPUBindGroupLayoutEntry {
|
|||
required GPUIndex32 binding;
|
||||
required GPUShaderStageFlags visibility;
|
||||
required GPUBindingType type;
|
||||
boolean hasDynamicOffset = false;
|
||||
GPUSize64 minBufferBindingSize = 0;
|
||||
boolean hasDynamicOffset;
|
||||
GPUSize64 minBufferBindingSize;
|
||||
GPUTextureViewDimension viewDimension;
|
||||
GPUTextureComponentType textureComponentType;
|
||||
boolean multisampled = false;
|
||||
GPUTextureFormat storageTextureFormat;
|
||||
};
|
||||
|
||||
|
@ -31,6 +30,7 @@ enum GPUBindingType {
|
|||
"sampler",
|
||||
"comparison-sampler",
|
||||
"sampled-texture",
|
||||
"multisampled-texture",
|
||||
"readonly-storage-texture",
|
||||
"writeonly-storage-texture"
|
||||
};
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
// https://gpuweb.github.io/gpuweb/#gpucommandbuffer
|
||||
[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"]
|
||||
interface GPUCommandBuffer {
|
||||
//readonly attribute Promise<double> executionTime;
|
||||
};
|
||||
GPUCommandBuffer includes GPUObjectBase;
|
||||
|
|
|
@ -9,6 +9,11 @@ interface GPUComputePassEncoder {
|
|||
void dispatch(GPUSize32 x, optional GPUSize32 y = 1, optional GPUSize32 z = 1);
|
||||
void dispatchIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);
|
||||
|
||||
//void beginPipelineStatisticsQuery(GPUQuerySet querySet, GPUSize32 queryIndex);
|
||||
//void endPipelineStatisticsQuery();
|
||||
|
||||
//void writeTimestamp(GPUQuerySet querySet, GPUSize32 queryIndex);
|
||||
|
||||
void endPass();
|
||||
};
|
||||
GPUComputePassEncoder includes GPUObjectBase;
|
||||
|
|
|
@ -22,11 +22,16 @@ interface GPUDevice : EventTarget {
|
|||
GPUShaderModule createShaderModule(GPUShaderModuleDescriptor descriptor);
|
||||
GPUComputePipeline createComputePipeline(GPUComputePipelineDescriptor descriptor);
|
||||
GPURenderPipeline createRenderPipeline(GPURenderPipelineDescriptor descriptor);
|
||||
//Promise<GPUComputePipeline> createReadyComputePipeline(GPUComputePipelineDescriptor descriptor);
|
||||
//Promise<GPURenderPipeline> createReadyRenderPipeline(GPURenderPipelineDescriptor descriptor);
|
||||
|
||||
GPUCommandEncoder createCommandEncoder(optional GPUCommandEncoderDescriptor descriptor = {});
|
||||
GPURenderBundleEncoder createRenderBundleEncoder(GPURenderBundleEncoderDescriptor descriptor);
|
||||
|
||||
//GPUQuerySet createQuerySet(GPUQuerySetDescriptor descriptor);
|
||||
};
|
||||
GPUDevice includes GPUObjectBase;
|
||||
|
||||
dictionary GPUCommandEncoderDescriptor : GPUObjectDescriptorBase {
|
||||
boolean measureExecutionTime = false;
|
||||
};
|
||||
|
|
|
@ -13,13 +13,13 @@ interface GPUQueue {
|
|||
[Throws] void writeBuffer(
|
||||
GPUBuffer buffer,
|
||||
GPUSize64 bufferOffset,
|
||||
/*[AllowShared]*/ ArrayBuffer data,
|
||||
/*[AllowShared]*/ BufferSource data,
|
||||
optional GPUSize64 dataOffset = 0,
|
||||
optional GPUSize64 size);
|
||||
|
||||
[Throws] void writeTexture(
|
||||
GPUTextureCopyView destination,
|
||||
/*[AllowShared]*/ ArrayBuffer data,
|
||||
/*[AllowShared]*/ BufferSource data,
|
||||
GPUTextureDataLayout dataLayout,
|
||||
GPUExtent3D size);
|
||||
|
||||
|
|
|
@ -16,8 +16,9 @@ dictionary GPUSamplerDescriptor : GPUObjectDescriptorBase {
|
|||
GPUFilterMode minFilter = "nearest";
|
||||
GPUFilterMode mipmapFilter = "nearest";
|
||||
float lodMinClamp = 0;
|
||||
float lodMaxClamp = 0xfffff; // TODO: Update this. Value in spec was too big
|
||||
float lodMaxClamp = 0xfffff; // TODO: What should this be? Was Number.MAX_VALUE.
|
||||
GPUCompareFunction compare;
|
||||
unsigned short maxAnisotropy = 1;
|
||||
};
|
||||
|
||||
enum GPUAddressMode {
|
||||
|
|
|
@ -57,8 +57,9 @@ enum GPUTextureFormat {
|
|||
"bgra8unorm",
|
||||
"bgra8unorm-srgb",
|
||||
// Packed 32-bit formats
|
||||
//"rgb9e5ufloat",
|
||||
"rgb10a2unorm",
|
||||
"rg11b10float",
|
||||
//"rg11b10ufloat",
|
||||
|
||||
// 64-bit formats
|
||||
"rg32uint",
|
||||
|
@ -74,15 +75,42 @@ enum GPUTextureFormat {
|
|||
"rgba32float",
|
||||
|
||||
// Depth and stencil formats
|
||||
"depth32float",
|
||||
//"stencil8",
|
||||
//"depth16unorm",
|
||||
"depth24plus",
|
||||
"depth24plus-stencil8"
|
||||
"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" extension
|
||||
//"depth24unorm-stencil8",
|
||||
|
||||
// "depth32float-stencil8" extension
|
||||
//"depth32float-stencil8",
|
||||
};
|
||||
|
||||
enum GPUTextureComponentType {
|
||||
"float",
|
||||
"sint",
|
||||
"uint"
|
||||
"uint",
|
||||
// Texture is used with comparison sampling only.
|
||||
"depth-comparison"
|
||||
};
|
||||
|
||||
dictionary GPUExtent3DDict {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue