Implement GPURenderPassEncoder

Add webidls for GPURenderPassEncoder and  GPURenderEncoderBase and
implement relevant methods.
This commit is contained in:
Kunal Mohan 2020-06-02 21:02:06 +05:30
parent e452570be0
commit 1d4efb48ba
11 changed files with 524 additions and 35 deletions

View file

@ -5,7 +5,7 @@
// https://gpuweb.github.io/gpuweb/#gpucommandencoder
[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"]
interface GPUCommandEncoder {
// GPURenderPassEncoder beginRenderPass(GPURenderPassDescriptor descriptor);
GPURenderPassEncoder beginRenderPass(GPURenderPassDescriptor descriptor);
GPUComputePassEncoder beginComputePass(optional GPUComputePassDescriptor descriptor = {});
void copyBufferToBuffer(
@ -43,3 +43,48 @@ dictionary GPUComputePassDescriptor : GPUObjectDescriptorBase {
dictionary GPUCommandBufferDescriptor : GPUObjectDescriptorBase {
};
dictionary GPURenderPassDescriptor : GPUObjectDescriptorBase {
required sequence<GPURenderPassColorAttachmentDescriptor> colorAttachments;
GPURenderPassDepthStencilAttachmentDescriptor depthStencilAttachment;
//GPUQuerySet occlusionQuerySet;
};
dictionary GPURenderPassColorAttachmentDescriptor {
required GPUTextureView attachment;
GPUTextureView resolveTarget;
required (GPULoadOp or GPUColor) loadValue;
GPUStoreOp storeOp = "store";
};
dictionary GPURenderPassDepthStencilAttachmentDescriptor {
required GPUTextureView attachment;
required (GPULoadOp or float) depthLoadValue;
required GPUStoreOp depthStoreOp;
boolean depthReadOnly = false;
required GPUStencilLoadValue stencilLoadValue;
required GPUStoreOp stencilStoreOp;
boolean stencilReadOnly = false;
};
typedef (GPULoadOp or GPUStencilValue) GPUStencilLoadValue;
enum GPULoadOp {
"load"
};
enum GPUStoreOp {
"store",
"clear"
};
dictionary GPUColorDict {
required double r;
required double g;
required double b;
required double a;
};
typedef (sequence<double> or GPUColorDict) GPUColor;