---
title: "setColorStoreAction(_:index:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlparallelrendercommandencoder/setcolorstoreaction(_:index:)"
---

# setColorStoreAction(_:index:)

Specifies a known store action to replace the initial MTLStoreAction.unknown value specified for a given color attachment.

## Declaration

```swift
func setColorStoreAction(_ storeAction: MTLStoreAction, index colorAttachmentIndex: Int)
```

## Parameters

- `storeAction`: The desired store action for the color attachment. This value can’t be doc://com.apple.metal/documentation/Metal/MTLStoreAction/unknown.
- `colorAttachmentIndex`: The index of the color attachment.

## Discussion

Discussion If the store action for the given color attachment was set to MTLStoreAction.unknown when the parallel render command encoder was created, you need to call this method to specify another store action before you call the endEncoding() method.

## See Also

### Setting render pass state

- [setColorStoreActionOptions(_:index:)](metal/mtlparallelrendercommandencoder/setcolorstoreactionoptions(_:index:).md)
- [setDepthStoreAction(_:)](metal/mtlparallelrendercommandencoder/setdepthstoreaction(_:).md)
- [setDepthStoreActionOptions(_:)](metal/mtlparallelrendercommandencoder/setdepthstoreactionoptions(_:).md)
- [setStencilStoreAction(_:)](metal/mtlparallelrendercommandencoder/setstencilstoreaction(_:).md)
- [setStencilStoreActionOptions(_:)](metal/mtlparallelrendercommandencoder/setstencilstoreactionoptions(_:).md)
