vulkanscenegraph显示倾斜模型(6.3)-呈现

前言

        上章深入分析了帧循环中记录与提交的处理流程。本章将继续分析帧循环过程中最后一部分的内容:呈现,上章通过代码的分析,在记录与提交阶段,队列提交完成后生成通知信号量,本章将通过代码剖析呈现阶段的具体工作,说明上一阶段(记录与提交阶段)完成后的通知信号量与呈现阶段的关系。


目录

  • 1 RecordAndSubmitTask
  • 2 呈现

1 RecordAndSubmitTask

    vsg_viewer->assignRecordAndSubmitTaskAndPresentation({ commandGraph });

        vsg::Viewer调用接口assignRecordAndSubmitTaskAndPresentation,传入commandGraph,创建RecordAndSubmitTask对象。

1.1 DeviceQueueFamily

       RecordAndSubmitTask的创建粒度为DeviceQueueFamily,其中DeviceQueueFamily定义代码如下:

    struct DeviceQueueFamily
    {
        Device* device = nullptr;
        int queueFamily = -1;
        int presentFamily = -1;

        bool operator<(const DeviceQueueFamily& rhs) const
        {
            if (device < rhs.device) return true;
            if (device > rhs.device) return false;
            if (queueFamily < rhs.queueFamily) return true;
            if (queueFamily > rhs.queueFamily) return false;
            return presentFamily < rhs.presentFamily;
        }
    };

       其中Device表示逻辑设备,queueFamily表示队列族,presentFamily表示呈现族。

1.2 收集所有DeviceQueueFamily

       通过遍历接口assignRecordAndSubmitTaskAndPresentation传入的CommandGraph数组,可获取由queueFamily对象作为key值与对应的CommandGraph数组映射的map数组。

    std::map<DeviceQueueFamily, CommandGraphs> deviceCommandGraphsMap;
    for (auto& commandGraph : in_commandGraphs)
    {
        commandGraph->accept(findWindows);
        deviceCommandGraphsMap[DeviceQueueFamily{commandGraph->device.get(), commandGraph->queueFamily, commandGraph->presentFamily}].emplace_back(commandGraph);
    }

1.3

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

CHPCWWHSU

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值