当前位置:网站首页>Chapter 12 pipeline monitoring of OpenGL super classic (version 7)
Chapter 12 pipeline monitoring of OpenGL super classic (version 7)
2022-06-30 05:01:00 【Jason_ Chen__】
OpenGL Super treasure ( The first 7 edition ) Chapter 12 pipeline monitoring
Preface
Query the execution process of the command in the graphics pipeline
Measure command execution time
Synchronize applications with OpenGL And synchronized multiple OpenGL context
One 、 Inquire about
sketch : Inquire about Opengl The execution status requires the creation of query objects , One object checks one question , After querying a question, you must delete a query object
glGenQueries(): Generate query objects
glDeleteQueries(): Delete query object
glGetError(): Query the execution result of the above function
1. occlusion query
sketch : For those with high rendering costs , But objects that may not appear in the scene
application :
glBeginQuery(...) # Start counting
RenderSimplifiedObject(object) # Render low fidelity objects
glEndQuery(...) # Stop count
glGetQueryObjectuiv(..., &result) # Query and draw results
if(result != 0)
RenderRealObject(object) # Render complete objects
Because rendering is done by pipeline , So many commands are queued , Not every time glEndQuery() when , All pixels are generated , Therefore, it is necessary to extend the time of query results .
Because the rendering command is sent to GPU There will be a lot of expenses , Some commands are executed only when the query object has results ( This method is called predicate ), therefore opengl You can use the conditional rendering tool to send commands to GPU,glBeginConditionalRender() and glEndConditionalRender()
Advanced occlusion query : Provide GL_ANY_SAMPLES_PASSED and GL_ANY_SAMPLES_PASSED_CONSERVATIVE Two Boolean occlusion queries complete the query target and count the exact number of samples that pass the depth test
Check regularly : have access to glQueryCounter() The query in glBeginQuery() and glEndQuery() Operation time between execution of commands , Query results are expressed in nanoseconds ,32 Bit unsigned counts as slightly higher than 4 Nanoseconds per second , have access to glGetQueryObjectui64v() The query is higher than 4 The result of seconds and nanoseconds
The parameters for querying pipeline status can be seen in P369 page
Two 、OpenGL Sync
Use glFlush() mandatory Opengl Start processing commands or complete currently issued commands
GLsync glFenceSync(): Create a synchronization object
glGetSynciv(): Query synchronization status , See if the end of the pipeline is reached
glClientWaitSync() and gkWaitSync(): Waiting for synchronization signal
glDeleteSync(): Delete sync signal
There is no mechanism to reset the synchronization signal to the no signal state
Each synchronization object represents a one-time event
边栏推荐
- UnityEngine. JsonUtility. The pit of fromjason()
- harbor api 2.0查询
- Ripple effect of mouse click (unity & shader)
- Meet in Bangkok for a romantic trip on Valentine's Day
- How to install win7 on AMD Ruilong CPU A320 series motherboard
- Unit screenshot saved on the phone
- amd锐龙CPU A320系列主板如何安装win7
- ParticleSystem in the official Manual of unity_ Collision module
- 力扣349. 两个数组的交集
- 【Paper】2021_ Analysis of the Consensus Protocol of Heterogeneous Agents with Time-Delays
猜你喜欢

一条命令运行rancher

力扣977. 有序数组的平方

力扣349. 两个数组的交集

Pit of smoothstep node in shadergraph

Oculus quest2 development: (I) basic environment construction and guide package

Unity is associated with vs. there is a compiler problem when opening

Pourquoi l'ordinateur n'a - t - il pas de réseau après l'ouverture du Hotspot win10?

Force buckle 349 Intersection of two arrays

Some problems encountered in unity steamvr

Free travel recommendation in Bangkok: introduction to the Mekong River in Bangkok
随机推荐
Generate a slice of mesh Foundation
[recruitment] UE4 Development Engineer
MySQL query gadget (I) replace a property value of the object in the JSON array in the JSON format string field
Passing values between classes using delegates and events
Unity supports the platform # define instruction of script
Thread safety and processing caused by multithreading
brew安装nvm报nvm command not found解决方案
Four methods of unity ugui button binding events
pycharm 数据库工具
How does unity use mapbox to implement real maps in games?
Have a heart beating Valentine's day in Singapore
Pourquoi l'ordinateur n'a - t - il pas de réseau après l'ouverture du Hotspot win10?
Marvel fan welfare: Singapore Madame Tussauds Wax Museum Marvel 4D experience Museum
2021-07-29 compilation of Cura in ubantu18.04
0 foundation starts self-study unit notes control direction becomes larger
Collective system
Connect to the database and run node JS running database shows that the database is missing
PWN入门(2)栈溢出基础
Arrays class
Lambda&Stream