Video demonstrating the problem:
(Glitches appear when vertices approach the z-plane and projection occurs from both front and back despite depth bounds being set for normalized device coordinates)
My Vulkan application exhibits some perculiar behaviour. I suspect this is due to the z-axis clipping not happening, causing vertices on the z-plane to be projected to vertices with infinately large x and y values. I’ve verified that my projection maps the frustrum to a canonical view volume with corners (-1, -1, 0) and (1, 1, 1) and I’ve set the following parameters:
VkViewport viewport; viewport.minDepth = 0.0f; viewport.maxDepth = 1.0f; .. VkPipelineDepthStencilStateCreateInfo depth_stencil_info; depth_stencil_info.depthBoundsTestEnable = VK_TRUE; depth_stencil_info.minDepthBounds = 0.0f; depth_stencil_info.maxDepthBounds = 1.0f; ..
Any idea what I’m missing here?