Engine: drop the layer-loop memory flush in preset M
The ten network layer dispatches only need dispatch serialization, not a global memoryBarrier flush: each layer's cross-block traffic goes through its own buffers, already published by the preceding stage's flush. An empty compute->compute pipeline barrier keeps the ordering and removes the flush cost: whole-frame median 2515.0 -> 2431.7 us at Balanced (1488x837 -> 2560x1440), 3818.9 -> 3773.3 at Quality, 1892.6 -> 1810.6 at Performance, byte-identical to the captured launches (chain test 10/10 layers 100.0%, frame test inf dB, 8- and 16-frame outputs match). Also documents this session's discarded probes (intra-frame barrier relaxation, colSum subgroup shuffle, downsample BLOCK_Y 32, expansion EO stride 24, cross-frame pipelining analysis, the NO_ROUND 7.0% rounding-free ceiling) and adds the round_half.glsl include guard.
This commit is contained in:
1 parent
d5c8be25c8
commit
065fe2c2a1
4 files changed
+134
-1
No files matched your search
@@ -434,6 +434,7 @@ void MEngine::setFrame(const FrameImages& images, const MFrameSettings& s, Frame
|
||||
}
|
||||
namespace {
|
||||
const auto compute = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT;
|
||||
void emptyStage(VkCommandBuffer cb) { vkCmdPipelineBarrier(cb, compute, compute, 0, 0, nullptr, 0, nullptr, 0, nullptr); }
|
||||
void nextStage(VkCommandBuffer cb) { memoryBarrier(cb, compute, compute, VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT, VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT); }
|
||||
void openStages(VkCommandBuffer cb) {
|
||||
memoryBarrier(cb, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, compute | VK_PIPELINE_STAGE_TRANSFER_BIT,
|
||||
@@ -508,7 +509,7 @@ void MEngine::recordFrame(VkCommandBuffer cb, VkQueryPool stamps, uint32_t first
|
||||
recordFront(cb, stamps, first);
|
||||
for (unsigned l = 0; l < MLayers; ++l) {
|
||||
const uint32_t w = e.gw / 2 / MScale[l], h = e.gh / 2 / MScale[l];
|
||||
dispatch(cb, m.network[l], e.layerSets[l], (w + (MShift[l] ^ ((e.frame & 1u) * 2u)) + 7) / 8, (h + MShift[l] + 7) / 8); nextStage(cb);
|
||||
dispatch(cb, m.network[l], e.layerSets[l], (w + (MShift[l] ^ ((e.frame & 1u) * 2u)) + 7) / 8, (h + MShift[l] + 7) / 8); emptyStage(cb);
|
||||
}
|
||||
recordBack(cb, stamps, stamps ? first + 3 : 0);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user