Skip to content

Commit e822402

Browse files
committed
Update pipeline matching rules
1 parent 46869b8 commit e822402

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

spec/index.bs

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7629,8 +7629,10 @@ dictionary GPURenderPassDescriptor : GPUObjectDescriptorBase {
76297629
Given a {{GPURenderPassDescriptor}} |this| the following validation rules apply:
76307630

76317631
1. |this|.{{GPURenderPassDescriptor/colorAttachments}}.length must be less than or equal to 8.
7632-
1. |this|.{{GPURenderPassDescriptor/colorAttachments}}.length must be greater than `0` or
7633-
|this|.{{GPURenderPassDescriptor/depthStencilAttachment}} must not be `null`.
7632+
1. If |this|.{{GPURenderPassDescriptor/colorAttachments}} has all values be `null` (or the sequence is empty):
7633+
7634+
1. |this|.{{GPURenderPassDescriptor/depthStencilAttachment}} must not be `null`.
7635+
76347636
1. For each non-`null` |colorAttachment| in |this|.{{GPURenderPassDescriptor/colorAttachments}}:
76357637

76367638
1. |colorAttachment| must meet the [$GPURenderPassColorAttachment/GPURenderPassColorAttachment Valid Usage$] rules.
@@ -7639,11 +7641,11 @@ dictionary GPURenderPassDescriptor : GPUObjectDescriptorBase {
76397641

76407642
1. |this|.{{GPURenderPassDescriptor/depthStencilAttachment}} must meet the [$GPURenderPassDepthStencilAttachment/GPURenderPassDepthStencilAttachment Valid Usage$] rules.
76417643

7642-
1. All {{GPURenderPassColorAttachment/view}}s in |this|.{{GPURenderPassDescriptor/colorAttachments}},
7644+
1. All {{GPURenderPassColorAttachment/view}}s in non-`null` members of |this|.{{GPURenderPassDescriptor/colorAttachments}},
76437645
and |this|.{{GPURenderPassDescriptor/depthStencilAttachment}}.{{GPURenderPassDepthStencilAttachment/view}}
76447646
if present, must have equal {{GPUTexture/[[descriptor]]}}.{{GPUTextureDescriptor/sampleCount}}s.
76457647

7646-
1. For each {{GPURenderPassColorAttachment/view}} in |this|.{{GPURenderPassDescriptor/colorAttachments}}
7648+
1. For each {{GPURenderPassColorAttachment/view}} in non-`null` members of |this|.{{GPURenderPassDescriptor/colorAttachments}}
76477649
and |this|.{{GPURenderPassDescriptor/depthStencilAttachment}}.{{GPURenderPassDepthStencilAttachment/view}},
76487650
if present, the {{GPUTextureView/[[renderExtent]]}} must match.
76497651

@@ -7906,7 +7908,7 @@ which determines the compatibility of the pass with render pipelines.
79067908

79077909
<script type=idl>
79087910
dictionary GPURenderPassLayout: GPUObjectDescriptorBase {
7909-
required sequence<GPUTextureFormat> colorFormats;
7911+
required sequence<GPUTextureFormat?> colorFormats;
79107912
GPUTextureFormat depthStencilFormat;
79117913
GPUSize32 sampleCount = 1;
79127914
};
@@ -7922,11 +7924,14 @@ dictionary GPURenderPassLayout: GPUObjectDescriptorBase {
79227924

79237925
1. Let |layout| be a new {{GPURenderPassLayout}} object.
79247926
1. For each |colorAttachment| in |descriptor|.{{GPURenderPassDescriptor/colorAttachments}}:
7925-
1. Set |layout|.{{GPURenderPassLayout/sampleCount}} to |colorAttachment|.{{GPURenderPassColorAttachment/view}}.{{GPUTextureView/[[texture]]}}.{{GPUTexture/[[descriptor]]}}.{{GPUTextureDescriptor/sampleCount}}.
7926-
1. Append |colorAttachment|.{{GPURenderPassColorAttachment/view}}.{{GPUTextureView/[[descriptor]]}}.{{GPUTextureViewDescriptor/format}} to |layout|.{{GPURenderPassLayout/colorFormats}}.
7927+
1. If |colorAttachment| is not `null`:
7928+
1. Set |layout|.{{GPURenderPassLayout/sampleCount}} to |colorAttachment|.{{GPURenderPassColorAttachment/view}}.{{GPUTextureView/[[texture]]}}.{{GPUTexture/[[descriptor]]}}.{{GPUTextureDescriptor/sampleCount}}.
7929+
1. Append |colorAttachment|.{{GPURenderPassColorAttachment/view}}.{{GPUTextureView/[[descriptor]]}}.{{GPUTextureViewDescriptor/format}} to |layout|.{{GPURenderPassLayout/colorFormats}}.
7930+
1. Otherwise:
7931+
1. Append `null` to |layout|.{{GPURenderPassLayout/colorFormats}}.
79277932
1. Let |depthStencilAttachment| be |descriptor|.{{GPURenderPassDescriptor/depthStencilAttachment}}.
79287933
1. If |depthStencilAttachment| is not `null`:
7929-
1. Let |view| be |depthStencilAttachment|.{{GPURenderPassDepthStencilAttachment/view}}
7934+
1. Let |view| be |depthStencilAttachment|.{{GPURenderPassDepthStencilAttachment/view}}.
79307935
1. Set |layout|.{{GPURenderPassLayout/sampleCount}} to |view|.{{GPUTextureView/[[texture]]}}.{{GPUTexture/[[descriptor]]}}.{{GPUTextureDescriptor/sampleCount}}.
79317936
1. Set |layout|.{{GPURenderPassLayout/depthStencilFormat}} to |view|.{{GPUTextureView/[[descriptor]]}}.{{GPUTextureViewDescriptor/format}}.
79327937
1. Return |layout|.
@@ -7948,6 +7953,7 @@ dictionary GPURenderPassLayout: GPUObjectDescriptorBase {
79487953
1. If |descriptor|.{{GPURenderPipelineDescriptor/fragment}} is not `null`:
79497954
1. For each |colorTarget| in |descriptor|.{{GPURenderPipelineDescriptor/fragment}}.{{GPUFragmentState/targets}}:
79507955
1. Append |colorTarget|.{{GPUColorTargetState/format}} to |layout|.{{GPURenderPassLayout/colorFormats}}
7956+
if |colorTarget| is not `null`, or append `null` otherwise.
79517957
1. Return |layout|.
79527958

79537959
</div>
@@ -8594,10 +8600,10 @@ GPURenderBundleEncoder includes GPURenderEncoderBase;
85948600
error and stop.
85958601
<div class=validusage>
85968602
- |descriptor|.{{GPURenderPassLayout/colorFormats}}.length must be less than or equal to 8.
8597-
- |descriptor|.{{GPURenderPassLayout/colorFormats}}.length must be greater than `0` or
8598-
|descriptor|.{{GPURenderPassLayout/depthStencilFormat}} must not be `null`.
8603+
- If |descriptor|.{{GPURenderPassLayout/colorFormats}} only contains `null` members:
8604+
- |descriptor|.{{GPURenderPassLayout/depthStencilFormat}} must not be `null`.
85998605
- For each |colorFormat| in |descriptor|.{{GPURenderPassLayout/colorFormats}}:
8600-
- |colorFormat| must be a [=color renderable format=].
8606+
- |colorFormat| is `null`, or it must be a [=color renderable format=].
86018607
- Let |depthStencilFormat| be |descriptor|.{{GPURenderPassLayout/depthStencilFormat}}.
86028608
- If |depthStencilFormat| is not `null`:
86038609
- |depthStencilFormat| must be a [=depth-or-stencil format=].

0 commit comments

Comments
 (0)