IResource

Description

interface Tinman.Terrain.Rendering.IResource

Base interface for classes that wrap GPU resources.

The amount of memory reported by IMemoryConsumption.MemoryConsumption is interpreted as the estimated amount of GPU memory that is consumed by this resource. It may be used to make large-scale resource decisions but must not be used to decide upfront whether a resource creation attempt will succeed or fail.

Passing an invalid resource object (see LifecycleState) to the graphics API will result in an TinmanException to be thrown.

Disposing a resource object while Binding1 returns true is invalid. An error log message will be generated in this case and the subsequent behaviour of the graphics API is implementation-specific and may even be undefined.

Disposing a resource object after all graphics API bindings have been nullified is valid, as the graphics API implementation is responsible for keeping native GPU resources alive until all pending GPU work has finished.

Public / Methods

Binding

2 overloads


public method Binding1 → ()

returns → bool

true if there is at least one graphics API binding,
false if this resource object is not bound to the graphics API.

Checks if there is at least one graphics API binding for this resource object.


public method Binding2 → (1)

balance in : int32

The binding counter delta.

Updates the graphics API binding counter of this resource object.

Public / Attributes

Access​Pattern


[Constant]
public attribute AccessPattern → (get)

value : ResourceAccessPattern

The access pattern.

Returns the access pattern of this GPU resource.

Name


public attribute Name → (get,set)

value : string

The name or null.

A human-readable name for debugging and testing.

Type


[Constant]
public attribute Type → (get)

value : string

[not-empty]
The human-readable resource type name.

Returns a human-readable name for the type of this resource.

Extensions

Assert​Dynamic


public static method AssertDynamic → (1)

source in : string

The error source tag.

Assert​Not​Static


public static method AssertNotStatic → (1)

source in : string

The error source tag.

Name​Prefix


public static method NamePrefix → (1)

prefix in : string

The prefix to add or null.

returns → IResource

this

Updates the name of this resource by adding the given prefix in.