当前位置:网站首页>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 .
边栏推荐
- 如何系统学习机器学习
- Helm basic learning
- AttributeError: ‘tuple‘ object has no attribute ‘layer‘问题解决
- Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径
- Multiprocess programming (4): shared memory
- 【AutoSAR 九 C/S原理架构】
- 1.12 - Instructions
- Problèmes de configuration lex & yacc & Bison & Flex
- 可下载《2022年中国数字化办公市场研究报告》详解1768亿元市场
- Pageoffice - bug modification journey
猜你喜欢

【AutoSAR 九 C/S原理架构】

Linux Software: how to install redis service

University of Toronto:Anthony Coache | 深度强化学习的条件可诱导动态风险度量

1.12 - Instructions

How SQLSEVER removes data with duplicate IDS

多进程编程(二):管道

Redis21 classic interview questions, extreme pull interviewer

1.11 - bus

2022中国3D视觉企业(引导定位、分拣场景)厂商名单

【单片机项目实训】八路抢答器
随机推荐
LeedCode1480. Dynamic sum of one-dimensional array
node_modules删不掉
【AutoSAR 五 方法论】
JSON conversion tool class
【单片机项目实训】八路抢答器
【luogu P4320】道路相遇(圆方树)
使用jenkins之二Job
Basic use of shell script
字符设备注册常用的两种方法和步骤
Shell 实现文件基本操作(sed-编辑、awk-匹配)
【AutoSAR 二 AppL概述】
redis21道经典面试题,极限拉扯面试官
[golang syntax] map common errors golang panic: assignment to entry in nil map
【Pulsar文档】概念和架构/Concepts and Architecture
Set up nacos2 X cluster steps and problems encountered
Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径
Vulkan-实践第一弹
Shell脚本基本使用
多进程编程(五):信号量
Shell 实现文件基本操作(切割、排序、去重)