diff options
| author | Mark Young <marky@lunarg.com> | 2016-08-31 11:53:26 -0600 |
|---|---|---|
| committer | Mark Young <marky@lunarg.com> | 2016-08-31 11:53:59 -0600 |
| commit | fdd6f14ef5d58a09c40ca6179f1cf6eeca5bf99b (patch) | |
| tree | 90ff7ff4549799a64390110f96aa238e5e845a4d /loader | |
| parent | c5ffaea78f77a50e4cfc0f0a8235c501ec4dc5b8 (diff) | |
| download | usermoji-fdd6f14ef5d58a09c40ca6179f1cf6eeca5bf99b.tar.xz | |
doc: Update loaderandlayerinterface
Added more information about layer wrapping, specifically requiring
support for extensions.
Change-Id: Ie60952f41c976b8e0245810c550b133dc5843097
Diffstat (limited to 'loader')
| -rw-r--r-- | loader/LoaderAndLayerInterface.md | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/loader/LoaderAndLayerInterface.md b/loader/LoaderAndLayerInterface.md index 375a263d..0c3004a1 100644 --- a/loader/LoaderAndLayerInterface.md +++ b/loader/LoaderAndLayerInterface.md @@ -1477,16 +1477,21 @@ vkCreateDevice( #### Special Considerations ##### Associating private data with Vulkan objects within a layer A layer may want to associate it's own private data with one or more Vulkan -objects. -Two common methods to do this are hash maps and object wrapping. The loader +objects. Two common methods to do this are hash maps and object wrapping. + +###### Wrapping: + +The loader supports layers wrapping any Vulkan object including dispatchable objects. Layers which wrap objects should ensure they always unwrap objects before passing them down the chain. This implies the layer must intercept every Vulkan -command which uses the object in question. Layers above the object wrapping -layer will see the wrapped object. Layers which wrap dispatchable objects must -ensure that the first field in the wrapping structure is a pointer to a dispatch table -as defined in vk_layer.h. Specifically, an instance wrapped dispatchable object -could be as follows: +command which uses the object in question. This includes adding support +for all extensions with commands using any object the layer wraps. + +Layers above the object wrapping layer will see the wrapped object. Layers +which wrap dispatchable objects must ensure that the first field in the wrapping +structure is a pointer to a dispatch table as defined in vk_layer.h. Specifically, an +instance wrapped dispatchable object could be as follows: ``` struct my_wrapped_instance_obj_ { VkLayerInstanceDispatchTable *disp; @@ -1501,6 +1506,7 @@ struct my_wrapped_instance_obj_ { }; ``` +###### Hash Maps: Alternatively, a layer may want to use a hash map to associate data with a given object. The key to the map could be the object. Alternatively, for dispatchable objects at a given level (eg device or instance) the layer may |
