Skip to content

Commit bbcdc41

Browse files
committed
Merge pull request #103113 from beicause/document-rids-freed-auto
Document RIDs that will be freed automatically when freeing their deps
2 parents fd672db + 7b79798 commit bbcdc41

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

doc/classes/RenderingDevice.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@
198198
<description>
199199
Creates a new compute pipeline. It can be accessed with the RID that is returned.
200200
Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
201+
This will be freed automatically when the [param shader] is freed.
201202
</description>
202203
</method>
203204
<method name="compute_pipeline_is_valid">
@@ -416,6 +417,7 @@
416417
<description>
417418
Creates a new framebuffer. It can be accessed with the RID that is returned.
418419
Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
420+
This will be freed automatically when any of the [param textures] is freed.
419421
</description>
420422
</method>
421423
<method name="framebuffer_create_empty">
@@ -437,6 +439,7 @@
437439
<description>
438440
Creates a new multipass framebuffer. It can be accessed with the RID that is returned.
439441
Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
442+
This will be freed automatically when any of the [param textures] is freed.
440443
</description>
441444
</method>
442445
<method name="framebuffer_format_create">
@@ -695,6 +698,7 @@
695698
<description>
696699
Creates a new index array. It can be accessed with the RID that is returned.
697700
Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
701+
This will be freed automatically when the [param index_buffer] is freed.
698702
</description>
699703
</method>
700704
<method name="index_buffer_create">
@@ -733,6 +737,7 @@
733737
<description>
734738
Creates a new render pipeline. It can be accessed with the RID that is returned.
735739
Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
740+
This will be freed automatically when the [param shader] is freed.
736741
</description>
737742
</method>
738743
<method name="render_pipeline_is_valid">
@@ -944,6 +949,7 @@
944949
<param index="1" name="with_texture" type="RID" />
945950
<description>
946951
Creates a shared texture using the specified [param view] and the texture information from [param with_texture].
952+
This will be freed automatically when the [param with_texture] is freed.
947953
</description>
948954
</method>
949955
<method name="texture_create_shared_from_slice">
@@ -958,6 +964,7 @@
958964
Creates a shared texture using the specified [param view] and the texture information from [param with_texture]'s [param layer] and [param mipmap]. The number of included mipmaps from the original texture can be controlled using the [param mipmaps] parameter. Only relevant for textures with multiple layers, such as 3D textures, texture arrays and cubemaps. For single-layer textures, use [method texture_create_shared].
959965
For 2D textures (which only have one layer), [param layer] must be [code]0[/code].
960966
[b]Note:[/b] Layer slicing is only supported for 2D texture arrays, not 3D textures or cubemaps.
967+
This will be freed automatically when the [param with_texture] is freed.
961968
</description>
962969
</method>
963970
<method name="texture_get_data">
@@ -1089,6 +1096,7 @@
10891096
<description>
10901097
Creates a new uniform set. It can be accessed with the RID that is returned.
10911098
Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
1099+
This will be freed automatically when the [param shader] or any of the RIDs in the [param uniforms] is freed.
10921100
</description>
10931101
</method>
10941102
<method name="uniform_set_is_valid">
@@ -1106,6 +1114,8 @@
11061114
<param index="3" name="offsets" type="PackedInt64Array" default="PackedInt64Array()" />
11071115
<description>
11081116
Creates a vertex array based on the specified buffers. Optionally, [param offsets] (in bytes) may be defined for each buffer.
1117+
Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
1118+
This will be freed automatically when any of the [param src_buffers] is freed.
11091119
</description>
11101120
</method>
11111121
<method name="vertex_buffer_create">

doc/classes/RenderingServer.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3849,6 +3849,8 @@
38493849
<param index="1" name="layer_type" type="int" enum="RenderingServer.TextureLayeredType" default="0" />
38503850
<description>
38513851
Creates a new texture object based on a texture created directly on the [RenderingDevice]. If the texture contains layers, [param layer_type] is used to define the layer type.
3852+
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method.
3853+
[b]Note:[/b] The RenderingServer's [method free_rid] won't free the underlying [param rd_texture], you will want to free the [param rd_texture] using [method RenderingDevice.free_rid].
38523854
</description>
38533855
</method>
38543856
<method name="texture_replace">

0 commit comments

Comments
 (0)