• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2021-2024 The Khronos Group Inc.
2//
3// SPDX-License-Identifier: CC-BY-4.0
4
5include::{generated}/meta/{refprefix}VK_EXT_depth_clip_control.adoc[]
6
7=== Other Extension Metadata
8
9*Last Modified Date*::
10    2021-11-09
11*Contributors*::
12  - Spencer Fricke, Samsung Electronics
13  - Shahbaz Youssefi, Google
14  - Ralph Potter, Samsung Electronics
15
16=== Description
17
18This extension allows the application to use the OpenGL depth range in NDC,
19i.e. with depth in range [eq]#[-1, 1]#, as opposed to Vulkan's default of
20[eq]#[0, 1]#.
21The purpose of this extension is to allow efficient layering of OpenGL over
22Vulkan, by avoiding emulation in the pre-rasterization shader stages.
23This emulation, which effectively duplicates gl_Position but with a
24different depth value, costs ALU and consumes shader output components that
25the implementation may not have to spare to meet OpenGL minimum
26requirements.
27
28include::{generated}/interfaces/VK_EXT_depth_clip_control.adoc[]
29
30=== Issues
31
321) Should this extension include an origin control option to match
33GL_LOWER_LEFT found in ARB_clip_control?
34
35*RESOLVED*: No.
36The fix for porting over the origin is a simple y-axis flip.
37The depth clip control is a much harder problem to solve than what this
38extension is aimed to solve.
39Adding an equivalent to GL_LOWER_LEFT would require more testing.
40
412) Should this pipeline state be dynamic?
42
43*RESOLVED*: Yes.
44The purpose of this extension is to emulate the OpenGL depth range, which is
45expected to be globally fixed (in case of OpenGL ES) or very infrequently
46changed (with `glClipControl` in OpenGL).
47
483) Should the control provided in this extension be an enum that could be
49extended in the future?
50
51*RESOLVED*: No.
52It is highly unlikely that the depth range is changed to anything other than
53[eq]#[0, 1]# in the future.
54Should that happen a new extension will be required to extend such an enum,
55and that extension might as well add a new struct to chain to
56slink:VkPipelineViewportStateCreateInfo::pname:pNext instead.
57
58=== Version History
59
60  * Revision 0, 2020-10-01 (Spencer Fricke)
61  ** Internal revisions
62
63  * Revision 1, 2020-11-26 (Shahbaz Youssefi)
64  ** Language fixes
65
66