Skip to content

Commit 13ce48a

Browse files
committed
Changed some member variables from static const to static constexpr
As suggested in GPUOpen-LibrariesAndSDKs#514
1 parent 4ae7e1f commit 13ce48a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

include/vk_mem_alloc.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6358,7 +6358,7 @@ class VmaMappingHysteresis
63586358
}
63596359

63606360
private:
6361-
static const int32_t COUNTER_MIN_EXTRA_MAPPING = 7;
6361+
static constexpr int32_t COUNTER_MIN_EXTRA_MAPPING = 7;
63626362

63636363
uint32_t m_MinorCounter = 0;
63646364
uint32_t m_MajorCounter = 0;
@@ -7161,7 +7161,7 @@ class VmaBlockBufferImageGranularity final
71617161
bool FinishValidation(ValidationContext& ctx) const;
71627162

71637163
private:
7164-
static const uint16_t MAX_LOW_BUFFER_IMAGE_GRANULARITY = 256;
7164+
static constexpr uint16_t MAX_LOW_BUFFER_IMAGE_GRANULARITY = 256;
71657165

71667166
struct RegionInfo
71677167
{
@@ -9102,11 +9102,11 @@ class VmaBlockMetadata_TLSF : public VmaBlockMetadata
91029102
// According to original paper it should be preferable 4 or 5:
91039103
// M. Masmano, I. Ripoll, A. Crespo, and J. Real "TLSF: a New Dynamic Memory Allocator for Real-Time Systems"
91049104
// http://www.gii.upv.es/tlsf/files/ecrts04_tlsf.pdf
9105-
static const uint8_t SECOND_LEVEL_INDEX = 5;
9106-
static const uint16_t SMALL_BUFFER_SIZE = 256;
9107-
static const uint32_t INITIAL_BLOCK_ALLOC_COUNT = 16;
9108-
static const uint8_t MEMORY_CLASS_SHIFT = 7;
9109-
static const uint8_t MAX_MEMORY_CLASSES = 65 - MEMORY_CLASS_SHIFT;
9105+
static constexpr uint8_t SECOND_LEVEL_INDEX = 5;
9106+
static constexpr uint16_t SMALL_BUFFER_SIZE = 256;
9107+
static constexpr uint32_t INITIAL_BLOCK_ALLOC_COUNT = 16;
9108+
static constexpr uint8_t MEMORY_CLASS_SHIFT = 7;
9109+
static constexpr uint8_t MAX_MEMORY_CLASSES = 65 - MEMORY_CLASS_SHIFT;
91109110

91119111
class Block
91129112
{
@@ -10122,7 +10122,7 @@ struct VmaDefragmentationContext_T
1012210122

1012310123
private:
1012410124
// Max number of allocations to ignore due to size constraints before ending single pass
10125-
static const uint8_t MAX_ALLOCS_TO_IGNORE = 16;
10125+
static constexpr uint8_t MAX_ALLOCS_TO_IGNORE = 16;
1012610126
enum class CounterStatus { Pass, Ignore, End };
1012710127

1012810128
struct FragmentedBlock

0 commit comments

Comments
 (0)