<p>I'd like to store arbitrary float depth, so I have to disable both primitive clipping and depth clamping.</p>

<p>I can disable clipping by setting <code>VkPipelineRasterizationStateCreateInfo::depthClampEnable</code> to <code>VK_TRUE</code>, but then I'd have to increase my viewport bounds to the range I wish to store (which is 0..FLT_MAX) and during rasterization my depth value would be multiplied by viewport depth range and would blow up.</p>

<p>Fortunately, I can disable both clipping and clamping using the VK_EXT_depth_clip_enable, but <a href="https://vulkan.gpuinfo.org/listdevices.php?platform=linux&amp;extension=VK_EXT_depth_clip_enable" rel="nofollow noreferrer">turns out</a> it was supported by the drivers quite recently.</p>

<p>Is there any way to disable both depth clamping and clipping on older drivers (i.e., without using VK_EXT_depth_clip_enable)?</p>

CC BY-SA 4.0
2019-09-06T16:11:12.357Z
"*Is there any way to disable both depth clamping and clipping on older drivers*" If there was a way, why would the extension need to exist?
Nicol Bolas
CC BY-SA 4.0
2019-09-09T07:04:04.573Z
@NicolBolas, yeah, I thought about it. Just wondered maybe there is a way to achieve this using some other transform in the pipeline or disable them both by enabling some other pipeline feature. But now as you commented with the same idea about rationale behind the extension, I see that chances are slim.
Vladimir Nazarenko
<vulkan>
Disable both depth clamp and depth clip in Vulkan (older drivers)
Vladimir Nazarenko
# Disable both depth clamp and depth clip in Vulkan (older drivers)

(Asked by: username_0 on 2019-09-06)

I'd like to store arbitrary float depth, so I have to disable both primitive clipping and depth clamping.

I can disable clipping by setting `VkPipelineRasterizationStateCreateInfo::depthClampEnable` to `VK_TRUE`, but then I'd have to increase my viewport bounds to the range I wish to store (which is 0..FLT\_MAX) and during rasterization my depth value would be multiplied by viewport depth range and would blow up.

Fortunately, I can disable both clipping and clamping using the VK\_EXT\_depth\_clip\_enable, but [turns out](https://vulkan.gpuinfo.org/listdevices.php?platform=linux&extension=VK_EXT_depth_clip_enable) it was supported by the drivers quite recently.

Is there any way to disable both depth clamping and clipping on older drivers (i.e., without using VK\_EXT\_depth\_clip\_enable)?

**Tags:** vulkan

> **Comments:**
> **username_1**: "*Is there any way to disable both depth clamping and clipping on older drivers*" If there was a way, why would the extension need to exist?  
> **username_0**: @username_1, yeah, I thought about it. Just wondered maybe there is a way to achieve this using some other transform in the pipeline or disable them both by enabling some other pipeline feature. But now as you commented with the same idea about rationale behind the extension, I see that chances are slim.  

---

## 0 answers

