Graphics APIVulkan and Graphics API Notes
Why My Depth Buffer Only Writes 0 or 1?
Width
Issue
Depth write only writes 0 or 1
Reason
Check your viewport settings in VkPipelineViewportStateCreateInfo. I bet your min/max depth are both 0.
Fix
Set your VkViewport’s min/max depth value in VkPipelineViewportStateCreateInfo and in vkCmdSetViewport.