-
Notifications
You must be signed in to change notification settings - Fork 344
Description
While working on an improvement for the wireframe sample I discovered that depthBias and depthBiasSlopeScale don't apply to line and point primitives! At least not on D3D and Metal, and maybe not on Vulkan. I was unaware of this limitation previously, and based on my searching through spec discussion it doesn't appear to have come up in this group.
D3D12
"Bias is not applied to any point or line primitives, except for lines drawn in wireframe mode." (Page linked is for D3D10/11, but is linked from the D3D12_RASTERIZER_DESC docs.
Metal
"Note: A depth bias only influences triangle primitives, but doesn’t apply to points or lines."
Vulkan
"Depth bias is applied to triangle topology primitives received by the rasterizer regardless of polygon mode. Depth bias may also be applied to line and point topology primitives received by the rasterizer."
So Vulkan is the only API that leaves open the possibility of depth bias affecting lines and points.
At the very least I think we should add a note to the WebGPU spec to indicate that this is the case, but given the potential for variation in behavior here I'd also suggest that we consider adding validation to enforce that depthBias, depthBiasSlopeScale, and depthBiasClamp are 0 when a line or point primitive topology is used.