Skip to content

Commit

Permalink
Avoid saving the texture_rd_rid property of TextureRD resources
Browse files Browse the repository at this point in the history
RIDs do not persist between runs, so they should not be saved
  • Loading branch information
clayjohn committed Jan 24, 2024
1 parent 74c32fa commit c6316bf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion doc/classes/Texture2DRD.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</tutorials>
<members>
<member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" />
<member name="texture_rd_rid" type="RID" setter="set_texture_rd_rid" getter="get_texture_rd_rid" default="RID()">
<member name="texture_rd_rid" type="RID" setter="set_texture_rd_rid" getter="get_texture_rd_rid">
The RID of the texture object created on the [RenderingDevice].
</member>
</members>
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/Texture3DRD.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<tutorials>
</tutorials>
<members>
<member name="texture_rd_rid" type="RID" setter="set_texture_rd_rid" getter="get_texture_rd_rid" default="RID()">
<member name="texture_rd_rid" type="RID" setter="set_texture_rd_rid" getter="get_texture_rd_rid">
The RID of the texture object created on the [RenderingDevice].
</member>
</members>
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/TextureLayeredRD.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<tutorials>
</tutorials>
<members>
<member name="texture_rd_rid" type="RID" setter="set_texture_rd_rid" getter="get_texture_rd_rid" default="RID()">
<member name="texture_rd_rid" type="RID" setter="set_texture_rd_rid" getter="get_texture_rd_rid">
The RID of the texture object created on the [RenderingDevice].
</member>
</members>
Expand Down
6 changes: 3 additions & 3 deletions scene/resources/texture_rd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void Texture2DRD::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_texture_rd_rid", "texture_rd_rid"), &Texture2DRD::set_texture_rd_rid);
ClassDB::bind_method(D_METHOD("get_texture_rd_rid"), &Texture2DRD::get_texture_rd_rid);

ADD_PROPERTY(PropertyInfo(Variant::RID, "texture_rd_rid"), "set_texture_rd_rid", "get_texture_rd_rid");
ADD_PROPERTY(PropertyInfo(Variant::RID, "texture_rd_rid", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_texture_rd_rid", "get_texture_rd_rid");
}

int Texture2DRD::get_width() const {
Expand Down Expand Up @@ -128,7 +128,7 @@ void TextureLayeredRD::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_texture_rd_rid", "texture_rd_rid"), &TextureLayeredRD::set_texture_rd_rid);
ClassDB::bind_method(D_METHOD("get_texture_rd_rid"), &TextureLayeredRD::get_texture_rd_rid);

ADD_PROPERTY(PropertyInfo(Variant::RID, "texture_rd_rid"), "set_texture_rd_rid", "get_texture_rd_rid");
ADD_PROPERTY(PropertyInfo(Variant::RID, "texture_rd_rid", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_texture_rd_rid", "get_texture_rd_rid");
}

TextureLayered::LayeredType TextureLayeredRD::get_layered_type() const {
Expand Down Expand Up @@ -255,7 +255,7 @@ void Texture3DRD::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_texture_rd_rid", "texture_rd_rid"), &Texture3DRD::set_texture_rd_rid);
ClassDB::bind_method(D_METHOD("get_texture_rd_rid"), &Texture3DRD::get_texture_rd_rid);

ADD_PROPERTY(PropertyInfo(Variant::RID, "texture_rd_rid"), "set_texture_rd_rid", "get_texture_rd_rid");
ADD_PROPERTY(PropertyInfo(Variant::RID, "texture_rd_rid", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_texture_rd_rid", "get_texture_rd_rid");
}

Image::Format Texture3DRD::get_format() const {
Expand Down

0 comments on commit c6316bf

Please sign in to comment.