diff --git a/.vscode/launch.json b/.vscode/launch.json index bb06894..870709b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -41,23 +41,22 @@ "request": "launch", "program": "${workspaceRoot}/build/Editor", "args": [], - "stopAtEntry": false, + "environment": [ + { + "name": "ASAN_OPTIONS", + "value": "alloc_dealloc_mismatch=0", + } + ], "cwd": "${workspaceRoot}/build", - "environment": [], - "externalConsole": false, "MIMode": "gdb", + "miDebuggerPath": "/usr/bin/gdb", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true - }, - { - "description": "Set Disassembly Flavor to Intel", - "text": "-gdb-set disassembly-flavor intel", - "ignoreFailures": true } - ] + ], }, ] } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 2691ea7..6458293 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -22,7 +22,7 @@ "lldb.showDisassembly": "auto", "lldb.dereferencePointers": true, "lldb.consoleMode": "commands", - "cmake.generator": "Ninja", + "cmake.generator": "Unix Makefiles", "editor.tabSize": 4, "slang.additionalSearchPaths": [ "res/shaders/", diff --git a/CMakeLists.txt b/CMakeLists.txt index 45784c1..4eaf9f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,8 @@ if(WIN32) set(VCPKG_BASE_FOLDER ${CMAKE_BINARY_DIR}/vcpkg_installed/x64-windows/) elseif(APPLE) set(VCPKG_BASE_FOLDER ${CMAKE_BINARY_DIR}/vcpkg_installed/arm64-osx/) +else() + set(VCPKG_BASE_FOLDER ${CMAKE_BINARY_DIR}/vcpkg_installed/x64-linux/) endif() set(Boost_NO_WARN_NEW_VERSIONS 1) @@ -81,6 +83,9 @@ if(WIN32) target_link_libraries(Engine PUBLIC ${VCPKG_BASE_FOLDER}/lib/slang.lib) elseif(APPLE) target_link_libraries(Engine PUBLIC ${VCPKG_BASE_FOLDER}/debug/lib/libslang.dylib) +else() + target_link_libraries(Engine PUBLIC ${VCPKG_BASE_FOLDER}/lib/libslang.so) + target_link_libraries(Engine PUBLIC ${VCPKG_BASE_FOLDER}/lib/libslang-glslang.so) endif() if(APPLE) diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..a332214 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,54 @@ +{ + "version": 3, + "cmakeMinimumRequired": { + "major": 3, + "minor": 19, + "patch": 0 + }, + "configurePresets": [ + { + "name": "default", + "displayName": "Default (Release)", + "description": "Release build without sanitizers", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "default-asan", + "displayName": "Default (Release + ASan)", + "description": "Release build with Address Sanitizer", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_CXX_FLAGS": "-fsanitize=address -fno-omit-frame-pointer", + "CMAKE_C_FLAGS": "-fsanitize=address -fno-omit-frame-pointer", + "CMAKE_EXE_LINKER_FLAGS": "-fsanitize=address", + "CMAKE_SHARED_LINKER_FLAGS": "-fsanitize=address" + } + }, + { + "name": "debug", + "displayName": "Debug (no ASan)", + "description": "Debug build without sanitizers", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "debug-asan", + "displayName": "Debug (ASan)", + "description": "Debug build with Address Sanitizer", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_CXX_FLAGS": "-fsanitize=address -fno-omit-frame-pointer", + "CMAKE_C_FLAGS": "-fsanitize=address -fno-omit-frame-pointer", + "CMAKE_EXE_LINKER_FLAGS": "-fsanitize=address", + "CMAKE_SHARED_LINKER_FLAGS": "-fsanitize=address" + } + } + ] +} \ No newline at end of file diff --git a/cmake-variants.json b/cmake-variants.json deleted file mode 100644 index b95b28d..0000000 --- a/cmake-variants.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "buildType": { - "default": "debug", - "description": "Configuration Type", - "choices": { - "asan": { - "short": "ASan", - "long": "Address Sanitizer", - "buildType": "Asan" - }, - "debug": { - "short": "Debug", - "long": "Enable debugging and validation", - "buildType": "Debug" - }, - "release": { - "short": "Release", - "long": "Optimize binary for speed", - "buildType": "Release" - }, - "relwithdebinfo": { - "short": "RelWithDebInfo", - "long": "Release with debug symbols", - "buildType": "RelWithDebInfo" - }, - "minsizerel": { - "short": "MinSizeRel", - "long": "Minimal size Release", - "buildType": "MinSizeRel" - } - } - }, - "architecture": { - "default": "x64", - "description": "Platform Architecture", - "choices": { - "x64": { - "short": "x64", - "long": "amd64 platform", - "settings": { - "CMAKE_PLATFORM": "x64" - } - }, - "arm64": { - "short": "arm64", - "long": "arm64 platform", - "settings": { - "CMAKE_PLATFORM": "arm64" - } - } - } - } -} \ No newline at end of file diff --git a/res/shaders/FullscreenQuad.slang b/res/shaders/FullScreenQuad.slang similarity index 100% rename from res/shaders/FullscreenQuad.slang rename to res/shaders/FullScreenQuad.slang diff --git a/src/Editor/main.cpp b/src/Editor/main.cpp index bbdc059..0eda3f6 100644 --- a/src/Editor/main.cpp +++ b/src/Editor/main.cpp @@ -66,7 +66,7 @@ int main() { // .importPath = "sponza", //}); AssetImporter::importMesh(MeshImportArgs{ - .filePath = sourcePath / "import" / "models" / "rttest.glb", + .filePath = sourcePath / "import" / "models" / "rttest.gltf", .importPath = "rttest", }); diff --git a/src/Engine/Asset/AssetRegistry.cpp b/src/Engine/Asset/AssetRegistry.cpp index 1dc9714..43e383d 100644 --- a/src/Engine/Asset/AssetRegistry.cpp +++ b/src/Engine/Asset/AssetRegistry.cpp @@ -13,6 +13,7 @@ #include #include #include +#include using namespace Seele; diff --git a/src/Engine/Containers/Array.h b/src/Engine/Containers/Array.h index cd534d4..81f6985 100644 --- a/src/Engine/Containers/Array.h +++ b/src/Engine/Containers/Array.h @@ -4,6 +4,7 @@ #include "MemoryResource.h" #include #include +#include #include #include #include @@ -423,6 +424,7 @@ template struct Array { } arraySize = newSize; } else { + size_t oldSize = allocated; allocated = calculateGrowth(newSize); // The array is not big enough, so we make a new one T* newData = allocateArray(allocated); @@ -438,7 +440,7 @@ template struct Array { std::allocator_traits::construct(allocator, &newData[i], value); } } - deallocateArray(_data, allocated); + deallocateArray(_data, oldSize); arraySize = newSize; _data = newData; } @@ -520,6 +522,7 @@ template struct StaticArray { beginIt = iterator(_data); endIt = iterator(_data + N); } + constexpr StaticArray(T value) { for (size_t i = 0; i < N; ++i) { _data[i] = value; @@ -527,6 +530,7 @@ template struct StaticArray { beginIt = iterator(_data); endIt = iterator(_data + N); } + constexpr StaticArray(std::initializer_list init) { auto beg = init.begin(); for (size_t i = 0; i < N; ++i) { diff --git a/src/Engine/Containers/MemoryResource.cpp b/src/Engine/Containers/MemoryResource.cpp index 5fb97fc..26cb564 100644 --- a/src/Engine/Containers/MemoryResource.cpp +++ b/src/Engine/Containers/MemoryResource.cpp @@ -1,6 +1,7 @@ #include "MemoryResource.h" #include "Map.h" #include +#include using namespace Seele; diff --git a/src/Engine/Graphics/Initializer.h b/src/Engine/Graphics/Initializer.h index 9191db6..dcdb6b1 100644 --- a/src/Engine/Graphics/Initializer.h +++ b/src/Engine/Graphics/Initializer.h @@ -22,7 +22,7 @@ struct GraphicsInitializer { void* windowHandle; GraphicsInitializer() - : applicationName("SeeleEngine"), engineName("SeeleEngine"), windowLayoutFile(nullptr), layers{"VK_LAYER_LUNARG_monitor"}, + : applicationName("SeeleEngine"), engineName("SeeleEngine"), windowLayoutFile(nullptr), layers{}, instanceExtensions{}, deviceExtensions{"VK_KHR_swapchain"}, windowHandle(nullptr) {} }; struct WindowCreateInfo { diff --git a/src/Engine/Graphics/Shader.cpp b/src/Engine/Graphics/Shader.cpp index 898370d..d7aa132 100644 --- a/src/Engine/Graphics/Shader.cpp +++ b/src/Engine/Graphics/Shader.cpp @@ -4,6 +4,7 @@ #include "Material/Material.h" #include "ThreadPool.h" #include +#include using namespace Seele; using namespace Seele::Gfx; diff --git a/src/Engine/Graphics/StaticMeshVertexData.cpp b/src/Engine/Graphics/StaticMeshVertexData.cpp index 386e68c..519ab47 100644 --- a/src/Engine/Graphics/StaticMeshVertexData.cpp +++ b/src/Engine/Graphics/StaticMeshVertexData.cpp @@ -4,6 +4,7 @@ #include "Graphics/VertexData.h" #include "Mesh.h" #include +#include using namespace Seele; diff --git a/src/Engine/Graphics/VertexData.cpp b/src/Engine/Graphics/VertexData.cpp index 546d089..7f86c84 100644 --- a/src/Engine/Graphics/VertexData.cpp +++ b/src/Engine/Graphics/VertexData.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include using namespace Seele; diff --git a/src/Engine/Graphics/Vulkan/Descriptor.cpp b/src/Engine/Graphics/Vulkan/Descriptor.cpp index 77187b1..4048369 100644 --- a/src/Engine/Graphics/Vulkan/Descriptor.cpp +++ b/src/Engine/Graphics/Vulkan/Descriptor.cpp @@ -11,6 +11,7 @@ #include "Texture.h" #include "vulkan/vulkan_core.h" #include +#include #include using namespace Seele; @@ -201,7 +202,9 @@ DescriptorSet::DescriptorSet(PGraphics graphics, PDescriptorPool owner) boundResources.resize(owner->getLayout()->getBindings().size()); for (uint32 i = 0; i < boundResources.size(); ++i) { boundResources[i].resize(owner->getLayout()->getBindings()[i].descriptorCount); - std::memset(boundResources[i].data(), 0, sizeof(PCommandBoundResource) * boundResources[i].size()); + for (size_t x = 0; x < boundResources[i].size(); ++x) { + boundResources[i][x] = nullptr; + } } constantData.resize(owner->getLayout()->constantsSize); } @@ -220,7 +223,7 @@ void DescriptorSet::updateBuffer(const std::string& mappingName, uint32 index, G // if the buffer is empty if (vulkanBuffer->getAlloc() == nullptr) return; - + bufferInfos.add(VkDescriptorBufferInfo{ .buffer = vulkanBuffer->getHandle(), .offset = 0, @@ -247,7 +250,6 @@ void DescriptorSet::updateBuffer(const std::string& mappingName, uint32 index, G // if the buffer is empty if (vulkanBuffer->getAlloc() == nullptr) return; - bufferInfos.add(VkDescriptorBufferInfo{ .buffer = vulkanBuffer->getHandle(), diff --git a/src/Engine/Graphics/Vulkan/Framebuffer.h b/src/Engine/Graphics/Vulkan/Framebuffer.h index c061b05..6e1fbf9 100644 --- a/src/Engine/Graphics/Vulkan/Framebuffer.h +++ b/src/Engine/Graphics/Vulkan/Framebuffer.h @@ -10,11 +10,11 @@ struct FramebufferDescription { StaticArray inputAttachments; StaticArray colorAttachments; StaticArray resolveAttachments; - VkImageView depthAttachment; - VkImageView depthResolveAttachment; - uint32 numInputAttachments; - uint32 numColorAttachments; - uint32 numResolveAttachments; + VkImageView depthAttachment = VK_NULL_HANDLE; + VkImageView depthResolveAttachment = VK_NULL_HANDLE; + uint32 numInputAttachments = 0; + uint32 numColorAttachments = 0; + uint32 numResolveAttachments = 0; }; class Framebuffer { public: diff --git a/src/Engine/Graphics/Vulkan/Graphics.cpp b/src/Engine/Graphics/Vulkan/Graphics.cpp index f127628..6b7cad6 100644 --- a/src/Engine/Graphics/Vulkan/Graphics.cpp +++ b/src/Engine/Graphics/Vulkan/Graphics.cpp @@ -18,6 +18,7 @@ #include "Window.h" #include #include +#include #include #define VMA_IMPLEMENTATION @@ -171,9 +172,9 @@ Gfx::OViewport Graphics::createViewport(Gfx::PWindow owner, const ViewportCreate return new Viewport(owner, viewportInfo); } -Gfx::ORenderPass Graphics::createRenderPass(Gfx::RenderTargetLayout layout, Array dependencies, URect renderArea, std::string name, - Array viewMasks, Array correlationMasks) { - // todo: re-introduce render area to renderpass +Gfx::ORenderPass Graphics::createRenderPass(Gfx::RenderTargetLayout layout, Array dependencies, URect renderArea, + std::string name, Array viewMasks, Array correlationMasks) { + // todo: re-introduce render area to renderpass return new RenderPass(this, std::move(layout), std::move(dependencies), name, std::move(viewMasks), std::move(correlationMasks)); } void Graphics::beginRenderPass(Gfx::PRenderPass renderPass) { @@ -284,9 +285,7 @@ Gfx::PComputePipeline Graphics::createComputePipeline(Gfx::ComputePipelineCreate return pipelineCache->createPipeline(std::move(createInfo)); } -Gfx::OSampler Graphics::createSampler(const SamplerCreateInfo& createInfo) { - return new Sampler(this, createInfo); -} +Gfx::OSampler Graphics::createSampler(const SamplerCreateInfo& createInfo) { return new Sampler(this, createInfo); } Gfx::ODescriptorLayout Graphics::createDescriptorLayout(const std::string& name) { return new DescriptorLayout(this, name); } @@ -450,7 +449,7 @@ void Graphics::buildBottomLevelAccelerationStructures(Array }; Array matrices; - for (const auto gfxBlas : data) { + for (const auto& gfxBlas : data) { const auto blas = gfxBlas.cast(); matrices.add(blas->getTransform()); } @@ -765,11 +764,15 @@ void Graphics::pickPhysicalDevice() { physicalDevice = bestDevice; vkGetPhysicalDeviceProperties2(physicalDevice, &props); + bufferDeviceAddressFeatures = { + .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES, + .pNext = nullptr, + .bufferDeviceAddress = true, + }; rayTracingFeatures = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR, - .pNext = nullptr, + .pNext = &bufferDeviceAddressFeatures, .rayTracingPipeline = true, - .rayTraversalPrimitiveCulling = true, }; accelerationFeatures = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR, @@ -780,6 +783,8 @@ void Graphics::pickPhysicalDevice() { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT, .taskShader = true, .meshShader = true, + .multiviewMeshShader = true, + .primitiveFragmentShadingRateMeshShader = false, .meshShaderQueries = true, }; features12 = { @@ -825,6 +830,11 @@ void Graphics::pickPhysicalDevice() { }; bool rayTracingPipelineSupport = false; bool accelerationStructureSupport = false; + bool hostOperationsSupport = false; + bool deviceAddressSupport = false; + bool descriptorIndexingSupport = false; + bool spirv14Support = false; + bool shaderFloatControls = false; uint32 count = 0; vkEnumerateDeviceExtensionProperties(physicalDevice, NULL, &count, nullptr); Array extensionProps(count); @@ -833,7 +843,6 @@ void Graphics::pickPhysicalDevice() { if (Gfx::useMeshShading) { if (std::strcmp(VK_EXT_MESH_SHADER_EXTENSION_NAME, extensionProps[i].extensionName) == 0) { meshShadingEnabled = true; - break; } } if (std::strcmp(VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME, extensionProps[i].extensionName) == 0) { @@ -842,8 +851,24 @@ void Graphics::pickPhysicalDevice() { if (std::strcmp(VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME, extensionProps[i].extensionName) == 0) { accelerationStructureSupport = true; } + if (std::strcmp(VK_KHR_DEFERRED_HOST_OPERATIONS_EXTENSION_NAME, extensionProps[i].extensionName) == 0) { + hostOperationsSupport = true; + } + if (std::strcmp(VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME, extensionProps[i].extensionName) == 0) { + deviceAddressSupport = true; + } + if (std::strcmp(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, extensionProps[i].extensionName) == 0) { + descriptorIndexingSupport = true; + } + if (std::strcmp(VK_KHR_SPIRV_1_4_EXTENSION_NAME, extensionProps[i].extensionName) == 0) { + spirv14Support = true; + } + if (std::strcmp(VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME, extensionProps[i].extensionName) == 0) { + shaderFloatControls = true; + } } - rayTracingEnabled = rayTracingPipelineSupport && accelerationStructureSupport; + rayTracingEnabled = rayTracingPipelineSupport && accelerationStructureSupport && hostOperationsSupport && deviceAddressSupport && + descriptorIndexingSupport && spirv14Support && shaderFloatControls; if (meshShadingEnabled) { features12.pNext = &meshShaderFeatures; } @@ -927,9 +952,17 @@ void Graphics::createDevice(GraphicsInitializer initializer) { initializer.deviceExtensions.add(VK_EXT_MESH_SHADER_EXTENSION_NAME); } if (supportRayTracing()) { + // ray tracing itself initializer.deviceExtensions.add(VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME); initializer.deviceExtensions.add(VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME); + // required by acceleration_structure initializer.deviceExtensions.add(VK_KHR_DEFERRED_HOST_OPERATIONS_EXTENSION_NAME); + initializer.deviceExtensions.add(VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME); + initializer.deviceExtensions.add(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME); + // required for ray tracing pipeline + initializer.deviceExtensions.add(VK_KHR_SPIRV_1_4_EXTENSION_NAME); + // required for spirv_1_4 + initializer.deviceExtensions.add(VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME); } initializer.deviceExtensions.add(VK_KHR_MULTIVIEW_EXTENSION_NAME); #ifdef __APPLE__ diff --git a/src/Engine/Graphics/Vulkan/Graphics.h b/src/Engine/Graphics/Vulkan/Graphics.h index 535026e..f7bab83 100644 --- a/src/Engine/Graphics/Vulkan/Graphics.h +++ b/src/Engine/Graphics/Vulkan/Graphics.h @@ -9,6 +9,35 @@ DECLARE_REF(CommandPool) DECLARE_REF(Queue) DECLARE_REF(PipelineCache) DECLARE_REF(Framebuffer) + +template +concept chainable_struct = requires(T t) { t.pNext; }; +template struct StructChain; +template <> struct StructChain<> { +}; +template struct StructChain : StructChain<> { + StructChain(Base b):b(b) {} + StructChain(const StructChain<>&, Base b) : b(b) {} + template StructChain append(Next next) { return StructChain(*this, next); } + Base b; + Base& operator*(){ + return b; + } +}; +template struct StructChain : StructChain { + StructChain(const StructChain& parent, This t) : StructChain(parent), t(t) {} + template StructChain append(Next next) { + return StructChain(*this, next); + } + auto& operator*() { + auto& base = StructChain::operator*(); + t.pNext = base.pNext; + base.pNext = &t; + return base; + } + This t; +}; + class Graphics : public Gfx::Graphics { public: Graphics(); @@ -34,8 +63,8 @@ class Graphics : public Gfx::Graphics { virtual Gfx::OWindow createWindow(const WindowCreateInfo& createInfo) override; virtual Gfx::OViewport createViewport(Gfx::PWindow owner, const ViewportCreateInfo& createInfo) override; - virtual Gfx::ORenderPass createRenderPass(Gfx::RenderTargetLayout layout, Array dependencies, URect renderArea, std::string name, - Array viewMasks, Array correlationMasks) override; + virtual Gfx::ORenderPass createRenderPass(Gfx::RenderTargetLayout layout, Array dependencies, URect renderArea, + std::string name, Array viewMasks, Array correlationMasks) override; virtual void beginRenderPass(Gfx::PRenderPass renderPass) override; virtual void endRenderPass() override; virtual void waitDeviceIdle() override; @@ -117,16 +146,20 @@ class Graphics : public Gfx::Graphics { thread_local static PCommandPool transferCommands; std::mutex poolLock; Array pools; + VkQueueFamilyProperties graphicsProps; + VkPhysicalDeviceProperties2 props; + VkPhysicalDeviceRayTracingPipelinePropertiesKHR rayTracingProperties; + VkPhysicalDeviceAccelerationStructurePropertiesKHR accelerationProperties; + VkPhysicalDeviceFeatures2 features; VkPhysicalDeviceVulkan11Features features11; VkPhysicalDeviceVulkan12Features features12; VkPhysicalDeviceMeshShaderFeaturesEXT meshShaderFeatures; + VkPhysicalDeviceBufferDeviceAddressFeatures bufferDeviceAddressFeatures; VkPhysicalDeviceAccelerationStructureFeaturesKHR accelerationFeatures; - VkPhysicalDeviceAccelerationStructurePropertiesKHR accelerationProperties; VkPhysicalDeviceRayTracingPipelineFeaturesKHR rayTracingFeatures; - VkPhysicalDeviceRayTracingPipelinePropertiesKHR rayTracingProperties; VkDebugUtilsMessengerEXT callback; Map allocatedFramebuffers; VmaAllocator allocator; diff --git a/src/Engine/Graphics/Vulkan/Query.h b/src/Engine/Graphics/Vulkan/Query.h index b4122b0..f887000 100644 --- a/src/Engine/Graphics/Vulkan/Query.h +++ b/src/Engine/Graphics/Vulkan/Query.h @@ -2,6 +2,7 @@ #include "Buffer.h" #include "Graphics.h" #include "Graphics/Query.h" +#include namespace Seele { namespace Vulkan { diff --git a/src/Engine/Graphics/Vulkan/Queue.cpp b/src/Engine/Graphics/Vulkan/Queue.cpp index 0517a6a..199b56e 100644 --- a/src/Engine/Graphics/Vulkan/Queue.cpp +++ b/src/Engine/Graphics/Vulkan/Queue.cpp @@ -3,7 +3,7 @@ #include "Command.h" #include "Enums.h" #include "Graphics.h" - +#include using namespace Seele; using namespace Seele::Vulkan; diff --git a/src/Engine/Graphics/Vulkan/RayTracing.h b/src/Engine/Graphics/Vulkan/RayTracing.h index c7dcb26..e007eac 100644 --- a/src/Engine/Graphics/Vulkan/RayTracing.h +++ b/src/Engine/Graphics/Vulkan/RayTracing.h @@ -43,7 +43,7 @@ class TopLevelAS : public Gfx::TopLevelAS { public: TopLevelAS(PGraphics graphics, const Gfx::TopLevelASCreateInfo& createInfo); ~TopLevelAS(); - const VkAccelerationStructureKHR getHandle() const { return handle; } + VkAccelerationStructureKHR getHandle() const { return handle; } private: PGraphics graphics; diff --git a/src/Engine/Graphics/Vulkan/RenderPass.cpp b/src/Engine/Graphics/Vulkan/RenderPass.cpp index 2a8374a..724b9ac 100644 --- a/src/Engine/Graphics/Vulkan/RenderPass.cpp +++ b/src/Engine/Graphics/Vulkan/RenderPass.cpp @@ -215,7 +215,6 @@ RenderPass::~RenderPass() { uint32 RenderPass::getFramebufferHash() { FramebufferDescription description; - std::memset(&description, 0, sizeof(FramebufferDescription)); for (auto& inputAttachment : layout.inputAttachments) { PTextureBase tex = inputAttachment.getTexture().cast(); description.inputAttachments[description.numInputAttachments++] = tex->getView(); diff --git a/src/Engine/System/CameraUpdater.cpp b/src/Engine/System/CameraUpdater.cpp index 3851527..2590f52 100644 --- a/src/Engine/System/CameraUpdater.cpp +++ b/src/Engine/System/CameraUpdater.cpp @@ -8,6 +8,4 @@ CameraUpdater::CameraUpdater(PScene scene) : ComponentSystem #include +#include namespace Seele { class ThreadPool { diff --git a/vcpkg.json b/vcpkg.json index 31abe54..54bb3be 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,5 +1,6 @@ { "dependencies": [ + "vulkan", "assimp", "entt", "stb",