Skip to content

tests: remove two MSVC shadow warnings in d3d12_vulkan_device - #4741

Open
illusionart453-max wants to merge 1 commit into
ItsNotRexed:mainfrom
illusionart453-max:fix/device-test-shadow-warnings
Open

illusionart453-max wants to merge 1 commit into
ItsNotRexed:mainfrom
illusionart453-max:fix/device-test-shadow-warnings

Conversation

@illusionart453-max

Copy link
Copy Markdown

The zero-fill buffer scenario in d3d12_vulkan_device_test declares readable and zero inside scopes that already contain locals with those names. MSVC /W4 reports C4456 at lines 6743 and 6750.

Rename the inner barrier to not_zeroed_readable and the expected zero bytes to expected_zero, including their uses.

Claimed as a new BUILD item (ID pending assignment)
#4683 (comment)

Reported in
#4683 (comment)

Verified on Windows 11, MSVC 19.44, Windows SDK 10.0.26100, RelWithDebInfo, base 98fa503.

  • Built d3d12_vulkan_device_test before the change and reproduced both C4456 warnings.
  • Rebuilt the same target after the change with no warnings.
  • git diff --check passed.

Build verification only. Host GPU is NVIDIA RTX 5060, driver 610.88.
AI-assisted (Codex). No game files.
Depends on no other PR.

@Kam471 Kam471 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.

Built and ran d3d12_vulkan_device_test at f9e955dbb on Windows 11, RTX 5070 Ti: exit 0 (all format/copy/clear/feature sections matched); git diff --check clean.

The two MSVC variable-shadowing warnings in the test are gone (all and the texture loop locals renamed), with no behaviour change. No blocking issue.

@Atomic258

Copy link
Copy Markdown

Independent verification on NVIDIA hardware.

  • Head SHA: f9e955dbbf2b2a4eaaa79c7de5397feec0aba870
  • OS: Windows 11 x64; GPU: NVIDIA GeForce RTX 5090 (driver 617.42); Vulkan SDK 1.4.363.0; MSVC 14.44 + Ninja, RelWithDebInfo (/W4)
  • Built d3d12_vulkan_device_test: [4/4] steps, exit 0, zero warnings in d3d12_vulkan_device_test.cpp (the two C4456 shadow warnings are gone).

Commands / results:

  • .\d3d12_vulkan_device_test.exe — exit 0 (all format/copy/clear/resolve/feature sections matched; 0 mismatches; the zero-filled-first-use buffer scenario that was renamed passes).

Red control (warnings): reverted only runtime/test/d3d12_vulkan_device_test.cpp to origin/main, rebuilt — both warnings reproduced:

  • d3d12_vulkan_device_test.cpp(6743): warning C4456: declaration of 'readable' hides previous local declaration
  • d3d12_vulkan_device_test.cpp(6750): warning C4456: declaration of 'zero' hides previous local declaration

Restored and rebuilt — no warnings, test still exit 0. Pure rename, no behaviour change; build+test pass is sufficient.

AI-assisted (Devin).

@tupacfan04

Copy link
Copy Markdown
Contributor

PASS. Head f9e955db, one commit on current origin/main, merge clean.

  • Renames are genuine and scoped: the outer readable is at :5702 and zero at :5751, both enclosing the inner scopes; :6743/6744 now use not_zeroed_readable and :6750/6751 use expected_zero, each exactly twice (declaration + use), with no collision. The diff is 1 file, 4+/4-, pure rename.
  • MSVC 19.51 x64 / Ninja / RelWithDebInfo / /W4 /permissive- reproduced both C4456 warnings on base 98fa503f (:6743 hides :5702, :6750 hides :5751) and builds the head with 0 warnings. d3d12_vulkan_device_test.exe exits 0, all sections matched, including the zero-filled buffer case.
  • tests/test_ctest_registration.py 4/4, compileall and git diff --check clean.

The body satisfies AGENTS.md (MSVC 19.44, Windows SDK 10.0.26100, RTX 5060 / 610.88, AI-assisted). Only nit: the coordination item ID still says "pending assignment" although the claim comment is linked.

Approve. AI-assisted review, no game files.

@kingzzim7-create

Copy link
Copy Markdown

Tested f9e955d together with #4743 (3db8ea4), merged onto main 98fa503, on Windows 11, VS 2026 (MSVC 14.52.37025), RTX 4060 Ti:

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.

5 participants