vulkan - 等待围栏会导致警告和应用程序冻结
问题描述
我提交了一个队列并指定了一个栅栏。就在提交之前,我打印了栅栏:
qDebug() << "submitting fence: " << cmdFence;
vkQueueSubmit(gfxQueue, 1, &submitInfo, cmdFence);
以下是最近 3 次提交的结果:
submitting fence: 0x145
submitting fence: 0x142
submitting fence: 0x145
在其他地方我有一个应该等待栅栏的代码:
qDebug() << "waiting for fences";
for(auto f : activeFences)
qDebug() << "fence " << f;
if(vkWaitForFences(m_moduleData.deviceData.device,
static_cast<uint32_t>(activeFences.size()),
activeFences.data(),
VK_TRUE,
UINT64_MAX) != VK_SUCCESS)
{
throw std::runtime_error{"failed to wait for fences"};
}
可以看出,在等待之前我也在打印围栏,这就是我在vkWaitForFences
打电话之前得到的:
waiting for fences
fence 0x142
0x142
之前提交的同一个栅栏!但是验证层会产生警告:
vkWaitForFences called for fence 0x142 which has not been submitted on a Queue or during acquire next image.
并且应用程序可能会在无限等待中冻结。但为什么?
解决方案
推荐阅读
- node.js - 单元和 e2e 测试 grpc 微服务
- jose4j - jose4j JSONAware 的反面
- javascript - 关联数组:无法设置未定义的属性
- java - maven依赖地狱:java.lang.NoSuchMethodError
- django - Django:如何使用两个同时连接到一个数据库?
- python - Keras 神经网络的准确性上限
- apache - 拆分器组属性注入变量参数
- express-gateway - 快递网关 jwt 发行不工作
- python - Pandas - 不同字符串之间的比较总是返回 True
- arrays - Lua 映射值作为构造函数