All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lwjgl.vulkan.VkImageMemoryBarrier Maven / Gradle / Ivy

Go to download

A new generation graphics and compute API that provides high-efficiency, cross-platform access to modern GPUs used in a wide variety of devices from PCs and consoles to mobile phones and embedded platforms.

There is a newer version: 3.3.4
Show newest version
/*
 * Copyright LWJGL. All rights reserved.
 * License terms: https://www.lwjgl.org/license
 * MACHINE GENERATED FILE, DO NOT EDIT
 */
package org.lwjgl.vulkan;

import javax.annotation.*;

import java.nio.*;

import org.lwjgl.*;
import org.lwjgl.system.*;

import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;

/**
 * Structure specifying the parameters of an image memory barrier.
 * 
 * 
Description
* *

The first access scope is limited to access to memory through the specified image subresource range, via access types in the source access mask specified by {@code srcAccessMask}. If {@code srcAccessMask} includes {@link VK10#VK_ACCESS_HOST_WRITE_BIT ACCESS_HOST_WRITE_BIT}, memory writes performed by that access type are also made visible, as that access type is not performed through a resource.

* *

The second access scope is limited to access to memory through the specified image subresource range, via access types in the destination access mask specified by {@code dstAccessMask}. If {@code dstAccessMask} includes {@link VK10#VK_ACCESS_HOST_WRITE_BIT ACCESS_HOST_WRITE_BIT} or {@link VK10#VK_ACCESS_HOST_READ_BIT ACCESS_HOST_READ_BIT}, available memory writes are also made visible to accesses of those types, as those access types are not performed through a resource.

* *

If {@code srcQueueFamilyIndex} is not equal to {@code dstQueueFamilyIndex}, and {@code srcQueueFamilyIndex} is equal to the current queue family, then the memory barrier defines a queue family release operation for the specified image subresource range, and the second access scope includes no access, as if {@code dstAccessMask} was 0.

* *

If {@code dstQueueFamilyIndex} is not equal to {@code srcQueueFamilyIndex}, and {@code dstQueueFamilyIndex} is equal to the current queue family, then the memory barrier defines a queue family acquire operation for the specified image subresource range, and the first access scope includes no access, as if {@code srcAccessMask} was 0.

* *

If the {@code synchronization2} feature is not enabled or {@code oldLayout} is not equal to {@code newLayout}, {@code oldLayout} and {@code newLayout} define an image layout transition for the specified image subresource range.

* *
Note
* *

If the {@code synchronization2} feature is enabled, when the old and new layout are equal, the layout values are ignored - data is preserved no matter what values are specified, or what layout the image is currently in.

*
* *

If {@code image} has a multi-planar format and the image is disjoint, then including {@link VK10#VK_IMAGE_ASPECT_COLOR_BIT IMAGE_ASPECT_COLOR_BIT} in the {@code aspectMask} member of {@code subresourceRange} is equivalent to including {@link VK11#VK_IMAGE_ASPECT_PLANE_0_BIT IMAGE_ASPECT_PLANE_0_BIT}, {@link VK11#VK_IMAGE_ASPECT_PLANE_1_BIT IMAGE_ASPECT_PLANE_1_BIT}, and (for three-plane formats only) {@link VK11#VK_IMAGE_ASPECT_PLANE_2_BIT IMAGE_ASPECT_PLANE_2_BIT}.

* *
Valid Usage
* *
    *
  • {@code subresourceRange.baseMipLevel} must be less than the {@code mipLevels} specified in {@link VkImageCreateInfo} when {@code image} was created
  • *
  • If {@code subresourceRange.levelCount} is not {@link VK10#VK_REMAINING_MIP_LEVELS REMAINING_MIP_LEVELS}, subresourceRange.baseMipLevel + subresourceRange.levelCount must be less than or equal to the {@code mipLevels} specified in {@link VkImageCreateInfo} when {@code image} was created
  • *
  • {@code subresourceRange.baseArrayLayer} must be less than the {@code arrayLayers} specified in {@link VkImageCreateInfo} when {@code image} was created
  • *
  • If {@code subresourceRange.layerCount} is not {@link VK10#VK_REMAINING_ARRAY_LAYERS REMAINING_ARRAY_LAYERS}, subresourceRange.baseArrayLayer + subresourceRange.layerCount must be less than or equal to the {@code arrayLayers} specified in {@link VkImageCreateInfo} when {@code image} was created
  • *
  • If {@code image} is non-sparse then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, and {@code oldLayout} or {@code newLayout} is {@link VK10#VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL} then {@code image} must have been created with {@link VK10#VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT IMAGE_USAGE_COLOR_ATTACHMENT_BIT}
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, and {@code oldLayout} or {@code newLayout} is {@link VK10#VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL} then {@code image} must have been created with {@link VK10#VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT}
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, and {@code oldLayout} or {@code newLayout} is {@link VK10#VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL} then {@code image} must have been created with {@link VK10#VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT}
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, and {@code oldLayout} or {@code newLayout} is {@link VK10#VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL} then {@code image} must have been created with {@link VK10#VK_IMAGE_USAGE_SAMPLED_BIT IMAGE_USAGE_SAMPLED_BIT} or {@link VK10#VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT IMAGE_USAGE_INPUT_ATTACHMENT_BIT}
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, and {@code oldLayout} or {@code newLayout} is {@link VK10#VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL} then {@code image} must have been created with {@link VK10#VK_IMAGE_USAGE_TRANSFER_SRC_BIT IMAGE_USAGE_TRANSFER_SRC_BIT}
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, and {@code oldLayout} or {@code newLayout} is {@link VK10#VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL} then {@code image} must have been created with {@link VK10#VK_IMAGE_USAGE_TRANSFER_DST_BIT IMAGE_USAGE_TRANSFER_DST_BIT}
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, {@code oldLayout} must be {@link VK10#VK_IMAGE_LAYOUT_UNDEFINED IMAGE_LAYOUT_UNDEFINED} or the current layout of the image subresources affected by the barrier
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, {@code newLayout} must not be {@link VK10#VK_IMAGE_LAYOUT_UNDEFINED IMAGE_LAYOUT_UNDEFINED} or {@link VK10#VK_IMAGE_LAYOUT_PREINITIALIZED IMAGE_LAYOUT_PREINITIALIZED}
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, and {@code oldLayout} or {@code newLayout} is {@link VK11#VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL} then {@code image} must have been created with {@link VK10#VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT}
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, and {@code oldLayout} or {@code newLayout} is {@link VK11#VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL} then {@code image} must have been created with {@link VK10#VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT}
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, and {@code oldLayout} or {@code newLayout} is {@link VK12#VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL} then {@code image} must have been created with at least one of {@link VK10#VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT}, {@link VK10#VK_IMAGE_USAGE_SAMPLED_BIT IMAGE_USAGE_SAMPLED_BIT}, or {@link VK10#VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT IMAGE_USAGE_INPUT_ATTACHMENT_BIT}
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, and {@code oldLayout} or {@code newLayout} is {@link VK12#VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL} then {@code image} must have been created with {@link VK10#VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT} set
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, and {@code oldLayout} or {@code newLayout} is {@link VK12#VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL} then {@code image} must have been created with at least one of {@link VK10#VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT}, {@link VK10#VK_IMAGE_USAGE_SAMPLED_BIT IMAGE_USAGE_SAMPLED_BIT}, or {@link VK10#VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT IMAGE_USAGE_INPUT_ATTACHMENT_BIT}
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, and {@code oldLayout} or {@code newLayout} is {@link VK12#VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL} then {@code image} must have been created with {@link VK10#VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT} set
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, and {@code oldLayout} or {@code newLayout} is {@link KHRSynchronization2#VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR}, {@code image} must have been created with {@link VK10#VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT IMAGE_USAGE_COLOR_ATTACHMENT_BIT} or {@link VK10#VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT}
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, and {@code oldLayout} or {@code newLayout} is {@link KHRSynchronization2#VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR}, {@code image} must have been created with at least one of {@link VK10#VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT}, {@link VK10#VK_IMAGE_USAGE_SAMPLED_BIT IMAGE_USAGE_SAMPLED_BIT}, or {@link VK10#VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT IMAGE_USAGE_INPUT_ATTACHMENT_BIT}
  • *
  • If {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} define a queue family ownership transfer or {@code oldLayout} and {@code newLayout} define an image layout transition, and {@code oldLayout} or {@code newLayout} is {@link KHRFragmentShadingRate#VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR} then {@code image} must have been created with {@link KHRFragmentShadingRate#VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR} set
  • *
  • If {@code image} has a single-plane color format or is not disjoint, then the {@code aspectMask} member of {@code subresourceRange} must be {@link VK10#VK_IMAGE_ASPECT_COLOR_BIT IMAGE_ASPECT_COLOR_BIT}
  • *
  • If {@code image} has a multi-planar format and the image is disjoint, then the {@code aspectMask} member of {@code subresourceRange} must include either at least one of {@link VK11#VK_IMAGE_ASPECT_PLANE_0_BIT IMAGE_ASPECT_PLANE_0_BIT}, {@link VK11#VK_IMAGE_ASPECT_PLANE_1_BIT IMAGE_ASPECT_PLANE_1_BIT}, and {@link VK11#VK_IMAGE_ASPECT_PLANE_2_BIT IMAGE_ASPECT_PLANE_2_BIT}; or must include {@link VK10#VK_IMAGE_ASPECT_COLOR_BIT IMAGE_ASPECT_COLOR_BIT}
  • *
  • If {@code image} has a multi-planar format with only two planes, then the {@code aspectMask} member of {@code subresourceRange} must not include {@link VK11#VK_IMAGE_ASPECT_PLANE_2_BIT IMAGE_ASPECT_PLANE_2_BIT}
  • *
  • If {@code image} has a depth/stencil format with both depth and stencil and the separateDepthStencilLayouts feature is enabled, then the {@code aspectMask} member of {@code subresourceRange} must include either or both {@link VK10#VK_IMAGE_ASPECT_DEPTH_BIT IMAGE_ASPECT_DEPTH_BIT} and {@link VK10#VK_IMAGE_ASPECT_STENCIL_BIT IMAGE_ASPECT_STENCIL_BIT}
  • *
  • If {@code image} has a depth/stencil format with both depth and stencil and the separateDepthStencilLayouts feature is not enabled, then the {@code aspectMask} member of {@code subresourceRange} must include both {@link VK10#VK_IMAGE_ASPECT_DEPTH_BIT IMAGE_ASPECT_DEPTH_BIT} and {@link VK10#VK_IMAGE_ASPECT_STENCIL_BIT IMAGE_ASPECT_STENCIL_BIT}
  • *
  • If {@code srcQueueFamilyIndex} is not equal to {@code dstQueueFamilyIndex}, at least one must not be a special queue family reserved for external memory ownership transfers, as described in Queue Family Ownership Transfer
  • *
  • If {@code image} was created with a sharing mode of {@link VK10#VK_SHARING_MODE_CONCURRENT SHARING_MODE_CONCURRENT}, {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} are not equal, and one of {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} is one of the special queue family values reserved for external memory transfers, the other must be {@link VK10#VK_QUEUE_FAMILY_IGNORED QUEUE_FAMILY_IGNORED}
  • *
  • If {@code image} was created with a sharing mode of {@link VK10#VK_SHARING_MODE_EXCLUSIVE SHARING_MODE_EXCLUSIVE}, and {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} are not equal, {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} must both be valid queue families, or one of the special queue family values reserved for external memory transfers, as described in Queue Family Ownership Transfer
  • *
  • If the {@code synchronization2} feature is not enabled, and {@code image} was created with a sharing mode of {@link VK10#VK_SHARING_MODE_CONCURRENT SHARING_MODE_CONCURRENT}, at least one of {@code srcQueueFamilyIndex} and {@code dstQueueFamilyIndex} must be {@link VK10#VK_QUEUE_FAMILY_IGNORED QUEUE_FAMILY_IGNORED}
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code sType} must be {@link VK10#VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER}
  • *
  • {@code pNext} must be {@code NULL} or a pointer to a valid instance of {@link VkSampleLocationsInfoEXT}
  • *
  • The {@code sType} value of each struct in the {@code pNext} chain must be unique
  • *
  • {@code oldLayout} must be a valid {@code VkImageLayout} value
  • *
  • {@code newLayout} must be a valid {@code VkImageLayout} value
  • *
  • {@code image} must be a valid {@code VkImage} handle
  • *
  • {@code subresourceRange} must be a valid {@link VkImageSubresourceRange} structure
  • *
* *
See Also
* *

{@link VkImageSubresourceRange}, {@link VK10#vkCmdPipelineBarrier CmdPipelineBarrier}, {@link VK10#vkCmdWaitEvents CmdWaitEvents}

* *

Layout

* *

 * struct VkImageMemoryBarrier {
 *     VkStructureType {@link #sType};
 *     void const * {@link #pNext};
 *     VkAccessFlags {@link #srcAccessMask};
 *     VkAccessFlags {@link #dstAccessMask};
 *     VkImageLayout {@link #oldLayout};
 *     VkImageLayout {@link #newLayout};
 *     uint32_t {@link #srcQueueFamilyIndex};
 *     uint32_t {@link #dstQueueFamilyIndex};
 *     VkImage {@link #image};
 *     {@link VkImageSubresourceRange VkImageSubresourceRange} {@link #subresourceRange};
 * }
*/ public class VkImageMemoryBarrier extends Struct implements NativeResource { /** The struct size in bytes. */ public static final int SIZEOF; /** The struct alignment in bytes. */ public static final int ALIGNOF; /** The struct member offsets. */ public static final int STYPE, PNEXT, SRCACCESSMASK, DSTACCESSMASK, OLDLAYOUT, NEWLAYOUT, SRCQUEUEFAMILYINDEX, DSTQUEUEFAMILYINDEX, IMAGE, SUBRESOURCERANGE; static { Layout layout = __struct( __member(4), __member(POINTER_SIZE), __member(4), __member(4), __member(4), __member(4), __member(4), __member(4), __member(8), __member(VkImageSubresourceRange.SIZEOF, VkImageSubresourceRange.ALIGNOF) ); SIZEOF = layout.getSize(); ALIGNOF = layout.getAlignment(); STYPE = layout.offsetof(0); PNEXT = layout.offsetof(1); SRCACCESSMASK = layout.offsetof(2); DSTACCESSMASK = layout.offsetof(3); OLDLAYOUT = layout.offsetof(4); NEWLAYOUT = layout.offsetof(5); SRCQUEUEFAMILYINDEX = layout.offsetof(6); DSTQUEUEFAMILYINDEX = layout.offsetof(7); IMAGE = layout.offsetof(8); SUBRESOURCERANGE = layout.offsetof(9); } /** * Creates a {@code VkImageMemoryBarrier} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be * visible to the struct instance and vice versa. * *

The created instance holds a strong reference to the container object.

*/ public VkImageMemoryBarrier(ByteBuffer container) { super(memAddress(container), __checkContainer(container, SIZEOF)); } @Override public int sizeof() { return SIZEOF; } /** the type of this structure. */ @NativeType("VkStructureType") public int sType() { return nsType(address()); } /** {@code NULL} or a pointer to a structure extending this structure. */ @NativeType("void const *") public long pNext() { return npNext(address()); } /** a bitmask of {@code VkAccessFlagBits} specifying a source access mask. */ @NativeType("VkAccessFlags") public int srcAccessMask() { return nsrcAccessMask(address()); } /** a bitmask of {@code VkAccessFlagBits} specifying a destination access mask. */ @NativeType("VkAccessFlags") public int dstAccessMask() { return ndstAccessMask(address()); } /** the old layout in an image layout transition. */ @NativeType("VkImageLayout") public int oldLayout() { return noldLayout(address()); } /** the new layout in an image layout transition. */ @NativeType("VkImageLayout") public int newLayout() { return nnewLayout(address()); } /** the source queue family for a queue family ownership transfer. */ @NativeType("uint32_t") public int srcQueueFamilyIndex() { return nsrcQueueFamilyIndex(address()); } /** the destination queue family for a queue family ownership transfer. */ @NativeType("uint32_t") public int dstQueueFamilyIndex() { return ndstQueueFamilyIndex(address()); } /** a handle to the image affected by this barrier. */ @NativeType("VkImage") public long image() { return nimage(address()); } /** describes the image subresource range within {@code image} that is affected by this barrier. */ public VkImageSubresourceRange subresourceRange() { return nsubresourceRange(address()); } /** Sets the specified value to the {@link #sType} field. */ public VkImageMemoryBarrier sType(@NativeType("VkStructureType") int value) { nsType(address(), value); return this; } /** Sets the {@link VK10#VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER} value to the {@link #sType} field. */ public VkImageMemoryBarrier sType$Default() { return sType(VK10.VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER); } /** Sets the specified value to the {@link #pNext} field. */ public VkImageMemoryBarrier pNext(@NativeType("void const *") long value) { npNext(address(), value); return this; } /** Prepends the specified {@link VkSampleLocationsInfoEXT} value to the {@code pNext} chain. */ public VkImageMemoryBarrier pNext(VkSampleLocationsInfoEXT value) { return this.pNext(value.pNext(this.pNext()).address()); } /** Sets the specified value to the {@link #srcAccessMask} field. */ public VkImageMemoryBarrier srcAccessMask(@NativeType("VkAccessFlags") int value) { nsrcAccessMask(address(), value); return this; } /** Sets the specified value to the {@link #dstAccessMask} field. */ public VkImageMemoryBarrier dstAccessMask(@NativeType("VkAccessFlags") int value) { ndstAccessMask(address(), value); return this; } /** Sets the specified value to the {@link #oldLayout} field. */ public VkImageMemoryBarrier oldLayout(@NativeType("VkImageLayout") int value) { noldLayout(address(), value); return this; } /** Sets the specified value to the {@link #newLayout} field. */ public VkImageMemoryBarrier newLayout(@NativeType("VkImageLayout") int value) { nnewLayout(address(), value); return this; } /** Sets the specified value to the {@link #srcQueueFamilyIndex} field. */ public VkImageMemoryBarrier srcQueueFamilyIndex(@NativeType("uint32_t") int value) { nsrcQueueFamilyIndex(address(), value); return this; } /** Sets the specified value to the {@link #dstQueueFamilyIndex} field. */ public VkImageMemoryBarrier dstQueueFamilyIndex(@NativeType("uint32_t") int value) { ndstQueueFamilyIndex(address(), value); return this; } /** Sets the specified value to the {@link #image} field. */ public VkImageMemoryBarrier image(@NativeType("VkImage") long value) { nimage(address(), value); return this; } /** Copies the specified {@link VkImageSubresourceRange} to the {@link #subresourceRange} field. */ public VkImageMemoryBarrier subresourceRange(VkImageSubresourceRange value) { nsubresourceRange(address(), value); return this; } /** Passes the {@link #subresourceRange} field to the specified {@link java.util.function.Consumer Consumer}. */ public VkImageMemoryBarrier subresourceRange(java.util.function.Consumer consumer) { consumer.accept(subresourceRange()); return this; } /** Initializes this struct with the specified values. */ public VkImageMemoryBarrier set( int sType, long pNext, int srcAccessMask, int dstAccessMask, int oldLayout, int newLayout, int srcQueueFamilyIndex, int dstQueueFamilyIndex, long image, VkImageSubresourceRange subresourceRange ) { sType(sType); pNext(pNext); srcAccessMask(srcAccessMask); dstAccessMask(dstAccessMask); oldLayout(oldLayout); newLayout(newLayout); srcQueueFamilyIndex(srcQueueFamilyIndex); dstQueueFamilyIndex(dstQueueFamilyIndex); image(image); subresourceRange(subresourceRange); return this; } /** * Copies the specified struct data to this struct. * * @param src the source struct * * @return this struct */ public VkImageMemoryBarrier set(VkImageMemoryBarrier src) { memCopy(src.address(), address(), SIZEOF); return this; } // ----------------------------------- /** Returns a new {@code VkImageMemoryBarrier} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ public static VkImageMemoryBarrier malloc() { return wrap(VkImageMemoryBarrier.class, nmemAllocChecked(SIZEOF)); } /** Returns a new {@code VkImageMemoryBarrier} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ public static VkImageMemoryBarrier calloc() { return wrap(VkImageMemoryBarrier.class, nmemCallocChecked(1, SIZEOF)); } /** Returns a new {@code VkImageMemoryBarrier} instance allocated with {@link BufferUtils}. */ public static VkImageMemoryBarrier create() { ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); return wrap(VkImageMemoryBarrier.class, memAddress(container), container); } /** Returns a new {@code VkImageMemoryBarrier} instance for the specified memory address. */ public static VkImageMemoryBarrier create(long address) { return wrap(VkImageMemoryBarrier.class, address); } /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ @Nullable public static VkImageMemoryBarrier createSafe(long address) { return address == NULL ? null : wrap(VkImageMemoryBarrier.class, address); } /** * Returns a new {@link VkImageMemoryBarrier.Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. * * @param capacity the buffer capacity */ public static VkImageMemoryBarrier.Buffer malloc(int capacity) { return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); } /** * Returns a new {@link VkImageMemoryBarrier.Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. * * @param capacity the buffer capacity */ public static VkImageMemoryBarrier.Buffer calloc(int capacity) { return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); } /** * Returns a new {@link VkImageMemoryBarrier.Buffer} instance allocated with {@link BufferUtils}. * * @param capacity the buffer capacity */ public static VkImageMemoryBarrier.Buffer create(int capacity) { ByteBuffer container = __create(capacity, SIZEOF); return wrap(Buffer.class, memAddress(container), capacity, container); } /** * Create a {@link VkImageMemoryBarrier.Buffer} instance at the specified memory. * * @param address the memory address * @param capacity the buffer capacity */ public static VkImageMemoryBarrier.Buffer create(long address, int capacity) { return wrap(Buffer.class, address, capacity); } /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ @Nullable public static VkImageMemoryBarrier.Buffer createSafe(long address, int capacity) { return address == NULL ? null : wrap(Buffer.class, address, capacity); } // ----------------------------------- /** Deprecated for removal in 3.4.0. Use {@link #malloc(MemoryStack)} instead. */ @Deprecated public static VkImageMemoryBarrier mallocStack() { return malloc(stackGet()); } /** Deprecated for removal in 3.4.0. Use {@link #calloc(MemoryStack)} instead. */ @Deprecated public static VkImageMemoryBarrier callocStack() { return calloc(stackGet()); } /** Deprecated for removal in 3.4.0. Use {@link #malloc(MemoryStack)} instead. */ @Deprecated public static VkImageMemoryBarrier mallocStack(MemoryStack stack) { return malloc(stack); } /** Deprecated for removal in 3.4.0. Use {@link #calloc(MemoryStack)} instead. */ @Deprecated public static VkImageMemoryBarrier callocStack(MemoryStack stack) { return calloc(stack); } /** Deprecated for removal in 3.4.0. Use {@link #malloc(int, MemoryStack)} instead. */ @Deprecated public static VkImageMemoryBarrier.Buffer mallocStack(int capacity) { return malloc(capacity, stackGet()); } /** Deprecated for removal in 3.4.0. Use {@link #calloc(int, MemoryStack)} instead. */ @Deprecated public static VkImageMemoryBarrier.Buffer callocStack(int capacity) { return calloc(capacity, stackGet()); } /** Deprecated for removal in 3.4.0. Use {@link #malloc(int, MemoryStack)} instead. */ @Deprecated public static VkImageMemoryBarrier.Buffer mallocStack(int capacity, MemoryStack stack) { return malloc(capacity, stack); } /** Deprecated for removal in 3.4.0. Use {@link #calloc(int, MemoryStack)} instead. */ @Deprecated public static VkImageMemoryBarrier.Buffer callocStack(int capacity, MemoryStack stack) { return calloc(capacity, stack); } /** * Returns a new {@code VkImageMemoryBarrier} instance allocated on the specified {@link MemoryStack}. * * @param stack the stack from which to allocate */ public static VkImageMemoryBarrier malloc(MemoryStack stack) { return wrap(VkImageMemoryBarrier.class, stack.nmalloc(ALIGNOF, SIZEOF)); } /** * Returns a new {@code VkImageMemoryBarrier} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. * * @param stack the stack from which to allocate */ public static VkImageMemoryBarrier calloc(MemoryStack stack) { return wrap(VkImageMemoryBarrier.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); } /** * Returns a new {@link VkImageMemoryBarrier.Buffer} instance allocated on the specified {@link MemoryStack}. * * @param stack the stack from which to allocate * @param capacity the buffer capacity */ public static VkImageMemoryBarrier.Buffer malloc(int capacity, MemoryStack stack) { return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); } /** * Returns a new {@link VkImageMemoryBarrier.Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. * * @param stack the stack from which to allocate * @param capacity the buffer capacity */ public static VkImageMemoryBarrier.Buffer calloc(int capacity, MemoryStack stack) { return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); } // ----------------------------------- /** Unsafe version of {@link #sType}. */ public static int nsType(long struct) { return UNSAFE.getInt(null, struct + VkImageMemoryBarrier.STYPE); } /** Unsafe version of {@link #pNext}. */ public static long npNext(long struct) { return memGetAddress(struct + VkImageMemoryBarrier.PNEXT); } /** Unsafe version of {@link #srcAccessMask}. */ public static int nsrcAccessMask(long struct) { return UNSAFE.getInt(null, struct + VkImageMemoryBarrier.SRCACCESSMASK); } /** Unsafe version of {@link #dstAccessMask}. */ public static int ndstAccessMask(long struct) { return UNSAFE.getInt(null, struct + VkImageMemoryBarrier.DSTACCESSMASK); } /** Unsafe version of {@link #oldLayout}. */ public static int noldLayout(long struct) { return UNSAFE.getInt(null, struct + VkImageMemoryBarrier.OLDLAYOUT); } /** Unsafe version of {@link #newLayout}. */ public static int nnewLayout(long struct) { return UNSAFE.getInt(null, struct + VkImageMemoryBarrier.NEWLAYOUT); } /** Unsafe version of {@link #srcQueueFamilyIndex}. */ public static int nsrcQueueFamilyIndex(long struct) { return UNSAFE.getInt(null, struct + VkImageMemoryBarrier.SRCQUEUEFAMILYINDEX); } /** Unsafe version of {@link #dstQueueFamilyIndex}. */ public static int ndstQueueFamilyIndex(long struct) { return UNSAFE.getInt(null, struct + VkImageMemoryBarrier.DSTQUEUEFAMILYINDEX); } /** Unsafe version of {@link #image}. */ public static long nimage(long struct) { return UNSAFE.getLong(null, struct + VkImageMemoryBarrier.IMAGE); } /** Unsafe version of {@link #subresourceRange}. */ public static VkImageSubresourceRange nsubresourceRange(long struct) { return VkImageSubresourceRange.create(struct + VkImageMemoryBarrier.SUBRESOURCERANGE); } /** Unsafe version of {@link #sType(int) sType}. */ public static void nsType(long struct, int value) { UNSAFE.putInt(null, struct + VkImageMemoryBarrier.STYPE, value); } /** Unsafe version of {@link #pNext(long) pNext}. */ public static void npNext(long struct, long value) { memPutAddress(struct + VkImageMemoryBarrier.PNEXT, value); } /** Unsafe version of {@link #srcAccessMask(int) srcAccessMask}. */ public static void nsrcAccessMask(long struct, int value) { UNSAFE.putInt(null, struct + VkImageMemoryBarrier.SRCACCESSMASK, value); } /** Unsafe version of {@link #dstAccessMask(int) dstAccessMask}. */ public static void ndstAccessMask(long struct, int value) { UNSAFE.putInt(null, struct + VkImageMemoryBarrier.DSTACCESSMASK, value); } /** Unsafe version of {@link #oldLayout(int) oldLayout}. */ public static void noldLayout(long struct, int value) { UNSAFE.putInt(null, struct + VkImageMemoryBarrier.OLDLAYOUT, value); } /** Unsafe version of {@link #newLayout(int) newLayout}. */ public static void nnewLayout(long struct, int value) { UNSAFE.putInt(null, struct + VkImageMemoryBarrier.NEWLAYOUT, value); } /** Unsafe version of {@link #srcQueueFamilyIndex(int) srcQueueFamilyIndex}. */ public static void nsrcQueueFamilyIndex(long struct, int value) { UNSAFE.putInt(null, struct + VkImageMemoryBarrier.SRCQUEUEFAMILYINDEX, value); } /** Unsafe version of {@link #dstQueueFamilyIndex(int) dstQueueFamilyIndex}. */ public static void ndstQueueFamilyIndex(long struct, int value) { UNSAFE.putInt(null, struct + VkImageMemoryBarrier.DSTQUEUEFAMILYINDEX, value); } /** Unsafe version of {@link #image(long) image}. */ public static void nimage(long struct, long value) { UNSAFE.putLong(null, struct + VkImageMemoryBarrier.IMAGE, value); } /** Unsafe version of {@link #subresourceRange(VkImageSubresourceRange) subresourceRange}. */ public static void nsubresourceRange(long struct, VkImageSubresourceRange value) { memCopy(value.address(), struct + VkImageMemoryBarrier.SUBRESOURCERANGE, VkImageSubresourceRange.SIZEOF); } // ----------------------------------- /** An array of {@link VkImageMemoryBarrier} structs. */ public static class Buffer extends StructBuffer implements NativeResource { private static final VkImageMemoryBarrier ELEMENT_FACTORY = VkImageMemoryBarrier.create(-1L); /** * Creates a new {@code VkImageMemoryBarrier.Buffer} instance backed by the specified container. * * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided * by {@link VkImageMemoryBarrier#SIZEOF}, and its mark will be undefined. * *

The created buffer instance holds a strong reference to the container object.

*/ public Buffer(ByteBuffer container) { super(container, container.remaining() / SIZEOF); } public Buffer(long address, int cap) { super(address, null, -1, 0, cap, cap); } Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { super(address, container, mark, pos, lim, cap); } @Override protected Buffer self() { return this; } @Override protected VkImageMemoryBarrier getElementFactory() { return ELEMENT_FACTORY; } /** @return the value of the {@link VkImageMemoryBarrier#sType} field. */ @NativeType("VkStructureType") public int sType() { return VkImageMemoryBarrier.nsType(address()); } /** @return the value of the {@link VkImageMemoryBarrier#pNext} field. */ @NativeType("void const *") public long pNext() { return VkImageMemoryBarrier.npNext(address()); } /** @return the value of the {@link VkImageMemoryBarrier#srcAccessMask} field. */ @NativeType("VkAccessFlags") public int srcAccessMask() { return VkImageMemoryBarrier.nsrcAccessMask(address()); } /** @return the value of the {@link VkImageMemoryBarrier#dstAccessMask} field. */ @NativeType("VkAccessFlags") public int dstAccessMask() { return VkImageMemoryBarrier.ndstAccessMask(address()); } /** @return the value of the {@link VkImageMemoryBarrier#oldLayout} field. */ @NativeType("VkImageLayout") public int oldLayout() { return VkImageMemoryBarrier.noldLayout(address()); } /** @return the value of the {@link VkImageMemoryBarrier#newLayout} field. */ @NativeType("VkImageLayout") public int newLayout() { return VkImageMemoryBarrier.nnewLayout(address()); } /** @return the value of the {@link VkImageMemoryBarrier#srcQueueFamilyIndex} field. */ @NativeType("uint32_t") public int srcQueueFamilyIndex() { return VkImageMemoryBarrier.nsrcQueueFamilyIndex(address()); } /** @return the value of the {@link VkImageMemoryBarrier#dstQueueFamilyIndex} field. */ @NativeType("uint32_t") public int dstQueueFamilyIndex() { return VkImageMemoryBarrier.ndstQueueFamilyIndex(address()); } /** @return the value of the {@link VkImageMemoryBarrier#image} field. */ @NativeType("VkImage") public long image() { return VkImageMemoryBarrier.nimage(address()); } /** @return a {@link VkImageSubresourceRange} view of the {@link VkImageMemoryBarrier#subresourceRange} field. */ public VkImageSubresourceRange subresourceRange() { return VkImageMemoryBarrier.nsubresourceRange(address()); } /** Sets the specified value to the {@link VkImageMemoryBarrier#sType} field. */ public VkImageMemoryBarrier.Buffer sType(@NativeType("VkStructureType") int value) { VkImageMemoryBarrier.nsType(address(), value); return this; } /** Sets the {@link VK10#VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER} value to the {@link VkImageMemoryBarrier#sType} field. */ public VkImageMemoryBarrier.Buffer sType$Default() { return sType(VK10.VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER); } /** Sets the specified value to the {@link VkImageMemoryBarrier#pNext} field. */ public VkImageMemoryBarrier.Buffer pNext(@NativeType("void const *") long value) { VkImageMemoryBarrier.npNext(address(), value); return this; } /** Prepends the specified {@link VkSampleLocationsInfoEXT} value to the {@code pNext} chain. */ public VkImageMemoryBarrier.Buffer pNext(VkSampleLocationsInfoEXT value) { return this.pNext(value.pNext(this.pNext()).address()); } /** Sets the specified value to the {@link VkImageMemoryBarrier#srcAccessMask} field. */ public VkImageMemoryBarrier.Buffer srcAccessMask(@NativeType("VkAccessFlags") int value) { VkImageMemoryBarrier.nsrcAccessMask(address(), value); return this; } /** Sets the specified value to the {@link VkImageMemoryBarrier#dstAccessMask} field. */ public VkImageMemoryBarrier.Buffer dstAccessMask(@NativeType("VkAccessFlags") int value) { VkImageMemoryBarrier.ndstAccessMask(address(), value); return this; } /** Sets the specified value to the {@link VkImageMemoryBarrier#oldLayout} field. */ public VkImageMemoryBarrier.Buffer oldLayout(@NativeType("VkImageLayout") int value) { VkImageMemoryBarrier.noldLayout(address(), value); return this; } /** Sets the specified value to the {@link VkImageMemoryBarrier#newLayout} field. */ public VkImageMemoryBarrier.Buffer newLayout(@NativeType("VkImageLayout") int value) { VkImageMemoryBarrier.nnewLayout(address(), value); return this; } /** Sets the specified value to the {@link VkImageMemoryBarrier#srcQueueFamilyIndex} field. */ public VkImageMemoryBarrier.Buffer srcQueueFamilyIndex(@NativeType("uint32_t") int value) { VkImageMemoryBarrier.nsrcQueueFamilyIndex(address(), value); return this; } /** Sets the specified value to the {@link VkImageMemoryBarrier#dstQueueFamilyIndex} field. */ public VkImageMemoryBarrier.Buffer dstQueueFamilyIndex(@NativeType("uint32_t") int value) { VkImageMemoryBarrier.ndstQueueFamilyIndex(address(), value); return this; } /** Sets the specified value to the {@link VkImageMemoryBarrier#image} field. */ public VkImageMemoryBarrier.Buffer image(@NativeType("VkImage") long value) { VkImageMemoryBarrier.nimage(address(), value); return this; } /** Copies the specified {@link VkImageSubresourceRange} to the {@link VkImageMemoryBarrier#subresourceRange} field. */ public VkImageMemoryBarrier.Buffer subresourceRange(VkImageSubresourceRange value) { VkImageMemoryBarrier.nsubresourceRange(address(), value); return this; } /** Passes the {@link VkImageMemoryBarrier#subresourceRange} field to the specified {@link java.util.function.Consumer Consumer}. */ public VkImageMemoryBarrier.Buffer subresourceRange(java.util.function.Consumer consumer) { consumer.accept(subresourceRange()); return this; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy