[PR #1050] [MERGED] amdgpu: Fix buffer comparison by naming padding fields for initialization. #1903

Closed
opened 2026-02-27 21:14:23 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1050
Author: @squidbus
Created: 9/24/2024
Status: Merged
Merged: 9/25/2024
Merged by: @georgemoralis

Base: mainHead: buffer-cmp


📝 Commits (1)

  • 692f831 amdgpu: Fix buffer comparison by naming padding fields for initialization.

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 src/video_core/amdgpu/resource.h (+2 -2)

📄 Description

Comparing two buffers was not working because memcmp is not guaranteed to work properly for bitfield structs with anonymous padding, as the padding is not initialized.

This was causing some shaders to balloon in binding count since buffers were not properly being matched and de-duplicated. It also caused pipeline compilation failures in CUSA16429 since two different permutations could have different memcmp results in de-duplication and thus compile with different buffer bindings.


🔄 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/1050 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 9/24/2024 **Status:** ✅ Merged **Merged:** 9/25/2024 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `buffer-cmp` --- ### 📝 Commits (1) - [`692f831`](https://github.com/shadps4-emu/shadPS4/commit/692f831de788b5ff6f2a56b8b2e57d640d82cef2) amdgpu: Fix buffer comparison by naming padding fields for initialization. ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/video_core/amdgpu/resource.h` (+2 -2) </details> ### 📄 Description Comparing two buffers was not working because `memcmp` is not guaranteed to work properly for bitfield structs with anonymous padding, as the padding is not initialized. This was causing some shaders to balloon in binding count since buffers were not properly being matched and de-duplicated. It also caused pipeline compilation failures in CUSA16429 since two different permutations could have different memcmp results in de-duplication and thus compile with different buffer bindings. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:14:23 +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#1903
No description provided.