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
24 changes: 24 additions & 0 deletions .github/workflows/cpp_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,30 @@ on:
branches: [ master ]

jobs:
cpp-tests-1-4-debug-with-debug-layers:
runs-on: ubuntu-latest
container: axsauze/kompute-builder:0.4
env:
VK_ICD_FILENAMES: "/swiftshader/vk_swiftshader_icd.json"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: false
- name: "[Release g++] Build & Test"
uses: KomputeProject/action-cmake-build@master
with:
build-dir: ${{github.workspace}}/build
source-dir: ${{github.workspace}}
cc: gcc
cxx: g++
build-type: Debug
run-test: false
ctest-options: -V
configure-options: -DKOMPUTE_OPT_BUILD_TESTS=ON -DKOMPUTE_OPT_DISABLE_VK_DEBUG_LAYERS=OFF -DKOMPUTE_OPT_USE_BUILT_IN_VULKAN_HEADER=ON -DKOMPUTE_OPT_BUILT_IN_VULKAN_HEADER_TAG=v1.4.304 -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON
- name: Run tests
run: make mk_run_tests

cpp-tests-debug-with-debug-layers:
runs-on: ubuntu-latest
container: axsauze/kompute-builder:0.4
Expand Down
13 changes: 12 additions & 1 deletion src/Manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@
namespace kp {

#ifndef KOMPUTE_DISABLE_VK_DEBUG_LAYERS
static VKAPI_ATTR VkBool32 VKAPI_CALL
#ifdef VK_VERSION_1_4
VKAPI_PTR vk::Bool32 VKAPI_CALL
debugMessageCallback(vk::DebugReportFlagsEXT /*flags*/,
vk::DebugReportObjectTypeEXT /*objectType*/,
#else
static VKAPI_PTR VkBool32 VKAPI_CALL
debugMessageCallback(VkDebugReportFlagsEXT /*flags*/,
VkDebugReportObjectTypeEXT /*objectType*/,
#endif // VK_VERSION_1_4
uint64_t /*object*/,
size_t /*location*/,
int32_t /*messageCode*/,
Expand Down Expand Up @@ -274,8 +280,13 @@ Manager::createInstance()
vk::DebugReportFlagBitsEXT::eError |
vk::DebugReportFlagBitsEXT::eWarning;
vk::DebugReportCallbackCreateInfoEXT debugCreateInfo = {};
#ifdef VK_VERSION_1_4
debugCreateInfo.pfnCallback =
(vk::PFN_DebugReportCallbackEXT)debugMessageCallback;
#else
debugCreateInfo.pfnCallback =
(PFN_vkDebugReportCallbackEXT)debugMessageCallback;
#endif
debugCreateInfo.flags = debugFlags;

this->mDebugDispatcher.init(*this->mInstance, &vkGetInstanceProcAddr);
Expand Down
6 changes: 5 additions & 1 deletion src/include/kompute/Manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,12 @@ class Manager

#ifndef KOMPUTE_DISABLE_VK_DEBUG_LAYERS
vk::DebugReportCallbackEXT mDebugReportCallback;
#ifdef VK_VERSION_1_4
vk::detail::DispatchLoaderDynamic mDebugDispatcher;
#else
vk::DispatchLoaderDynamic mDebugDispatcher;
#endif
#endif // VK_VERSION_1_4
#endif // KOMPUTE_DISABLE_VK_DEBUG_LAYERS

// Create functions
void createInstance();
Expand Down