initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
This commit is contained in:
13
thirdparty/vulkan/patches/0001-VKEnumStringHelper-godot-vulkan.patch
vendored
Normal file
13
thirdparty/vulkan/patches/0001-VKEnumStringHelper-godot-vulkan.patch
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/thirdparty/vulkan/vk_enum_string_helper.h b/thirdparty/vulkan/vk_enum_string_helper.h
|
||||
index 8026787ad4..7a54b12a38 100644
|
||||
--- a/thirdparty/vulkan/vk_enum_string_helper.h
|
||||
+++ b/thirdparty/vulkan/vk_enum_string_helper.h
|
||||
@@ -13,7 +13,7 @@
|
||||
#ifdef __cplusplus
|
||||
#include <string>
|
||||
#endif
|
||||
-#include <vulkan/vulkan.h>
|
||||
+#include "drivers/vulkan/godot_vulkan.h"
|
||||
static inline const char* string_VkResult(VkResult input_value) {
|
||||
switch (input_value) {
|
||||
case VK_SUCCESS:
|
18
thirdparty/vulkan/patches/0002-VMA-godot-vulkan.patch
vendored
Normal file
18
thirdparty/vulkan/patches/0002-VMA-godot-vulkan.patch
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
diff --git a/thirdparty/vulkan/vk_mem_alloc.h b/thirdparty/vulkan/vk_mem_alloc.h
|
||||
index 2307325d4e..ecb84094b9 100644
|
||||
--- a/thirdparty/vulkan/vk_mem_alloc.h
|
||||
+++ b/thirdparty/vulkan/vk_mem_alloc.h
|
||||
@@ -122,12 +122,12 @@ for user-defined purpose without allocating any real GPU memory.
|
||||
See documentation chapter: \ref statistics.
|
||||
*/
|
||||
|
||||
+#include "drivers/vulkan/godot_vulkan.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
-#include <vulkan/vulkan.h>
|
||||
|
||||
#if !defined(VMA_VULKAN_VERSION)
|
||||
#if defined(VK_VERSION_1_3)
|
51
thirdparty/vulkan/patches/0003-VMA-add-vmaCalculateLazilyAllocatedBytes.patch
vendored
Normal file
51
thirdparty/vulkan/patches/0003-VMA-add-vmaCalculateLazilyAllocatedBytes.patch
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
diff --git a/thirdparty/vulkan/vk_mem_alloc.h b/thirdparty/vulkan/vk_mem_alloc.h
|
||||
index ecb84094b9..c436209896 100644
|
||||
--- a/thirdparty/vulkan/vk_mem_alloc.h
|
||||
+++ b/thirdparty/vulkan/vk_mem_alloc.h
|
||||
@@ -1713,6 +1713,19 @@ VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStatistics(
|
||||
VmaAllocator VMA_NOT_NULL allocator,
|
||||
VmaTotalStatistics* VMA_NOT_NULL pStats);
|
||||
|
||||
+/** \brief Retrieves lazily allocated bytes
|
||||
+
|
||||
+This function is called "calculate" not "get" because it has to traverse all
|
||||
+internal data structures, so it may be quite slow. Use it for debugging purposes.
|
||||
+For faster but more brief statistics suitable to be called every frame or every allocation,
|
||||
+use vmaGetHeapBudgets().
|
||||
+
|
||||
+Note that when using allocator from multiple threads, returned information may immediately
|
||||
+become outdated.
|
||||
+*/
|
||||
+VMA_CALL_PRE uint64_t VMA_CALL_POST vmaCalculateLazilyAllocatedBytes(
|
||||
+ VmaAllocator VMA_NOT_NULL allocator);
|
||||
+
|
||||
/** \brief Retrieves information about current memory usage and budget for all memory heaps.
|
||||
|
||||
\param allocator
|
||||
@@ -14912,6 +14925,26 @@ VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStatistics(
|
||||
allocator->CalculateStatistics(pStats);
|
||||
}
|
||||
|
||||
+VMA_CALL_PRE uint64_t VMA_CALL_POST vmaCalculateLazilyAllocatedBytes(
|
||||
+ VmaAllocator allocator)
|
||||
+{
|
||||
+ VMA_ASSERT(allocator);
|
||||
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
|
||||
+ VmaTotalStatistics stats;
|
||||
+ allocator->CalculateStatistics(&stats);
|
||||
+ uint64_t total_lazilily_allocated_bytes = 0;
|
||||
+ for (uint32_t heapIndex = 0; heapIndex < allocator->GetMemoryHeapCount(); ++heapIndex) {
|
||||
+ for (uint32_t typeIndex = 0; typeIndex < allocator->GetMemoryTypeCount(); ++typeIndex) {
|
||||
+ if (allocator->MemoryTypeIndexToHeapIndex(typeIndex) == heapIndex) {
|
||||
+ VkMemoryPropertyFlags flags = allocator->m_MemProps.memoryTypes[typeIndex].propertyFlags;
|
||||
+ if (flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT)
|
||||
+ total_lazilily_allocated_bytes += stats.memoryType[typeIndex].statistics.allocationBytes;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return total_lazilily_allocated_bytes;
|
||||
+}
|
||||
+
|
||||
VMA_CALL_PRE void VMA_CALL_POST vmaGetHeapBudgets(
|
||||
VmaAllocator allocator,
|
||||
VmaBudget* pBudgets)
|
Reference in New Issue
Block a user