Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions include/vsg/io/DatabasePager.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,47 @@ namespace vsg
std::vector<const PagedLOD*> newHighresRequired;
};

struct PagedLODContainer : public Inherit<Object, PagedLODContainer>
{
explicit PagedLODContainer(uint32_t maxNumPagedLOD = 10000);

struct List
{
uint32_t head = 0;
uint32_t tail = 0;
uint32_t count = 0;
std::string name;
};

struct Element
{
uint32_t previous = 0;
uint32_t next = 0;
ref_ptr<PagedLOD> plod;
List* list = nullptr;
};

using Elements = std::vector<Element>;

Elements elements;
List availableList;
List inactiveList;
List activeList;

void resize(uint32_t new_size);
void resize();
void inactive(const PagedLOD* plod);
void active(const PagedLOD* plod);
void remove(PagedLOD* plod);

void _move(const PagedLOD* plod, List* targetList);

bool check();
bool check(const List& list);

void print(std::ostream& out);
};

/// Thread safe queue for tracking PagedLOD that needs to be loaded, compiled or merged by the DatabasePager
class VSG_DECLSPEC DatabaseQueue : public Inherit<Object, DatabaseQueue>
{
Expand Down
41 changes: 0 additions & 41 deletions include/vsg/nodes/PagedLOD.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,45 +108,4 @@ namespace vsg
};
VSG_type_name(vsg::PagedLOD);

struct PagedLODContainer : public Inherit<Object, PagedLODContainer>
{
explicit PagedLODContainer(uint32_t maxNumPagedLOD = 10000);

struct List
{
uint32_t head = 0;
uint32_t tail = 0;
uint32_t count = 0;
std::string name;
};

struct Element
{
uint32_t previous = 0;
uint32_t next = 0;
ref_ptr<PagedLOD> plod;
List* list = nullptr;
};

using Elements = std::vector<Element>;

Elements elements;
List availableList;
List inactiveList;
List activeList;

void resize(uint32_t new_size);
void resize();
void inactive(const PagedLOD* plod);
void active(const PagedLOD* plod);
void remove(PagedLOD* plod);

void _move(const PagedLOD* plod, List* targetList);

bool check();
bool check(const List& list);

void print(std::ostream& out);
};

} // namespace vsg
35 changes: 35 additions & 0 deletions include/vsg/vk/vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,41 @@ typedef struct VkRenderPassCreateInfo2KHR

#endif

////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Definitions not provided prior to 1.1.97
//
#if VK_HEADER_VERSION < 97

#define VK_EXT_memory_budget 1
#define VK_EXT_MEMORY_BUDGET_SPEC_VERSION 1
#define VK_EXT_MEMORY_BUDGET_EXTENSION_NAME "VK_EXT_memory_budget"

typedef struct VkPhysicalDeviceMemoryBudgetPropertiesEXT {
VkStructureType sType;
void* pNext;
VkDeviceSize heapBudget[VK_MAX_MEMORY_HEAPS];
VkDeviceSize heapUsage[VK_MAX_MEMORY_HEAPS];
} VkPhysicalDeviceMemoryBudgetPropertiesEXT;

#define VK_EXT_memory_priority 1
#define VK_EXT_MEMORY_PRIORITY_SPEC_VERSION 1
#define VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME "VK_EXT_memory_priority"

typedef struct VkPhysicalDeviceMemoryPriorityFeaturesEXT {
VkStructureType sType;
void* pNext;
VkBool32 memoryPriority;
} VkPhysicalDeviceMemoryPriorityFeaturesEXT;

typedef struct VkMemoryPriorityAllocateInfoEXT {
VkStructureType sType;
const void* pNext;
float priority;
} VkMemoryPriorityAllocateInfoEXT;

#endif

////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Definitions not provided prior to 1.3.215
Expand Down
Loading
Loading