# RadeonRaysContext

> RadeonRaysContext implements the IDeviceContext interface. It uses the RadeonRays SDK for ray-triangle intersection testing and the OpenCL 1.2 API for computations.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine.LightTransport](/engine/6000.7/script-reference/unityengine/lighttransport.md)
* **Assembly:** UnityEditor.CoreModule
* **Implements:** [IDeviceContext](/engine/6000.7/script-reference/unityengine/lighttransport/idevicecontext.md), [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
public class RadeonRaysContext : IDeviceContext, IDisposable
```

## Constructors

| Constructor                                                                                                                                          | Description  |
| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| [RadeonRaysContext()](/engine/6000.7/script-reference/unityengine/lighttransport/radeonrayscontext/ctor.md#radeonrayscontext\(\))                    | Constructor. |
| [RadeonRaysContext(System.IntPtr)](/engine/6000.7/script-reference/unityengine/lighttransport/radeonrayscontext/ctor.md#radeonrayscontext\(intptr\)) | Constructor. |

## Methods

| Method                                                                                                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| -------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [CreateBuffer](/engine/6000.7/script-reference/unityengine/lighttransport/radeonrayscontext/createbuffer.md)   | Create a new buffer for a number of elements with a given stride.                                                                                                                                                                                                                                                                                                                                                                                                |
| [CreateEvent](/engine/6000.7/script-reference/unityengine/lighttransport/radeonrayscontext/createevent.md)     | Creates a new event.                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [DestroyBuffer](/engine/6000.7/script-reference/unityengine/lighttransport/radeonrayscontext/destroybuffer.md) | Destroy the buffer with the given ID.                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [DestroyEvent](/engine/6000.7/script-reference/unityengine/lighttransport/radeonrayscontext/destroyevent.md)   | Destroy the event with the given ID. You should call this to free temporary resources associated with an event. Attempting to use the event after it has been destroyed, for example using [IDeviceContext.Wait](/engine/6000.7/script-reference/unityengine/lighttransport/idevicecontext/wait.md) or [IDeviceContext.IsCompleted](/engine/6000.7/script-reference/unityengine/lighttransport/idevicecontext/iscompleted.md) will result in undefined behavior. |
| [Dispose](/engine/6000.7/script-reference/unityengine/lighttransport/radeonrayscontext/dispose.md)             | Dispose.                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [Flush](/engine/6000.7/script-reference/unityengine/lighttransport/radeonrayscontext/flush.md)                 | Flush the device context.                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [Initialize](/engine/6000.7/script-reference/unityengine/lighttransport/radeonrayscontext/initialize.md)       | Initialize the device context.                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [IsCompleted](/engine/6000.7/script-reference/unityengine/lighttransport/radeonrayscontext/iscompleted.md)     | Returns true if the asynchronous operation completed.                                                                                                                                                                                                                                                                                                                                                                                                            |
| [ReadBuffer](/engine/6000.7/script-reference/unityengine/lighttransport/radeonrayscontext/readbuffer.md)       | Read contents of a buffer from the context.                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [Wait](/engine/6000.7/script-reference/unityengine/lighttransport/radeonrayscontext/wait.md)                   | Wait for an asynchronous event.                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [WriteBuffer](/engine/6000.7/script-reference/unityengine/lighttransport/radeonrayscontext/writebuffer.md)     | Write data into the memory buffer allocated by the context.                                                                                                                                                                                                                                                                                                                                                                                                      |
