Skip to content

Commit

Permalink
Update dependencies and remove uniform updateAfterBind bit
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyong committed May 16, 2022
1 parent 403db7c commit 09199d4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
12 changes: 6 additions & 6 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ FetchContent_MakeAvailable(volk)

set(TINYEXR_BUILD_SAMPLE OFF CACHE BOOL "")
FetchContent_Declare(
tinyexr
GIT_REPOSITORY https://github.com/syoyo/tinyexr.git
GIT_TAG 74d0820a3ec7f67d734fabdb4311ba8dffdde5a7
GIT_SHALLOW ON
tinyexr
GIT_REPOSITORY https://github.com/syoyo/tinyexr.git
GIT_TAG v1.0.1
GIT_SHALLOW ON
)
FetchContent_MakeAvailable(tinyexr)

Expand All @@ -39,7 +39,7 @@ set(VMA_DYNAMIC_VULKAN_FUNCTIONS ON CACHE BOOL "")
FetchContent_Declare(
vma
GIT_REPOSITORY https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
GIT_TAG v2.3.0
GIT_TAG v3.0.0
GIT_SHALLOW ON
)
if(NOT vma_POPULATED)
Expand Down Expand Up @@ -77,7 +77,7 @@ target_include_directories(
lflop
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../include
${vma_SOURCE_DIR}/src
${vma_SOURCE_DIR}/include
PRIVATE
${stb_SOURCE_DIR}
${tinyexr_SOURCE_DIR}
Expand Down
8 changes: 6 additions & 2 deletions lib/Flop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ static int create_device(char const* preferred_device, bool swapchain)
.descriptorIndexing = VK_TRUE,
.shaderSampledImageArrayNonUniformIndexing = VK_TRUE,
.shaderStorageImageArrayNonUniformIndexing = VK_TRUE,
.descriptorBindingUniformBufferUpdateAfterBind = VK_TRUE,
.descriptorBindingSampledImageUpdateAfterBind = VK_TRUE,
.descriptorBindingStorageImageUpdateAfterBind = VK_TRUE,
.descriptorBindingStorageBufferUpdateAfterBind = VK_TRUE,
Expand Down Expand Up @@ -325,13 +324,18 @@ static int create_device(char const* preferred_device, bool swapchain)
vkGetDeviceQueue(g_device, g_compute_queue_index, 0, &g_compute_queue);
}

VmaVulkanFunctions vulkan_functions{
.vkGetInstanceProcAddr = vkGetInstanceProcAddr,
.vkGetDeviceProcAddr = vkGetDeviceProcAddr,
};

VmaAllocatorCreateInfo allocator_info{
.physicalDevice = g_physical_device,
.device = g_device,
.preferredLargeHeapBlockSize = 0, // 256 MiB default
.pAllocationCallbacks = nullptr,
.pDeviceMemoryCallbacks = nullptr,
.frameInUseCount = 0,
.pVulkanFunctions = &vulkan_functions,
.instance = g_instance};

if (vmaCreateAllocator(&allocator_info, &g_allocator) != VK_SUCCESS)
Expand Down
3 changes: 2 additions & 1 deletion lib/VMA.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#define VMA_IMPLEMENTATION
#define VMA_STATIC_VULKAN_FUNCTIONS 1
#define VMA_STATIC_VULKAN_FUNCTIONS 0
#define VMA_DYNAMIC_VULKAN_FUNCTIONS 1
#include <volk.h>
#include <vk_mem_alloc.h>
6 changes: 6 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ target_compile_features(
cxx_std_20
)

target_compile_definitions(
flop
PUBLIC
NOMINMAX=1
)

target_link_libraries(
flop
PUBLIC
Expand Down

0 comments on commit 09199d4

Please sign in to comment.