# GetData<T>(int)

> Fetches the data of a successful request.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Rendering](/engine/6000.6/script-reference/unityengine/rendering.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public NativeArray<T> GetData<T>(int layer = 0) where T : struct
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the layer to retrieve.

### Returns

| Type                                                                                 | Description |
| ------------------------------------------------------------------------------------ | ----------- |
| [NativeArray\<T>](/engine/6000.6/script-reference/unity/collections/nativearray1.md) |             |

### Remarks

This method throws an InvalidOperationException if called when the request has not been fulfilled or has been disposed of. If the request is still pending then calling [AsyncGPUReadbackRequest.done](/engine/6000.6/script-reference/unityengine/rendering/asyncgpureadbackrequest/done.md) on this request will return false. In the case of a request not completing successfully, or if it has been disposed of then calling [AsyncGPUReadbackRequest.hasError](/engine/6000.6/script-reference/unityengine/rendering/asyncgpureadbackrequest/haserror.md) on this request will return true. Layer index allows you to access the different request slices of a [Texture3D](/engine/6000.6/script-reference/unityengine/texture3d.md),TextureCube,[Texture2DArray](/engine/6000.6/script-reference/unityengine/texture2darray.md) and TextureCubeArray.
