From 9ed4723e6e0b7c1bf0e00d77acb06932c3d7fea1 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 16 Oct 2023 17:37:26 +0200 Subject: [PATCH] Fix misc bugs --- src/lightmapper/doom_levelmesh.cpp | 2 ++ src/lightmapper/gpuraytracer.cpp | 5 +++-- thirdparty/ZVulkan/src/vulkanbuilders.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lightmapper/doom_levelmesh.cpp b/src/lightmapper/doom_levelmesh.cpp index af37dc6..3e4c0e5 100644 --- a/src/lightmapper/doom_levelmesh.cpp +++ b/src/lightmapper/doom_levelmesh.cpp @@ -16,6 +16,8 @@ DoomLevelMesh::DoomLevelMesh(FLevel& doomMap, int samples, int lmdims) StaticMesh = std::make_unique(); static_cast(StaticMesh.get())->CreateStatic(doomMap); + static_cast(StaticMesh.get())->PackLightmapAtlas(0); + static_cast(StaticMesh.get())->BindLightmapSurfacesToGeometry(doomMap); } int DoomLevelMesh::AddSurfaceLights(const LevelMeshSurface* surface, LevelMeshLight* list, int listMaxSize) diff --git a/src/lightmapper/gpuraytracer.cpp b/src/lightmapper/gpuraytracer.cpp index 4639847..49f10fb 100644 --- a/src/lightmapper/gpuraytracer.cpp +++ b/src/lightmapper/gpuraytracer.cpp @@ -46,14 +46,15 @@ void GPURaytracer::Raytrace(DoomLevelMesh* mesh) printf("."); raytrace->SetLevelMesh(mesh); lightmap->SetLevelMesh(mesh); - raytrace->BeginFrame(); - lightmap->BeginFrame(); // Keep baking until all surfaces have been processed while (true) { printf("."); + raytrace->BeginFrame(); + lightmap->BeginFrame(); + TArray surfaces; for (int i = 0, count = submesh->GetSurfaceCount(); i < count; i++) { diff --git a/thirdparty/ZVulkan/src/vulkanbuilders.cpp b/thirdparty/ZVulkan/src/vulkanbuilders.cpp index 90527f7..b0acae5 100644 --- a/thirdparty/ZVulkan/src/vulkanbuilders.cpp +++ b/thirdparty/ZVulkan/src/vulkanbuilders.cpp @@ -1680,7 +1680,6 @@ VulkanInstanceBuilder::VulkanInstanceBuilder() { apiVersionsToTry = { VK_API_VERSION_1_2, VK_API_VERSION_1_1, VK_API_VERSION_1_0 }; - OptionalExtension(VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME); OptionalExtension(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); } @@ -1701,6 +1700,7 @@ VulkanInstanceBuilder& VulkanInstanceBuilder::RequireSurfaceExtensions(bool enab if (enable) { RequireExtension(VK_KHR_SURFACE_EXTENSION_NAME); + OptionalExtension(VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME); #if defined(VK_USE_PLATFORM_WIN32_KHR) RequireExtension(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);