Fixing linux build kind of

This commit is contained in:
2021-10-13 15:20:30 +02:00
parent 99760724cd
commit 59b262777c
18 changed files with 111 additions and 100 deletions
+2 -2
View File
@@ -4,7 +4,7 @@
"name": "Win32", "name": "Win32",
"includePath": [ "includePath": [
"${workspaceFolder}/**", "${workspaceFolder}/**",
"${VULKAN_SDK}\\Include" "external/**"
], ],
"defines": [ "defines": [
"_DEBUG", "_DEBUG",
@@ -16,7 +16,7 @@
"cppStandard": "c++20", "cppStandard": "c++20",
"browse": { "browse": {
"path": [ "path": [
"${VULKAN_SDK}/**" "external/**"
] ]
} }
} }
+4 -4
View File
@@ -5,7 +5,6 @@ set(CMAKE_CXX_STANDARD 20)
# Handle superbuild first # Handle superbuild first
option (USE_SUPERBUILD "Whether or not a superbuild should be invoked" ON) option (USE_SUPERBUILD "Whether or not a superbuild should be invoked" ON)
set(ENGINE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/src/Engine) set(ENGINE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/src/Engine)
set(EXTERNAL_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/external) set(EXTERNAL_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/external)
set(ASSIMP_ROOT ${EXTERNAL_ROOT}/assimp) set(ASSIMP_ROOT ${EXTERNAL_ROOT}/assimp)
@@ -22,7 +21,6 @@ set(NSAM_ROOT ${EXTERNAL_ROOT}/aftermath)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/)
set(Boost_USE_STATIC_LIBS OFF) set(Boost_USE_STATIC_LIBS OFF)
set(Boost_LIB_PREFIX lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
#Workaround for vs, because it places artifacts into an additional subfolder #Workaround for vs, because it places artifacts into an additional subfolder
@@ -81,8 +79,10 @@ target_link_libraries(SeeleEngine ${SLANG_LIBRARIES})
target_link_libraries(SeeleEngine ${ASSIMP_LIBRARIES}) target_link_libraries(SeeleEngine ${ASSIMP_LIBRARIES})
target_link_libraries(SeeleEngine ${NSAM_LIBRARIES}) target_link_libraries(SeeleEngine ${NSAM_LIBRARIES})
target_link_libraries(SeeleEngine ${KTX_LIBRARIES}) target_link_libraries(SeeleEngine ${KTX_LIBRARIES})
#target_link_libraries(SeeleEngine ${SPIRV_LIBRARIES}) if(UNIX)
target_link_libraries(SeeleEngine Threads::Threads)
target_link_libraries(SeeleEngine dl)
endif()
target_precompile_headers(SeeleEngine target_precompile_headers(SeeleEngine
PRIVATE PRIVATE
<assert.h> <assert.h>
+5 -20
View File
@@ -62,33 +62,18 @@ else()
# Find include files # Find include files
find_path( find_path(
NSAM_INCLUDE_DIR NSAM_INCLUDE_DIR
NAMES NSAM/nsam3.h NAMES GFSDK_Aftermath.h
PATHS PATHS
/usr/include /usr/include
/usr/local/include /usr/local/include
/sw/include /sw/include
/opt/local/include /opt/local/include
${NSAM_ROOT}/include
DOC "The directory where GL/nsam.h resides") DOC "The directory where GL/nsam.h resides")
# Find library files
# Try to use static libraries
#find_library(
# NSAM_LIBRARY
# NAMES nsam3
# PATHS
# /usr/lib64
# /usr/lib
# /usr/local/lib64
# /usr/local/lib
# /sw/lib
# /opt/local/lib
# ${NSAM_ROOT}/lib
# DOC "The NSAM library")
set(NSAM_LIBRARY "")
find_file( find_file(
NSAM_BINARY NSAM_BINARY
NAMES libnsam${CMAKE_DEBUG_POSTFIX}.so NAMES libGFSDK_Aftermath_Lib.${CMAKE_PLATFORM}.so
PATHS PATHS
/usr/lib64 /usr/lib64
/usr/lib /usr/lib
@@ -96,8 +81,8 @@ else()
/usr/local/lib /usr/local/lib
/sw/lib /sw/lib
/opt/local/lib /opt/local/lib
${NSAM_ROOT}/src ${NSAM_ROOT}/lib
) PATH_SUFFIXES x64 x86)
endif() endif()
# Handle REQUIRD argument, define *_FOUND variable # Handle REQUIRD argument, define *_FOUND variable
+15 -2
View File
@@ -55,6 +55,19 @@ else()
# Find library files # Find library files
find_library( find_library(
ASSIMP_LIBRARY ASSIMP_LIBRARY
NAMES libassimp${CMAKE_DEBUG_POSTFIX}.a
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
${ASSIMP_ROOT}/code
DOC "Assimp library file")
find_file(
ASSIMP_BINARY
NAMES libassimp${CMAKE_DEBUG_POSTFIX}.so NAMES libassimp${CMAKE_DEBUG_POSTFIX}.so
PATHS PATHS
/usr/lib64 /usr/lib64
@@ -63,12 +76,12 @@ else()
/usr/local/lib /usr/local/lib
/sw/lib /sw/lib
/opt/local/lib /opt/local/lib
${ASSIMP_ROOT}/bin ${ASSIMP_ROOT}/code
DOC "The Assimp library") DOC "The Assimp library")
endif() endif()
# Handle REQUIRD argument, define *_FOUND variable # Handle REQUIRD argument, define *_FOUND variable
find_package_handle_standard_args(assimp DEFAULT_MSG ASSIMP_INCLUDE_DIR ASSIMP_LIBRARY) find_package_handle_standard_args(assimp DEFAULT_MSG ASSIMP_INCLUDE_DIR ASSIMP_BINARY)
# Define GLFW_LIBRARIES and GLFW_INCLUDE_DIRS # Define GLFW_LIBRARIES and GLFW_INCLUDE_DIRS
if (ASSIMP_FOUND) if (ASSIMP_FOUND)
+13 -14
View File
@@ -70,19 +70,18 @@ else()
# Find library files # Find library files
# Try to use static libraries # Try to use static libraries
#find_library( find_library(
# GLFW_LIBRARY GLFW_LIBRARY
# NAMES glfw3 NAMES libglfw3${CMAKE_DEBUG_POSTFIX}.a
# PATHS PATHS
# /usr/lib64 /usr/lib64
# /usr/lib /usr/lib
# /usr/local/lib64 /usr/local/lib64
# /usr/local/lib /usr/local/lib
# /sw/lib /sw/lib
# /opt/local/lib /opt/local/lib
# ${GLFW_ROOT}/lib ${GLFW_ROOT}/src
# DOC "The GLFW library") DOC "The GLFW library")
set(GLFW_LIBRARY "")
find_file( find_file(
GLFW_BINARY GLFW_BINARY
@@ -99,7 +98,7 @@ else()
endif() endif()
# Handle REQUIRD argument, define *_FOUND variable # Handle REQUIRD argument, define *_FOUND variable
find_package_handle_standard_args(GLFW DEFAULT_MSG GLFW_INCLUDE_DIR GLFW_BINARY) find_package_handle_standard_args(GLFW DEFAULT_MSG GLFW_INCLUDE_DIR GLFW_LIBRARY GLFW_BINARY)
# Define GLFW_LIBRARIES and GLFW_INCLUDE_DIRS # Define GLFW_LIBRARIES and GLFW_INCLUDE_DIRS
if (GLFW_FOUND) if (GLFW_FOUND)
+11
View File
@@ -47,6 +47,17 @@ else()
/opt/local/include /opt/local/include
${KTX_ROOT} ${KTX_ROOT}
DOC "The directory where KTX/ktx.h resides") DOC "The directory where KTX/ktx.h resides")
find_library(
KTX_LIBRARY
NAMES libktx${CMAKE_DEBUG_POSTFIX}.so
PATHS
/usr/include
/usr/local/include
/sw/include
/opt/local/include
${KTX_ROOT}
DOC "The directory where KTX/libktx.so resides")
endif() endif()
# Handle REQUIRD argument, define *_FOUND variable # Handle REQUIRD argument, define *_FOUND variable
+25 -18
View File
@@ -49,7 +49,7 @@ if (WIN32)
PATHS PATHS
${SLANG_BINARY_PATH}) ${SLANG_BINARY_PATH})
else() else()
set(SLANG_BINARY_PATH ${SLANG_ROOT}/bin/linux-${CMAKE_PLATFORM}/release/) set(SLANG_BINARY_PATH ${SLANG_ROOT}/bin/linux-${CMAKE_PLATFORM}/debug/)
# Find include files # Find include files
find_path( find_path(
SLANG_INCLUDE_DIR SLANG_INCLUDE_DIR
@@ -62,9 +62,29 @@ else()
${SLANG_ROOT} ${SLANG_ROOT}
DOC "The directory where GL/glfw.h resides") DOC "The directory where GL/glfw.h resides")
find_library(
SLANG_LIBRARY
NAMES libcore.a
PATHS
/usr/include
/usr/local/include
/sw/include
/opt/local/include
${SLANG_BINARY_PATH}
DOC "The directory where GL/glfw.h resides")
find_library(
SLANG_COMPILER
NAMES libcompiler-core.a
PATHS
/usr/include
/usr/local/include
/sw/include
/opt/local/include
${SLANG_BINARY_PATH}
DOC "The directory where GL/glfw.h resides")
# Find library files # Find library files
# Try to use static libraries
set(SLANG_LIBRARY "")
find_library( find_library(
SLANG_BINARY SLANG_BINARY
NAMES libslang.so NAMES libslang.so
@@ -77,28 +97,15 @@ else()
/opt/local/lib /opt/local/lib
${SLANG_BINARY_PATH} ${SLANG_BINARY_PATH}
DOC "The SLANG library") DOC "The SLANG library")
find_file(
SLANG_GLSLANG
NAMES libslang-glslang.so
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
${SLANG_BINARY_PATH}
)
endif() endif()
# Handle REQUIRD argument, define *_FOUND variable # Handle REQUIRD argument, define *_FOUND variable
find_package_handle_standard_args(SLANG DEFAULT_MSG SLANG_INCLUDE_DIR SLANG_BINARY SLANG_GLSLANG) find_package_handle_standard_args(SLANG DEFAULT_MSG SLANG_INCLUDE_DIR SLANG_LIBRARY SLANG_BINARY)
# Define SLANG_LIBRARIES and SLANG_INCLUDE_DIRS # Define SLANG_LIBRARIES and SLANG_INCLUDE_DIRS
if (SLANG_FOUND) if (SLANG_FOUND)
set(SLANG_BINARIES ${SLANG_BINARY} ${SLANG_GLSLANG}) set(SLANG_BINARIES ${SLANG_BINARY} ${SLANG_GLSLANG})
set(SLANG_LIBRARIES ${SLANG_LIBRARY}) set(SLANG_LIBRARIES ${SLANG_LIBRARY} ${SLANG_COMPILER})
set(SLANG_INCLUDE_DIRS ${SLANG_INCLUDE_DIR}) set(SLANG_INCLUDE_DIRS ${SLANG_INCLUDE_DIR})
endif() endif()
+11 -16
View File
@@ -10,15 +10,15 @@ set(ASSIMP_BUILD_OVERALLS OFF CACHE INTERNAL "")
set(ASSIMP_BUILD_ASSIMP_TOOLS OFF CACHE INTERNAL "") set(ASSIMP_BUILD_ASSIMP_TOOLS OFF CACHE INTERNAL "")
set(ASSIMP_INSTALL OFF CACHE INTERNAL "") set(ASSIMP_INSTALL OFF CACHE INTERNAL "")
set(ASSIMP_BUILD_ZLIB OFF CACHE INTERNAL "") set(ASSIMP_BUILD_ZLIB OFF CACHE INTERNAL "")
set(BUILD_SHARED_LIBS ON CACHE INTERNAL "") set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "")
add_subdirectory(${ASSIMP_ROOT} ${ASSIMP_ROOT}) add_subdirectory(${ASSIMP_ROOT} ${ASSIMP_ROOT})
target_compile_definitions(assimp PRIVATE _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING) target_compile_definitions(assimp PRIVATE _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING)
#if(WIN32) if(WIN32)
# target_compile_options(assimp PRIVATE /WX-) target_compile_options(assimp PRIVATE /WX-)
#else() else()
# target_compile_options(assimp PRIVATE -Wno-error) target_compile_options(assimp PRIVATE -Wno-error -fPIC)
#endif() endif()
#-------------BOOST---------------- #-------------BOOST----------------
list(APPEND DEPENDENCIES boost) list(APPEND DEPENDENCIES boost)
if(WIN32) if(WIN32)
@@ -30,7 +30,7 @@ ExternalProject_Add(boost
SOURCE_DIR ${BOOST_ROOT} SOURCE_DIR ${BOOST_ROOT}
UPDATE_COMMAND "" UPDATE_COMMAND ""
CONFIGURE_COMMAND ./bootstrap.${BOOTSTRAP_EXTENSION} --with-libraries=serialization,test CONFIGURE_COMMAND ./bootstrap.${BOOTSTRAP_EXTENSION} --with-libraries=serialization,test
BUILD_COMMAND ./b2 link=static -d0 BUILD_COMMAND ./b2 -d0
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
INSTALL_COMMAND "") INSTALL_COMMAND "")
@@ -59,12 +59,13 @@ set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "GLFW lib only" )
set(GLFW_BUILD_TESTS OFF CACHE BOOL "GLFW lib only" ) set(GLFW_BUILD_TESTS OFF CACHE BOOL "GLFW lib only" )
set(GLFW_BUILD_DOCS OFF CACHE BOOL "GLFW lib only" ) set(GLFW_BUILD_DOCS OFF CACHE BOOL "GLFW lib only" )
set(GLFW_BUILD_INSTALL OFF CACHE BOOL "GLFW lib only" ) set(GLFW_BUILD_INSTALL OFF CACHE BOOL "GLFW lib only" )
set(GLFW_VULKAN_STATIC ON CACHE BOOL "GLFW vulkan static")
add_subdirectory(${GLFW_ROOT} ${GLFW_ROOT}) add_subdirectory(${GLFW_ROOT} ${GLFW_ROOT})
#--------------SLang------------------------------ #--------------SLang------------------------------
list(APPEND DEPENDENCIES slang) list(APPEND DEPENDENCIES slang)
string(TOLOWER release_${CMAKE_PLATFORM} SLANG_CONFIG) string(TOLOWER debug_${CMAKE_PLATFORM} SLANG_CONFIG)
if(WIN32) if(WIN32)
ExternalProject_Add(slang ExternalProject_Add(slang
SOURCE_DIR ${SLANG_ROOT} SOURCE_DIR ${SLANG_ROOT}
@@ -72,19 +73,13 @@ ExternalProject_Add(slang
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
BUILD_COMMAND msbuild slang.sln -p:Configuration=Release -p:Platform=${CMAKE_PLATFORM} BUILD_COMMAND msbuild slang.sln -p:Configuration=Release -p:Platform=${CMAKE_PLATFORM}
INSTALL_COMMAND "") INSTALL_COMMAND "")
set(SLANG_LIB_PATH ${SLANG_ROOT}/${SLANG_LIB_PATH})
elseif(UNIX) elseif(UNIX)
ExternalProject_Add(slang ExternalProject_Add(slang
SOURCE_DIR ${SLANG_ROOT} SOURCE_DIR ${SLANG_ROOT}
BINARY_DIR ${SLANG_ROOT}/lib BINARY_DIR ${SLANG_ROOT}/lib
CONFIGURE_COMMAND ${CMAKE_SOURCE_DIR}/premake5 --file=${CMAKE_SOURCE_DIR}/external/slang/premake5.lua gmake2 --build-location=build.linux CONFIGURE_COMMAND ${CMAKE_SOURCE_DIR}/premake5 --file=${CMAKE_SOURCE_DIR}/external/slang/premake5.lua gmake2 --build-location=build/linux
BUILD_COMMAND make -C ${CMAKE_SOURCE_DIR}/external/slang/build.linux config=${SLANG_CONFIG} BUILD_COMMAND make -C ${CMAKE_SOURCE_DIR}/external/slang/build/linux config=${SLANG_CONFIG}
INSTALL_COMMAND "") INSTALL_COMMAND "")
string(TOLOWER bin/linux-${CMAKE_PLATFORM}/Release/libslang.so SLANG_BINARY)
string(TOLOWER bin/linux-${CMAKE_PLATFORM}/Release/libslang-glslang.so SLANG_GLSLANG)
set(SLANG_LIB_PATH)
endif() endif()
@@ -28,14 +28,14 @@ private:
void setupFrustums(); void setupFrustums();
static constexpr uint32 BLOCK_SIZE = 8; static constexpr uint32 BLOCK_SIZE = 8;
static constexpr uint32 INDEX_LIGHT_ENV = 1; static constexpr uint32 INDEX_LIGHT_ENV = 1;
_declspec(align(16)) struct DispatchParams struct DispatchParams
{ {
glm::uvec3 numThreadGroups; glm::uvec3 numThreadGroups;
uint32_t pad0; uint32_t pad0;
glm::uvec3 numThreads; glm::uvec3 numThreads;
uint32_t pad1; uint32_t pad1;
} dispatchParams; } dispatchParams;
__declspec(align(16)) struct Plane struct Plane
{ {
Vector n; Vector n;
float d; float d;
@@ -43,7 +43,7 @@ private:
Vector p1; Vector p1;
Vector p2; Vector p2;
}; };
__declspec(align(16)) struct Frustum struct Frustum
{ {
Plane planes[4]; Plane planes[4];
}; };
+1 -1
View File
@@ -28,7 +28,7 @@ public:
virtual void createRenderPass() = 0; virtual void createRenderPass() = 0;
void setResources(PRenderGraphResources resources) { this->resources = resources; } void setResources(PRenderGraphResources resources) { this->resources = resources; }
protected: protected:
_declspec(align(16)) struct ViewParameter struct ViewParameter
{ {
Matrix4 viewMatrix; Matrix4 viewMatrix;
Matrix4 projectionMatrix; Matrix4 projectionMatrix;
@@ -1,10 +1,5 @@
target_sources(SeeleEngine target_sources(SeeleEngine
PRIVATE PRIVATE
NsightAftermathGpuCrashTracker.h
NsightAftermathGpuCrashTracker.cpp
NsightAftermathHelpers.h
NsightAftermathShaderDatabase.h
NsightAftermathShaderDatabase.cpp
VulkanAllocator.h VulkanAllocator.h
VulkanAllocator.cpp VulkanAllocator.cpp
VulkanBuffer.cpp VulkanBuffer.cpp
@@ -45,7 +45,7 @@ GpuCrashTracker::~GpuCrashTracker()
// If initialized, disable GPU crash dumps // If initialized, disable GPU crash dumps
if (m_initialized) if (m_initialized)
{ {
GFSDK_Aftermath_DisableGpuCrashDumps(); AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_DisableGpuCrashDumps());
} }
} }
@@ -91,7 +91,7 @@ void GpuCrashTracker::OnShaderDebugInfo(const void* pShaderDebugInfo, const uint
// Get shader debug information identifier // Get shader debug information identifier
GFSDK_Aftermath_ShaderDebugInfoIdentifier identifier = {}; GFSDK_Aftermath_ShaderDebugInfoIdentifier identifier = {};
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GetShaderDebugInfoIdentifier( AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GetShaderDebugInfoIdentifier(
GFSDK_Aftermath_Version_API, GFSDK_Aftermath_Version_API,
pShaderDebugInfo, pShaderDebugInfo,
shaderDebugInfoSize, shaderDebugInfoSize,
@@ -124,7 +124,7 @@ void GpuCrashTracker::WriteGpuCrashDumpToFile(const void* pGpuCrashDump, const u
{ {
// Create a GPU crash dump decoder object for the GPU crash dump. // Create a GPU crash dump decoder object for the GPU crash dump.
GFSDK_Aftermath_GpuCrashDump_Decoder decoder = {}; GFSDK_Aftermath_GpuCrashDump_Decoder decoder = {};
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GpuCrashDump_CreateDecoder( AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GpuCrashDump_CreateDecoder(
GFSDK_Aftermath_Version_API, GFSDK_Aftermath_Version_API,
pGpuCrashDump, pGpuCrashDump,
gpuCrashDumpSize, gpuCrashDumpSize,
@@ -133,19 +133,19 @@ void GpuCrashTracker::WriteGpuCrashDumpToFile(const void* pGpuCrashDump, const u
// Use the decoder object to read basic information, like application // Use the decoder object to read basic information, like application
// name, PID, etc. from the GPU crash dump. // name, PID, etc. from the GPU crash dump.
GFSDK_Aftermath_GpuCrashDump_BaseInfo baseInfo = {}; GFSDK_Aftermath_GpuCrashDump_BaseInfo baseInfo = {};
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GpuCrashDump_GetBaseInfo(decoder, &baseInfo)); AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GpuCrashDump_GetBaseInfo(decoder, &baseInfo));
// Use the decoder object to query the application name that was set // Use the decoder object to query the application name that was set
// in the GPU crash dump description. // in the GPU crash dump description.
uint32_t applicationNameLength = 0; uint32_t applicationNameLength = 0;
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GpuCrashDump_GetDescriptionSize( AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GpuCrashDump_GetDescriptionSize(
decoder, decoder,
GFSDK_Aftermath_GpuCrashDumpDescriptionKey_ApplicationName, GFSDK_Aftermath_GpuCrashDumpDescriptionKey_ApplicationName,
&applicationNameLength)); &applicationNameLength));
std::vector<char> applicationName(applicationNameLength, '\0'); std::vector<char> applicationName(applicationNameLength, '\0');
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GpuCrashDump_GetDescription( AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GpuCrashDump_GetDescription(
decoder, decoder,
GFSDK_Aftermath_GpuCrashDumpDescriptionKey_ApplicationName, GFSDK_Aftermath_GpuCrashDumpDescriptionKey_ApplicationName,
uint32_t(applicationName.size()), uint32_t(applicationName.size()),
@@ -176,7 +176,7 @@ void GpuCrashTracker::WriteGpuCrashDumpToFile(const void* pGpuCrashDump, const u
// Decode the crash dump to a JSON string. // Decode the crash dump to a JSON string.
// Step 1: Generate the JSON and get the size. // Step 1: Generate the JSON and get the size.
uint32_t jsonSize = 0; uint32_t jsonSize = 0;
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GpuCrashDump_GenerateJSON( AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GpuCrashDump_GenerateJSON(
decoder, decoder,
GFSDK_Aftermath_GpuCrashDumpDecoderFlags_ALL_INFO, GFSDK_Aftermath_GpuCrashDumpDecoderFlags_ALL_INFO,
GFSDK_Aftermath_GpuCrashDumpFormatterFlags_NONE, GFSDK_Aftermath_GpuCrashDumpFormatterFlags_NONE,
@@ -188,7 +188,7 @@ void GpuCrashTracker::WriteGpuCrashDumpToFile(const void* pGpuCrashDump, const u
&jsonSize)); &jsonSize));
// Step 2: Allocate a buffer and fetch the generated JSON. // Step 2: Allocate a buffer and fetch the generated JSON.
std::vector<char> json(jsonSize); std::vector<char> json(jsonSize);
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GpuCrashDump_GetJSON( AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GpuCrashDump_GetJSON(
decoder, decoder,
uint32_t(json.size()), uint32_t(json.size()),
json.data())); json.data()));
@@ -203,7 +203,7 @@ void GpuCrashTracker::WriteGpuCrashDumpToFile(const void* pGpuCrashDump, const u
} }
// Destroy the GPU crash dump decoder object. // Destroy the GPU crash dump decoder object.
AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GpuCrashDump_DestroyDecoder(decoder)); AFTERMATH_CHECK_ERROR(PFN_GFSDK_Aftermath_GpuCrashDump_DestroyDecoder(decoder));
} }
// Helper for writing shader debug information to a file // Helper for writing shader debug information to a file
@@ -414,7 +414,7 @@ void Graphics::setupDebugCallback()
VK_CHECK(CreateDebugReportCallbackEXT(instance, &createInfo, nullptr, &callback)); VK_CHECK(CreateDebugReportCallbackEXT(instance, &createInfo, nullptr, &callback));
crashTracker.Initialize(); //crashTracker.Initialize();
} }
void Graphics::pickPhysicalDevice() void Graphics::pickPhysicalDevice()
+1 -2
View File
@@ -1,7 +1,6 @@
#pragma once #pragma once
#include "VulkanGraphicsResources.h" #include "VulkanGraphicsResources.h"
#include "Graphics/Graphics.h" #include "Graphics/Graphics.h"
#include "NsightAftermathGpuCrashTracker.h"
namespace Seele namespace Seele
{ {
@@ -99,7 +98,7 @@ protected:
Map<uint32, PFramebuffer> allocatedFramebuffers; Map<uint32, PFramebuffer> allocatedFramebuffers;
PAllocator allocator; PAllocator allocator;
PStagingManager stagingManager; PStagingManager stagingManager;
GpuCrashTracker crashTracker; //GpuCrashTracker crashTracker;
friend class Window; friend class Window;
}; };
+1
View File
@@ -58,6 +58,7 @@ public:
} }
private: private:
Array<std::thread> workers; Array<std::thread> workers;
Map<JobStage, List<Job>> jobs;
void threadLoop(); void threadLoop();
}; };
static ThreadPool& getGlobalThreadPool(); static ThreadPool& getGlobalThreadPool();
+1 -1
View File
@@ -60,7 +60,7 @@ void RenderHierarchy::moveElement(PElement elementToMove, PElement newParent)
void RenderHierarchy::updateHierarchy() void RenderHierarchy::updateHierarchy()
{ {
Array<RenderHierarchyUpdate*> localUpdates; List<RenderHierarchyUpdate*> localUpdates;
{ // make a local copy of the updates so we dont hold the lock for too long { // make a local copy of the updates so we dont hold the lock for too long
std::lock_guard lock(updateLock); std::lock_guard lock(updateLock);
localUpdates = updates; localUpdates = updates;
+7
View File
@@ -26,12 +26,19 @@ struct AddElementRenderHierarchyUpdate : public RenderHierarchyUpdate
{ {
Element* addedElement; Element* addedElement;
Element* parent; Element* parent;
AddElementRenderHierarchyUpdate(Element* addedElement, Element* parent)
: addedElement(addedElement)
, parent(parent)
{}
virtual void apply(Array<RenderElement>& elements) override; virtual void apply(Array<RenderElement>& elements) override;
}; };
struct RemoveElementRenderHierarchyUpdate : public RenderHierarchyUpdate struct RemoveElementRenderHierarchyUpdate : public RenderHierarchyUpdate
{ {
Element* element; Element* element;
RemoveElementRenderHierarchyUpdate(Element* elementToRemove)
: element(elementToRemove)
{}
virtual void apply(Array<RenderElement>& elements) override; virtual void apply(Array<RenderElement>& elements) override;
}; };
-1
View File
@@ -1,5 +1,4 @@
#pragma once #pragma once
#include "Fibers/JobQueue.h"
namespace Seele namespace Seele
{ {