Browse Source

Vk: clarify where CreateInfo does a copy of a list/string.

Also make the docs a bit terser in a few places.
pull/504/head
Vladimír Vondruš 5 years ago
parent
commit
90b1a5a8ea
  1. 3
      src/Magnum/Vk/DescriptorSetLayoutCreateInfo.h
  2. 10
      src/Magnum/Vk/DeviceCreateInfo.h
  3. 3
      src/Magnum/Vk/FramebufferCreateInfo.h
  4. 34
      src/Magnum/Vk/InstanceCreateInfo.h
  5. 8
      src/Magnum/Vk/RasterizationPipelineCreateInfo.h
  6. 19
      src/Magnum/Vk/RenderPassCreateInfo.h

3
src/Magnum/Vk/DescriptorSetLayoutCreateInfo.h

@ -405,8 +405,7 @@ class MAGNUM_VK_EXPORT DescriptorSetLayoutCreateInfo {
* pre-filled in addition to `sType`, everything else is zero-filled:
*
* - `flags`
* - `bindingCount` to @cpp bindings.size() @ce
* - `pBindings` to a copy of @p bindings
* - `bindingCount` and `pBindings` to a copy of @p bindings
*
* If any of the @p bindings has @ref DescriptorSetLayoutBinding::flags()
* non-empty, a @type_vk{DescriptorSetLayoutBindingFlagsCreateInfo}

10
src/Magnum/Vk/DeviceCreateInfo.h

@ -175,9 +175,6 @@ class MAGNUM_VK_EXPORT DeviceCreateInfo {
* All listed extensions are expected to be supported either globally
* or in at least one of the enabled layers, use
* @ref ExtensionProperties::isSupported() to check for their presence.
* The function makes copies of string views that are not global or
* null-terminated, use the @link Containers::Literals::operator""_s() @endlink
* literal to prevent that where possible.
*
* The following @type_vk{DeviceCreateInfo} fields are set by this
* function:
@ -186,7 +183,12 @@ class MAGNUM_VK_EXPORT DeviceCreateInfo {
* previously by this function plus @cpp extensions.size() @ce
* - `pEnabledExtensionNames` to an array containing all extension
* strings added previously by this function together with ones
* from @p extensions
* from @p extensions (doing a copy where needed)
*
* @note The function makes copies of string views that are not global
* or null-terminated, use the
* @link Containers::Literals::operator""_s() @endlink
* literal to prevent that where possible.
*/
DeviceCreateInfo& addEnabledExtensions(Containers::ArrayView<const Containers::StringView> extensions) &;
/** @overload */

3
src/Magnum/Vk/FramebufferCreateInfo.h

@ -91,7 +91,8 @@ class MAGNUM_VK_EXPORT FramebufferCreateInfo {
*
* - `flags`
* - `renderPass`
* - `attachmentCount` and `pAttachments` to @p attachments
* - `attachmentCount` and `pAttachments` to a copy of
* @p attachments
* - `width`, `height` and `layers` to @p size
*/
explicit FramebufferCreateInfo(VkRenderPass renderPass, Containers::ArrayView<const Containers::Reference<ImageView>> attachments, const Vector3i& size, Flags flags = {});

34
src/Magnum/Vk/InstanceCreateInfo.h

@ -156,16 +156,18 @@ class MAGNUM_VK_EXPORT InstanceCreateInfo {
* Use the @ref version() helper to create the @p version value. The
* name is @cpp nullptr @ce by default.
*
* The function makes copies of string views that are not global or
* null-terminated, use the @link Containers::Literals::operator""_s() @endlink
* literal to prevent that where possible.
*
* The following @type_vk{InstanceCreateInfo} fields are set by this
* function:
*
* - `pApplicationInfo`
* - @cpp pApplicationInfo->pApplicationName @ce to @p name
* - @cpp pApplicationInfo->pApplicationName @ce to @p name (a copy
* of it, if needed)
* - @cpp pApplicationInfo->applicationVersion @ce to @p version
*
* @note The function makes copies of string views that are not global
* or null-terminated, use the
* @link Containers::Literals::operator""_s() @endlink literal to
* prevent that where possible.
*/
InstanceCreateInfo& setApplicationInfo(Containers::StringView name, Version version);
@ -179,10 +181,6 @@ class MAGNUM_VK_EXPORT InstanceCreateInfo {
* @ref Vk-Instance-command-line "command-line options", it's not
* added.
*
* The function makes copies of string views that are not global or
* null-terminated, use the @link Containers::Literals::operator""_s() @endlink
* literal to prevent that where possible.
*
* The following @type_vk{InstanceCreateInfo} fields are set by this
* function:
*
@ -190,7 +188,12 @@ class MAGNUM_VK_EXPORT InstanceCreateInfo {
* this function plus @cpp layers.size() @ce
* - `pEnabledLayerNames` to an array containing all layer strings
* added previously by this function together with ones from
* @p layers
* @p layers (doing a copy where needed)
*
* @note The function makes copies of string views that are not global
* or null-terminated, use the
* @link Containers::Literals::operator""_s() @endlink literal to
* prevent that where possible.
*/
InstanceCreateInfo& addEnabledLayers(Containers::ArrayView<const Containers::StringView> layers);
/** @overload */
@ -208,10 +211,6 @@ class MAGNUM_VK_EXPORT InstanceCreateInfo {
* @ref Vk-Instance-command-line "command-line options", it's not
* added.
*
* The function makes copies of string views that are not global or
* null-terminated, use the @link Containers::Literals::operator""_s() @endlink
* literal to prevent that where possible.
*
* The following @type_vk{InstanceCreateInfo} fields are set by this
* function:
*
@ -219,7 +218,12 @@ class MAGNUM_VK_EXPORT InstanceCreateInfo {
* previously by this function plus @cpp extensions.size() @ce
* - `pEnabledExtensionNames` to an array containing all extension
* strings added previously by this function together with ones
* from @p extensions
* from @p extensions (doing a copy where needed)
*
* @note The function makes copies of string views that are not global
* or null-terminated, use the
* @link Containers::Literals::operator""_s() @endlink literal to
* prevent that where possible.
*/
InstanceCreateInfo& addEnabledExtensions(Containers::ArrayView<const Containers::StringView> extensions);
/** @overload */

8
src/Magnum/Vk/RasterizationPipelineCreateInfo.h

@ -360,10 +360,6 @@ class MAGNUM_VK_EXPORT RasterizationPipelineCreateInfo {
* @p subpass uses
* @param flags Rasterization pipeline creation flags
*
* Note that the @p shaderSet and @p meshLayout structure internals are
* referenced, not copied, and thus have to stay in scope until the
* @ref Pipeline object is created.
*
* The following @type_vk{GraphicsPipelineCreateInfo} and substructure
* fields are pre-filled in addition to `sType` of all referenced
* structures, everything else is zero-filled:
@ -394,6 +390,10 @@ class MAGNUM_VK_EXPORT RasterizationPipelineCreateInfo {
* - `renderPass`
* - `subpass`
*
* @attention Note that the @p shaderSet and @p meshLayout structure
* internals are referenced, not copied, and thus have to stay in
* scope until the @ref Pipeline object is created.
*
* You need to call at least @ref setViewport() or specifying
* @ref DynamicRasterizationState::Viewport in
* @ref setDynamicStates() for a valid setup.

19
src/Magnum/Vk/RenderPassCreateInfo.h

@ -570,8 +570,8 @@ class MAGNUM_VK_EXPORT SubpassDescription {
* The following @type_vk{SubpassDescription2} fields are set by this
* function:
*
* - `inputAttachmentCount` to @cpp attachments.size() @ce
* - `pInputAttachments` to a copy of @p attachments
* - `inputAttachmentCount` and `pInputAttachments` to a copy of
* @p attachments
*/
SubpassDescription& setInputAttachments(Containers::ArrayView<const AttachmentReference> attachments) &;
/** @overload */
@ -601,8 +601,8 @@ class MAGNUM_VK_EXPORT SubpassDescription {
* The following @type_vk{SubpassDescription2} fields are set by this
* function:
*
* - `colorAttachmentCount` to @cpp attachments.size() @ce
* - `pColorAttachments` to a copy of @p attachments
* - `colorAttachmentCount` and `pColorAttachments` to a copy of
* @p attachments
* - `pResolveAttachments` to a copy of @p resolveAttachments, if
* the parameter is non-empty
*/
@ -654,7 +654,8 @@ class MAGNUM_VK_EXPORT SubpassDescription {
* The following @type_vk{SubpassDescription2} fields are set by this
* function:
*
* - `pPreserveAttachments` to a copy of @p attachments
* - `preserveAttachmentCount` and `pPreserveAttachments` to a copy
* of @p attachments
*/
SubpassDescription& setPreserveAttachments(Containers::ArrayView<const UnsignedInt> attachments) &;
/** @overload */
@ -994,8 +995,8 @@ class MAGNUM_VK_EXPORT RenderPassCreateInfo {
* The following @type_vk{RenderPassCreateInfo2} fields are set by this
* function:
*
* - `attachmentCount` to @cpp attachments.size() @ce
* - `pAttachments` to a copy of @p attachments
* - `attachmentCount` and `pAttachments` to a copy of
* @p attachments
*/
RenderPassCreateInfo& setAttachments(Containers::ArrayView<const AttachmentDescription> attachments);
/** @overload */
@ -1037,8 +1038,8 @@ class MAGNUM_VK_EXPORT RenderPassCreateInfo {
* The following @type_vk{RenderPassCreateInfo2} fields are set by this
* function:
*
* - `dependencyCount` to @cpp dependencies.size() @ce
* - `pDependencies` to a copy of @p dependencies
* - `dependencyCount` and `pDependencies` to a copy of
* @p dependencies
*/
RenderPassCreateInfo& setDependencies(Containers::ArrayView<const SubpassDependency> dependencies);
/** @overload */

Loading…
Cancel
Save