Skip to content

Fix write-only stencil state descriptors from not working - fixes #911#912

Merged
bors[bot] merged 1 commit intogfx-rs:masterfrom
Dinnerbone:fix/stencils
Aug 31, 2020
Merged

Fix write-only stencil state descriptors from not working - fixes #911#912
bors[bot] merged 1 commit intogfx-rs:masterfrom
Dinnerbone:fix/stencils

Conversation

@Dinnerbone
Copy link
Copy Markdown
Contributor

Connections
This fixes #911 - Stencil testing broken between v0.5 and v0.6.

Description
Write-only stencil states (read 0, write >0) are being treated as if they are disabled, which causes pipelines to act as though they don't have any stencil state set at all. This worked prior to commit 2473c25 (introduced in PR #873). As far as I can tell, this works fine in Vulkan, Metal, DX12 and DX11 as we've been using this approach over at Ruffle for a while now.

Testing
You can view the reproduction case in #911 for manual testing. I have confirmed that this fix makes that case work as expected.

I couldn't find any automated tests for wgpu-types to copy and add for this case. If that's wanted then please let me know what the best approach is.

Copy link
Copy Markdown
Contributor

@monocodus monocodus bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an autogenerated code review.

Checker summary (by rust_clippy):
The tool has found 0 warnings, 1 errors.

(self.front != StencilStateFaceDescriptor::IGNORE
|| self.back != StencilStateFaceDescriptor::IGNORE)
&& self.read_mask != 0
&& (self.read_mask != 0 || self.write_mask != 0)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kvark this is the check I was also wondering about in #873 (comment)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, sorry, looks like I screwed this up 😓

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem :) I just wanted to link it here in case it was intentional

Copy link
Copy Markdown
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I double checked Vulkan spec, and I think I was just confused about this. Write and read masks are separate.
bors +

@bors
Copy link
Copy Markdown
Contributor

bors bot commented Aug 31, 2020

Did you mean "r+"?

@kvark
Copy link
Copy Markdown
Member

kvark commented Aug 31, 2020

bors r+

@bors
Copy link
Copy Markdown
Contributor

bors bot commented Aug 31, 2020

@bors bors bot merged commit 128ead0 into gfx-rs:master Aug 31, 2020
@kvark kvark mentioned this pull request Aug 31, 2020
6 tasks
@kvark
Copy link
Copy Markdown
Member

kvark commented Aug 31, 2020

@Dinnerbone could you make the same PR against the 0.6 branch, and add a small commit that bumps wgpu-types patch version and adds a small line to the changelog?

@kvark
Copy link
Copy Markdown
Member

kvark commented Sep 2, 2020

I've done the backporting myself, and this fix is now available in wgpu-types-0.6.1

bors bot added a commit to gfx-rs/wgpu-rs that referenced this pull request Sep 2, 2020
548: wgpu update with correctness fixes r=kvark a=kvark

Picks up a few important correctness fixes, such as gfx-rs/wgpu#916 and gfx-rs/wgpu#912

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
kvark added a commit to kvark/wgpu that referenced this pull request Jun 3, 2021
548: wgpu update with correctness fixes r=kvark a=kvark

Picks up a few important correctness fixes, such as gfx-rs#916 and gfx-rs#912

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
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.

Stencil testing broken between v0.5 and v0.6

3 participants