Skip to content

fix(shader): initialize BindingLayout fields with zero defaults - #21018

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Kikoarl:fix/shader-recompiler-binding-layout-initializers
Nov 25, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Kikoarl:fix/shader-recompiler-binding-layout-initializers

Conversation

@Kikoarl

@Kikoarl Kikoarl commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

What

Ensure BindingLayout struct members have explicit default zero initializers to prevent uninitialized memory reads.

Tested

  • Verified with Ninja and CTest in RAM-disk /tmp/anyps5_build (request_serializer).
  • Verified with python3 tools/check_conventions.py --base origin/main.

Checklist

  • Description explains the problem and the change
  • Clean commit history, no extraneous commits
  • No commented-out code or unneeded comments
  • Documentation updated (TechnicalDebt.md, USAGE.md, etc.)
  • Tests added or updated
  • All tests pass locally
  • 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: none
  • AI-assisted: yes

@github-actions github-actions Bot added the shader core/shader label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5609 core/shader/recompiler/Recompiler.hpp
PR 5925 core/shader/recompiler/Recompiler.hpp
PR 6188 core/shader/recompiler/Recompiler.hpp
PR 6235 core/shader/recompiler/Recompiler.hpp
PR 6412 core/shader/recompiler/Recompiler.hpp
PR 7642 core/shader/recompiler/Recompiler.hpp
PR 9356 core/shader/recompiler/Recompiler.hpp
PR 9387 core/shader/recompiler/Recompiler.hpp
PR 9508 core/shader/recompiler/Recompiler.hpp
PR 9852 core/shader/recompiler/Recompiler.hpp
PR 9897 core/shader/recompiler/Recompiler.hpp
PR 10193 core/shader/recompiler/Recompiler.hpp
PR 10359 core/shader/recompiler/Recompiler.hpp
PR 10652 core/shader/recompiler/Recompiler.hpp
PR 11483 core/shader/recompiler/Recompiler.hpp
PR 11551 core/shader/recompiler/Recompiler.hpp
PR 12828 core/shader/recompiler/Recompiler.hpp
PR 12944 core/shader/recompiler/Recompiler.hpp
PR 13928 core/shader/recompiler/Recompiler.hpp
PR 13929 core/shader/recompiler/Recompiler.hpp
PR 14032 core/shader/recompiler/Recompiler.hpp
PR 14944 core/shader/recompiler/Recompiler.hpp
PR 15548 core/shader/recompiler/Recompiler.hpp
PR 16391 core/shader/recompiler/Recompiler.hpp
PR 17022 core/shader/recompiler/Recompiler.hpp
PR 17056 core/shader/recompiler/Recompiler.hpp
PR 20030 core/shader/recompiler/Recompiler.hpp
PR 20111 core/shader/recompiler/Recompiler.hpp
PR 20248 core/shader/recompiler/Recompiler.hpp
PR 20519 core/shader/recompiler/Recompiler.hpp
PR 22071 core/shader/recompiler/Recompiler.hpp
PR 22424 core/shader/recompiler/Recompiler.hpp
PR 22647 core/shader/recompiler/Recompiler.hpp
PR 22692 core/shader/recompiler/Recompiler.hpp
PR 23242 core/shader/recompiler/Recompiler.hpp
PR 23243 core/shader/recompiler/Recompiler.hpp
PR 23244 core/shader/recompiler/Recompiler.hpp
PR 23258 core/shader/recompiler/Recompiler.hpp
PR 23281 core/shader/recompiler/Recompiler.hpp
PR 24049 core/shader/recompiler/Recompiler.hpp
PR 25010 core/shader/recompiler/Recompiler.hpp

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The four zero initializers make default-initialized BindingLayout objects start with defined values, and I found no blocking defect in the reviewed change.

What I ran

Reviewed head 31831f576e0f008efa7382f885122ba28713c555 using repo_read.py reader tools. No build or tests were run by me; the description reports a request_serializer test and convention check, but I did not independently verify them.

repo_read.py cat core/shader/recompiler/Recompiler.hpp 378 410
repo_read.py search BindingLayout
repo_read.py search descriptorSet|firstBinding|pushConstantOffsetBytes|pushConstantSizeBytes

Results

Check Result Note
Source review passed One changed file read
Build and tests not run Author reports checks; not independently run
Negative control not run No test change in this patch

Findings

Blocking

None.

Non-blocking

None.

Sources

The change adds zero defaults to all four BindingLayout members in core/shader/recompiler/Recompiler.hpp:389-392.

Not verified

No files were excluded from the review bundle. The sole changed file, core/shader/recompiler/Recompiler.hpp, was read. Build and test results in the description were not independently verified; console behavior was not tested.

To get this to a good state

Nothing is required.

@kiwe147

kiwe147 commented Nov 21, 2026

Copy link
Copy Markdown

Tested head 31831f576e, applied with git apply on main fd4aeed483 together with the other 28 PRs of one batch (#22683, #23796, #23923, #24367, #24370, #24409, #24486, #24587, #10623, #18903, #18941, #19461, #21303, #21451, #21965, #23477, #23478, #23726, #24463, #12827, #14127, #14991, #20063, #24103, #24331, #24508, #24565, #15838). All applied without conflicts and the whole tree built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. GPUs: NVIDIA GeForce RTX 3080 (driver 621.24) and the AMD Radeon iGPU of the CPU (gfx1036, driver 32.0.21036.18). No validation layer. iGPU run: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_GPU="AMD Radeon", agc_/video tests only.

tests RTX 3080 iGPU
none: no test of its own in this PR - -

Whole batch: the full ctest -j 12 (6523 tests) on the RTX 3080 has 5 failing tests; the 4 that also fail on main fd4aeed483 are agc_driver_stencil_plane_memory, agc_driver_msaa_dcc_unwatch, agc_storage_write_back_host_retile, and pr_overlap_names, which needs a newer Python than my 3.10. Intermittent in this run (pass when rerun alone, or known flaky): agc_driver_store_over_untracked. Traced to other PRs of the batch, each by reverting it and testing again: #24409 (guest_usbd); none is in this PR's area. Failing tests I could not trace to a single PR (reverting the likely candidates did not clear them): guest_net_dns_info, test_script_registration. The 2126 agc_/video tests on the iGPU have 2 failing: agc_driver_stencil_plane_memory, agc_driver_store_over_untracked (agc_driver_stencil_plane_memory also fails on main).

This is one combined tree, not a run of this PR alone.

AI-assisted: yes (Claude Code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants