Skip to content

Move clampDepth to GPUPrimitiveState. - #1583

Merged
kvark merged 1 commit into
gpuweb:mainfrom
Kangz:depth-clamping
Apr 5, 2021
Merged

kvark merged 1 commit into
gpuweb:mainfrom
Kangz:depth-clamping

Conversation

@Kangz

@Kangz Kangz commented Mar 31, 2021 •

Copy link
Copy Markdown
Contributor

GPUDepthStencilState contains state that's useful only when a depth
stencil attachment is present. However clampDepth clamps the depth
instead of clipping pixels even when there are no depth-stencil
attachments. That's why we move it to GPUPrimitiveState.

This is based on a comment @kvark made in passing that clampDepth should
be moved.


Preview | Diff

GPUDepthStencilState contains state that's useful only when a depth
stencil attachment is present. However clampDepth clamps the depth
instead of clipping pixels even when there are no depth-stencil
attachments. That's why we move it to GPUPrimitiveState.

This is based on a comment @kvark made in passing that clampDepth should
be moved.
@Kangz
Kangz requested a review from kvark March 31, 2021 13:12
@kvark
kvark merged commit cb355a2 into gpuweb:main Apr 5, 2021
bors Bot added a commit to gfx-rs/wgpu that referenced this pull request Apr 5, 2021
1309: Move depth clamping to primitive state r=kvark a=kvark

**Connections**
Matches gpuweb/gpuweb#1583

**Description**
There are valid cases where we'd want the depth clamping happening without any depth/stencil attachment or state.

**Testing**
Untested


Co-authored-by: Dzmitry Malyshau <[email protected]>
@Kangz
Kangz deleted the depth-clamping branch March 25, 2022 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants