这是indexloc提供的服务,不要输入任何密码
Skip to content

Depth Bias does not affect line and point primitives. #4729

@toji

Description

@toji

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api resolvedResolved - waiting for a change to the API specificationpotentially breakingCould require a breaking change to the API

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions