Repository navigation
l_post=own direct route: the filter writes the game's texture (speed step 2) - #167
Merged
Merged
Conversation
…_filter_direct) - clean/dx12/kernels/post_filter.hlsl: l_post_filter_direct (co=-, rs=direct), the analytic filter w64/post_filter_c1_s4 with the output in the game's output texture: times pi (native_direct_scale), framebuffer_half's bytes with output_rne16, alpha 1 (what the FP32 output then l_direct_store stored). The lane of channel 0 gathers channels 1, 2 from its neighbour lanes. The buffer form's ISA is unchanged. - runtime: the direct route launches it in place of the filter + l_direct_store; no FP32 output buffer there. l_direct_store is removed (l_post_direct.hlsl keeps l_direct_color). - post_tf_d3d12_check.py --store: l_post_filter_direct against HIP's output-copy rows (and an RGBA32F texture against HIP's FP32 output); its out_p untouched. - kernel_sets.json: l_post_filter_direct for l_direct_store in Model L's set (Model M: 46). Direct route, 1440p Quality: 4.411 -> 4.310 ms frame span; 1080p Quality: 2.517 -> 2.497 ms. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #89
Step 2 of the
l_post=ownspeed work. On the direct-resource route (games), the filter now writes the game's texture itself.l_direct_storeand the FP32 output buffer's round trip are gone. Stacked on #166.What
clean/dx12/kernels/post_filter.hlsl: newl_post_filter_direct(co=-,rs=direct, D3D12 only). It is the analytic filterw64/post_filter_c1_s4with its output going to the game's output texture instead ofout_p, which it doesn't write.l_direct_storestored. That is, times pi vianative_direct_scalewhen pi != 1;framebuffer_half's bytes withoutput_rne16(±65504 clamp, round to nearest even; NaN kept); alpha 1.w64/post_filter_c1_s4is unchanged: its RGA ISA is identical to D3D12 l_post_recon(_p12): smaller and faster, byte for byte the same (l_post=own speed, step 1) #166's.l_post=ownon the direct route: launchesl_post_filter_directin place of the filter +l_direct_store. No FP32 output buffer is allocated there; onlycolor_netforl_direct_color. The port list namesl_post_filter_direct.clean/dx12/kernels/l_post_direct.hlsl:l_direct_storeremoved;l_direct_colorkept.clean/dx12/tests/post_tf_d3d12_check.py --store: now runsl_post_filter_directon the display image against HIP's output copy of it.kernel_sets.json:l_post_filter_directreplacesl_direct_storein Model L's set. Model M: 46.Byte identity (GPU, one slot per run)
post_tf_d3d12_check.py --store --seeds 2:l_post_filter_direct→ RGBA16F texture withoutput_rne16, against HIPpost_filter_c1_s4_o16(pi 1) /post_filter_h(pi 1.25, 1.375, 30000) rows; 2 cases: RGBA32F texture against HIP's FP32 output + alpha 1out_puntouchedw64/post_filter_c1_s4(FP32) against HIP, same cases--direct)orig_w64/post_tf_f32_p12_diet_vsit_directand the analytic direct forms identical; negative control caughtl_post=ownagainst the HIP Model L frame (l_d3d12_own_post_check.py)native_direct_test, Model L,l_post=own, matrix)l_post_filter_directon the 96 direct frames (nol_direct_store); the staged frames keep the filter +scale_rgbnative_direct_testwithout the option)Timing
native_direct_test ... bench, Model L,l_post=own, synthetic model. GPU frame span, median of 1,500 samples (3 rounds of 500, every measurement window valid). #166's program against this branch's, the same ports.l_direct_store)The buffer route (
l_d3d12_profile.py) runs the same kernels as in #166.Negative result: the full reconstruction + filter fusion (not in this PR)
The first step 2 was a true fusion:
l_post_tf_p12, reconstruction and the analytic filter in one kernel, walking output strips with a ring of filtered rows in LDS as Model M's fused post does.output_rne16at pi 1.375, the unstaged route, chunk edges), the frame check 11 / 11, and direct against staged 96 / 96.Why: fusion can only save the filter launch and the display image's write and read, about 0.05–0.08 ms. In exchange, every step of the strip walk holds the whole workgroup at four barriers while the slow, scattered history reads finish, and the large workgroups leave fewer workgroups resident. The bigger workgroup was the slower one although it stages fewer redundant texel rows, so the barrier stalls dominate, not the staging. Model M gains from fusion because its reconstruction is cheap next to its display traffic; Model L's reconstruction is the expensive part. The code is kept locally as a record, not proposed.
Notes
l_post_recon_p12.Tested
clean/l/runtime/tests(33),test_kernel_sets, line endings.Not tested
Update: on main after #166 (merge 8972cbc)
Base is now main (f0fd94c, #166 merged). The merges bring #162's raw-byte check API and #166 (already in this branch);
this PR's own change is unchanged. Re-checked on the merged tree (same tree as the record) with
l_d3d12_own_post_check.py(raw-byte API, sentinels HIP 0xA5 / D3D12 0x5A / D3D12 stages 0x3C), GPU record:caught;
The DXILs of l_post_filter_direct, w64/post_filter_c1_s4 and l_direct_color on the merged tree are byte-identical to
those of the direct-store record above (26 of 26), so that record stands.