Vulkan 中的 VKAPI

编程入门 行业动态 更新时间:2024-10-28 03:21:46
本文介绍了Vulkan 中的 VKAPI_ATTR 和 VKAPI_CALL 宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我一直在搜索,但我仍然不确定什么 VKAPI_ATTRVKAPI_CALL 是什么.我不确定它们是不是我不知道的宏或一些花哨的 C++ 函数声明.

I have been searching and I still am not sure what VKAPI_ATTR and VKAPI_CALL are. I am not sure if they are suppose to be a macro or some fancy C++ function declaration I am not aware of.

什么是 VKAPI_ATTR void VKAPI_CALL vkCommand(void) 提供而 void vkCommand(void) 不提供的?

What is VKAPI_ATTR void VKAPI_CALL vkCommand(void) offering that void vkCommand(void) doesn't offer?

推荐答案

它们是确保应用正确调用约定的宏.这在 64 位中不太重要,因为它们大多收敛,但在 32 位中存在一些不兼容的.

They are macros to make sure the correct calling convention is applied. This is less important in 64 bit where they have mostly converged but in 32 bit there are several incompatible ones.

不幸的是,不同的编译器有不同的方法来做到这一点.一个将所需的标记放在返回值之前,另一个将其放在后面.

Unfortunately different compilers have different ways of doing that. One puts the required token before the return value the other puts it after.

所以标题使用两者来确保它可以覆盖所有基础.

So the header uses both to make sure it can cover all bases.

这篇关于Vulkan 中的 VKAPI_ATTR 和 VKAPI_CALL 宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-26 22:28:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1142824.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Vulkan   VKAPI

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!