Skip to content

Commit

Permalink
Implement buffer_get_data_async and texture_get_data_async.
Browse files Browse the repository at this point in the history
  • Loading branch information
DarioSamo committed Dec 10, 2024
1 parent a372214 commit d6b5144
Show file tree
Hide file tree
Showing 4 changed files with 455 additions and 85 deletions.
1 change: 1 addition & 0 deletions core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,7 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/rendering_device/staging_buffer/block_size_kb", PROPERTY_HINT_RANGE, "4,2048,1,or_greater"), 256);
GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/rendering_device/staging_buffer/max_size_mb", PROPERTY_HINT_RANGE, "1,1024,1,or_greater"), 128);
GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/rendering_device/staging_buffer/texture_upload_region_size_px", PROPERTY_HINT_RANGE, "1,256,1,or_greater"), 64);
GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/rendering_device/staging_buffer/texture_download_region_size_px", PROPERTY_HINT_RANGE, "1,256,1,or_greater"), 64);
GLOBAL_DEF_RST(PropertyInfo(Variant::BOOL, "rendering/rendering_device/pipeline_cache/enable"), true);
GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "rendering/rendering_device/pipeline_cache/save_chunk_size_mb", PROPERTY_HINT_RANGE, "0.000001,64.0,0.001,or_greater"), 3.0);
GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/rendering_device/vulkan/max_descriptors_per_pool", PROPERTY_HINT_RANGE, "1,256,1,or_greater"), 64);
Expand Down
17 changes: 17 additions & 0 deletions doc/classes/RenderingDevice.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@
Returns a copy of the data of the specified [param buffer], optionally [param offset_bytes] and [param size_bytes] can be set to copy only a portion of the buffer.
</description>
</method>
<method name="buffer_get_data_async">
<return type="int" enum="Error" />
<param index="0" name="buffer" type="RID" />
<param index="1" name="callback" type="Callable" />
<param index="2" name="offset_bytes" type="int" default="0" />
<param index="3" name="size_bytes" type="int" default="0" />
<description>
</description>
</method>
<method name="buffer_update">
<return type="int" enum="Error" />
<param index="0" name="buffer" type="RID" />
Expand Down Expand Up @@ -930,6 +939,14 @@
[b]Note:[/b] [param texture] requires the [constant TEXTURE_USAGE_CAN_COPY_FROM_BIT] to be retrieved. Otherwise, an error is printed and a empty [PackedByteArray] is returned.
</description>
</method>
<method name="texture_get_data_async">
<return type="int" enum="Error" />
<param index="0" name="texture" type="RID" />
<param index="1" name="layer" type="int" />
<param index="2" name="callback" type="Callable" />
<description>
</description>
</method>
<method name="texture_get_format">
<return type="RDTextureFormat" />
<param index="0" name="texture" type="RID" />
Expand Down
Loading

0 comments on commit d6b5144

Please sign in to comment.