Description
The Common
field is a member of the ResourceState
enumeration within the Sandbox.Rendering
namespace. It represents a common state for GPU resources, typically used when a resource is not being accessed by the GPU in a specific way. This state is often used as a default or neutral state for resources.
Usage
Use the ResourceState.Common
when you need to set a GPU resource to a state where it is not being actively used by the GPU in a specific manner. This is useful for resources that are not currently involved in rendering or compute operations.
Example
// Example of setting a resource state to Common
ResourceState currentState = ResourceState.Common;
// Use this state in a resource barrier transition
// This is typically done when the resource is not actively used
// by the GPU in a specific operation
void TransitionResourceToCommon(Resource resource)
{
// Assuming 'resource' is a valid GPU resource
resource.TransitionState(ResourceState.Common);
}