---
title: "setColorAttachmentMap(_:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtl4rendercommandencoder/setcolorattachmentmap(_:)"
---

# setColorAttachmentMap(_:)

Sets the mapping from logical shader color output to physical render pass color attachments.

## Declaration

```swift
func setColorAttachmentMap(_ mapping: MTLLogicalToPhysicalColorAttachmentMap?)
```

## Parameters

- `mapping`: Mapping from logical shader outputs to physical outputs.

## Discussion

Discussion Use this method to define how the physical color attachments you specify via colorAttachments map to the logical color output the fragment shader writes to. To use this feature, make sure to set supportColorAttachmentMapping to true.

## See Also

### Configuring blend behavior

- [setBlendColor(red:green:blue:alpha:)](metal/mtl4rendercommandencoder/setblendcolor(red:green:blue:alpha:).md)
