Open kjarosh opened 2 weeks ago
This probably needs to be bumped up to webgpu as it's unclear what we're supposed to do here - I suspect there's not a ton we can do about this, without extremely expensive polyfills.
Couldn't you just set MultisampleEnable
to FALSE
in the rasterizer state?
https://learn.microsoft.com/en-us/windows/win32/api/d3d11/ns-d3d11-d3d11_rasterizer_desc
MultisampleEnable
Type: BOOL
Specifies whether to use the quadrilateral or alpha line anti-aliasing algorithm on multisample antialiasing (MSAA) render targets. Set to TRUE to use the quadrilateral line anti-aliasing algorithm and to FALSE to use the alpha line anti-aliasing algorithm. For more info about this member, see Remarks.
Description
When drawing lines using
PrimitiveTopology::LineList
orPrimitiveTopology::LineStrip
, they are 1px thick onVulkan
andGl
, but onDx12
they are thicker than 1px when MSAA sample count is greater than 1.I suspect this has something to do with their rasterization rules:
Repro steps
Draw a line on
Dx12
usingPrimitiveTopology::LineList
orPrimitiveTopology::LineStrip
withMultisampleState.count > 1
.Expected vs observed behavior
Expected: lines always have 1px.
Observed: lines have 1px for
Vulkan
,Gl
,Dx12
without MSAA, but they are thicker than 1px forDx12
with MSAA.Extra materials
Dx12
with MSAA on WindowsVulkan
with MSAA on LinuxPlatform
I actually do not use Windows at all, but unfortunately our tests at Ruffle started failing on the Windows runner when I started using
PrimitiveTopology::LineStrip
(https://github.com/ruffle-rs/ruffle/pull/16619, failing job). I have confirmed that it in fact does look like that on a Windows machine.