summaryrefslogtreecommitdiff
path: root/appendices/VK_EXT_depth_clip_control.adoc
blob: 4e430a70fb1e03a550a7e9334eb4598c9987f877 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright 2021-2023 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

include::{generated}/meta/{refprefix}VK_EXT_depth_clip_control.adoc[]

=== Other Extension Metadata

*Last Modified Date*::
    2021-11-09
*Contributors*::
  - Spencer Fricke, Samsung Electronics
  - Shahbaz Youssefi, Google
  - Ralph Potter, Samsung Electronics

=== Description

This extension allows the application to use the OpenGL depth range in NDC,
i.e. with depth in range [eq]#[-1, 1]#, as opposed to Vulkan's default of
[eq]#[0, 1]#.
The purpose of this extension is to allow efficient layering of OpenGL over
Vulkan, by avoiding emulation in the pre-rasterization shader stages.
This emulation, which effectively duplicates gl_Position but with a
different depth value, costs ALU and consumes shader output components that
the implementation may not have to spare to meet OpenGL minimum
requirements.

include::{generated}/interfaces/VK_EXT_depth_clip_control.adoc[]

=== Issues

1) Should this extension include an origin control option to match
GL_LOWER_LEFT found in ARB_clip_control?

*RESOLVED*: No.
The fix for porting over the origin is a simple y-axis flip.
The depth clip control is a much harder problem to solve than what this
extension is aimed to solve.
Adding an equivalent to GL_LOWER_LEFT would require more testing.

2) Should this pipeline state be dynamic?

*RESOLVED*: Yes.
The purpose of this extension is to emulate the OpenGL depth range, which is
expected to be globally fixed (in case of OpenGL ES) or very infrequently
changed (with `glClipControl` in OpenGL).

3) Should the control provided in this extension be an enum that could be
extended in the future?

*RESOLVED*: No.
It is highly unlikely that the depth range is changed to anything other than
[eq]#[0, 1]# in the future.
Should that happen a new extension will be required to extend such an enum,
and that extension might as well add a new struct to chain to
slink:VkPipelineViewportStateCreateInfo::pname:pNext instead.

=== Version History

  * Revision 0, 2020-10-01 (Spencer Fricke)
  ** Internal revisions

  * Revision 1, 2020-11-26 (Shahbaz Youssefi)
  ** Language fixes