Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

代码示例错误(In Chapter 21.3) #15

Open
HuajiKojima opened this issue Oct 2, 2024 · 1 comment
Open

代码示例错误(In Chapter 21.3) #15

HuajiKojima opened this issue Oct 2, 2024 · 1 comment

Comments

@HuajiKojima
Copy link

在第21章重建交换链的第21.3小节(page 163),判断交换链是否重建的代码段中第10至14行代码(文档中代码段行号)与第5到9行代码(文档中代码段行号)重复且易造成歧义。Vulkan tutorial原文中代码不存在第10至第14行。
文档中代码如下:

VkResult result = vkAcquireNextImageKHR(device, swapChain, std::numeric<uint64_t>::max(), imageAvailableSemaphores[currentFrame], VK_NULL_HANDLE, &imageIndex);

if (result == VK_ERROR_OUT_OF_DATE_KHR) {
    recreateSwapChain();
    return;
} else if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR) {
    throw std::runtime_error("failed to acquire swap chain image!");
}
recreateSwapChain();
return;
} else if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR) {
    throw std::runtime_error("failed to acquire swap chain image!");
}

Vulkan tutorial原文中代码如下:

VkResult result = vkAcquireNextImageKHR(device, swapChain, UINT64_MAX, imageAvailableSemaphores[currentFrame], VK_NULL_HANDLE, &imageIndex);

if (result == VK_ERROR_OUT_OF_DATE_KHR) {
    recreateSwapChain();
    return;
} else if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR) {
    throw std::runtime_error("failed to acquire swap chain image!");
}
@fangcun010
Copy link
Owner

感谢反馈,欢迎提PR,我来合并。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants