当前位置:网站首页>Vulkan performance and refinement
Vulkan performance and refinement
2022-07-03 00:43:00 【I haven't had quiet memories for a long time】
Vulkan It is a new generation of graphic display API. It is also called “ The next generation OpenGL”, It goes without saying that people always like to take Vulkan and OpenGL( Have already experienced 20 Years of very mature contemporary graphics API The achiever of ) Make a comparison to highlight its advantages in some scenes .
Vulkan--API Design philosophy
Explicit( clear 、 transparent ):GPU Driver Do less , Give more control to the development
Streamlined( Streamlining ): Faster performance , Lower cost , Less delay
Portable( portable ):Cloud, desktop, console, mobile and embedde
Extensible ( Scalable ): Support the expansion of new functions , Promote the advancement of industry technology
In another sentence ,Vulkan It is the next generation of open cross platform graphics with high performance and fine control API. Next, we will also focus on this summary .
to open up
Vulkan By Khronos Group Cross platform image rendering engine released by the organization , The organization also issued such as OpenGL、OpenGL ES、WebGL Isograph API.Vulkan Born out of Mantle, It contains some Mantle Components ;Mantle It's for 3D A new generation of graphics rendering for games API, Developers can operate directly GPU The underlying hardware , So as to improve hardware utilization and game performance . But unfortunately, because AMD Insufficient industry influence , Mantle It has not become the standard of the whole industry .
However, Microsoft references AMD Mantle Ideas developed DirectX 12, Apple proposed Metal.2015 year Khronos from AMD Took the Mantle And hatch later Vulkan, And push Vulkan The great development of .Vulkan Our developers come from all walks of life in the graphics field , Yes GPU manufacturer , There are system manufacturers , There are game engine manufacturers
Cross platform
Vulkan Our developers come from all walks of life in the graphics field , Yes GPU manufacturer , There are system manufacturers , There is a game engine factory , So the inherent attribute is cross platform , Take the unified standard of the whole industry as the ultimate goal . It supports desktop 、 Mobile devices 、 Game consoles 、 Embedded and so on .
Fine control
Traditional graphics API, Driver is a big role , The driver tracks the state of the object , Will do for you API verification , memory management , Thread management and most other work . Drivers help developers hide many low-level details , Of course, this is a blessing for developers , Because it's easy to operate from the perspective of developers , There is no need to consider too much underlying implementation and error handling . Drive even in api When there is an error in the call, it can help deal with , Ensure the normal operation of the application . But in order to achieve these , Drivers waste more performance , When the application is debugged and running correctly , Will consume precious CPU performance , In some complex scenarios and extreme performance experience scenarios , This kind of problem will be magnified exponentially and developers will be very frustrated , Because they don't have much ability to alleviate this situation , Sometimes it can be very complicated , Because drivers are implemented differently on different platforms and vendors .
Vulkan To solve this problem , Provides a more visible API, More refined GPU Underlying control logic , And regard the driver as an application and GPU The bridge between , Help with data communication and instruction transmission .Vulkan Track the status 、 Synchronization and memory management are left to the application developers , It doesn't even include the error checking layer during execution . once API Use error , Applications will appear crash. No one helped the app to find out , Everything is left to the app . The drivers are doing less , Hidden bug It's less .
Vulkan Let the program have more permissions and responsibilities, and deal with scheduling and optimization autonomously , It doesn't depend on the driver trying to optimize in the background . But for developers, the complexity of its use has also become higher , And the stability is reduced to a certain extent .
Although this method has undoubtedly increased API Complexity and difficulty of use , But in exchange for a huge improvement in performance . Just remove it from the drive API verification , It improves the performance 9 times .
performance
Multithreading
Vulkan be based on Queue Of API The design is very thread friendly , It also offers a variety of Synchronization Methods . There are two common parallel methods , The first is in CPU Side by side update Buffer Data in . What we should pay attention to here is , In the case of multithreading, it is necessary to ensure the safety of updating resources . The second is that the parallel method brings more significant performance improvement , Especially when rendering very complex scenes .
First, if your program renders very efficiently , At the same time CPU The client needs to process several frames of data , So the program can use Round Robin Methods to update and use these resources . At this time, we should ensure the security of updating resources .Vulkan Of Event Can be inserted in Command Buffer in , After the call using the specified resource, the security of the resource can be more effectively guaranteed .
The second parallel method brings more significant performance improvement , Especially when rendering very complex scenes , This is also Vulkan Compared with tradition API The most significant improvement , That is to generate rendering tasks of different parts of the scene on different threads in parallel , And generate your own Command Buffer, Without any inter thread Synchronization. Last , Different threads can put Command Buffer Of Handle It is passed to the main thread, and then the main thread writes them Queue in , You can also write directly to per-thread Queue Submit to GPU. Give developers full play CPU The advantages of multi-core and multi threading . In a complex scene , The performance improvement is very considerable !
however Queue The task submission time of is not completely negligible , Therefore, it is suggested that Command Pass it to the main thread and submit it together . This model maximizes the utilization of computing resources , Multiple CPU Both cores participate in the rendering of the scene , And a large number of rendering tasks are submitted to GPU Maximized GPU Throughput .
precompile shader
The driver layer does not provide a front end shader compiler . Only standard portable intermediate representation binary code is supported (SPIR-V), Can support AOT Runtime . Both improve the implementation Shaders The efficiency of coloring language adds the flexibility of future coloring language .Vulkan You can also use offline shader
Progress in mobile platform support
Android 7.0 Added right Vulkan Support for , Q Start using vulkan Default UI Rendering .
Flutter The bottom graphics library of the framework Skia It's supporting Vulcan Of ,Fuchsia Google's next-generation cross platform system also supports .
边栏推荐
- 【AutoSAR 十三 NVM】
- 关于QByteArray存储十六进制 与十六进制互转
- Shell implements basic file operations (cutting, sorting, and de duplication)
- lex && yacc && bison && flex 配置的問題
- 1.11 - bus
- Rust所有权(非常重要)
- Multiprocess programming (V): semaphores
- NC50965 Largest Rectangle in a Histogram
- Rust字符串切片、结构体和枚举类
- Sentry developer contribution Guide - configure pycharm
猜你喜欢
【雅思阅读】王希伟阅读P1(阅读判断题)
kubernetes资源对象介绍及常用命令(五)-(NFS&PV&PVC)
AEM: Nanlin fan Ben et al. - plant rhizosphere growth promoting bacteria control soybean blight
Attributeerror: 'tuple' object has no attribute 'layer' problem solving
奥斯陆大学:Li Meng | 基于Swin-Transformer的深度强化学习
Callback event after the antv X6 node is dragged onto the canvas (stepping on a big hole record)
Vulkan-性能及精细化
【AutoSAR 四 BSW概述】
【AutoSAR 七 工具链简介】
【AutoSAR 二 AppL概述】
随机推荐
Detailed explanation of pod life cycle
antv x6节点拖拽到画布上后的回调事件(踩大坑记录)
微信小程序获取某个元素的信息(高、宽等),并将px转换为rpx。
Pageoffice - bug modification journey
【AutoSAR 九 C/S原理架构】
利亚德:Micro LED 产品消费端首先针对 100 英寸以上电视,现阶段进入更小尺寸还有难度
MySQL 23道经典面试吊打面试官
Linux Software: how to install redis service
Multi process programming (III): message queue
Confluence的PDF导出中文文档异常显示问题解决
2022上半年值得被看见的10条文案,每一句都能带给你力量!
字符设备注册常用的两种方法和步骤
腾讯云免费SSL证书扩展文件含义
如何系统学习机器学习
[jetcache] jetcache configuration description and annotation attribute description
Is there a free text to speech tool to help recommend?
Rust string slicing, structs, and enumeration classes
NC24325 [USACO 2012 Mar S]Flowerpot
Extension of flutter
Hundreds of continuous innovation to create free low code office tools