🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Using depthClampEnable on VkPipelineRasterizationStateCreateInfo

Started by
0 comments, last by _void_ 3 years, 10 months ago

Hey guys! I would like to ask to help me to understand the usage of depthClampEnable on VkPipelineRasterizationStateCreateInfo structure. The documentation sounds rather odd.

According to the documentation, “depthClampEnable controls whether to clamp the fragment’s depth values as described in Depth Test”.

If I understand correctly, if we set depthClampEnable to TRUE, z is going to be clamped to the range between near plane Z and far plane Z? I have tried to set depthClampEnable to TRUE and now debug layer starts to complain that depth clamping feature is not enabled.

I guess, in this case I need to go through an extension VkPipelineRasterizationDepthClipStateCreateInfoEXT. The documentation around VkPipelineRasterizationDepthClipStateCreateInfoEXT states “If the pipeline is not created with VkPipelineRasterizationDepthClipStateCreateInfoEXT present then enabling depth clamp will also disable clipping primitives to the z planes of the frustrum as described in Primitive Clipping. ”

I do not buy this. If we set depthClampEnable to TRUE, this will disable clipping primitives to the z planes. How is it possible? Isn't depthClampEnable = TRUE is the same as depthClipEnable = TRUE on VkPipelineRasterizationDepthClipStateCreateInfoEXT?

Thanks :-)

This topic is closed to new replies.

Advertisement