Description
We make extensive use of stencil testing over at ruffle, as Flash games often used one shape to mask another. After updating to v0.6 of wgpu-rs, any game with masking seems to be broken. I've managed to port the relevant code back over on top of the wgpu-rs hello-triangle example code, to use stencil testing to turn two overlapping triangles into a diamond. It works in v0.5 but when ported to v0.6, it only shows the clear colour.
For some reason, I can't open the v0.6 version in RenderDoc to see how the output compares, and trying the trace feature doesn't appear to do anything.
I've managed to get RenderDoc to work when running in dx12, and I can see that the up triangle (which should set the stencil state) isn't setting the correct stencil state. Pictures of that at the end of the report.
Repro steps
I've written one commit for 0.5 and 0.6 which should be effectively the same, and it mimics a stripped down version of how we use stencils at Ruffle. It (should) display a diamond, by first drawing a triangle going down - but only writing 1 to the stencil buffer and colour output disabled - and then one going up which requires the stencil bit 1 to be set.
It should look like this: 
Commit for 0.5: Dinnerbone/wgpu-rs@69a16ae
Commit for 0.6: Dinnerbone/wgpu-rs@43fcfc8
Expected vs observed behavior
Stencil testing should work. In the example above, you should see a diamond - currently you see nothing, as the test fails so no pixels are allowed to show.
Extra materials
Unfortunately I'm not able to get the 0.6 example to run in RenderDoc, and running with mkdir -p trace && WGPU_TRACE=trace cargo run --features trace --example hello_triangle is giving me nothing.
I'm attempting to run a debug now.
I have ran a bisect on wgpu-rs repo and found that it was introduced in http://github.com/gfx-rs/wgpu-rs/pull/503.
In 0.5 (working), the stencil state of the first draw looks like this: 
In 0.6 (broken), the stencil state of the first draw looks like this: 
Platform
I've only confirmed the issue on Windows 10 x64 so far.
It affects (at least) Vulkan, DX12 and DX11.
Description
We make extensive use of stencil testing over at ruffle, as Flash games often used one shape to mask another. After updating to v0.6 of wgpu-rs, any game with masking seems to be broken. I've managed to port the relevant code back over on top of the wgpu-rs
hello-triangleexample code, to use stencil testing to turn two overlapping triangles into a diamond. It works in v0.5 but when ported to v0.6, it only shows the clear colour.For some reason, I can't open the v0.6 version in RenderDoc to see how the output compares, and trying the trace feature doesn't appear to do anything.I've managed to get RenderDoc to work when running in dx12, and I can see that the up triangle (which should set the stencil state) isn't setting the correct stencil state. Pictures of that at the end of the report.
Repro steps
I've written one commit for 0.5 and 0.6 which should be effectively the same, and it mimics a stripped down version of how we use stencils at Ruffle. It (should) display a diamond, by first drawing a triangle going down - but only writing
1to the stencil buffer and colour output disabled - and then one going up which requires the stencil bit1to be set.It should look like this:
Commit for 0.5: Dinnerbone/wgpu-rs@69a16ae
Commit for 0.6: Dinnerbone/wgpu-rs@43fcfc8
Expected vs observed behavior
Stencil testing should work. In the example above, you should see a diamond - currently you see nothing, as the test fails so no pixels are allowed to show.
Extra materials
Unfortunately
I'm not able to get the 0.6 example to run in RenderDoc, andrunning withmkdir -p trace && WGPU_TRACE=trace cargo run --features trace --example hello_triangleis giving me nothing.I'm attempting to run a debug now.
I have ran a bisect on wgpu-rs repo and found that it was introduced in http://github.com/gfx-rs/wgpu-rs/pull/503.
In 0.5 (working), the stencil state of the first draw looks like this:
In 0.6 (broken), the stencil state of the first draw looks like this:
Platform
I've only confirmed the issue on Windows 10 x64 so far.
It affects (at least) Vulkan, DX12 and DX11.