Skip to content

Commit f508fe3

Browse files
keep depth/stencil aspects checks
1 parent 215fa5c commit f508fe3

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

src/webgpu/api/validation/render_pass/render_pass_descriptor.spec.ts

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,21 +1081,21 @@ g.test('depth_stencil_attachment,loadOp_storeOp_match_depthReadOnly_stencilReadO
10811081
.desc(
10821082
`
10831083
Test GPURenderPassDepthStencilAttachment Usage:
1084-
- if the format has a depth aspect:
1085-
- if depthReadOnly is true
1086-
- depthLoadOp and depthStoreOp must not be provided
1087-
- else:
1088-
- depthLoadOp and depthStoreOp must be provided
1089-
- if the format has a stencil aspect:
1090-
- if stencilReadOnly is true
1091-
- stencilLoadOp and stencilStoreOp must not be provided
1092-
- else:
1093-
- stencilLoadOp and stencilStoreOp must be provided
1084+
- if the format has a depth aspect and depthReadOnly is false
1085+
- depthLoadOp and depthStoreOp must be provided
1086+
- else:
1087+
- depthLoadOp and depthStoreOp must not be provided
1088+
- if the format has a stencil aspect and stencilReadOnly is false
1089+
- stencilLoadOp and stencilStoreOp must be provided
1090+
- else:
1091+
- stencilLoadOp and stencilStoreOp must not be provided
10941092
- if usage includes TRANSIENT_ATTACHMENT
1095-
- depthLoadOp must be clear
1096-
- stencilLoadOp must be clear
1097-
- depthStoreOp must be discard
1098-
- stencilStoreOp must be discard
1093+
- if the format has a depth aspect:
1094+
- depthLoadOp must be clear
1095+
- depthStoreOp must be discard
1096+
- if the format has a stencil aspect:
1097+
- stencilLoadOp must be clear
1098+
- stencilStoreOp must be discard
10991099
`
11001100
)
11011101
.params(u =>
@@ -1174,10 +1174,8 @@ g.test('depth_stencil_attachment,loadOp_storeOp_match_depthReadOnly_stencilReadO
11741174

11751175
const goodTransient =
11761176
!transientTexture ||
1177-
(depthLoadOp === 'clear' &&
1178-
stencilLoadOp === 'clear' &&
1179-
depthStoreOp === 'discard' &&
1180-
stencilStoreOp === 'discard');
1177+
((!hasDepth || (depthLoadOp === 'clear' && depthStoreOp === 'discard')) &&
1178+
(!hasStencil || (stencilLoadOp === 'clear' && stencilStoreOp === 'discard')));
11811179

11821180
const shouldError =
11831181
!goodAspectSettingsPresent || !goodDepthCombo || !goodStencilCombo || !goodTransient;

0 commit comments

Comments
 (0)