Skip to content

Commit

Permalink
Added defines for build without installed vulkan validations
Browse files Browse the repository at this point in the history
  • Loading branch information
tx00100xt committed Nov 4, 2023
1 parent 8b99a3f commit b8d1ab2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions SamTFE/Sources/Engine/Graphics/Gfx_Vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ extern INDEX GFX_ctVertices;
extern BOOL GFX_bViewMatrix;

#pragma region Debug messenger
#if SVK_ENABLE_VALIDATION
static VKAPI_ATTR VkBool32 VKAPI_CALL DebugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, void* pUserData)
{
// print debug message to console
Expand All @@ -94,6 +95,7 @@ void GetDebugMsgCreateInfo(VkDebugUtilsMessengerCreateInfoEXT &outInfo)
outInfo.messageType = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT;
outInfo.pfnUserCallback = DebugCallback;
}
#endif
#pragma endregion

BOOL CGfxLibrary::InitDriver_Vulkan()
Expand Down Expand Up @@ -439,9 +441,9 @@ void SvkMain::Reset_Vulkan()
gl_VkQueuePresent = VK_NULL_HANDLE;

gl_VkPipelineOcclusion = VK_NULL_HANDLE;

#if SVK_ENABLE_VALIDATION
gl_VkDebugMessenger = VK_NULL_HANDLE;

#endif
for (uint32_t i = 0; i < gl_VkMaxCmdBufferCount; i++)
{
gl_VkTextureDescPools[i] = VK_NULL_HANDLE;
Expand Down
4 changes: 2 additions & 2 deletions SamTFE/Sources/Engine/Graphics/Vulkan/SvkMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ class SvkMain

VkQueryPool gl_VkOcclusionQueryPools[gl_VkMaxCmdBufferCount];
uint32_t gl_VkOcclusionQueryLast[gl_VkMaxCmdBufferCount];

#if SVK_ENABLE_VALIDATION
VkDebugUtilsMessengerEXT gl_VkDebugMessenger;

#endif
uint32_t gl_VkReloadTexturesTimer;

// current mesh
Expand Down
6 changes: 4 additions & 2 deletions SamTSE/Sources/Engine/Graphics/Gfx_Vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ extern INDEX GFX_ctVertices;
extern BOOL GFX_bViewMatrix;

#pragma region Debug messenger
#if SVK_ENABLE_VALIDATION
static VKAPI_ATTR VkBool32 VKAPI_CALL DebugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, void* pUserData)
{
// print debug message to console
Expand All @@ -94,6 +95,7 @@ void GetDebugMsgCreateInfo(VkDebugUtilsMessengerCreateInfoEXT &outInfo)
outInfo.messageType = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT;
outInfo.pfnUserCallback = DebugCallback;
}
#endif
#pragma endregion

BOOL CGfxLibrary::InitDriver_Vulkan()
Expand Down Expand Up @@ -439,9 +441,9 @@ void SvkMain::Reset_Vulkan()
gl_VkQueuePresent = VK_NULL_HANDLE;

gl_VkPipelineOcclusion = VK_NULL_HANDLE;

#if SVK_ENABLE_VALIDATION
gl_VkDebugMessenger = VK_NULL_HANDLE;

#endif
for (uint32_t i = 0; i < gl_VkMaxCmdBufferCount; i++)
{
gl_VkTextureDescPools[i] = VK_NULL_HANDLE;
Expand Down
4 changes: 2 additions & 2 deletions SamTSE/Sources/Engine/Graphics/Vulkan/SvkMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ class SvkMain

VkQueryPool gl_VkOcclusionQueryPools[gl_VkMaxCmdBufferCount];
uint32_t gl_VkOcclusionQueryLast[gl_VkMaxCmdBufferCount];

#if SVK_ENABLE_VALIDATION
VkDebugUtilsMessengerEXT gl_VkDebugMessenger;

#endif
uint32_t gl_VkReloadTexturesTimer;

// current mesh
Expand Down

0 comments on commit b8d1ab2

Please sign in to comment.