aboutsummaryrefslogtreecommitdiff
path: root/src/strategies/low_latency2/queue_strategy.cc
blob: 855ff5d78edb4b74192c6f8b83a5c4f4240c4c60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "queue_strategy.hh"
#include "helper.hh"

#include <ranges>
#include <span>

namespace low_latency {

LowLatency2QueueStrategy::LowLatency2QueueStrategy(QueueContext& queue)
    : QueueStrategy(queue) {}

LowLatency2QueueStrategy::~LowLatency2QueueStrategy() {}

void LowLatency2QueueStrategy::notify_submit(
    [[maybe_unused]] const VkSubmitInfo& submit,
    [[maybe_unused]] std::unique_ptr<Submission> submission) {}

void LowLatency2QueueStrategy::notify_submit(
    [[maybe_unused]] const VkSubmitInfo2& submit,
    [[maybe_unused]] std::unique_ptr<Submission> submission) {}

void LowLatency2QueueStrategy::notify_present(const VkPresentInfoKHR& present) {

    const auto pid =
        find_next<VkPresentIdKHR>(&present, VK_STRUCTURE_TYPE_PRESENT_ID_KHR);

    // All submissions should be tagged with a present_id. If it isn't, I'm not
    // going to fail hard here - we will just ignore it.
    if (!pid) {
        return;
    }

    const auto swapchains =
        std::span{present.pSwapchains, present.swapchainCount};
    const auto present_ids =
        std::span{pid->pPresentIds, present.swapchainCount};
    for (const auto& [swapchain, present_id] :
         std::views::zip(swapchains, present_ids)) {

        // TODO
    }
}

} // namespace low_latency