Qt是目前最先进、最完整的跨平台C++开发工具。它不仅完全实现了一次编写,所有平台无差别运行,更提供了几乎所有开发过程中需要用到的工具。如今,Qt已被运用于超过70个行业、数千家企业,支持数百万设备及应用。
macOS上的Metal
在macOS 10.13或10.14设置QSG_RHI = 1(以及QSG_INFO = 1)并运行qt5-cinematic-experience示例程序,可以看到如下的结果:

qt.scenegraph.general: Using QRhi with backend Metal
graphics API debug/validation layers: 0
QRhi profiling and debug markers: 0
qt.scenegraph.general: threaded render loop
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
qt.rhi.general: Metal device: Intel(R) HD Graphics 615
qt.scenegraph.general: MSAA sample count for the swapchain is 1. Alpha channel requested = no.
qt.scenegraph.general: rhi texture atlas dimensions: 4096x2048
qt.rhi.general: got CAMetalLayer, size 2560x1440
Qt 6的目标,是默认使用目标平台上主流的、支持最好的图形API(同时也允许应用程序选择其他图形API),在macOS上启用QRhi的渲染方式后,系统会默认使用Metal来渲染Qt Quick。
类似于在QtGui、QPA,和其他一些平台插件中添加Vulkan实例和Surface构建Vulkan渲染后台的方式,QRhi的Metal后台依赖于Qt 5.12前后引入的cocoa平台插件中的Metal的支持。带QSurface::MetalSurface标志的QWindow将获得一个NSView,NSView背后是一个CAMertalLayer。这就是QRhi的Metal

本文详细介绍了Qt在不同平台上的图形API使用,包括在macOS上利用Metal,iOS/tvOS的未来支持,以及Windows上的Direct3D 11、Vulkan和OpenGL。Qt 6目标是默认使用每个平台的最佳图形API,并讨论了启用QRhi渲染路径的细节,如Metal设备、Vulkan的MoltenVK支持和Direct3D的使用。同时,文章提及了调试工具如RenderDoc和XCode的GPU帧快照器。
最低0.47元/天 解锁文章
2746

被折叠的 条评论
为什么被折叠?



