---
title: "setStageInRegion(_:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlcomputecommandencoder/setstageinregion(_:)"
---

# setStageInRegion(_:)

Sets the dimensions over the thread grid of how your compute kernel receives stage-in arguments.

## Declaration

```swift
func setStageInRegion(_ region: MTLRegion)
```

## Parameters

- `region`: The doc://com.apple.metal/documentation/Metal/MTLRegion defining how to interpret a thread’s location as a coordinate for stage-in data.

## Discussion

Discussion The region’s origin point, starting from (0,0,0) in the upper left of the bound data, determines the final index of [[stage_in]] data. Note that the total number of threads Metal launches may be larger than your stage-in data. To determine the index used to fetch [[stage_in]] data for a given thread, the GPU adds the values specified by the region’s origin to the thread position in the grid. Threads in the grid outside of the maximum stage-in data size have undefined behavior when accessing the stage-in memory region.

## See Also

### Configuring stage-in data

- [setStageInRegionWithIndirectBuffer(_:indirectBufferOffset:)](metal/mtlcomputecommandencoder/setstageinregionwithindirectbuffer(_:indirectbufferoffset:).md)
