mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-10 21:28:32 +09:00
[Fix] (DirectVulkan): make texture/renderbuffer GC reach every dead resource - name-deleted textures register via weak_from_this so first-sync-after-delete can no longer orphan a TextureResource, an orphan sweep makes GC authoritative over the resource map, dead-texture pruning moves to a frame-boundary gate (64 frames) so churn through clears/readbacks reclaims without draws, and dead renderbuffers age past frames-in-flight before their VkImage/view is destroyed instead of leaking until shutdown (or being freed while in flight)
This commit is contained in:
@@ -15,7 +15,11 @@
|
||||
#include <MG_Util/Math/VectorTypes.h>
|
||||
|
||||
namespace MobileGL::MG_State::GLState {
|
||||
class ITextureObject {
|
||||
// Texture objects are always SharedPtr-owned (TextureState creates every instance via
|
||||
// MakeShared, including the per-target default objects). enable_shared_from_this lets
|
||||
// backends that only receive a reference (e.g. syncing a name-deleted texture kept
|
||||
// alive by an FBO attachment) still register a weak liveness reference for GC.
|
||||
class ITextureObject : public std::enable_shared_from_this<ITextureObject> {
|
||||
public:
|
||||
using TargetEnum = TextureTarget;
|
||||
virtual ~ITextureObject() = default;
|
||||
|
||||
Reference in New Issue
Block a user