Improve diagnostics for unknown DXGI formats #277

Merged
dhruv0807 merged 2 commits from upstream-pr/277 into main 2026-11-27 13:05:59 +00:00
dhruv0807 commented 2026-11-27 07:33:19 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by dhruv0807 on 2026-11-27T07:33:19Z.


Summary

Improves error reporting when an unknown DXGI render-target format is encountered.

Changes

  • Change color_formats() to return Result<Vec<Format>, u32> so unknown DXGI format values are preserved.
  • Update shader pipeline handling to report the specific unknown target or depth format.
  • Update affected tests and add a regression test for unknown colour formats.

How it was tested

  • cargo test -p victory-gpu native::state::tests — passed (10 tests).
  • cargo test -p victory-gpu native::console_state::tests — passed (5 tests).
  • cargo check -p victory-gpu — passed.
  • tools/macos/run-summary.sh --self-test — passed (self-test ok).
  • git diff --check origin/main...HEAD — passed (no whitespace errors).

A broader test run could not complete because /usr/local/lib/libmetalirconverter.dylib is missing on this machine.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5522942322 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/277). Originally posted by [dhruv0807](https://github.com/dhruv0807) on 2026-11-27T07:33:19Z. --- ## Summary Improves error reporting when an unknown DXGI render-target format is encountered. ## Changes - Change `color_formats()` to return `Result<Vec<Format>, u32>` so unknown DXGI format values are preserved. - Update shader pipeline handling to report the specific unknown target or depth format. - Update affected tests and add a regression test for unknown colour formats. ## How it was tested - `cargo test -p victory-gpu native::state::tests` — passed (10 tests). - `cargo test -p victory-gpu native::console_state::tests` — passed (5 tests). - `cargo check -p victory-gpu` — passed. - `tools/macos/run-summary.sh --self-test` — passed (`self-test ok`). - `git diff --check origin/main...HEAD` — passed (no whitespace errors). A broader test run could not complete because `/usr/local/lib/libmetalirconverter.dylib` is missing on this machine.
LakshanSivakumar commented 2026-11-27 08:08:14 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T08:08:14Z.


Thank you for your first pull request. The change does what the title says, and the unit test pins it.

Please update the branch on main, and fill in the "How it was tested" part of the template (the exact commands you ran and their result). Your workflow needs my approval to run; I will do that. I have not run it myself.

One thing to check: the refusal text now has the format number in it. Please run tools/macos/run-summary.sh --self-test and say it still passes.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7213190104 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/277#issuecomment-7213190104). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T08:08:14Z. --- Thank you for your first pull request. The change does what the title says, and the unit test pins it. Please update the branch on main, and fill in the "How it was tested" part of the template (the exact commands you ran and their result). Your workflow needs my approval to run; I will do that. I have not run it myself. One thing to check: the refusal text now has the format number in it. Please run `tools/macos/run-summary.sh --self-test` and say it still passes.
dhruv0807 commented 2026-11-27 08:23:53 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by dhruv0807 on 2026-11-27T08:23:53Z.


Thanks! I've rebased the branch onto the latest main and pushed the update. I also ran tools/macos/run-summary.sh --self-test successfully and updated the PR description with the exact test commands and results.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7213493066 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/277#issuecomment-7213493066). Originally posted by [dhruv0807](https://github.com/dhruv0807) on 2026-11-27T08:23:53Z. --- Thanks! I've rebased the branch onto the latest `main` and pushed the update. I also ran `tools/macos/run-summary.sh --self-test` successfully and updated the PR description with the exact test commands and results.
LakshanSivakumar commented 2026-11-27 10:32:23 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T10:32:23Z.


Thank you. The rebase, the filled-in description and the self-test run are all there. The only thing left is your workflow, which needs my approval to run. Once it has run and passed I will merge. I have not run it myself.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7216005556 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/277#issuecomment-7216005556). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T10:32:23Z. --- Thank you. The rebase, the filled-in description and the self-test run are all there. The only thing left is your workflow, which needs my approval to run. Once it has run and passed I will merge. I have not run it myself.
dhruv0807 commented 2026-11-27 10:36:47 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by dhruv0807 on 2026-11-27T10:36:47Z.


Thanks for confirming! Appreciate you reviewing the changes. I'll wait for the workflow approval and its result.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7216095568 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/277#issuecomment-7216095568). Originally posted by [dhruv0807](https://github.com/dhruv0807) on 2026-11-27T10:36:47Z. --- Thanks for confirming! Appreciate you reviewing the changes. I'll wait for the workflow approval and its result.
LakshanSivakumar commented 2026-11-27 11:35:38 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T11:35:38Z.


Your workflow has run now. Clippy fails in your new test: "field assignment outside of initializer for an instance created with Default::default()" (the test build of victory-gpu). Please build the value with a struct literal (Type { field: value, ..Default::default() }) and run cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings before you push. After that it can merge.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7217253232 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/277#issuecomment-7217253232). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T11:35:38Z. --- Your workflow has run now. Clippy fails in your new test: "field assignment outside of initializer for an instance created with Default::default()" (the test build of `victory-gpu`). Please build the value with a struct literal (`Type { field: value, ..Default::default() }`) and run `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` before you push. After that it can merge.
dhruv0807 commented 2026-11-27 12:13:55 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by dhruv0807 on 2026-11-27T12:13:55Z.


Thanks! I've pushed the fix in commit 4e857b2.

I've now successfully run the exact requested command:

cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings

It completes successfully with no warnings or errors.

The test now uses a struct literal with ..Default::default() as requested.

Ready for review!

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7217993883 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/277#issuecomment-7217993883). Originally posted by [dhruv0807](https://github.com/dhruv0807) on 2026-11-27T12:13:55Z. --- Thanks! I've pushed the fix in commit `4e857b2`. I've now successfully run the exact requested command: `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` It completes successfully with no warnings or errors. The test now uses a struct literal with `..Default::default()` as requested. Ready for review!
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LakshanSivakumar/Native-Victory-macOS!277
No description provided.