feat(agc): support guest 4_4 texture format #16253

Merged
akkadbakkad89 merged 2 commits from upstream-pr/16253 into main 2026-11-16 05:37:52 +00:00
akkadbakkad89 commented 2026-11-06 00:31:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-11-06T00:31:53Z.


What

Maps a GFX10 image-descriptor format that titles can describe but the driver rejected with unsupported guest texture format (the 5_5_5_1 half of this PR was dropped — it duplicated #14628):

  • guest format 137 (4_4_UNORM, channels least-significant-first [G4][R4]) -> VK_FORMAT_R4G4_UNORM_PACK8, sampled-only: numeric class + GetFormatInfo {4,4} at {0,4}. No storage view (1-byte packed elements fail the conversion path's 2/4-byte check) and it needs VK_EXT_4444_formats; unsupported hosts keep the existing throw.

Format names/layouts follow PAL's gfx10_3.yaml/gfx9_plus_merged_enum.h (least-significant-channel-first naming) and Mesa's ac_translate_tex_dataformat. The remaining unmapped defined IDs (depth-stencil aspect plumbing, 2x1-element 422 formats, USCALED/SSCALED shader scaling, Fmask/video/reserved) are recorded in the libSceAgcDriver debt file.

Tested

Windows 11, RTX 3070 (driver 617.42): ctest --test-dir build -R 'buffer_format|gcn_buffer|gpu_buffer|converted_unorm|packed16|image_pck|texture_format' with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_LAYER_PATH=D:\VulkanSDK\Bin, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation - 12/12 pass; the 5_5_5_1 work (incl. agc_driver_image_packed16_storage_135) was later dropped in aa70770 for duplicating #14628, and the same suite plus packed16 133/134/136 storage, agc_driver_image_packed16_load and agc_driver_graphics re-passed on the reduced diff. vulkaninfoSDK.exe --summary confirms the layer loads (adding layers "VK_LAYER_KHRONOS_validation"); no was not found but was requested, no VUID- output. Not run against a title: no capture exercising format 137 exists.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA RTX 3070, driver 617.42, Windows 11
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5180884134 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16253). Originally posted by [akkadbakkad89](https://github.com/akkadbakkad89) on 2026-11-06T00:31:53Z. --- ### What Maps a GFX10 image-descriptor format that titles can describe but the driver rejected with `unsupported guest texture format` (the 5_5_5_1 half of this PR was dropped — it duplicated #14628): - guest format 137 (`4_4_UNORM`, channels least-significant-first `[G4][R4]`) -> `VK_FORMAT_R4G4_UNORM_PACK8`, sampled-only: numeric class + `GetFormatInfo` `{4,4}` at `{0,4}`. No storage view (1-byte packed elements fail the conversion path's 2/4-byte check) and it needs `VK_EXT_4444_formats`; unsupported hosts keep the existing throw. Format names/layouts follow PAL's `gfx10_3.yaml`/`gfx9_plus_merged_enum.h` (least-significant-channel-first naming) and Mesa's `ac_translate_tex_dataformat`. The remaining unmapped defined IDs (depth-stencil aspect plumbing, 2x1-element 422 formats, USCALED/SSCALED shader scaling, Fmask/video/reserved) are recorded in the libSceAgcDriver debt file. ### Tested Windows 11, RTX 3070 (driver 617.42): `ctest --test-dir build -R 'buffer_format|gcn_buffer|gpu_buffer|converted_unorm|packed16|image_pck|texture_format'` with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_LAYER_PATH=D:\VulkanSDK\Bin`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` - 12/12 pass; the 5_5_5_1 work (incl. `agc_driver_image_packed16_storage_135`) was later dropped in `aa70770` for duplicating #14628, and the same suite plus `packed16` 133/134/136 storage, `agc_driver_image_packed16_load` and `agc_driver_graphics` re-passed on the reduced diff. `vulkaninfoSDK.exe --summary` confirms the layer loads (`adding layers "VK_LAYER_KHRONOS_validation"`); no `was not found but was requested`, no `VUID-` output. Not run against a title: no capture exercising format 137 exists. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA RTX 3070, driver 617.42, Windows 11 - [x] AI-assisted: yes
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
boykopovar/AnyPS5!16253
No description provided.