当前位置:网站首页>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 .
边栏推荐
- About the practice topic of screen related to unity screen, unity moves around a certain point inside
- 毕业总结
- [IELTS reading] Wang Xiwei reading P2 (reading fill in the blank)
- Teach you JDBC hand in hand -- structure separation
- FAQ | FAQ for building applications for large screen devices
- 多进程编程(一):基本概念
- setInterval定时器在ie不生效原因之一:回调的是箭头函数
- The most painful programming problem in 2021, adventure of code 2021 Day24
- form表单实例化
- Markdown使用教程
猜你喜欢
Feature Engineering: summary of common feature transformation methods
DotNet圈里一个优秀的ORM——FreeSql
图解网络:什么是虚拟路由器冗余协议 VRRP?
redis21道经典面试题,极限拉扯面试官
2022上半年值得被看见的10条文案,每一句都能带给你力量!
【AutoSAR 一 概述】
文件操作IO-Part2
Detailed explanation of pod life cycle
【AutoSAR 六 描述文件】
[IELTS reading] Wang Xiwei reading P1 (reading judgment question)
随机推荐
毕业总结
Centos7 one click compilation to build MySQL script
关于QByteArray存储十六进制 与十六进制互转
LeedCode1480. Dynamic sum of one-dimensional array
ftrace工具的介绍及使用
【AutoSAR 二 AppL概述】
[IELTS reading] Wang Xiwei reading P2 (reading fill in the blank)
【AutoSAR 十 IO架构】
Rust所有权(非常重要)
Helm basic learning
There is an unknown problem in inserting data into the database
Preview word documents online
【单片机项目实训】八路抢答器
简单聊聊运维监控的其他用途
【AutoSAR 八 OS】
Rust字符串切片、结构体和枚举类
Multiprocess programming (4): shared memory
Free we media essential tools sharing
关于XML一些介绍和注意事项
1.11 - bus