Skip to content

fix(agc): name the S# words in a refused guest sampler descriptor's error - #2051

Open
Thimo188 wants to merge 1 commit into
mainfrom
upstream-pr/28270
Open

Thimo188 wants to merge 1 commit into
mainfrom
upstream-pr/28270

Conversation

@Thimo188

@Thimo188 Thimo188 commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Imported from boykopovar/AnyPS5#28270, originally opened by Remi-Bon.

Source commit: 4f16777a038aa213824538ec4f9215bbd3f9fc56. The import branch preserves this fetched upstream PR snapshot. The description and validation below are copied from upstream; no new code changes or test runs were made for this import. Original reviews, discussions, and attachments remain at the linked upstream PR.


Requested by Chef · project thread

What

A guest sampler descriptor that the driver refuses fails with a message such as "guest sampler descriptor uses point preclamping which is not implemented", but not which S# it was. Texture and buffer refusals already name their T# and V# words. DecodeSamplerResource now appends the four S# words to the error of every refusal it throws, as (S# xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx). The decode itself is unchanged.

Open PRs boykopovar#16935, boykopovar#14964 and boykopovar#26197 change the same function's signature or add refusals in it; none of them reports the descriptor words. Whichever lands second needs a one-line rebase.

Tested

  • Windows 11, MinGW Release build.
  • ctest --test-dir build -R "agc_graphics_profile_draw|sampler|image_table|border" -V: 60/60 passed, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and VK_LOADER_DEBUG=layer. The loader log shows Insert instance layer "VK_LAYER_KHRONOS_validation", has no was not found but was requested by env var VK_INSTANCE_LAYERS, and contains no VUID-.
  • The guest sampler tests require the words in the point preclamping refusal; that check fails on main and passes with this change.
  • In PPSA01317 (Gran Turismo 7) the words identified the refused samplers: one sets POINT_PRECLAMP, the others force sRGB decoding.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: AMD Radeon RX 9070, AMD driver 2.0.416 (Vulkan 1.4.359), Windows 11
  • AI-assisted: yes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Errors encountered while decoding four-word sampler descriptors now include the descriptor’s values, making it easier to identify which sampler configuration caused the failure. For descriptors with other word counts, the existing error message is retained.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Sampler error details

Layer / File(s) Summary
Add descriptor context to decoder errors
core/libs/prx/libSceAgcDriver/Graphics/src/GuestSamplerResource.cpp, core/libs/prx/libSceAgcDriver/tests/GuestSamplerResource.cpp
The public decoder wrapper appends the four-word descriptor to caught runtime errors when the input contains four words. The point-preclamp test checks the formatted descriptor in the error message.

Possibly related PRs

  • Thimo188/AnyPS5#288: Changes refusal paths and decode logic in DecodeSamplerResource, which this PR also modifies.

Change: Other

Merge Risk: Minimal · up to 4f167

This change adds the sampler descriptor words to refused-sampler error messages to make failures easier to diagnose. Decoding behavior is unchanged, and no concrete merge-blocking risk was found.

Security architecture risk: Minimal · up to 4f167

Sampler refusals now identify the descriptor that failed. The AGC driver still accepts and rejects the same descriptors, and the change does not require callers or operators to do anything differently.

Finishing Touches

Generate unit tests (beta)

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

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 2
  • Waived: $0.50 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 904ea247-f05d-45f2-a65f-d1d1b790a9eb
Commits

Reviewing files that changed from the base of the PR and between 4131f51 and 4f16777.

Files selected for processing: 2

  • core/libs/prx/libSceAgcDriver/Graphics/src/GuestSamplerResource.cpp
  • core/libs/prx/libSceAgcDriver/tests/GuestSamplerResource.cpp

Limit details: You’ve used all 10 included reviews currently available.

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.

2 participants