OpenUSD icon indicating copy to clipboard operation
OpenUSD copied to clipboard

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

Open lilike-adsk opened this issue 1 month ago • 1 comments

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.

lilike-adsk avatar Dec 01 '25 15:12 lilike-adsk