Skip to content

Commit e2c6daf

Browse files
committed
Implement asynchronous transfer queues, thread guards on RenderingDevice. Add ubershaders and rework pipeline caches for Forward+ and Mobile.
- Implements asynchronous transfer queues from PR godotengine#87590. - Adds ubershaders that can run with specialization constants specified as push constants. - Pipelines with specialization constants can compile in the background. - Added monitoring for pipeline compilations. - Materials and shaders can now be created asynchronously on background threads. - Meshes that are loaded on background threads can also compile pipelines as part of the loading process.
1 parent 1917bc3 commit e2c6daf

File tree

78 files changed

+5155
-2481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+5155
-2481
lines changed

doc/classes/Performance.xml

+16-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,22 @@
224224
<constant name="NAVIGATION_OBSTACLE_COUNT" value="33" enum="Monitor">
225225
Number of active navigation obstacles in the [NavigationServer3D].
226226
</constant>
227-
<constant name="MONITOR_MAX" value="34" enum="Monitor">
227+
<constant name="PIPELINE_COMPILATIONS_CANVAS" value="34" enum="Monitor">
228+
Number of pipeline compilations that were triggered by the 2D canvas renderer.
229+
</constant>
230+
<constant name="PIPELINE_COMPILATIONS_MESH" value="35" enum="Monitor">
231+
Number of pipeline compilations that were triggered by loading meshes. These compilations will show up as longer loading times the first time a user runs the game and the pipeline is required.
232+
</constant>
233+
<constant name="PIPELINE_COMPILATIONS_SURFACE" value="36" enum="Monitor">
234+
Number of pipeline compilations that were triggered by building the surface cache before rendering the scene. These compilations will show up as a stutter when loading an scene the first time a user runs the game and the pipeline is required.
235+
</constant>
236+
<constant name="PIPELINE_COMPILATIONS_DRAW" value="37" enum="Monitor">
237+
Number of pipeline compilations that were triggered while drawing the scene. These compilations will show up as stutters during gameplay the first time a user runs the game and the pipeline is required.
238+
</constant>
239+
<constant name="PIPELINE_COMPILATIONS_SPECIALIZATION" value="38" enum="Monitor">
240+
Number of pipeline compilations that were triggered to optimize the current scene. These compilations are done in the background and should not cause any stutters whatsoever.
241+
</constant>
242+
<constant name="MONITOR_MAX" value="39" enum="Monitor">
228243
Represents the size of the [enum Monitor] enum.
229244
</constant>
230245
</constants>

doc/classes/RenderingServer.xml

+33
Original file line numberDiff line numberDiff line change
@@ -5687,6 +5687,39 @@
56875687
<constant name="RENDERING_INFO_VIDEO_MEM_USED" value="5" enum="RenderingInfo">
56885688
Video memory used (in bytes). When using the Forward+ or mobile rendering backends, this is always greater than the sum of [constant RENDERING_INFO_TEXTURE_MEM_USED] and [constant RENDERING_INFO_BUFFER_MEM_USED], since there is miscellaneous data not accounted for by those two metrics. When using the GL Compatibility backend, this is equal to the sum of [constant RENDERING_INFO_TEXTURE_MEM_USED] and [constant RENDERING_INFO_BUFFER_MEM_USED].
56895689
</constant>
5690+
<constant name="RENDERING_INFO_PIPELINE_COMPILATIONS_CANVAS" value="6" enum="RenderingInfo">
5691+
Number of pipeline compilations that were triggered by the 2D canvas renderer.
5692+
</constant>
5693+
<constant name="RENDERING_INFO_PIPELINE_COMPILATIONS_MESH" value="7" enum="RenderingInfo">
5694+
Number of pipeline compilations that were triggered by loading meshes. These compilations will show up as longer loading times the first time a user runs the game and the pipeline is required.
5695+
</constant>
5696+
<constant name="RENDERING_INFO_PIPELINE_COMPILATIONS_SURFACE" value="8" enum="RenderingInfo">
5697+
Number of pipeline compilations that were triggered by building the surface cache before rendering the scene. These compilations will show up as a stutter when loading an scene the first time a user runs the game and the pipeline is required.
5698+
</constant>
5699+
<constant name="RENDERING_INFO_PIPELINE_COMPILATIONS_DRAW" value="9" enum="RenderingInfo">
5700+
Number of pipeline compilations that were triggered while drawing the scene. These compilations will show up as stutters during gameplay the first time a user runs the game and the pipeline is required.
5701+
</constant>
5702+
<constant name="RENDERING_INFO_PIPELINE_COMPILATIONS_SPECIALIZATION" value="10" enum="RenderingInfo">
5703+
Number of pipeline compilations that were triggered to optimize the current scene. These compilations are done in the background and should not cause any stutters whatsoever.
5704+
</constant>
5705+
<constant name="PIPELINE_SOURCE_CANVAS" value="0" enum="PipelineSource">
5706+
Pipeline compilation that was triggered by the 2D canvas renderer.
5707+
</constant>
5708+
<constant name="PIPELINE_SOURCE_MESH" value="1" enum="PipelineSource">
5709+
Pipeline compilation that was triggered by loading a mesh.
5710+
</constant>
5711+
<constant name="PIPELINE_SOURCE_SURFACE" value="2" enum="PipelineSource">
5712+
Pipeline compilation that was triggered by building the surface cache before rendering the scene.
5713+
</constant>
5714+
<constant name="PIPELINE_SOURCE_DRAW" value="3" enum="PipelineSource">
5715+
Pipeline compilation that was triggered while drawing the scene.
5716+
</constant>
5717+
<constant name="PIPELINE_SOURCE_SPECIALIZATION" value="4" enum="PipelineSource">
5718+
Pipeline compilation that was triggered to optimize the current scene.
5719+
</constant>
5720+
<constant name="PIPELINE_SOURCE_MAX" value="5" enum="PipelineSource">
5721+
Represents the size of the [enum PipelineSource] enum.
5722+
</constant>
56905723
<constant name="FEATURE_SHADERS" value="0" enum="Features" deprecated="This constant has not been used since Godot 3.0.">
56915724
</constant>
56925725
<constant name="FEATURE_MULTITHREADED" value="1" enum="Features" deprecated="This constant has not been used since Godot 3.0.">

0 commit comments

Comments
 (0)