<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLTextureUsage/shaderAtomic",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:@E@MTLTextureUsage@MTLTextureUsageShaderAtomic"
  },
  "title" : "shaderAtomic"
}
-->

# shaderAtomic

An option that enables atomic memory operations on texture elements in shader code.

```
static var shaderAtomic: MTLTextureUsage { get }
```

## Discussion

Shaders can run atomic memory operations on textures with specific element type and pixel format combinations:

|Shader element type|Pixel format                                                         |
|-------------------|---------------------------------------------------------------------|
|`int`              |``doc://com.apple.metal/documentation/Metal/MTLPixelFormat/r32Sint`` |
|`uint`             |``doc://com.apple.metal/documentation/Metal/MTLPixelFormat/r32Uint`` |
|`ulong`            |``doc://com.apple.metal/documentation/Metal/MTLPixelFormat/rg32Uint``|

> Note:
> Applying this usage option to a texture disables lossless compression.

---

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)