ResourceState

sg_resource_state

The current state of a resource in its resource pool. Resources start in the INITIAL state, which means the pool slot is unoccupied and can be allocated. When a resource is created, first an id is allocated, and the resource pool slot is set to state ALLOC. After allocation, the resource is initialized, which may result in the VALID or FAILED state. The reason why allocation and initialization are separate is because some resource types (e.g. buffers and images) might be asynchronously initialized by the user application. If a resource which is not in the VALID state is attempted to be used for rendering, rendering operations will silently be dropped.

The special INVALID state is returned in sg_query_xxx_state() if no resource object exists for the provided resource id

Values

ValueMeaning
Initial
Alloc
Valid
Failed
Invalid

Meta