Quake II RTX doxygen
1.0 dev
device_memory_allocator.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2019, NVIDIA CORPORATION. All rights reserved.
3
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
8
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
14
You should have received a copy of the GNU General Public License along
15
with this program; if not, write to the Free Software Foundation, Inc.,
16
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
*/
18
19
#pragma once
20
#include <stdint.h>
21
22
typedef
enum
23
{
24
DMA_SUCCESS
= 0,
25
DMA_NOT_ENOUGH_MEMORY
26
}
DMAResult
;
27
28
typedef
struct
DeviceMemory
29
{
30
VkDeviceMemory
memory
;
31
uint64_t
memory_offset
;
32
uint64_t
size
;
33
uint64_t
alignment
;
34
uint32_t
memory_type
;
35
}
DeviceMemory
;
36
37
typedef
struct
DeviceMemoryAllocator
DeviceMemoryAllocator
;
38
39
DeviceMemoryAllocator
*
create_device_memory_allocator
(VkDevice
device
);
40
DMAResult
allocate_device_memory
(
DeviceMemoryAllocator
* allocator,
DeviceMemory
* device_memory);
41
void
free_device_memory
(
DeviceMemoryAllocator
* allocator,
const
DeviceMemory
* device_memory);
42
void
destroy_device_memory_allocator
(
DeviceMemoryAllocator
* allocator);
DMAResult
DMAResult
Definition:
device_memory_allocator.h:22
allocate_device_memory
DMAResult allocate_device_memory(DeviceMemoryAllocator *allocator, DeviceMemory *device_memory)
Definition:
device_memory_allocator.c:60
DeviceMemoryAllocator
Definition:
device_memory_allocator.c:39
device
static ALCdevice * device
Definition:
dynamic.c:53
DeviceMemory::alignment
uint64_t alignment
Definition:
device_memory_allocator.h:33
DeviceMemory
Definition:
device_memory_allocator.h:28
DeviceMemory
struct DeviceMemory DeviceMemory
DeviceMemory::memory
VkDeviceMemory memory
Definition:
device_memory_allocator.h:30
DMA_SUCCESS
@ DMA_SUCCESS
Definition:
device_memory_allocator.h:24
DeviceMemory::memory_offset
uint64_t memory_offset
Definition:
device_memory_allocator.h:31
DeviceMemory::size
uint64_t size
Definition:
device_memory_allocator.h:32
create_device_memory_allocator
DeviceMemoryAllocator * create_device_memory_allocator(VkDevice device)
Definition:
device_memory_allocator.c:48
destroy_device_memory_allocator
void destroy_device_memory_allocator(DeviceMemoryAllocator *allocator)
Definition:
device_memory_allocator.c:110
DeviceMemory::memory_type
uint32_t memory_type
Definition:
device_memory_allocator.h:34
free_device_memory
void free_device_memory(DeviceMemoryAllocator *allocator, const DeviceMemory *device_memory)
Definition:
device_memory_allocator.c:100
DMA_NOT_ENOUGH_MEMORY
@ DMA_NOT_ENOUGH_MEMORY
Definition:
device_memory_allocator.h:25
src
refresh
vkpt
device_memory_allocator.h
Generated by
1.8.17