Unter vulkan_handler.cc finden Sie ein Beispiel für das Rendern einer AR-Anwendung mit Vulkan.
Unterstützte Geräte
Der Vulkan-Rendering-Support ist nur für Android-API-Levels ab 27 verfügbar. Außerdem muss das Gerät die Erweiterung VK_ANDROID_external_memory_android_hardware_buffer unterstützen.
Vulkan im Manifest Ihrer App anfordern
Google Play verwendet die in Ihrem App-Manifest deklarierte <uses-feature>, um Ihre App von Geräten zu filtern, die die Anforderungen an Hardware- und Softwarefunktionen nicht erfüllen.
Geräte mit Vulkan 1.0 unterstützen die erforderliche Erweiterung möglicherweise nicht. Geräte, die mit Vulkan 1.1 kompatibel sind, müssen sie jedoch ab Android 10 (API-Level 29) haben.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-02-28 (UTC)."],[[["ARCore can provide the camera image as an Android hardware buffer for efficient Vulkan rendering when `TextureUpdateMode.EXPOSE_HARDWARE_BUFFER` is enabled."],["This hardware buffer can be accessed using `Frame.getHardwareBuffer()` and bound to a Vulkan `VkImage` for rendering."],["Vulkan rendering with ARCore requires Android API level 27 or higher and device support for the `VK_ANDROID_external_memory_android_hardware_buffer` extension."],["The `hello_ar_vulkan_c` sample app demonstrates how to implement Vulkan rendering with ARCore."],["To ensure your app is only available on compatible devices, declare the Vulkan feature requirement in your app's manifest."]]],["To utilize hardware buffer output, set `Config.TextureUpdateMode` to `EXPOSE_HARDWARE_BUFFER` during session configuration. This enables ARCore to provide a hardware buffer via `Session.update()`. Retrieve this buffer using `Frame.getHardwareBuffer()`. It can then be bound to a Vulkan `VkImage`. Vulkan rendering is demonstrated in the `hello_ar_vulkan_c` sample app. Support requires Android API level 27+, with the `VK_ANDROID_external_memory_android_hardware_buffer` extension and ensure your manifest declares Vulkan usage.\n"]]