-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a simple compilation test and linux CI (and fix linux build) #446
Open
Mrkol
wants to merge
1
commit into
GPUOpen-LibrariesAndSDKs:master
Choose a base branch
from
Mrkol:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+99
−8
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: linux | ||
|
||
on: [push, pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
cxx: [g++-12, clang++-15] | ||
build_type: [Debug, Release] | ||
include: | ||
- cxx: g++-12 | ||
install: sudo apt install g++-12 | ||
- cxx: clang++-15 | ||
cxxflags: -stdlib=libc++ | ||
install: sudo apt install clang-15 libc++-15-dev libc++abi-15-dev | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Prepare Vulkan SDK | ||
uses: humbletim/[email protected] | ||
with: | ||
version: 1.3.290.0 | ||
cache: true | ||
|
||
- name: Create Build Environment | ||
run: | | ||
sudo apt update | ||
${{matrix.install}} | ||
cmake -E make_directory ${{runner.workspace}}/build | ||
|
||
- name: Configure | ||
working-directory: ${{runner.workspace}}/build | ||
env: | ||
CXX: ${{matrix.cxx}} | ||
CXXFLAGS: ${{matrix.cxxflags}} | ||
run: | | ||
cmake -DCPM_SOURCE_CACHE=~/cpm-cache \ | ||
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ | ||
-DVMA_BUILD_SAMPLES=YES \ | ||
$GITHUB_WORKSPACE | ||
|
||
- name: Build | ||
working-directory: ${{runner.workspace}}/build | ||
run: | | ||
threads=`nproc` | ||
cmake --build . --target VmaCompilationTest --config ${{matrix.build_type}} --parallel $threads |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# | ||
# Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved. | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in | ||
# all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. | ||
# | ||
|
||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
find_package(Vulkan REQUIRED) | ||
|
||
add_library(VmaCompilationTest) | ||
target_sources(VmaCompilationTest PRIVATE vma_impl.cpp) | ||
|
||
target_link_libraries(VmaCompilationTest PRIVATE GPUOpen::VulkanMemoryAllocator) | ||
|
||
target_link_libraries(VmaCompilationTest PUBLIC Vulkan::Vulkan) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#define VMA_IMPLEMENTATION | ||
#include <vk_mem_alloc.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1467,17 +1467,17 @@ typedef struct VmaAllocationInfo | |
typedef struct VmaAllocationInfo2 | ||
{ | ||
/** \brief Basic parameters of the allocation. | ||
|
||
If you need only these, you can use function vmaGetAllocationInfo() and structure #VmaAllocationInfo instead. | ||
*/ | ||
VmaAllocationInfo allocationInfo; | ||
/** \brief Size of the `VkDeviceMemory` block that the allocation belongs to. | ||
|
||
In case of an allocation with dedicated memory, it will be equal to `allocationInfo.size`. | ||
*/ | ||
VkDeviceSize blockSize; | ||
/** \brief `VK_TRUE` if the allocation has dedicated memory, `VK_FALSE` if it was placed as part of a larger memory block. | ||
|
||
When `VK_TRUE`, it also means `VkMemoryDedicatedAllocateInfo` was used when creating the allocation | ||
(if VK_KHR_dedicated_allocation extension or Vulkan version >= 1.1 is enabled). | ||
*/ | ||
|
@@ -2567,7 +2567,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAliasingBuffer( | |
\param allocator | ||
\param allocation Allocation that provides memory to be used for binding new buffer to it. | ||
\param allocationLocalOffset Additional offset to be added while binding, relative to the beginning of the allocation. Normally it should be 0. | ||
\param pBufferCreateInfo | ||
\param pBufferCreateInfo | ||
\param[out] pBuffer Buffer that was created. | ||
|
||
This function automatically: | ||
|
@@ -6195,7 +6195,7 @@ class VmaWin32Handle | |
HANDLE m_hHandle; | ||
VMA_RW_MUTEX m_Mutex; // Protects access m_Handle | ||
}; | ||
#else | ||
#else | ||
class VmaWin32Handle | ||
{ | ||
// ABI compatibility | ||
|
@@ -10594,7 +10594,7 @@ VmaDeviceMemoryBlock::VmaDeviceMemoryBlock(VmaAllocator hAllocator) | |
m_hMemory(VK_NULL_HANDLE), | ||
m_MapCount(0), | ||
m_pMappedData(VMA_NULL), | ||
m_Handle(VMA_NULL) {} | ||
m_Handle() {} | ||
|
||
VmaDeviceMemoryBlock::~VmaDeviceMemoryBlock() | ||
{ | ||
|
@@ -16675,7 +16675,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaGetMemoryWin32Handle(VmaAllocator VMA_NOT | |
VMA_DEBUG_GLOBAL_MUTEX_LOCK; | ||
return allocation->GetWin32Handle(allocator, hTargetProcess, pHandle); | ||
} | ||
#endif // VMA_EXTERNAL_MEMORY_WIN32 | ||
#endif // VMA_EXTERNAL_MEMORY_WIN32 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that you change many lines that are unrelated to your change due to using some automated formatting tools. Changes like this make it difficult to analyze the history of a file later (like "blame" function). |
||
#endif // VMA_STATS_STRING_ENABLED | ||
#endif // _VMA_PUBLIC_INTERFACE | ||
#endif // VMA_IMPLEMENTATION | ||
|
@@ -18929,7 +18929,7 @@ res = vmaCreateBuffer(g_Allocator, &bufCreateInfo, &allocCreateInfo, &buf, &allo | |
vmaDestroyBuffer(g_Allocator, buf, alloc); | ||
\endcode | ||
|
||
If you need each allocation to have its own device memory block and start at offset 0, you can still do | ||
If you need each allocation to have its own device memory block and start at offset 0, you can still do | ||
by using #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT flag. It works also with custom pools. | ||
|
||
\section vk_khr_external_memory_win32_exporting_win32_handle Exporting Win32 handle | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to reuse VulkanSample app for testing compilation on Linux instead of creating a new project? VulkanSample.cpp and VmaUsage.* files already have appropriate
#ifdef
-s and even some Clang-specific#pragma
directives.