Skip to content

Tests: cover RGBA8 RTV automatic mips, predication and range bounds (D3D-70 follow-up) - #785

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
73N1X:test/rgba8-rtv-subresource-regressions
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
73N1X:test/rgba8-rtv-subresource-regressions

Conversation

@73N1X

@73N1X 73N1X commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Follow-up to merged #630 (D3D-70). The existing tests cover explicit mip counts and ordinary array clears, but do not compare automatic mip chains or predicated mixed-format subresource clears against WARP.

This adds tests only, retaining the existing three RGBA8 formats:

  • MipLevels=0 must resolve to the full chain before enumerating readback footprints.
  • Whole-view and rectangle clears of every mip, as 2D views and two-layer array ranges, with explicit or automatic mip counts. Rectangle cases mix all UNORM/sRGB/UINT pairs on the same range and retain descriptor-rewrite checks.
  • Predicates disabled, zero and nonzero, both EQUAL_ZERO and NOT_EQUAL_ZERO. Predicated cases explicitly skip when conditional rendering is unavailable. All other mips/layers and skipped clears must retain literal per-subresource UINT sentinels.
  • CPU replay checks for predicated mip/range geometry and valid end boundaries, plus invalid mips, zero ranges and overflowing layer ranges. Frontend checks also overwrite valid descriptors before trying invalid ranges, including automatic-mip boundaries.

Claim: #313 (comment)

No runtime behavior change was needed: these cases pass on main. This does not implement D3D-69/#621's format generalization or include any pending PR.

Validation on head 6998954a1549e17730204acbf09afa72d9daae4e, based directly on main 8df277fb035b384971497f6f9790f7fc4b9ec1d1:

  • RX 5700 XT, driver 32.0.21045.5002, Windows build 26200, MSVC 19.44, RelWithDebInfo; synthetic fixtures only, no game data.
  • Full runtime build passed.
  • d3d12_typeless_rtv_test: 799 WARP comparisons (79 existing + 720 new) and 23 invalid-view rejections passed. Conditional rendering was enabled. Selected normalized channels retain the existing one-byte tolerance; UINT and untouched sentinel bytes are exact.
  • typeless_rtv_test: 58 scenarios passed (31 existing + 27 new).
  • GPU replay suites A-E, including predication, passed. Vulkan validation and synchronization validation reported no errors in these scoped GPU runs.
  • Negative control on the initial 67204bf base: temporarily forcing automatic mip resolution to one mip causes the new GetDesc assertion to fail; restoring production code makes the test pass. No mutation remains in this branch.
  • CTest is 30/31, not a full pass: the unchanged d3d12_vulkan_device fails its copy comparison (2/69 cases) on this AMD device. I restored both modified test files to exact main 8df277f, rebuilt, and ran the complete suite: the same 30/31 result and device-test failure. Then restored this branch's fixtures and rebuilt successfully.
  • git diff --check passed. Optional descriptor sampling and register-preservation checks were unavailable (glslangValidator/ml64 absent).

@Vonsek

Vonsek commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Verified predicate rebinding within one command list on 6998954. The stock test passed 799 WARP comparisons and 23 invalid-view checks separately on RTX 5080 (616.92) and Radeon(TM) Graphics (26.10.1), with conditional rendering and Vulkan validation enabled.

In a separate synthetic case, a single 24-byte upload buffer holds three 64-bit words. With EQUAL_ZERO, the first clear reads offset 8 and the second reads offset 16. I tried the values (0,1) and (1,0) at those offsets. A UINT whole-view clear and a UNORM rectangle clear target mip 1, layers 1–2, of a 5×3 four-layer automatic mip chain. After disabling predication, a final UINT clear writes (200,199,198,197) to the sole texel at mip 2, layer 3.

Both drivers and WARP matched all 72 literal expected RGBA pixels in each ordering. For example, at mip 1, layer 1, (0,1) left the left texel at its sentinel (15,31,73,127) and made the right one (0,255,0,255). With (1,0) both were (7,128,255,9).

Two negative controls on each Vulkan driver, leaving WARP and the CPU expectations unchanged:

  • Reusing offset 8 for the second clear produced exactly two wrong texels per ordering, the right-hand texel in each selected layer.
  • Omitting the predication reset produced exactly one wrong texel when the second clear was suppressed, the final texel at mip 2, layer 3. The other ordering still matched 72/72.

@ItsNotRexed
ItsNotRexed merged commit 507b72e into ItsNotRexed:main Nov 22, 2026
10 checks passed
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.

3 participants