Name String

XR_ANDROID_recommended_resolution

Extension Type

Instance extension

Registered Extension Number

462

Revision

1

Ratification Status

Not ratified

Extension and Version Dependencies

OpenXR 1.0

IP Status

No known IP claims.

Contributors

Trevor Debrechtabel, Google
Spencer Quin, Google
Lachlan Ford, Google
Vasiliy Baranov, Google

ภาพรวม

ส่วนขยายนี้ช่วยให้รันไทม์แจ้งเตือนแอปพลิเคชันได้เมื่อความละเอียดที่แนะนำมีการเปลี่ยนแปลง โดยอิงตามประสิทธิภาพของระบบในปัจจุบัน อุณหภูมิของอุปกรณ์ หรือปัจจัยอื่นๆ

ส่วนขยายนี้แก้ไขข้อกำหนดในลักษณะต่อไปนี้

  • รันไทม์อาจ แสดงผลเนื้อหาบัฟเฟอร์ที่ไม่เหมือนกันจากการแจงนับ xrEnumerateViewConfigurationViews สำหรับ systemId และ viewConfigurationType ที่กำหนดตลอดอายุการใช้งานของอินสแตนซ์

โครงสร้าง XrEventDataRecommendedResolutionChangedANDROID มีคำจำกัดความดังนี้

typedef struct XrEventDataRecommendedResolutionChangedANDROID {
    XrStructureType    type;
    const void*        next;
} XrEventDataRecommendedResolutionChangedANDROID;

Member Descriptions

  • type คือ XrStructureType ของโครงสร้างนี้
  • next คือ NULL หรือ Pointer ไปยังโครงสร้างถัดไปในเชนโครงสร้าง ไม่มีโครงสร้างดังกล่าวที่กำหนดไว้ใน OpenXR หลักหรือส่วนขยายนี้

การรับโครงสร้างเหตุการณ์ XrEventDataRecommendedResolutionChangedANDROID บ่งชี้ว่าความละเอียดที่แนะนำมีการเปลี่ยนแปลง แอปพลิเคชันควร สอบถามรันไทม์เกี่ยวกับความละเอียดที่แนะนำใหม่โดยใช้ xrEnumerateViewConfigurationViews

Valid Usage (Implicit)

โค้ดตัวอย่าง

โค้ดตัวอย่างต่อไปนี้แสดงวิธีรับฟังเหตุการณ์การเปลี่ยนแปลงความละเอียดที่แนะนำ

// Created at app startup time.
XrInstance instance;
XrSystemId systemId; // Previously initialized.
uint32_t viewCountOutput; // Previously initialized.

// View configuration type the application uses.
XrViewConfigurationType viewConfigType;

// Poll events for recommended resolution changes.
XrEventDataBuffer event = {
  .type = XR_TYPE_EVENT_DATA_BUFFER,
};
XrResult result = xrPollEvent(instance, &event);
if (result == XR_SUCCESS) {
  switch (event.type) {
    case XR_TYPE_EVENT_DATA_RECOMMENDED_RESOLUTION_CHANGED_ANDROID: {
        uint32_t viewCapacityInput = viewCountOutput;
        std::vector<XrViewConfigurationView> views(viewCapacityInput);
        result = xrEnumerateViewConfigurationViews(instance, systemId,
          viewConfigType, viewCapacityInput, &viewCountOutput, views.data());
        if(!XR_SUCCEEDED(result)) {
          // Handle error
        }

        // New recommended resolution is found in
        // views.recommendedImageRectWidth and views.recommendedImageRectHeight
        // Change the resolution for the viewConfigType
      break;
    }
    default:
      break;
  }
}

ประวัติเวอร์ชัน

  • Revision 1, 04-04-2025 (Kenny Vercaemer)

    • คำอธิบายส่วนขยายเริ่มต้น