# ComputeMipChainSize

> Computes the memory size in bytes for a chain of mipmaps.

## Definition

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

## ComputeMipChainSize(int, int, GraphicsFormat, int)

Computes the memory size in bytes for a chain of mipmaps.

```csharp
public static uint ComputeMipChainSize(int width, int height, GraphicsFormat format, int mipCount = -1)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[GraphicsFormat]\(/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformat)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Total number of mip levels to calculate. A value of -1 means Unity calculates the entire mip chain.

### Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

## ComputeMipChainSize(int, int, TextureFormat, int)

Computes the memory size in bytes for a chain of mipmaps.

```csharp
public static uint ComputeMipChainSize(int width, int height, TextureFormat format, int mipCount = -1)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[TextureFormat]\(/engine/6000.7/script-reference/unityengine/textureformat)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Total number of mip levels to calculate. A value of -1 means Unity calculates the entire mip chain.

### Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

## ComputeMipChainSize(int, int, int, GraphicsFormat, int)

Computes the memory size in bytes for a chain of mipmaps.

```csharp
public static uint ComputeMipChainSize(int width, int height, int depth, GraphicsFormat format, int mipCount = -1)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[GraphicsFormat]\(/engine/6000.7/script-reference/unityengine/experimental/rendering/graphicsformat)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Total number of mip levels to calculate. A value of -1 means Unity calculates the entire mip chain.

### Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

## ComputeMipChainSize(int, int, int, TextureFormat, int)

Computes the memory size in bytes for a chain of mipmaps.

```csharp
public static uint ComputeMipChainSize(int width, int height, int depth, TextureFormat format, int mipCount = -1)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[TextureFormat]\(/engine/6000.7/script-reference/unityengine/textureformat)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Total number of mip levels to calculate. A value of -1 means Unity calculates the entire mip chain.

### Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |
