# RequestIntoNativeArray

> Retrieves data asynchronously from a GPU Graphics Buffer resource.

## Definition

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

## RequestIntoNativeArray\<T>(NativeArray\<T>, ComputeBuffer, Action\<AsyncGPUReadbackRequest>)

Retrieves data asynchronously from a GPU Graphics Buffer resource.

```csharp
public static AsyncGPUReadbackRequest RequestIntoNativeArray<T>(ref NativeArray<T> output, ComputeBuffer src, Action<AsyncGPUReadbackRequest> callback = null) where T : struct
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): Reference to the NativeArray to write the data into. The NativeArray or underlying memory cannot be Disposed until the request is complete.**** (\[ComputeBuffer]\(/engine/6000.0/script-reference/unityengine/computebuffer)): The [GraphicsBuffer](/engine/6000.0/script-reference/unityengine/graphicsbuffer.md) to read the data from.**** (\[Action\<AsyncGPUReadbackRequest>]\(https\://learn.microsoft.com/dotnet/api/system.action)): An optional delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

### Returns

| Type                                                                                                        | Description                                                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) | Returns an [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) that you can use to determine when the data is available. Otherwise, returns a request with an error. |

### Remarks

If the return value is a request with an error, calling [AsyncGPUReadbackRequest.hasError](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest/haserror.md) returns true.

For texture data, the extents are checked against the size of the source texture. If graphics [QualitySettings](/engine/6000.0/script-reference/unityengine/qualitysettings.md) are set low enough to generate reduced size textures, then the reduced size must be requested. Use [QualitySettings.masterTextureLimit](/engine/6000.0/script-reference/unityengine/qualitysettings/mastertexturelimit.md) to adjust the width and height (and x,y if required), by bit shifting right.

For texture data, use the [SystemInfo.IsFormatSupported](/engine/6000.0/script-reference/unityengine/systeminfo/isformatsupported.md) method with the [GraphicsFormatUsage.ReadPixels](/engine/6000.0/script-reference/unityengine/experimental/rendering/graphicsformatusage/readpixels.md) flag to query if the format is supported.

## RequestIntoNativeArray\<T>(NativeArray\<T>, ComputeBuffer, int, int, Action\<AsyncGPUReadbackRequest>)

Retrieves data asynchronously from a GPU Graphics Buffer resource.

```csharp
public static AsyncGPUReadbackRequest RequestIntoNativeArray<T>(ref NativeArray<T> output, ComputeBuffer src, int size, int offset, Action<AsyncGPUReadbackRequest> callback = null) where T : struct
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): Reference to the NativeArray to write the data into. The NativeArray or underlying memory cannot be Disposed until the request is complete.**** (\[ComputeBuffer]\(/engine/6000.0/script-reference/unityengine/computebuffer)): The [GraphicsBuffer](/engine/6000.0/script-reference/unityengine/graphicsbuffer.md) to read the data from.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The size, in bytes, of the data to retrieve from the [GraphicsBuffer](/engine/6000.0/script-reference/unityengine/graphicsbuffer.md).**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Offset in bytes in the [GraphicsBuffer](/engine/6000.0/script-reference/unityengine/graphicsbuffer.md).**** (\[Action\<AsyncGPUReadbackRequest>]\(https\://learn.microsoft.com/dotnet/api/system.action)): An optional delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

### Returns

| Type                                                                                                        | Description                                                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) | Returns an [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) that you can use to determine when the data is available. Otherwise, returns a request with an error. |

### Remarks

If the return value is a request with an error, calling [AsyncGPUReadbackRequest.hasError](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest/haserror.md) returns true.

For texture data, the extents are checked against the size of the source texture. If graphics [QualitySettings](/engine/6000.0/script-reference/unityengine/qualitysettings.md) are set low enough to generate reduced size textures, then the reduced size must be requested. Use [QualitySettings.masterTextureLimit](/engine/6000.0/script-reference/unityengine/qualitysettings/mastertexturelimit.md) to adjust the width and height (and x,y if required), by bit shifting right.

For texture data, use the [SystemInfo.IsFormatSupported](/engine/6000.0/script-reference/unityengine/systeminfo/isformatsupported.md) method with the [GraphicsFormatUsage.ReadPixels](/engine/6000.0/script-reference/unityengine/experimental/rendering/graphicsformatusage/readpixels.md) flag to query if the format is supported.

## RequestIntoNativeArray\<T>(NativeArray\<T>, GraphicsBuffer, Action\<AsyncGPUReadbackRequest>)

Retrieves data asynchronously from a GPU Graphics Buffer resource.

```csharp
public static AsyncGPUReadbackRequest RequestIntoNativeArray<T>(ref NativeArray<T> output, GraphicsBuffer src, Action<AsyncGPUReadbackRequest> callback = null) where T : struct
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): Reference to the NativeArray to write the data into. The NativeArray or underlying memory cannot be Disposed until the request is complete.**** (\[GraphicsBuffer]\(/engine/6000.0/script-reference/unityengine/graphicsbuffer)): The [GraphicsBuffer](/engine/6000.0/script-reference/unityengine/graphicsbuffer.md) to read the data from.**** (\[Action\<AsyncGPUReadbackRequest>]\(https\://learn.microsoft.com/dotnet/api/system.action)): An optional delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

### Returns

| Type                                                                                                        | Description                                                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) | Returns an [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) that you can use to determine when the data is available. Otherwise, returns a request with an error. |

### Remarks

If the return value is a request with an error, calling [AsyncGPUReadbackRequest.hasError](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest/haserror.md) returns true.

For texture data, the extents are checked against the size of the source texture. If graphics [QualitySettings](/engine/6000.0/script-reference/unityengine/qualitysettings.md) are set low enough to generate reduced size textures, then the reduced size must be requested. Use [QualitySettings.masterTextureLimit](/engine/6000.0/script-reference/unityengine/qualitysettings/mastertexturelimit.md) to adjust the width and height (and x,y if required), by bit shifting right.

For texture data, use the [SystemInfo.IsFormatSupported](/engine/6000.0/script-reference/unityengine/systeminfo/isformatsupported.md) method with the [GraphicsFormatUsage.ReadPixels](/engine/6000.0/script-reference/unityengine/experimental/rendering/graphicsformatusage/readpixels.md) flag to query if the format is supported.

## RequestIntoNativeArray\<T>(NativeArray\<T>, GraphicsBuffer, int, int, Action\<AsyncGPUReadbackRequest>)

Retrieves data asynchronously from a GPU Graphics Buffer resource.

```csharp
public static AsyncGPUReadbackRequest RequestIntoNativeArray<T>(ref NativeArray<T> output, GraphicsBuffer src, int size, int offset, Action<AsyncGPUReadbackRequest> callback = null) where T : struct
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): Reference to the NativeArray to write the data into. The NativeArray or underlying memory cannot be Disposed until the request is complete.**** (\[GraphicsBuffer]\(/engine/6000.0/script-reference/unityengine/graphicsbuffer)): The [GraphicsBuffer](/engine/6000.0/script-reference/unityengine/graphicsbuffer.md) to read the data from.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The size, in bytes, of the data to retrieve from the [GraphicsBuffer](/engine/6000.0/script-reference/unityengine/graphicsbuffer.md).**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Offset in bytes in the [GraphicsBuffer](/engine/6000.0/script-reference/unityengine/graphicsbuffer.md).**** (\[Action\<AsyncGPUReadbackRequest>]\(https\://learn.microsoft.com/dotnet/api/system.action)): An optional delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

### Returns

| Type                                                                                                        | Description                                                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) | Returns an [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) that you can use to determine when the data is available. Otherwise, returns a request with an error. |

### Remarks

If the return value is a request with an error, calling [AsyncGPUReadbackRequest.hasError](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest/haserror.md) returns true.

For texture data, the extents are checked against the size of the source texture. If graphics [QualitySettings](/engine/6000.0/script-reference/unityengine/qualitysettings.md) are set low enough to generate reduced size textures, then the reduced size must be requested. Use [QualitySettings.masterTextureLimit](/engine/6000.0/script-reference/unityengine/qualitysettings/mastertexturelimit.md) to adjust the width and height (and x,y if required), by bit shifting right.

For texture data, use the [SystemInfo.IsFormatSupported](/engine/6000.0/script-reference/unityengine/systeminfo/isformatsupported.md) method with the [GraphicsFormatUsage.ReadPixels](/engine/6000.0/script-reference/unityengine/experimental/rendering/graphicsformatusage/readpixels.md) flag to query if the format is supported.

## RequestIntoNativeArray\<T>(NativeArray\<T>, Texture, int, Action\<AsyncGPUReadbackRequest>)

Retrieves data asynchronously from a GPU Texture resource.

```csharp
public static AsyncGPUReadbackRequest RequestIntoNativeArray<T>(ref NativeArray<T> output, Texture src, int mipIndex = 0, Action<AsyncGPUReadbackRequest> callback = null) where T : struct
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): Reference to the NativeArray to write the data into. The NativeArray or underlying memory cannot be Disposed until the request is complete.**** (\[Texture]\(/engine/6000.0/script-reference/unityengine/texture)): The [Texture](/engine/6000.0/script-reference/unityengine/texture.md) resource to read the data from.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the mipmap to fetch.**** (\[Action\<AsyncGPUReadbackRequest>]\(https\://learn.microsoft.com/dotnet/api/system.action)): An optional delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

### Returns

| Type                                                                                                        | Description                                                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) | Returns an [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) that you can use to determine when the data is available. Otherwise, returns a request with an error. |

### Remarks

If the return value is a request with an error, calling [AsyncGPUReadbackRequest.hasError](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest/haserror.md) returns true.

For texture data, the extents are checked against the size of the source texture. If graphics [QualitySettings](/engine/6000.0/script-reference/unityengine/qualitysettings.md) are set low enough to generate reduced size textures, then the reduced size must be requested. Use [QualitySettings.masterTextureLimit](/engine/6000.0/script-reference/unityengine/qualitysettings/mastertexturelimit.md) to adjust the width and height (and x,y if required), by bit shifting right.

For texture data, use the [SystemInfo.IsFormatSupported](/engine/6000.0/script-reference/unityengine/systeminfo/isformatsupported.md) method with the [GraphicsFormatUsage.ReadPixels](/engine/6000.0/script-reference/unityengine/experimental/rendering/graphicsformatusage/readpixels.md) flag to query if the format is supported.

## RequestIntoNativeArray\<T>(NativeArray\<T>, Texture, int, TextureFormat, Action\<AsyncGPUReadbackRequest>)

Retrieves data asynchronously from a GPU Texture resource.

```csharp
public static AsyncGPUReadbackRequest RequestIntoNativeArray<T>(ref NativeArray<T> output, Texture src, int mipIndex, TextureFormat dstFormat, Action<AsyncGPUReadbackRequest> callback = null) where T : struct
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): Reference to the NativeArray to write the data into. The NativeArray or underlying memory cannot be Disposed until the request is complete.**** (\[Texture]\(/engine/6000.0/script-reference/unityengine/texture)): The [Texture](/engine/6000.0/script-reference/unityengine/texture.md) resource to read the data from.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the mipmap to fetch.**** (\[TextureFormat]\(/engine/6000.0/script-reference/unityengine/textureformat)): The target [TextureFormat](/engine/6000.0/script-reference/unityengine/textureformat.md) of the data. Conversion happens automatically if this format is different from the format stored on the GPU.**** (\[Action\<AsyncGPUReadbackRequest>]\(https\://learn.microsoft.com/dotnet/api/system.action)): An optional delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

### Returns

| Type                                                                                                        | Description                                                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) | Returns an [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) that you can use to determine when the data is available. Otherwise, returns a request with an error. |

### Remarks

If the return value is a request with an error, calling [AsyncGPUReadbackRequest.hasError](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest/haserror.md) returns true.

For texture data, the extents are checked against the size of the source texture. If graphics [QualitySettings](/engine/6000.0/script-reference/unityengine/qualitysettings.md) are set low enough to generate reduced size textures, then the reduced size must be requested. Use [QualitySettings.masterTextureLimit](/engine/6000.0/script-reference/unityengine/qualitysettings/mastertexturelimit.md) to adjust the width and height (and x,y if required), by bit shifting right.

For texture data, use the [SystemInfo.IsFormatSupported](/engine/6000.0/script-reference/unityengine/systeminfo/isformatsupported.md) method with the [GraphicsFormatUsage.ReadPixels](/engine/6000.0/script-reference/unityengine/experimental/rendering/graphicsformatusage/readpixels.md) flag to query if the format is supported.

## RequestIntoNativeArray\<T>(NativeArray\<T>, Texture, int, GraphicsFormat, Action\<AsyncGPUReadbackRequest>)

Retrieves data asynchronously from a GPU Texture resource.

```csharp
public static AsyncGPUReadbackRequest RequestIntoNativeArray<T>(ref NativeArray<T> output, Texture src, int mipIndex, GraphicsFormat dstFormat, Action<AsyncGPUReadbackRequest> callback = null) where T : struct
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): Reference to the NativeArray to write the data into. The NativeArray or underlying memory cannot be Disposed until the request is complete.**** (\[Texture]\(/engine/6000.0/script-reference/unityengine/texture)): The [Texture](/engine/6000.0/script-reference/unityengine/texture.md) resource to read the data from.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the mipmap to fetch.**** (\[GraphicsFormat]\(/engine/6000.0/script-reference/unityengine/experimental/rendering/graphicsformat)): The target [TextureFormat](/engine/6000.0/script-reference/unityengine/textureformat.md) of the data. Conversion happens automatically if this format is different from the format stored on the GPU.**** (\[Action\<AsyncGPUReadbackRequest>]\(https\://learn.microsoft.com/dotnet/api/system.action)): An optional delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

### Returns

| Type                                                                                                        | Description                                                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) | Returns an [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) that you can use to determine when the data is available. Otherwise, returns a request with an error. |

### Remarks

If the return value is a request with an error, calling [AsyncGPUReadbackRequest.hasError](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest/haserror.md) returns true.

For texture data, the extents are checked against the size of the source texture. If graphics [QualitySettings](/engine/6000.0/script-reference/unityengine/qualitysettings.md) are set low enough to generate reduced size textures, then the reduced size must be requested. Use [QualitySettings.masterTextureLimit](/engine/6000.0/script-reference/unityengine/qualitysettings/mastertexturelimit.md) to adjust the width and height (and x,y if required), by bit shifting right.

For texture data, use the [SystemInfo.IsFormatSupported](/engine/6000.0/script-reference/unityengine/systeminfo/isformatsupported.md) method with the [GraphicsFormatUsage.ReadPixels](/engine/6000.0/script-reference/unityengine/experimental/rendering/graphicsformatusage/readpixels.md) flag to query if the format is supported.

## RequestIntoNativeArray\<T>(NativeArray\<T>, Texture, int, int, int, int, int, int, int, TextureFormat, Action\<AsyncGPUReadbackRequest>)

Retrieves data asynchronously from a GPU Texture resource.

```csharp
public static AsyncGPUReadbackRequest RequestIntoNativeArray<T>(ref NativeArray<T> output, Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, TextureFormat dstFormat, Action<AsyncGPUReadbackRequest> callback = null) where T : struct
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): Reference to the NativeArray to write the data into. The NativeArray or underlying memory cannot be Disposed until the request is complete.**** (\[Texture]\(/engine/6000.0/script-reference/unityengine/texture)): The [Texture](/engine/6000.0/script-reference/unityengine/texture.md) resource to read the data from.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the mipmap to fetch.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The starting x-coordinate, in pixels, of the Texture data to fetch.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The width, in pixels, of the Texture data to fetch.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The starting y-coordinate, in pixels, of the Texture data to fetch.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The height, in pixels, of the Texture data to fetch.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The starting z-coordinate, in pixels, of the [Texture3D](/engine/6000.0/script-reference/unityengine/texture3d.md) to fetch. For TextureCube, [Texture2DArray](/engine/6000.0/script-reference/unityengine/texture2darray.md), and TextureCubeArray, this is the index of the start layer.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The depth, in pixels of the [Texture3D](/engine/6000.0/script-reference/unityengine/texture3d.md) to fetch. For TextureCube, [Texture2DArray](/engine/6000.0/script-reference/unityengine/texture2darray.md), and TextureCubeArray, this is the number of layers to retrieve.**** (\[TextureFormat]\(/engine/6000.0/script-reference/unityengine/textureformat)): The target [TextureFormat](/engine/6000.0/script-reference/unityengine/textureformat.md) of the data. Conversion happens automatically if this format is different from the format stored on the GPU.**** (\[Action\<AsyncGPUReadbackRequest>]\(https\://learn.microsoft.com/dotnet/api/system.action)): An optional delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

### Returns

| Type                                                                                                        | Description                                                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) | Returns an [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) that you can use to determine when the data is available. Otherwise, returns a request with an error. |

### Remarks

If the return value is a request with an error, calling [AsyncGPUReadbackRequest.hasError](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest/haserror.md) returns true.

For texture data, the extents are checked against the size of the source texture. If graphics [QualitySettings](/engine/6000.0/script-reference/unityengine/qualitysettings.md) are set low enough to generate reduced size textures, then the reduced size must be requested. Use [QualitySettings.masterTextureLimit](/engine/6000.0/script-reference/unityengine/qualitysettings/mastertexturelimit.md) to adjust the width and height (and x,y if required), by bit shifting right.

For texture data, use the [SystemInfo.IsFormatSupported](/engine/6000.0/script-reference/unityengine/systeminfo/isformatsupported.md) method with the [GraphicsFormatUsage.ReadPixels](/engine/6000.0/script-reference/unityengine/experimental/rendering/graphicsformatusage/readpixels.md) flag to query if the format is supported.

## RequestIntoNativeArray\<T>(NativeArray\<T>, Texture, int, int, int, int, int, int, int, GraphicsFormat, Action\<AsyncGPUReadbackRequest>)

Retrieves data asynchronously from a GPU Texture resource.

```csharp
public static AsyncGPUReadbackRequest RequestIntoNativeArray<T>(ref NativeArray<T> output, Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, GraphicsFormat dstFormat, Action<AsyncGPUReadbackRequest> callback = null) where T : struct
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): Reference to the NativeArray to write the data into. The NativeArray or underlying memory cannot be Disposed until the request is complete.**** (\[Texture]\(/engine/6000.0/script-reference/unityengine/texture)): The [Texture](/engine/6000.0/script-reference/unityengine/texture.md) resource to read the data from.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the mipmap to fetch.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The starting x-coordinate, in pixels, of the Texture data to fetch.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The width, in pixels, of the Texture data to fetch.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The starting y-coordinate, in pixels, of the Texture data to fetch.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The height, in pixels, of the Texture data to fetch.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The starting z-coordinate, in pixels, of the [Texture3D](/engine/6000.0/script-reference/unityengine/texture3d.md) to fetch. For TextureCube, [Texture2DArray](/engine/6000.0/script-reference/unityengine/texture2darray.md), and TextureCubeArray, this is the index of the start layer.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The depth, in pixels of the [Texture3D](/engine/6000.0/script-reference/unityengine/texture3d.md) to fetch. For TextureCube, [Texture2DArray](/engine/6000.0/script-reference/unityengine/texture2darray.md), and TextureCubeArray, this is the number of layers to retrieve.**** (\[GraphicsFormat]\(/engine/6000.0/script-reference/unityengine/experimental/rendering/graphicsformat)): The target [TextureFormat](/engine/6000.0/script-reference/unityengine/textureformat.md) of the data. Conversion happens automatically if this format is different from the format stored on the GPU.**** (\[Action\<AsyncGPUReadbackRequest>]\(https\://learn.microsoft.com/dotnet/api/system.action)): An optional delegate Action to call after Unity completes the request. When Unity calls the delegate, it passes the completed request as a parameter to the Action.

### Returns

| Type                                                                                                        | Description                                                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) | Returns an [AsyncGPUReadbackRequest](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest.md) that you can use to determine when the data is available. Otherwise, returns a request with an error. |

### Remarks

If the return value is a request with an error, calling [AsyncGPUReadbackRequest.hasError](/engine/6000.0/script-reference/unityengine/rendering/asyncgpureadbackrequest/haserror.md) returns true.

For texture data, the extents are checked against the size of the source texture. If graphics [QualitySettings](/engine/6000.0/script-reference/unityengine/qualitysettings.md) are set low enough to generate reduced size textures, then the reduced size must be requested. Use [QualitySettings.masterTextureLimit](/engine/6000.0/script-reference/unityengine/qualitysettings/mastertexturelimit.md) to adjust the width and height (and x,y if required), by bit shifting right.

For texture data, use the [SystemInfo.IsFormatSupported](/engine/6000.0/script-reference/unityengine/systeminfo/isformatsupported.md) method with the [GraphicsFormatUsage.ReadPixels](/engine/6000.0/script-reference/unityengine/experimental/rendering/graphicsformatusage/readpixels.md) flag to query if the format is supported.
