You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
Not doing so can result in the URuntimeMesh's GPU buffers sticking around for quite a while until the URuntimeMesh finally gets garbage-collected for being unreachable.
Copy-pasted from my comment on the Discord:
I fixed my DEVICE REMOVED, REASON: HUNG issues! As it turns out, the symptom of the error was a VRAM overflow. I was destroying the actor that held the mesh immediately when it wasn't required. The URuntimeMesh object that a URuntimeMeshProvider subclass maintains wasn't being Reset() until the garbage collector eventually got around to deleting unreachable objects (happens infrequently). So, between garbage collections, I was basically leaking VRAM at 100s of MB/s when being aggressive with it.
I fixed this by calling URuntimeMeshProvider::Shutdown() on my provider (which ends up calling URuntimeMesh::Reset() during its corresponding actor's EndPlay().
//.hUCLASS()
class SPACECRAFT_API APlanetQuadtreeSurface : public AActor
{
GENERATED_BODY()
private:
URuntimeMeshProviderCollision* collisionProvider;
//NOTE: can move back to public if necessary
PlanetContext context;
public:UPROPERTY(VisibleAnywhere)
URuntimeMeshComponent* runtimeMeshComp;
UPROPERTY(VisibleAnywhere)
URuntimeMesh* runtimeMesh;
UPROPERTY(VisibleAnywhere)
UPlanetSurfaceMeshProvider* surfaceProvider;
//.cppvoidAPlanetQuadtreeSurface::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
Super::EndPlay(EndPlayReason);
// Deallocating the mesh buffers is something we can't wait on the// UObject garbage collection to do.
surfaceProvider->Shutdown();
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Not doing so can result in the
URuntimeMesh
's GPU buffers sticking around for quite a while until theURuntimeMesh
finally gets garbage-collected for being unreachable.Copy-pasted from my comment on the Discord:
I fixed my DEVICE REMOVED, REASON: HUNG issues! As it turns out, the symptom of the error was a VRAM overflow. I was destroying the actor that held the mesh immediately when it wasn't required. The
URuntimeMesh
object that aURuntimeMeshProvider
subclass maintains wasn't beingReset()
until the garbage collector eventually got around to deleting unreachable objects (happens infrequently). So, between garbage collections, I was basically leaking VRAM at 100s of MB/s when being aggressive with it.I fixed this by calling
URuntimeMeshProvider::Shutdown()
on my provider (which ends up callingURuntimeMesh::Reset()
during its corresponding actor'sEndPlay()
.The text was updated successfully, but these errors were encountered: