Skip to content

fix(ovxr): use sRGB swapchains for camera panels - #1564

Open
hougantc-nvda wants to merge 2 commits into
mainfrom
fix/ovxr-camera-panel-srgb
Open

hougantc-nvda wants to merge 2 commits into
mainfrom
fix/ovxr-camera-panel-srgb

Conversation

@hougantc-nvda

@hougantc-nvda hougantc-nvda commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

Camera PiP panels appear washed out in CloudXR because the native helper uploads sRGB-encoded OVRTX LdrColor bytes into a Vulkan UNORM swapchain. The compositor interprets the values as linear, which lifts midtones in the encoded stream.

Request VK_FORMAT_R8G8B8A8_SRGB so the compositor decodes the source correctly. The helper checks OpenXR's advertised formats and uploads the camera bytes directly.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Testing

  • On Linux, the same grayscale ramp in two otherwise identical OpenXR quads decoded an input value of 128 as 180 with UNORM and 115 with sRGB. The sRGB result matches the expected sRGB-to-linear-to-BT.709 conversion.
  • Built the Linux native camera panel helper with this patch. In Isaac Lab, three panels streamed through play, reset, and reconnect using the normal GPU upload path.
  • Ran SKIP=check-copyright-year pre-commit run --all-files and clang-format-14 --dry-run --Werror on the changed C++ file.
  • The decoded video comparison exercises the transfer function end to end. An enum-selection unit test would only check the requested format.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the linter and formatter with SKIP=check-copyright-year pre-commit run --all-files
  • I have made corresponding changes to the documentation (no documentation changes needed)
  • I have added tests that prove my fix/feature works (or explained why not)
  • I have signed off all my commits (git commit -s) per the DCO

OVRTX LdrColor is already sRGB encoded. Declare that encoding on the OpenXR swapchain so the compositor can decode the input before applying the stream transfer function.

Signed-off-by: Hougant Chen <hougantc@nvidia.com>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

createSwapchain now searches for VK_FORMAT_R8G8B8A8_SRGB instead of VK_FORMAT_R8G8B8A8_UNORM. If the sRGB format is unavailable, the existing failure path remains.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: Minimal · previous review 443f6

Camera panels now request an sRGB swapchain format so the compositor decodes the sRGB-encoded camera colors correctly. If a runtime does not offer that exact format, the panel fails to display rather than showing wrong colors. No supported runtime was shown to lack the format. The change is small and easy to revert.

Architecture risk: Low · up to 443f6

The change affects 1 system.

Changed systems: src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in src/core/ovxr_pip_layer/cpp/pip_layer.cpp: createSwapchain now searches for the sRGB format instead of the UNORM format; if the sRGB format is not enumerated, the existing failure path remains.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: camera-panel OpenXR swapchains switch from UNORM to sRGB format (VK_FORMAT_R8G8B8A8_SRGB). The raw summary and PR objectives both describe this same change, so the tit…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: camera-panel OpenXR swapchains switch from UNORM to sRGB format (VK_FORMAT_R8G8B8A8_SRGB). The raw summary and PR objectives both describe this same change, so the title matches the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c1a874d and 443f65e.

Files selected for processing: 1

  • src/core/ovxr_pip_layer/cpp/pip_layer.cpp

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

The contract test's fake runtime offered only UNORM, which the sRGB swapchain
change no longer accepts. Offer UNORM first and SRGB second, and assert that the
swapchain is created as SRGB. A runtime that offers only UNORM must fail without
creating a swapchain.

Signed-off-by: Hougant Chen <hougantc@nvidia.com>

This branch was successfully deployed

1 active deployment
dev — 3de404ae Deployed Nov 21, 2026 by hougantc-nvda via publish-wheel #7215
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants