Package org.lwjgl.vulkan
Class VkMappedMemoryRange
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkMappedMemoryRange
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class VkMappedMemoryRange extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure specifying a mapped memory range.Valid Usage
memory
must be currently host mapped- If
size
is not equal toWHOLE_SIZE
,offset
andsize
must specify a range contained within the currently mapped range ofmemory
- If
size
is equal toWHOLE_SIZE
,offset
must be within the currently mapped range ofmemory
- If
size
is equal toWHOLE_SIZE
, the end of the current mapping ofmemory
must be a multiple ofVkPhysicalDeviceLimits
::nonCoherentAtomSize
bytes from the beginning of the memory object. offset
must be a multiple ofVkPhysicalDeviceLimits
::nonCoherentAtomSize
- If
size
is not equal toWHOLE_SIZE
,size
must either be a multiple ofVkPhysicalDeviceLimits
::nonCoherentAtomSize
, oroffset
plussize
must equal the size ofmemory
.
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_MAPPED_MEMORY_RANGE
pNext
must beNULL
memory
must be a validVkDeviceMemory
handle
See Also
FlushMappedMemoryRanges
,InvalidateMappedMemoryRanges
Member documentation
sType
– the type of this structure.pNext
–NULL
or a pointer to an extension-specific structure.memory
– the memory object to which this range belongs.offset
– the zero-based byte offset from the beginning of the memory object.size
– either the size of range, orWHOLE_SIZE
to affect the range fromoffset
to the end of the current mapping of the allocation.
Layout
struct VkMappedMemoryRange { VkStructureType sType; void const * pNext; VkDeviceMemory memory; VkDeviceSize offset; VkDeviceSize size; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VkMappedMemoryRange.Buffer
An array ofVkMappedMemoryRange
structs.
-
Constructor Summary
Constructors Constructor Description VkMappedMemoryRange(java.nio.ByteBuffer container)
Creates aVkMappedMemoryRange
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VkMappedMemoryRange
calloc()
Returns a newVkMappedMemoryRange
instance allocated withmemCalloc
.static VkMappedMemoryRange.Buffer
calloc(int capacity)
Returns a newVkMappedMemoryRange.Buffer
instance allocated withmemCalloc
.static VkMappedMemoryRange
callocStack()
Returns a newVkMappedMemoryRange
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkMappedMemoryRange.Buffer
callocStack(int capacity)
Returns a newVkMappedMemoryRange.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkMappedMemoryRange.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkMappedMemoryRange.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkMappedMemoryRange
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkMappedMemoryRange
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkMappedMemoryRange
create()
Returns a newVkMappedMemoryRange
instance allocated withBufferUtils
.static VkMappedMemoryRange.Buffer
create(int capacity)
Returns a newVkMappedMemoryRange.Buffer
instance allocated withBufferUtils
.static VkMappedMemoryRange
create(long address)
Returns a newVkMappedMemoryRange
instance for the specified memory address.static VkMappedMemoryRange.Buffer
create(long address, int capacity)
Create aVkMappedMemoryRange.Buffer
instance at the specified memory.static VkMappedMemoryRange
createSafe(long address)
static VkMappedMemoryRange.Buffer
createSafe(long address, int capacity)
static VkMappedMemoryRange
malloc()
Returns a newVkMappedMemoryRange
instance allocated withmemAlloc
.static VkMappedMemoryRange.Buffer
malloc(int capacity)
Returns a newVkMappedMemoryRange.Buffer
instance allocated withmemAlloc
.static VkMappedMemoryRange
mallocStack()
Returns a newVkMappedMemoryRange
instance allocated on the thread-localMemoryStack
.static VkMappedMemoryRange.Buffer
mallocStack(int capacity)
Returns a newVkMappedMemoryRange.Buffer
instance allocated on the thread-localMemoryStack
.static VkMappedMemoryRange.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkMappedMemoryRange.Buffer
instance allocated on the specifiedMemoryStack
.static VkMappedMemoryRange
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkMappedMemoryRange
instance allocated on the specifiedMemoryStack
.long
memory()
Returns the value of thememory
field.VkMappedMemoryRange
memory(long value)
Sets the specified value to thememory
field.static long
nmemory(long struct)
Unsafe version ofmemory()
.static void
nmemory(long struct, long value)
Unsafe version ofmemory
.static long
noffset(long struct)
Unsafe version ofoffset()
.static void
noffset(long struct, long value)
Unsafe version ofoffset
.static long
npNext(long struct)
Unsafe version ofpNext()
.static void
npNext(long struct, long value)
Unsafe version ofpNext
.static long
nsize(long struct)
Unsafe version ofsize()
.static void
nsize(long struct, long value)
Unsafe version ofsize
.static int
nsType(long struct)
Unsafe version ofsType()
.static void
nsType(long struct, int value)
Unsafe version ofsType
.long
offset()
Returns the value of theoffset
field.VkMappedMemoryRange
offset(long value)
Sets the specified value to theoffset
field.long
pNext()
Returns the value of thepNext
field.VkMappedMemoryRange
pNext(long value)
Sets the specified value to thepNext
field.VkMappedMemoryRange
set(int sType, long pNext, long memory, long offset, long size)
Initializes this struct with the specified values.VkMappedMemoryRange
set(VkMappedMemoryRange src)
Copies the specified struct data to this struct.long
size()
Returns the value of thesize
field.VkMappedMemoryRange
size(long value)
Sets the specified value to thesize
field.int
sizeof()
int
sType()
Returns the value of thesType
field.VkMappedMemoryRange
sType(int value)
Sets the specified value to thesType
field.
-
-
-
Constructor Detail
-
VkMappedMemoryRange
public VkMappedMemoryRange(java.nio.ByteBuffer container)
Creates aVkMappedMemoryRange
instance at the current position of the specifiedByteBuffer
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.
-
-
Method Detail
-
sizeof
public int sizeof()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
sType
public int sType()
Returns the value of thesType
field.
-
pNext
public long pNext()
Returns the value of thepNext
field.
-
memory
public long memory()
Returns the value of thememory
field.
-
offset
public long offset()
Returns the value of theoffset
field.
-
size
public long size()
Returns the value of thesize
field.
-
sType
public VkMappedMemoryRange sType(int value)
Sets the specified value to thesType
field.
-
pNext
public VkMappedMemoryRange pNext(long value)
Sets the specified value to thepNext
field.
-
memory
public VkMappedMemoryRange memory(long value)
Sets the specified value to thememory
field.
-
offset
public VkMappedMemoryRange offset(long value)
Sets the specified value to theoffset
field.
-
size
public VkMappedMemoryRange size(long value)
Sets the specified value to thesize
field.
-
set
public VkMappedMemoryRange set(int sType, long pNext, long memory, long offset, long size)
Initializes this struct with the specified values.
-
set
public VkMappedMemoryRange set(VkMappedMemoryRange src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkMappedMemoryRange malloc()
Returns a newVkMappedMemoryRange
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkMappedMemoryRange calloc()
Returns a newVkMappedMemoryRange
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkMappedMemoryRange create()
Returns a newVkMappedMemoryRange
instance allocated withBufferUtils
.
-
create
public static VkMappedMemoryRange create(long address)
Returns a newVkMappedMemoryRange
instance for the specified memory address.
-
createSafe
@Nullable public static VkMappedMemoryRange createSafe(long address)
-
malloc
public static VkMappedMemoryRange.Buffer malloc(int capacity)
Returns a newVkMappedMemoryRange.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkMappedMemoryRange.Buffer calloc(int capacity)
Returns a newVkMappedMemoryRange.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkMappedMemoryRange.Buffer create(int capacity)
Returns a newVkMappedMemoryRange.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkMappedMemoryRange.Buffer create(long address, int capacity)
Create aVkMappedMemoryRange.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VkMappedMemoryRange.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkMappedMemoryRange mallocStack()
Returns a newVkMappedMemoryRange
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkMappedMemoryRange callocStack()
Returns a newVkMappedMemoryRange
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkMappedMemoryRange mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkMappedMemoryRange
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkMappedMemoryRange callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkMappedMemoryRange
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkMappedMemoryRange.Buffer mallocStack(int capacity)
Returns a newVkMappedMemoryRange.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkMappedMemoryRange.Buffer callocStack(int capacity)
Returns a newVkMappedMemoryRange.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkMappedMemoryRange.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkMappedMemoryRange.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkMappedMemoryRange.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkMappedMemoryRange.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nsType
public static int nsType(long struct)
Unsafe version ofsType()
.
-
npNext
public static long npNext(long struct)
Unsafe version ofpNext()
.
-
nmemory
public static long nmemory(long struct)
Unsafe version ofmemory()
.
-
noffset
public static long noffset(long struct)
Unsafe version ofoffset()
.
-
nsize
public static long nsize(long struct)
Unsafe version ofsize()
.
-
nsType
public static void nsType(long struct, int value)
Unsafe version ofsType
.
-
npNext
public static void npNext(long struct, long value)
Unsafe version ofpNext
.
-
nmemory
public static void nmemory(long struct, long value)
Unsafe version ofmemory
.
-
noffset
public static void noffset(long struct, long value)
Unsafe version ofoffset
.
-
nsize
public static void nsize(long struct, long value)
Unsafe version ofsize
.
-
-