From 194d5fcf87360674acfe4caf35d9fd8ac00191d9 Mon Sep 17 00:00:00 2001 From: RaveYard <29225776+MrRaveYard@users.noreply.github.com> Date: Mon, 4 Sep 2023 02:53:00 +0200 Subject: [PATCH] Fix use of uninitialized variables boundsMin and boundsMax --- src/common/rendering/hwrenderer/data/hw_levelmesh.h | 1 - src/common/rendering/vulkan/accelstructs/vk_lightmap.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/common/rendering/hwrenderer/data/hw_levelmesh.h b/src/common/rendering/hwrenderer/data/hw_levelmesh.h index e837c2d119..c537f8ae36 100644 --- a/src/common/rendering/hwrenderer/data/hw_levelmesh.h +++ b/src/common/rendering/hwrenderer/data/hw_levelmesh.h @@ -79,7 +79,6 @@ struct LevelMeshSurface // TArray verts; TArray uvs; - FVector3 boundsMin, boundsMax; // Touching light sources std::vector LightList; diff --git a/src/common/rendering/vulkan/accelstructs/vk_lightmap.cpp b/src/common/rendering/vulkan/accelstructs/vk_lightmap.cpp index 20fecba8e1..7334fa4954 100644 --- a/src/common/rendering/vulkan/accelstructs/vk_lightmap.cpp +++ b/src/common/rendering/vulkan/accelstructs/vk_lightmap.cpp @@ -102,8 +102,8 @@ void VkLightmap::RenderAtlasImage(size_t pageIndex) // Paint all surfaces part of the smoothing group into the surface for (LevelMeshSurface* surface : mesh->SmoothingGroups[targetSurface->smoothingGroupIndex].surfaces) { - FVector2 minUV = ToUV(surface->boundsMin, targetSurface); - FVector2 maxUV = ToUV(surface->boundsMax, targetSurface); + FVector2 minUV = ToUV(surface->bounds.min, targetSurface); + FVector2 maxUV = ToUV(surface->bounds.max, targetSurface); if (surface != targetSurface && (maxUV.X < 0.0f || maxUV.Y < 0.0f || minUV.X > 1.0f || minUV.Y > 1.0f)) continue; // Bounding box not visible