Description
The AllShaderResource
field is a member of the ResourceState
enumeration within the Sandbox.Rendering
namespace. It represents a state where a GPU resource is accessible by all shader stages. This state is typically used when a resource needs to be read by any shader stage without restrictions.
Usage
Use the AllShaderResource
state when you need a resource to be available for reading by all shader stages. This is useful in scenarios where a resource is shared across multiple shaders and needs to be accessed without transitioning between different states for each shader stage.
Example
// Example of setting a resource state to AllShaderResource
ResourceState currentState = ResourceState.AllShaderResource;
// Use this state when binding a resource to a shader
// This ensures the resource is accessible by all shader stages
BindResourceToShader(resource, currentState);