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: * pre-filled in addition to `sType`, everything else is zero-filled:
* *
* - `flags` * - `flags`
* - `bindingCount` to @cpp bindings.size() @ce * - `bindingCount` and `pBindings` to a copy of @p bindings
* - `pBindings` to a copy of @p bindings
* *
* If any of the @p bindings has @ref DescriptorSetLayoutBinding::flags() * If any of the @p bindings has @ref DescriptorSetLayoutBinding::flags()
* non-empty, a @type_vk{DescriptorSetLayoutBindingFlagsCreateInfo} * 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 * All listed extensions are expected to be supported either globally
* or in at least one of the enabled layers, use * or in at least one of the enabled layers, use
* @ref ExtensionProperties::isSupported() to check for their presence. * @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 * The following @type_vk{DeviceCreateInfo} fields are set by this
* function: * function:
@ -186,7 +183,12 @@ class MAGNUM_VK_EXPORT DeviceCreateInfo {
* previously by this function plus @cpp extensions.size() @ce * previously by this function plus @cpp extensions.size() @ce
* - `pEnabledExtensionNames` to an array containing all extension * - `pEnabledExtensionNames` to an array containing all extension
* strings added previously by this function together with ones * 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) &; DeviceCreateInfo& addEnabledExtensions(Containers::ArrayView<const Containers::StringView> extensions) &;
/** @overload */ /** @overload */

3
src/Magnum/Vk/FramebufferCreateInfo.h

@ -91,7 +91,8 @@ class MAGNUM_VK_EXPORT FramebufferCreateInfo {
* *
* - `flags` * - `flags`
* - `renderPass` * - `renderPass`
* - `attachmentCount` and `pAttachments` to @p attachments * - `attachmentCount` and `pAttachments` to a copy of
* @p attachments
* - `width`, `height` and `layers` to @p size * - `width`, `height` and `layers` to @p size
*/ */
explicit FramebufferCreateInfo(VkRenderPass renderPass, Containers::ArrayView<const Containers::Reference<ImageView>> attachments, const Vector3i& size, Flags flags = {}); 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 * Use the @ref version() helper to create the @p version value. The
* name is @cpp nullptr @ce by default. * 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 * The following @type_vk{InstanceCreateInfo} fields are set by this
* function: * function:
* *
* - `pApplicationInfo` * - `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 * - @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); 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 * @ref Vk-Instance-command-line "command-line options", it's not
* added. * 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 * The following @type_vk{InstanceCreateInfo} fields are set by this
* function: * function:
* *
@ -190,7 +188,12 @@ class MAGNUM_VK_EXPORT InstanceCreateInfo {
* this function plus @cpp layers.size() @ce * this function plus @cpp layers.size() @ce
* - `pEnabledLayerNames` to an array containing all layer strings * - `pEnabledLayerNames` to an array containing all layer strings
* added previously by this function together with ones from * 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); InstanceCreateInfo& addEnabledLayers(Containers::ArrayView<const Containers::StringView> layers);
/** @overload */ /** @overload */
@ -208,10 +211,6 @@ class MAGNUM_VK_EXPORT InstanceCreateInfo {
* @ref Vk-Instance-command-line "command-line options", it's not * @ref Vk-Instance-command-line "command-line options", it's not
* added. * 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 * The following @type_vk{InstanceCreateInfo} fields are set by this
* function: * function:
* *
@ -219,7 +218,12 @@ class MAGNUM_VK_EXPORT InstanceCreateInfo {
* previously by this function plus @cpp extensions.size() @ce * previously by this function plus @cpp extensions.size() @ce
* - `pEnabledExtensionNames` to an array containing all extension * - `pEnabledExtensionNames` to an array containing all extension
* strings added previously by this function together with ones * 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); InstanceCreateInfo& addEnabledExtensions(Containers::ArrayView<const Containers::StringView> extensions);
/** @overload */ /** @overload */

8
src/Magnum/Vk/RasterizationPipelineCreateInfo.h

@ -360,10 +360,6 @@ class MAGNUM_VK_EXPORT RasterizationPipelineCreateInfo {
* @p subpass uses * @p subpass uses
* @param flags Rasterization pipeline creation flags * @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 * The following @type_vk{GraphicsPipelineCreateInfo} and substructure
* fields are pre-filled in addition to `sType` of all referenced * fields are pre-filled in addition to `sType` of all referenced
* structures, everything else is zero-filled: * structures, everything else is zero-filled:
@ -394,6 +390,10 @@ class MAGNUM_VK_EXPORT RasterizationPipelineCreateInfo {
* - `renderPass` * - `renderPass`
* - `subpass` * - `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 * You need to call at least @ref setViewport() or specifying
* @ref DynamicRasterizationState::Viewport in * @ref DynamicRasterizationState::Viewport in
* @ref setDynamicStates() for a valid setup. * @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 * The following @type_vk{SubpassDescription2} fields are set by this
* function: * function:
* *
* - `inputAttachmentCount` to @cpp attachments.size() @ce * - `inputAttachmentCount` and `pInputAttachments` to a copy of
* - `pInputAttachments` to a copy of @p attachments * @p attachments
*/ */
SubpassDescription& setInputAttachments(Containers::ArrayView<const AttachmentReference> attachments) &; SubpassDescription& setInputAttachments(Containers::ArrayView<const AttachmentReference> attachments) &;
/** @overload */ /** @overload */
@ -601,8 +601,8 @@ class MAGNUM_VK_EXPORT SubpassDescription {
* The following @type_vk{SubpassDescription2} fields are set by this * The following @type_vk{SubpassDescription2} fields are set by this
* function: * function:
* *
* - `colorAttachmentCount` to @cpp attachments.size() @ce * - `colorAttachmentCount` and `pColorAttachments` to a copy of
* - `pColorAttachments` to a copy of @p attachments * @p attachments
* - `pResolveAttachments` to a copy of @p resolveAttachments, if * - `pResolveAttachments` to a copy of @p resolveAttachments, if
* the parameter is non-empty * the parameter is non-empty
*/ */
@ -654,7 +654,8 @@ class MAGNUM_VK_EXPORT SubpassDescription {
* The following @type_vk{SubpassDescription2} fields are set by this * The following @type_vk{SubpassDescription2} fields are set by this
* function: * function:
* *
* - `pPreserveAttachments` to a copy of @p attachments * - `preserveAttachmentCount` and `pPreserveAttachments` to a copy
* of @p attachments
*/ */
SubpassDescription& setPreserveAttachments(Containers::ArrayView<const UnsignedInt> attachments) &; SubpassDescription& setPreserveAttachments(Containers::ArrayView<const UnsignedInt> attachments) &;
/** @overload */ /** @overload */
@ -994,8 +995,8 @@ class MAGNUM_VK_EXPORT RenderPassCreateInfo {
* The following @type_vk{RenderPassCreateInfo2} fields are set by this * The following @type_vk{RenderPassCreateInfo2} fields are set by this
* function: * function:
* *
* - `attachmentCount` to @cpp attachments.size() @ce * - `attachmentCount` and `pAttachments` to a copy of
* - `pAttachments` to a copy of @p attachments * @p attachments
*/ */
RenderPassCreateInfo& setAttachments(Containers::ArrayView<const AttachmentDescription> attachments); RenderPassCreateInfo& setAttachments(Containers::ArrayView<const AttachmentDescription> attachments);
/** @overload */ /** @overload */
@ -1037,8 +1038,8 @@ class MAGNUM_VK_EXPORT RenderPassCreateInfo {
* The following @type_vk{RenderPassCreateInfo2} fields are set by this * The following @type_vk{RenderPassCreateInfo2} fields are set by this
* function: * function:
* *
* - `dependencyCount` to @cpp dependencies.size() @ce * - `dependencyCount` and `pDependencies` to a copy of
* - `pDependencies` to a copy of @p dependencies * @p dependencies
*/ */
RenderPassCreateInfo& setDependencies(Containers::ArrayView<const SubpassDependency> dependencies); RenderPassCreateInfo& setDependencies(Containers::ArrayView<const SubpassDependency> dependencies);
/** @overload */ /** @overload */

Loading…
Cancel
Save