Skip to content

hgiMetal: Enable depth bias for line primitives could lead to rendering issues #3900

@lilike-adsk

Description

@lilike-adsk

Is this issue known? On MacOS with Metal, we spotted some rendering issues when apply depth bias for line primitives.
E.g., when depth bias is enabled in the pipeline, and we draw triangle primitives in first pass, then draw line primitives in second pass with the previous color & depth buffers, we found the lines occluded by triangles became visible, see below.
Image

Ignore the depth bias setting for line primitives by adding a primitive type check can produce expected result:
https://github.com/PixarAnimationStudios/OpenUSD/blob/release/pxr/imaging/hgiMetal/graphicsPipeline.mm#L441
Image

BTW, seems Metal doesn't support setdepthbias API for line primitives: https://developer.apple.com/documentation/metal/mtlrendercommandencoder/setdepthbias(_:slopescale:clamp:)

USD version: 25.08.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions