// Copyright 2020-2024 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

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

=== Other Extension Metadata

*Last Modified Date*::
    2020-03-25
*IP Status*::
    No known IP claims.
*Contributors*::
  - Matthew Rusch, NVIDIA
  - Nuno Subtil, NVIDIA
  - Piers Daniell, NVIDIA
  - Jeff Bolz, NVIDIA

=== Description

This extension is a device extension which enables attaching arbitrary
payloads to Vulkan objects.
It introduces the idea of private data slots as a means of storing a 64-bit
unsigned integer of application defined data.
Private data slots can be created or destroyed any time an associated device
is available.
Private data slots can be reserved at device creation time, and limiting use
to the amount reserved will allow the extension to exhibit better
performance characteristics.

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

=== Promotion to Vulkan 1.3

Functionality in this extension is included in core Vulkan 1.3, with the EXT
suffix omitted.
The original type, enum and command names are still available as aliases of
the core functionality.

=== Examples

  * In progress

=== Issues

(1) If I have to create a slink:VkPrivateDataSlot to store and retrieve data
on an object, how does this extension help me? Will I not need to store the
slink:VkPrivateDataSlot mapping with each object, and if I am doing that, I
might as well just store the original data!
--
**RESOLVED:** The slink:VkPrivateDataSlot can be thought of as an opaque
index into storage that is reserved in each object.
That is, you can use the same slink:VkPrivateDataSlot with each object for a
specific piece of information.
For example, if a layer wishes to track per-object information, the layer
only needs to allocate one slink:VkPrivateDataSlot per device and it can use
that private data slot for all of the device's child objects.
This allows multiple layers to store private data without conflicting with
each other's and/or the application's private data.
--

(2) What if I need to store more than 64-bits of information per object?
--
**RESOLVED:** The data that you store per object could be a pointer to
another object or structure of your own allocation.
--

=== Version History

  * Revision 1, 2020-01-15 (Matthew Rusch)
  ** Initial draft
