[PR #2857] [MERGED] lower_buffer_format_to_raw: Fix handling of format remapping. #3033

Closed
opened 2026-02-27 22:02:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2857
Author: @squidbus
Created: 4/27/2025
Status: Merged
Merged: 4/27/2025
Merged by: @squidbus

Base: mainHead: fix-tbuf-mapping


📝 Commits (1)

  • ed4bec6 lower_buffer_format_to_raw: Fix handling of format remapping.

📊 Changes

1 file changed (+10 additions, -5 deletions)

View changed files

📝 src/shader_recompiler/ir/passes/lower_buffer_format_to_raw.cpp (+10 -5)

📄 Description

Format and swizzle remaps and number type conversions were not being properly applied when lowering texel buffers to raw buffer accesses:

  • All instruction-provided formats need to have remapping applied.
  • Instead of always using AmdGpu::MapNumberConversion on the number format to get the conversion type, it should only be used for instruction-provided formats. For buffer-provided formats, we should use buffer.GetNumberConversion() as the number format we see will already have been remapped.

Fixes one issue seen in https://github.com/shadps4-emu/shadPS4/pull/2841 because the remaps weren't actually being emitted for texel buffers.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/2857 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 4/27/2025 **Status:** ✅ Merged **Merged:** 4/27/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `fix-tbuf-mapping` --- ### 📝 Commits (1) - [`ed4bec6`](https://github.com/shadps4-emu/shadPS4/commit/ed4bec655e13d9c50bcae781162fa12c59f6c549) lower_buffer_format_to_raw: Fix handling of format remapping. ### 📊 Changes **1 file changed** (+10 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/shader_recompiler/ir/passes/lower_buffer_format_to_raw.cpp` (+10 -5) </details> ### 📄 Description Format and swizzle remaps and number type conversions were not being properly applied when lowering texel buffers to raw buffer accesses: * All instruction-provided formats need to have remapping applied. * Instead of always using `AmdGpu::MapNumberConversion` on the number format to get the conversion type, it should only be used for instruction-provided formats. For buffer-provided formats, we should use `buffer.GetNumberConversion()` as the number format we see will already have been remapped. Fixes one issue seen in https://github.com/shadps4-emu/shadPS4/pull/2841 because the remaps weren't actually being emitted for texel buffers. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:02:11 +03:00
Sign in to join this conversation.
No milestone
No project
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.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3033
No description provided.