Repository navigation
test(d3d12): verify heap and static POINT/LINEAR samplers in M2 - #4192
oguzhanozfe wants to merge 6 commits into
Conversation
…lers The Vulkan device parsed a root signature's static samplers and dropped them, so a shader holding one's S# by value missed in the hash table and sampled through the fallback sampler. Each one now gets a sampler in set 0 and a key in the hash table at root-signature creation, encoded as CreateSampler2 encodes the same description (1.0, 1.1 and 1.2 blobs, the static border-colour enum, the 1.2 flags). d3d12_descriptor_test checks the key before and after for four root signatures and samples with three of them on the GPU. docs/d3d12_vulkan.md no longer says both that they are registered and that they are not. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Added Radeon iGPU verification at 82ef2f1. All four stock sampler draws matched 4,096/4,096 pixels each with zero channel error, and the addressing control passed. Zero core or synchronization validation errors. AI-assisted. |
Kam471
left a comment
There was a problem hiding this comment.
Built and ran d3d12_m2_textured_test at 82ef2f1f on Windows 11, RTX 5070 Ti (Vulkan 1.4.357, LLVM_MC from LLVM 21, SDK spirv-as/spirv-val):
- Translator: 4 shaders, 4 translated, 4 pass spirv-val (including
ps_m2_static.asm). - M2 heap: POINT exact, LINEAR maximum RGBA8 error 0 over 4096 pixels each.
- M2 static: POINT exact, LINEAR maximum RGBA8 error 0 over 4096 pixels each.
- The original heap path still matches: 4096/4096 pixels error 0, sampler control WRAP left / CLAMP right differs on 1536 pixels, 2 image entries + 1 sampler entry in the hash table.
ctest -R '^d3d12_m2_textured$'-> 1/1 passed (0.22 s).
The static draws use only CreateRootSignature, SetGraphicsRoot32BitConstants and the SRV heap (no sampler heap), so the zero error confirms that CreateRootSignature alone registers the static sampler's S# in the hash table while the heap POINT/LINEAR paths stay correct in the same draw. This also exercises #3494's registration and #3717's CPU reference as stacked here. No blocking issue.
|
Tested
AI-assisted (Claude). No game files. |
|
Tested 82ef2f1 on RTX 5090, 621.24, Windows 11: pass. Built the runtime from this tree and ran the two tests it touches: So the static POINT/LINEAR samplers reach the M2 textured quad with the expected pixels and the heap checks still pass. |
Claimed in the coordination issue: #4084 (comment)
Depends on: #3494 (register root-signature static samplers) and #3717 (heap POINT/LINEAR CPU reference). The incremental test change is ce46667.
What and why
Render the same M2 quad four ways: heap POINT, heap LINEAR, static POINT and static LINEAR. The static root signatures each declare one sampler. The original assembly fixture receives its S# by value through root constants and loads only the SRV from a descriptor table. Only the SRV heap is bound for the static draws.
Check each static S# lookup before and after root-signature creation, before creating any heap samplers or the corresponding PSO. Static keys use MaxLOD zero and therefore differ from the heap sampler keys even though all sample the same single mip. All four readbacks are compared independently against the same CPU nearest and bilinear reference functions. LINEAR allows one RGBA8 quantization level.
Tested
Clean GitHub checkout of ce46667, Windows, MSVC, GeForce RTX 3090 driver 621.24, Vulkan validation enabled. Built target d3d12_m2_textured_test and ran:
All 4096 pixels matched for each of the four draws, with zero maximum channel error. The separate addressing control still differed from the plain scene at 1536 pixels as expected. All four original shader fixtures translated and passed spirv-val. A local negative control that supplied the static POINT key for the LINEAR draw failed at pixel (4,0), red 0 versus expected 2. The GPU-runner Python unit suite passed 40 tests.
Checklist