Class VulkanLWJGLTemporaryAllocator

    • Method Detail

      • 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
        Allocate size octets of memory, aligned to alignment, pass it to receiver, then unconditionally deallocate the memory before returning the value of T returned by receiver.
        Specified by:
        withAllocation in interface VulkanTemporaryAllocatorType
        Type Parameters:
        T - The type of returned values
        E - The type of raised exceptions
        Parameters:
        size - The size of the memory
        alignment - The alignment of the memory
        receiver - The receiver of the allocated memory
        Returns:
        The value returned by receiver
        Throws:
        VulkanException - If receiver raises VulkanException
        E - If receiver raises E
        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
        Allocate size octets of memory, aligned to alignment, pass it to receiver, then unconditionally deallocate the memory before returning the value of T returned by receiver.
        Specified by:
        withAllocationBuffer in interface VulkanTemporaryAllocatorType
        Type Parameters:
        T - The type of returned values
        E - The type of raised exceptions
        Parameters:
        size - The size of the memory
        alignment - The alignment of the memory
        receiver - The receiver of the allocated memory
        Returns:
        The value returned by receiver
        Throws:
        VulkanException - If receiver raises VulkanException
        E - If receiver raises E
        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
        Allocate data.length octets of memory, aligned to alignment, initialize it with the contents of data, pass it to receiver, then unconditionally deallocate the memory before returning the value of T returned by receiver.
        Specified by:
        withAllocationBufferInitialized in interface VulkanTemporaryAllocatorType
        Type Parameters:
        T - The type of returned values
        E - The type of raised exceptions
        Parameters:
        data - The initial contents of the memory
        alignment - The alignment of the memory
        receiver - The receiver of the allocated memory
        Returns:
        The value returned by receiver
        Throws:
        VulkanException - If receiver raises VulkanException
        E - If receiver raises E
        E extends java.lang.Exception