-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusage.h
34 lines (29 loc) · 996 Bytes
/
usage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: Copyright (c) 2021-2024 Chris Dragan
#pragma once
#include <stdint.h>
enum class Usage {
// Constant resources created on host and transferred to device, e.g. textures, vertex buffers, etc.
fixed,
// Frequently changing resources, e.g. uniform buffers
dynamic,
// Resources initialized and used on the device, never accessed on the host
device_only,
// Resources allocated on the host
host_only,
// Resources used on the device, which are occasionally purged, e.g. depth buffers
device_temporary
};
struct Description {
#ifdef NDEBUG
constexpr Description(const char*, uint32_t) { }
constexpr Description(const char*) { }
#else
constexpr Description(const char* dbg_name, uint32_t dbg_idx)
: name(dbg_name), idx(dbg_idx) { }
constexpr Description(const char* dbg_name)
: name(dbg_name) { }
const char* name = nullptr;
uint32_t idx = ~0U;
#endif
};