Skip to content

Feature/surface format setting#540

Closed
xXJSONDeruloXx wants to merge 3 commits intoutkarshdalal:masterfrom
xXJSONDeruloXx:feature/surface-format-setting
Closed

Feature/surface format setting#540
xXJSONDeruloXx wants to merge 3 commits intoutkarshdalal:masterfrom
xXJSONDeruloXx:feature/surface-format-setting

Conversation

@xXJSONDeruloXx
Copy link
Contributor

@xXJSONDeruloXx xXJSONDeruloXx commented Feb 17, 2026

https://discord.com/channels/1378308569287622737/1472071060785725635

Hey guys I was recently testing out Doom Eternal on my snapdragon 8 elite gen 5 device and couldn't get it to load on Gamenative. I decided to test it on Gamehub lite and found that changing the surface option from RGBA8 to BGRA8 was the difference between the game running and the game not running.

Could we add the option to change Surface format within the 'edit container' graphics tab?


Summary by cubic

Adds a Surface Format option (RGBA8/BGRA8) in the Graphics tab to improve game compatibility. This enables titles like Doom Eternal on Snapdragon 8 Elite devices to launch by switching to BGRA8.

  • New Features

    • Added Surface Format dropdown in Edit Container → Graphics.
    • Options: RGBA8 (default) and BGRA8.
    • Saves selection in graphicsDriverConfig as surfaceFormat.
    • XServer exports WRAPPER_SURFACE_FORMAT env var when set.
    • UI strings and array resources added.
  • Migration

    • No required changes. For affected games, set Surface Format to BGRA8 in Graphics settings.

Written for commit 5066002. Summary will update on new commits.

Summary by CodeRabbit

  • New Features
    • Added Surface Format configuration option to graphics settings
    • Users can now select between RGBA8 and BGRA8 surface format options
    • Selected surface format preference is persisted and applied to the graphics driver

Adds configurable surface format option to fix compatibility issues with
games like Doom Eternal on Snapdragon 8 Elite devices.

## Changes

- Added 'Surface Format' dropdown to Graphics tab (Edit Container)
- Options: RGBA8 (default) | BGRA8
- Stored in graphicsDriverConfig as 'surfaceFormat' key
- State management integrated with existing graphics config flow

## UI Changes

**GraphicsTab.kt:**
- Added SettingsListDropdown for surface format selection
- Positioned after Resource Type dropdown (arm64ec builds)
- Updates graphicsDriverConfig.surfaceFormat on selection

**ContainerConfigDialog.kt:**
- Added surfaceFormatIndex state (MutableIntState)
- LaunchedEffect loads surfaceFormat from config (default: RGBA8)
- Syncs state with graphicsDriverConfig changes

**ContainerConfigState.kt:**
- Added surfaceFormatIndex: MutableIntState
- Added surfaceFormats: List<String>

## Resources

**strings.xml:**
- Added 'Surface Format' label

**arrays.xml:**
- Added surface_format_entries array: [RGBA8, BGRA8]

## Configuration

Surface format is persisted in Container.graphicsDriverConfig:

Tested with Doom Eternal on SD8Elite - switching to BGRA8 fixes launch.

Resolves compatibility issues where certain games require specific surface
format on ARM devices.

Co-authored-by: Kurt
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 17, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

The pull request introduces surface format selection to the container configuration system. A new dropdown UI element in the graphics settings allows users to choose between RGBA8 and BGRA8 surface formats, with the selection tracked in state, persisted to configuration, and passed to the graphics driver via environment variables.

Changes

Cohort / File(s) Summary
State Management
ContainerConfigState.kt, ContainerConfigDialog.kt
Added surfaceFormatIndex (MutableIntState) and surfaceFormats (List) fields to the public state container, initialized from resources and persisted configuration with RGBA8 as default.
UI Components
GraphicsTab.kt
Introduced new SettingsListDropdown for surface format selection in the Bionic graphics variant, binding the selection to state and persisting the chosen format to graphics driver configuration.
Environment Setup
XServerScreen.kt
Integrated surface format handling into graphics driver environment variable setup, setting WRAPPER_SURFACE_FORMAT when a non-empty surface format is configured.
Resources
arrays.xml, strings.xml
Added surface_format_entries string array with RGBA8 and BGRA8 options, and surface_format string resource for the UI label.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A dropdown hops into the scene,
Where RGBA and BGRA gleam,
The format flows through state so clean,
To graphics cards' envVar dream! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Feature/surface format setting' clearly and concisely describes the main change: adding a configurable surface format option to the UI.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into master

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

@xXJSONDeruloXx xXJSONDeruloXx marked this pull request as draft February 17, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant