Skip to content

Commit

Permalink
Tighten setScissorRest / setViewport validation. (#1138)
Browse files Browse the repository at this point in the history
Tighten setScissorRest / setViewport validation.

Based on the investigation in #373 empty viewports are allowed in all
target APIs, which means that empty scissors can be emulated on APIs
that don't allow them.

Also record in the spec that we agreed that the viewport should be
contained in the attachment rect.
  • Loading branch information
Kangz authored Oct 13, 2020
1 parent 73647ed commit eb96ea6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6047,10 +6047,17 @@ attachments used by this encoder.
1. If any of the following conditions are unsatisfied, generate a validation
error and stop.
<div class=validusage>
- |width| is greater than `0`.
- |height| is greater than `0`.
- |x| is greater than or equal to `0`.
- |y| is greater than or equal to `0`.
- |width| is greater than or equal to `0`.
- |height| is greater than or equal to `0`.
- |x| + |width| is less than or equal to
|this|.{{GPURenderPassEncoder/[[attachment_size]]}}.width.
- |y| + |height| is less than or equal to
|this|.{{GPURenderPassEncoder/[[attachment_size]]}}.height.
- |minDepth| is greater than or equal to `0.0` and less than or equal to `1.0`.
- |maxDepth| is greater than or equal to `0.0` and less than or equal to `1.0`.
- |minDepth| is greater than |maxDepth|.
</div>
1. Set the viewport to the extents |x|, |y|, |width|, |height|, |minDepth|, and |maxDepth|.
</div>
Expand Down Expand Up @@ -6082,10 +6089,6 @@ attachments used by this encoder.
1. If any of the following conditions are unsatisfied, generate a validation
error and stop.
<div class=validusage>
- |x| is greater than or equal to `0`.
- |y| is greater than or equal to `0`.
- |width| is greater than `0`.
- |height| is greater than `0`.
- |x|+|width| is less than or equal to
|this|.{{GPURenderPassEncoder/[[attachment_size]]}}.width.
- |y|+|height| is less than or equal to
Expand Down

0 comments on commit eb96ea6

Please sign in to comment.