---
title: "encodeIntersection(commandBuffer:intersectionType:rayTexture:intersectionTexture:accelerationStructure:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpsrayintersector/encodeintersection(commandbuffer:intersectiontype:raytexture:intersectiontexture:accelerationstructure:)"
---

# encodeIntersection(commandBuffer:intersectionType:rayTexture:intersectionTexture:accelerationStructure:)

## Declaration

```swift
func encodeIntersection(commandBuffer: any MTLCommandBuffer, intersectionType: MPSIntersectionType, rayTexture: any MTLTexture, intersectionTexture: any MTLTexture, accelerationStructure: MPSAccelerationStructure)
```
