mirror of
https://github.com/w23/xash3d-fwgs
synced 2024-12-05 00:11:05 +01:00
vk: devmem: fix previously conflicting code.
- `mem->priv_.devmem` -> `slot_index`; - Move static `VK_DevMemUsageTypeString()` out of `devmem.h` header.
This commit is contained in:
parent
8363cedf93
commit
790bf25263
@ -153,6 +153,20 @@ static void register_free_for_type( vk_devmem_usage_type_t type, int size, int a
|
||||
}
|
||||
}
|
||||
|
||||
// Returns short string representation of `vk_devmem_usage_type_t` usage type.
|
||||
static const char *VK_DevMemUsageTypeString( vk_devmem_usage_type_t type ) {
|
||||
ASSERT( type >= VK_DEVMEM_USAGE_TYPE_ALL );
|
||||
ASSERT( type < VK_DEVMEM_USAGE_TYPES_COUNT );
|
||||
|
||||
switch ( type ) {
|
||||
case VK_DEVMEM_USAGE_TYPE_ALL: return "ALL";
|
||||
case VK_DEVMEM_USAGE_TYPE_BUFFER: return "BUFFER";
|
||||
case VK_DEVMEM_USAGE_TYPE_IMAGE: return "IMAGE";
|
||||
}
|
||||
|
||||
return "(unknown)";
|
||||
}
|
||||
|
||||
static int findMemoryWithType(uint32_t type_index_bits, VkMemoryPropertyFlags flags) {
|
||||
const VkPhysicalDeviceMemoryProperties *const properties = &vk_core.physical_device.memory_properties2.memoryProperties;
|
||||
for ( int type = 0; type < (int)properties->memoryTypeCount; type += 1 ) {
|
||||
@ -328,7 +342,7 @@ void VK_DevMemFree(const vk_devmem_t *mem) {
|
||||
|
||||
if (slot->refcount == 0) {
|
||||
// FIXME free empty
|
||||
gEngine.Con_Reportf(S_WARN "devmem[%d] reached refcount=0\n", mem->priv_.devmem);
|
||||
gEngine.Con_Reportf(S_WARN "device_memory_slot[%d] reached refcount=0\n", slot_index);
|
||||
}
|
||||
}
|
||||
|
||||
@ -388,16 +402,3 @@ void VK_DevMemDestroy( void ) {
|
||||
|
||||
g_devmem.alloc_slots_count = 0;
|
||||
}
|
||||
|
||||
const char *VK_DevMemUsageTypeString( vk_devmem_usage_type_t type ) {
|
||||
ASSERT( type >= VK_DEVMEM_USAGE_TYPE_ALL );
|
||||
ASSERT( type < VK_DEVMEM_USAGE_TYPES_COUNT );
|
||||
|
||||
switch ( type ) {
|
||||
case VK_DEVMEM_USAGE_TYPE_ALL: return "ALL";
|
||||
case VK_DEVMEM_USAGE_TYPE_BUFFER: return "BUFFER";
|
||||
case VK_DEVMEM_USAGE_TYPE_IMAGE: return "IMAGE";
|
||||
}
|
||||
|
||||
return "(unknown)";
|
||||
}
|
||||
|
@ -54,6 +54,4 @@ typedef struct vk_devmem_allocate_args_s {
|
||||
vk_devmem_t VK_DevMemAllocate(const char *name, vk_devmem_usage_type_t usage_type, vk_devmem_allocate_args_t devmem_allocate_args);
|
||||
void VK_DevMemFree(const vk_devmem_t *mem);
|
||||
|
||||
// Returns short string representation of `vk_devmem_usage_type_t` usage type.
|
||||
static const char *VK_DevMemUsageTypeString( vk_devmem_usage_type_t type );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user