Class GPUResource
The base class for all GPU resources.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Graphics/GPUResource.h
Syntax
public class GPUResource : public ScriptingObject
Constructors
~GPUResource()
GPUResource()
GPUResource(const SpawnParams& params)
Initializes a new instance of the GPUResource class.
Declaration
public GPUResource(const SpawnParams& params)
Parameters
SpawnParams
params
The object initialization parameters. |
Fields
_memoryUsage
Declaration
protected uint64 _memoryUsage = 0
Field Value
uint64
|
_nameCapacity
Declaration
protected int32 _nameCapacity = 0
Field Value
int32
|
_namePtr
Declaration
protected Char* _namePtr = nullptr
Field Value
Char
|
_nameSize
Declaration
protected int32 _nameSize = 0
Field Value
int32
|
LastRenderTime
Declaration
public double LastRenderTime = -1
Field Value
double
|
Releasing
Action fired when resource GPU state gets released. All objects and async tasks using this resource should release references to this object nor use its data.
Declaration
public Action Releasing
Field Value
Action
|
Methods
GetMemoryUsage()
Gets amount of GPU memory used by this resource (in bytes). It's a rough estimation. GPU memory may be fragmented, compressed or sub-allocated so the actual memory pressure from this resource may vary (also depends on the current graphics backend).
Declaration
public uint64 GetMemoryUsage() const
Returns
uint64
|
GetName()
GetResourceType()
Gets the GPU resource type.
Declaration
public virtual GPUResourceType GetResourceType() const = 0
Returns
GPUResourceType
|
OnDeleteObject()
Deletes the object. Called by the ObjectsRemovalService. Can be overriden to provide custom logic per object (cleanup, etc.).
Declaration
public virtual void OnDeleteObject() override
Overrides
OnDeviceDispose()
Action called when GPU device is disposing.
Declaration
public virtual void OnDeviceDispose()
OnReleaseGPU()
Releases GPU resource data (implementation).
Declaration
protected virtual void OnReleaseGPU()
ReleaseGPU()
Releases GPU resource data.
Declaration
public void ReleaseGPU()
SetName(const StringView& name)
Sets the resource name.
Declaration
public void SetName(const StringView& name)
Parameters
StringView
name
|
ToString()
Gets the string representation of this object.
Declaration
public virtual String ToString() const override
Returns
String
|