Class ManagedResource

java.lang.Object
icyllis.arc3d.core.RefCnt
icyllis.arc3d.engine.ManagedResource
All Implemented Interfaces:
RefCounted
Direct Known Subclasses:
ComputePipeline, Framebuffer, GLProgram, GLTextureView, GLUniformBuffer, GLVertexArray, GraphicsPipeline, RecycledResource, VulkanCommandPool, VulkanImageView, VulkanRenderPassFramebuffer

public abstract class ManagedResource extends RefCnt
Base class for operating GPU resources that may be shared by multiple objects, in particular objects that are tracked by a command buffer. Unlike Resource, these resources will not have a large memory allocation, but a set of constant states instead. When an existing owner wants to share a reference, it calls RefCnt.ref(). When an owner wants to release its reference, it calls RefCnt.unref(). When the shared object's reference count goes to zero as the result of an RefCnt.unref() call, its RefCnt.deallocate() is called. It is an error for the destructor to be called explicitly (or via the object going out of scope on the stack or calling RefCnt.deallocate()) if RefCnt.getRefCnt() > 1.
  • Constructor Details

    • ManagedResource

      public ManagedResource(Device device)
  • Method Details

    • getDevice

      protected Device getDevice()