When the [`Config.TextureUpdateMode`](https://developers.google.com/ar/reference/java/com/google/ar/core/Config.TextureUpdateMode) is set to [`TextureUpdateMode.EXPOSE_HARDWARE_BUFFER`](https://developers.google.com/ar/reference/java/com/google/ar/core/Config.TextureUpdateMode#expose_hardware_buffer), ARCore will provide an Android [hardware buffer](https://developer.android.com/ndk/reference/group/a-hardware-buffer) when [`Session.update()`](https://developers.google.com/ar/reference/java/com/google/ar/core/Session#update-) is called. This hardware buffer can be bound to a Vulkan [`VkImage`](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkImage.html).

## View the sample application

Vulkan rendering support is demonstrated in the [hello_ar_vulkan_c sample app](https://github.com/google-ar/arcore-android-sdk/tree/master/samples/hello_ar_vulkan_c).

## Enable the hardware buffer output mode

The configured [`Config.TextureUpdateMode`](https://developers.google.com/ar/reference/java/com/google/ar/core/Config.TextureUpdateMode) determines how ARCore will update the camera texture. When it is set to [`TextureUpdateMode.EXPOSE_HARDWARE_BUFFER`](https://developers.google.com/ar/reference/java/com/google/ar/core/Config.TextureUpdateMode#expose_hardware_buffer), ARCore will provide the camera image through a [`HardwareBuffer`](https://developer.android.com/reference/android/hardware/HardwareBuffer).

Configure the session to use [`TextureUpdateMode.EXPOSE_HARDWARE_BUFFER`](https://developers.google.com/ar/reference/java/com/google/ar/core/Config.TextureUpdateMode#expose_hardware_buffer):

### Java

```java
Config config = session.getConfig();
config.setTextureUpdateMode(Config.TextureUpdateMode.EXPOSE_HARDWARE_BUFFER);
session.configure(config);
```

### Kotlin

```kotlin
session.configure(
  session.config.apply { textureUpdateMode = Config.TextureUpdateMode.EXPOSE_HARDWARE_BUFFER }
)
```

> [!NOTE]
> **Note:** When using [`TextureUpdateMode.EXPOSE_HARDWARE_BUFFER`](https://developers.google.com/ar/reference/java/com/google/ar/core/Config.TextureUpdateMode#expose_hardware_buffer) on incompatible devices, [`Session.configure()`](https://developers.google.com/ar/reference/java/com/google/ar/core/Session#configure(com.google.ar.core.Config)) will fail and throw [`UnsupportedConfigurationException`](https://developers.google.com/ar/reference/java/com/google/ar/core/exceptions/UnsupportedConfigurationException).

## Obtain the hardware buffer

When [`TextureUpdateMode.EXPOSE_HARDWARE_BUFFER`](https://developers.google.com/ar/reference/java/com/google/ar/core/Config.TextureUpdateMode#expose_hardware_buffer) is enabled, use [`Frame.getHardwareBuffer()`](https://developers.google.com/ar/reference/java/com/google/ar/core/Frame#getHardwareBuffer-) to get the hardware buffer:

### Java

```java
try {
  HardwareBuffer buffer = frame.getHardwareBuffer();
  // Use the buffer object in your rendering.
} catch (NotYetAvailableException e) {
  // The hardware buffer is not ready yet.
}
```

### Kotlin

```kotlin
try {
  val buffer = frame.hardwareBuffer
  // Use the buffer object in your rendering.
} catch (e: NotYetAvailableException) {
  // The hardware buffer is not ready yet.
}
```

## Use the hardware buffer during Vulkan rendering

See [`vulkan_handler.cc`](https://github.com/google-ar/arcore-android-sdk/blob/master/samples/hello_ar_vulkan_c/app/src/main/cpp/vulkan_handler.cc) for an example of how to render an AR application using Vulkan.

## Supported devices

Vulkan rendering support is only available on Android API levels **27** and
above. Additionally, the device must support the `VK_ANDROID_external_memory_android_hardware_buffer` extension.

### Require Vulkan in your app's manifest

Google Play uses `<uses-feature>` declared in your app manifest to filter your
app from devices that don't meet its hardware and software feature requirements.
Devices using Vulkan 1.0 **might not** support the required extension, but devices
compatible with Vulkan 1.1 **must** have the required extension starting in Android 10 (API level 29).