Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UE 5.5 crash with hardware ray tracing enabled #1550

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
#include <CesiumGltf/KhrTextureTransform.h>
#include <array>
#include <variant>

struct FCesiumFeatureIdSet;
Expand Down
6 changes: 6 additions & 0 deletions Source/CesiumRuntime/Private/CesiumGltfComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,12 @@ static void loadPrimitive(
LODResources.bHasReversedIndices = false;
LODResources.bHasReversedDepthOnlyIndices = false;

#if ENGINE_VERSION_5_5_OR_HIGHER
// UE 5.5 requires that we do this in order to avoid a crash when ray tracing
// is enabled.
RenderData->InitializeRayTracingRepresentationFromRenderingLODs();
#endif

primitiveResult.meshIndex = options.pMeshOptions->meshIndex;
primitiveResult.primitiveIndex = options.primitiveIndex;
primitiveResult.RenderData = std::move(RenderData);
Expand Down
2 changes: 2 additions & 0 deletions Source/CesiumRuntime/Public/CesiumCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "Runtime/Launch/Resources/Version.h"

#define ENGINE_VERSION_5_5_OR_HIGHER \
(ENGINE_MAJOR_VERSION > 5 || ENGINE_MINOR_VERSION >= 5)
#define ENGINE_VERSION_5_4_OR_HIGHER \
(ENGINE_MAJOR_VERSION > 5 || ENGINE_MINOR_VERSION >= 4)
#define ENGINE_VERSION_5_3_OR_HIGHER \
Expand Down