Skip to content

tests: rename the multisample levels in d3d12_descriptor_test (C4456) - #909

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
dea7hsmiless:test/descriptor-levels-shadow
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
dea7hsmiless:test/descriptor-levels-shadow

Conversation

@dea7hsmiless

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: @etcetera-yt's C4456 finding (#634 (comment)); claim: #634 (comment)

What and why

runtime/test/d3d12_descriptor_test.cpp declared D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS levels inside the A8 multisample-quality check, hiding the D3D12_PLACED_SUBRESOURCE_FOOTPRINT levels[3] declared earlier in the same scope and still used later at line 871. MSVC /W4 reports C4456, and a future edit that mixed the two meanings would compile silently.

Rename the feature struct to quality_levels and its three uses. No behavior change.

The other remaining runtime C4456 in vulkan_replay.h is the separate #865 item; this PR only removes the descriptor-test one.

Tested

Windows 11 Pro 26300, MSVC 19.44, RelWithDebInfo (Ninja).

  • Recompiled d3d12_descriptor_test.cpp: the build log has 0 C4456 warnings for the file.
  • d3d12_descriptor_test: exit 0, all descriptor checks pass (A8 views, B4G4R4A4, B5G5R5A1, bindless T#/S# lookups and borders).
  • ctest --test-dir runtime/build: 32/32 passed.

No GPU-specific code changed. No game files.

AI-assisted (OpenCode, DeepSeek V4.1 Flash).

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable: test-only rename.)

The multisample-quality check declared a local 'levels' that hid the footprint array 'levels[3]' still used later in the function, which MSVC /W4 reported as C4456. Rename the feature struct to quality_levels; no behavior change.
@kapitche

Copy link
Copy Markdown
Contributor

Reviewed fb31cc7: a rename only. The inner levels becomes quality_levels in all three places (declaration, CheckFeatureSupport pointer and size, and the NumQualityLevels check), so nothing else changes and MSVC's C4456 shadowing warning goes away. d3d12_descriptor_test builds and passes from main with MSVC 14.51 on an RTX 4080 SUPER, and the change can't alter what it checks.

@Parakeet-Wheat

Copy link
Copy Markdown
Contributor

Tested fb31cc7 on an NVIDIA GeForce RTX 3070, driver 610.88, Windows 11 (26300), MSVC 19.44 (VS generator, RelWithDebInfo), Vulkan SDK 1.4.363.0: pass

AI-assisted (Claude Code).

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.

4 participants