Module com.io7m.jcoronado.lwjgl
Package com.io7m.jcoronado.lwjgl
Class VulkanLWJGLTemporaryAllocator
- java.lang.Object
-
- com.io7m.jcoronado.lwjgl.VulkanLWJGLTemporaryAllocator
-
- All Implemented Interfaces:
VulkanTemporaryAllocatorType
public final class VulkanLWJGLTemporaryAllocator extends java.lang.Object implements VulkanTemporaryAllocatorType
An LWJGL based implementation of theVulkanTemporaryAllocatorType
interface.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.io7m.jcoronado.api.VulkanTemporaryAllocatorType
VulkanTemporaryAllocatorType.ByteBufferMemoryReceiverType<T,E extends java.lang.Exception>, VulkanTemporaryAllocatorType.RawMemoryReceiverType<T,E extends java.lang.Exception>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VulkanTemporaryAllocatorType
create()
<T,E extends java.lang.Exception>
TwithAllocation(long size, long alignment, VulkanTemporaryAllocatorType.RawMemoryReceiverType<T,E> receiver)
Allocatesize
octets of memory, aligned toalignment
, pass it toreceiver
, then unconditionally deallocate the memory before returning the value ofT
returned byreceiver
.<T,E extends java.lang.Exception>
TwithAllocationBuffer(long size, long alignment, VulkanTemporaryAllocatorType.ByteBufferMemoryReceiverType<T,E> receiver)
Allocatesize
octets of memory, aligned toalignment
, pass it toreceiver
, then unconditionally deallocate the memory before returning the value ofT
returned byreceiver
.<T,E extends java.lang.Exception>
TwithAllocationBufferInitialized(byte[] data, long alignment, VulkanTemporaryAllocatorType.ByteBufferMemoryReceiverType<T,E> receiver)
Allocatedata.length
octets of memory, aligned toalignment
, initialize it with the contents ofdata
, pass it toreceiver
, then unconditionally deallocate the memory before returning the value ofT
returned byreceiver
.
-
-
-
Method Detail
-
create
public static VulkanTemporaryAllocatorType create()
- Returns:
- A new temporary allocator
-
withAllocation
public <T,E extends java.lang.Exception> T withAllocation(long size, long alignment, VulkanTemporaryAllocatorType.RawMemoryReceiverType<T,E> receiver) throws VulkanException, E extends java.lang.Exception
Description copied from interface:VulkanTemporaryAllocatorType
Allocatesize
octets of memory, aligned toalignment
, pass it toreceiver
, then unconditionally deallocate the memory before returning the value ofT
returned byreceiver
.- Specified by:
withAllocation
in interfaceVulkanTemporaryAllocatorType
- Type Parameters:
T
- The type of returned valuesE
- The type of raised exceptions- Parameters:
size
- The size of the memoryalignment
- The alignment of the memoryreceiver
- The receiver of the allocated memory- Returns:
- The value returned by
receiver
- Throws:
VulkanException
- Ifreceiver
raisesVulkanException
E
- Ifreceiver
raisesE
E extends java.lang.Exception
-
withAllocationBuffer
public <T,E extends java.lang.Exception> T withAllocationBuffer(long size, long alignment, VulkanTemporaryAllocatorType.ByteBufferMemoryReceiverType<T,E> receiver) throws VulkanException, E extends java.lang.Exception
Description copied from interface:VulkanTemporaryAllocatorType
Allocatesize
octets of memory, aligned toalignment
, pass it toreceiver
, then unconditionally deallocate the memory before returning the value ofT
returned byreceiver
.- Specified by:
withAllocationBuffer
in interfaceVulkanTemporaryAllocatorType
- Type Parameters:
T
- The type of returned valuesE
- The type of raised exceptions- Parameters:
size
- The size of the memoryalignment
- The alignment of the memoryreceiver
- The receiver of the allocated memory- Returns:
- The value returned by
receiver
- Throws:
VulkanException
- Ifreceiver
raisesVulkanException
E
- Ifreceiver
raisesE
E extends java.lang.Exception
-
withAllocationBufferInitialized
public <T,E extends java.lang.Exception> T withAllocationBufferInitialized(byte[] data, long alignment, VulkanTemporaryAllocatorType.ByteBufferMemoryReceiverType<T,E> receiver) throws VulkanException, E extends java.lang.Exception
Description copied from interface:VulkanTemporaryAllocatorType
Allocatedata.length
octets of memory, aligned toalignment
, initialize it with the contents ofdata
, pass it toreceiver
, then unconditionally deallocate the memory before returning the value ofT
returned byreceiver
.- Specified by:
withAllocationBufferInitialized
in interfaceVulkanTemporaryAllocatorType
- Type Parameters:
T
- The type of returned valuesE
- The type of raised exceptions- Parameters:
data
- The initial contents of the memoryalignment
- The alignment of the memoryreceiver
- The receiver of the allocated memory- Returns:
- The value returned by
receiver
- Throws:
VulkanException
- Ifreceiver
raisesVulkanException
E
- Ifreceiver
raisesE
E extends java.lang.Exception
-
-