Repository navigation
Conversation
|
Tested
No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent). |
|
With Static review, not built or run. |
|
A note from comparing this with #160, which covers the same a16 bias and // Special handling of bias when A16 is on. Bias is of type half but
// occupies full 32-bit.
SDValue Bias = DAG.getBuildVector(
MVT::v2f16, DL,
{Op.getOperand(ArgOffset + I), DAG.getPOISON(MVT::f16)});so with a16 the bias keeps its own dword but holds a half in the low 16 bits (the upper half is undefined); the offset and the comparison reference stay 32-bit. Read as an f32, an f16 bias comes out as a denormal near zero, so the sample would lose its bias without failing. One related point I got wrong myself and fixed in #160: on GFX10.3 a16 does not make the derivatives 16-bit (only the From the sources only, not run on hardware. No game data used. |
6c8af09 to
3eab56a
Compare
|
Thanks @Sunkiller-qc and @r4tedx for the great catches! Updated and rebased onto
|
…amp variants Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Measured on the full retail shader pack (26,503 containers) with
All four clear the 108 "biased image sample with 16-bit coordinates" programs identically. #73 and #318 also clear the 27 |
3eab56a to
7cc2445
Compare
In GFX10/RDNA2 MIMG instructions with a16=1, offset (_o), bias (_b) and z-compare (_c) remain full 32-bit VGPRs at the start of vaddr, while gradients, coordinates, LOD and clamp are packed in 16-bit pairs starting after them (matching gfx10::fields::image_addr_dwords). - Split address reading into full 32-bit prefix VGPRs and a16-packed trailing components, removing the a16+image_sample_b bailout. - Support _cl LOD-clamp variants (image_sample_cl, image_sample_b_cl, image_sample_d_cl, image_sample_c_cl) by passing the trailing clamp component to DXIL's clamp parameter. - Check unsupported cube sample modes before reading coordinates so cube gradient samples report the right error instead of an out-of-bounds address.
The tester tree (upstream main ffe310e plus its PRs, update 8; see its INTEGRATION.md) ran 11-25 minutes in the world on an RTX 5070 without a device removal. Where both sides carry the same PR (the wave64 stack #223/#233/#320 with #439 and #180, #454, #336, #259, #331 and others), the tester tree's newer head is taken; our own work and the PRs only we merged are kept. Conflicts, file by file: - descriptor/host.rs: the tester layout (`spare`, the guard slot after the dynamic slots, `free_table`, the capped sampler heap). A capped view heap keeps `capped_reserve()` dynamic slots, now 2^18 by default (the tester measurement, and our 91fed158), still `VICTORY_DYNAMIC_SLOTS` in diagnostics builds; uncapped hosts keep our 2^19. Our slot statistics (TAKEN/PEAK/SHORT), the bindless plan cache (`CommittedRegions`, `timed_valid_title_address`, `timed_find`, `title_bounds`) and the revision triple are kept beside the tester's `guard_slot`. - Buffer states: the tester tree's buffer-state tracker (#334: every list moves host copies of title memory between GENERIC_READ and UNORDERED_ACCESS and back to common before it closes) and depth twins (#469) are taken. #40's enhanced/legacy indirect barriers (the indirect prelude, `use_indirect_buffers`, the title buffer handoff mirrored in `host_barrier`) cannot share buffers with that tracker and are dropped; #40's argument checks (`byte_len`, exact spans, overflow-safe clamp shader, aligned counts) stay. `indirect::bound` and #282's `rectangles` go through `buffer_state`, and `indirect::execute` (#334) replaces `done`. #178's DXC fallback compiles both of our passes. Our segments (#387: `close` ends the segment, `close_native` closes a native list) carry the tracker: each native list returns its buffers to common and its twins to their depth targets, and each prelude also holds our texture uploads. - shadow.rs: our write flow (`queue_write`, one `snapshot` after the batch's refreshes, `finish_writes`, the unchanged-page cache) with #261's copy-back that also gives the snapshot the title's bytes; its tests run through our flow. - pipeline/make.rs: #275's per-frame budget and per-pipeline wake pair, with our compute waits (a dispatch waits for its pipeline, up to 20 s). - pipeline/library.rs: the tester version (#347, #275's saver thread); our concurrent-write test kept. shader_cache.rs: our byte-returning cache API with #358's "translated, only not kept". - draw.rs: #493's root SRV tables; where no table can stand in, our drop of a draw whose root view is unset or outside title buffers. Our refusal of a table offset past the capped heap stays. - resource.rs: `HostTexture` has both our `staged` generation and the depth twin. - Shaders: the tester's lower.rs for the wave64 stack, #160's image sampling (it covers our #73 and #136 sample forms) and #453/#587; kept from our side: #136's preference for an image or buffer use of a descriptor read as data and its `s_buffer_` arm, #422's nearest-even narrowing (also for #169's d16 loads and #453's interpolation), #452's spin-wait limit, #391's LDS limit, #302's spilled root arguments (now in `NativeProgram::translation_ir`), #136's PSV0 interpolation beside the tester's row harmonisation. split_tests.rs, lane_read_loop_tests.rs and docs/wave64-on-wave32.md are the tester versions (the same PRs at newer heads). - Tests: #483's heap guard dwords filled in our GPU tests of #200 (v_div_scale) and #437 (scalar loads from a raw view), which read through the guard slot otherwise; #334's debug-layer test passes an offset to our `indirect::bound`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndards Docs: contributing guide points at the map, code standards and glossary added
…OD-clamp variants
…OD-clamp variants
In GFX10/RDNA2 MIMG instructions with
a16=1,offset(_o),bias(_b), andz-compare(_c) remain full 32-bit VGPRs at the start ofvaddr, while gradients, coordinates, LOD, and clamp are packed in 16-bit pairs starting after them (matchinggfx10::fields::image_addr_dwords).Changes
crates/victory-shader/src/emit/lower.rsinto full 32-bit prefix VGPRs (addr_u32) anda16-packed trailing components (addr_packed), removing thea16+image_sample_bbailout._clLOD-clamp variants (image_sample_cl,image_sample_b_cl,image_sample_d_cl,image_sample_c_cl) by passing the trailing clamp component to DXIL'sclampargument.unorm/ gradients /get_lod) ahead of coordinate reads so cube gradient samples report the right reason instead of an out-of-bounds address.Verification
cargo test -p victory-shader: 57/57 passed.victory translate --validateon GTA VIshaders.rpf(26,084 programs):a biased image sample with 16-bit coordinates:108→0image_sample_d_cl:27→012,272→12,316(+44 complete shaders, all passingdxil.dllvalidation with 0 new validator errors).