1e5c31af7Sopenharmony_ci// Copyright 2019-2021 The Khronos Group Inc.
2e5c31af7Sopenharmony_ci//
3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0
4e5c31af7Sopenharmony_ci
5e5c31af7Sopenharmony_ciinclude::{generated}/meta/{refprefix}VK_EXT_robustness2.txt[]
6e5c31af7Sopenharmony_ci
7e5c31af7Sopenharmony_ci=== Other Extension Metadata
8e5c31af7Sopenharmony_ci
9e5c31af7Sopenharmony_ci*Last Modified Date*::
10e5c31af7Sopenharmony_ci    2020-01-29
11e5c31af7Sopenharmony_ci*IP Status*::
12e5c31af7Sopenharmony_ci    No known IP claims.
13e5c31af7Sopenharmony_ci*Contributors*::
14e5c31af7Sopenharmony_ci    - Liam Middlebrook, NVIDIA
15e5c31af7Sopenharmony_ci    - Jeff Bolz, NVIDIA
16e5c31af7Sopenharmony_ci
17e5c31af7Sopenharmony_ci=== Description
18e5c31af7Sopenharmony_ci
19e5c31af7Sopenharmony_ciThis extension adds stricter requirements for how out of bounds reads and
20e5c31af7Sopenharmony_ciwrites are handled.
21e5c31af7Sopenharmony_ciMost accesses must: be tightly bounds-checked, out of bounds writes must: be
22e5c31af7Sopenharmony_cidiscarded, out of bound reads must: return zero.
23e5c31af7Sopenharmony_ciRather than allowing multiple possible [eq]#(0,0,0,x)# vectors, the out of
24e5c31af7Sopenharmony_cibounds values are treated as zero, and then missing components are inserted
25e5c31af7Sopenharmony_cibased on the format as described in <<textures-conversion-to-rgba,
26e5c31af7Sopenharmony_ciConversion to RGBA>> and <<fxvertex-input-extraction,vertex input attribute
27e5c31af7Sopenharmony_ciextraction>>.
28e5c31af7Sopenharmony_ci
29e5c31af7Sopenharmony_ciThese additional requirements may: be expensive on some implementations, and
30e5c31af7Sopenharmony_cishould only be enabled when truly necessary.
31e5c31af7Sopenharmony_ci
32e5c31af7Sopenharmony_ciThis extension also adds support for "`null descriptors`", where
33e5c31af7Sopenharmony_cidlink:VK_NULL_HANDLE can: be used instead of a valid handle.
34e5c31af7Sopenharmony_ciAccesses to null descriptors have well-defined behavior, and do not rely on
35e5c31af7Sopenharmony_cirobustness.
36e5c31af7Sopenharmony_ci
37e5c31af7Sopenharmony_ciinclude::{generated}/interfaces/VK_EXT_robustness2.txt[]
38e5c31af7Sopenharmony_ci
39e5c31af7Sopenharmony_ci=== Issues
40e5c31af7Sopenharmony_ci
41e5c31af7Sopenharmony_ci1. Why do
42e5c31af7Sopenharmony_ci   slink:VkPhysicalDeviceRobustness2PropertiesEXT::pname:robustUniformBufferAccessSizeAlignment
43e5c31af7Sopenharmony_ci   and
44e5c31af7Sopenharmony_ci   slink:VkPhysicalDeviceRobustness2PropertiesEXT::pname:robustStorageBufferAccessSizeAlignment
45e5c31af7Sopenharmony_ci   exist?
46e5c31af7Sopenharmony_ci
47e5c31af7Sopenharmony_ci*RESOLVED*: Some implementations cannot efficiently tightly bounds-check all
48e5c31af7Sopenharmony_cibuffer accesses.
49e5c31af7Sopenharmony_ciRather, the size of the bound range is padded to some power of two multiple,
50e5c31af7Sopenharmony_ciup to 256 bytes for uniform buffers and up to 4 bytes for storage buffers,
51e5c31af7Sopenharmony_ciand that padded size is bounds-checked.
52e5c31af7Sopenharmony_ciThis is sufficient to implement D3D-like behavior, because D3D only allows
53e5c31af7Sopenharmony_cibinding whole uniform buffers or ranges that are a multiple of 256 bytes,
54e5c31af7Sopenharmony_ciand D3D raw and structured buffers only support 32-bit accesses.
55e5c31af7Sopenharmony_ci
56e5c31af7Sopenharmony_ci=== Examples
57e5c31af7Sopenharmony_ci
58e5c31af7Sopenharmony_ciNone.
59e5c31af7Sopenharmony_ci
60e5c31af7Sopenharmony_ci=== Version History
61e5c31af7Sopenharmony_ci
62e5c31af7Sopenharmony_ci    * Revision 1, 2019-11-01 (Jeff Bolz, Liam Middlebrook)
63e5c31af7Sopenharmony_ci        - Initial draft
64