<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLParallelRenderCommandEncoder/setStencilStoreAction(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLParallelRenderCommandEncoder(im)setStencilStoreAction:"
  },
  "title" : "setStencilStoreAction(_:)"
}
-->

# setStencilStoreAction(_:)

Specifies a known store action to replace the initial [`MTLStoreAction.unknown`](/documentation/Metal/MTLStoreAction/unknown) value specified for a given stencil attachment.

```
func setStencilStoreAction(_ storeAction: MTLStoreAction)
```

## Parameters

`storeAction`

The desired store action for the stencil attachment. This value can’t be [`MTLStoreAction.unknown`](/documentation/Metal/MTLStoreAction/unknown).

## Discussion

If the store action for the given stencil attachment was set to [`MTLStoreAction.unknown`](/documentation/Metal/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()`](/documentation/Metal/MTLCommandEncoder/endEncoding()) method.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)