aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webidls/GPUCommandEncoder.webidl
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2020-06-02 21:02:06 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2020-06-04 00:27:58 +0530
commit1d4efb48ba904aab93ebad3a2892aed46444088f (patch)
treef577b3c8eb782b2938305b5ccb1b3bf1c595e337 /components/script/dom/webidls/GPUCommandEncoder.webidl
parente452570be0f01adc9ad6cd38ee58705b6a3f3812 (diff)
downloadservo-1d4efb48ba904aab93ebad3a2892aed46444088f.tar.gz
servo-1d4efb48ba904aab93ebad3a2892aed46444088f.zip
Implement GPURenderPassEncoder
Add webidls for GPURenderPassEncoder and GPURenderEncoderBase and implement relevant methods.
Diffstat (limited to 'components/script/dom/webidls/GPUCommandEncoder.webidl')
-rw-r--r--components/script/dom/webidls/GPUCommandEncoder.webidl47
1 files changed, 46 insertions, 1 deletions
diff --git a/components/script/dom/webidls/GPUCommandEncoder.webidl b/components/script/dom/webidls/GPUCommandEncoder.webidl
index f6801e46e96..6892c5393af 100644
--- a/components/script/dom/webidls/GPUCommandEncoder.webidl
+++ b/components/script/dom/webidls/GPUCommandEncoder.webidl
@@ -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;