Skip to content

Commit

Permalink
git subrepo pull (merge) --force --branch=groups-4.4.2025-01-16T22111…
Browse files Browse the repository at this point in the history
…6Z godot

subrepo:
  subdir:   "godot"
  merged:   "b09245232d"
upstream:
  origin:   "https://github.com/V-Sekai/godot.git"
  branch:   "groups-4.4.2025-01-16T221116Z"
  commit:   "b09245232d"
git-subrepo:
  version:  "0.4.9"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "cce3d93"
  • Loading branch information
fire committed Jan 16, 2025
1 parent 79b4aa7 commit b8fb6a9
Show file tree
Hide file tree
Showing 144 changed files with 1,898 additions and 370 deletions.
6 changes: 3 additions & 3 deletions godot/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
;
[subrepo]
remote = https://github.com/V-Sekai/godot.git
branch = groups-4.4.2025-01-14T005028Z
commit = ef703d957f07eda98619a40314f05653edaf6781
parent = 1be1b36904e73756e6429f39f7bc0dea107103f4
branch = groups-4.4.2025-01-16T221116Z
commit = b09245232dd453f5a6b787adee6ed7442f50e082
parent = 79b4aa74b943815c14c6e359f7062f0943331cb5
method = merge
cmdver = 0.4.9
4 changes: 2 additions & 2 deletions godot/core/debugger/remote_debugger_peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ Error RemoteDebuggerPeerTCP::connect_to_host(const String &p_host, uint16_t p_po
} else {
const int ms = waits[i];
OS::get_singleton()->delay_usec(ms * 1000);
print_verbose("Remote Debugger: Connection failed with status: '" + String::num(tcp_client->get_status()) + "', retrying in " + String::num(ms) + " msec.");
print_verbose("Remote Debugger: Connection failed with status: '" + String::num_int64(tcp_client->get_status()) + "', retrying in " + String::num_int64(ms) + " msec.");
}
}

if (tcp_client->get_status() != StreamPeerTCP::STATUS_CONNECTED) {
ERR_PRINT(vformat("Remote Debugger: Unable to connect. Status: %s.", String::num(tcp_client->get_status())));
ERR_PRINT(vformat("Remote Debugger: Unable to connect. Status: %s.", String::num_int64(tcp_client->get_status())));
return FAILED;
}
connected = true;
Expand Down
93 changes: 92 additions & 1 deletion godot/core/io/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ static void _overlay(const uint8_t *__restrict p_src, uint8_t *__restrict p_dst,
}

bool Image::is_size_po2() const {
return uint32_t(width) == next_power_of_2(width) && uint32_t(height) == next_power_of_2(height);
return is_power_of_2(width) && is_power_of_2(height);
}

void Image::resize_to_po2(bool p_square, Interpolation p_interpolation) {
Expand Down Expand Up @@ -3953,6 +3953,97 @@ String Image::get_format_name(Format p_format) {
return format_names[p_format];
}

uint32_t Image::get_format_component_mask(Format p_format) {
const uint32_t r = 1;
const uint32_t rg = 3;
const uint32_t rgb = 7;
const uint32_t rgba = 15;

switch (p_format) {
case FORMAT_L8:
return rgb;
case FORMAT_LA8:
return rgba;
case FORMAT_R8:
return r;
case FORMAT_RG8:
return rg;
case FORMAT_RGB8:
return rgb;
case FORMAT_RGBA8:
return rgba;
case FORMAT_RGBA4444:
return rgba;
case FORMAT_RGB565:
return rgb;
case FORMAT_RF:
return r;
case FORMAT_RGF:
return rg;
case FORMAT_RGBF:
return rgb;
case FORMAT_RGBAF:
return rgba;
case FORMAT_RH:
return r;
case FORMAT_RGH:
return rg;
case FORMAT_RGBH:
return rgb;
case FORMAT_RGBAH:
return rgba;
case FORMAT_RGBE9995:
return rgba;
case FORMAT_DXT1:
return rgb;
case FORMAT_DXT3:
return rgb;
case FORMAT_DXT5:
return rgba;
case FORMAT_RGTC_R:
return r;
case FORMAT_RGTC_RG:
return rg;
case FORMAT_BPTC_RGBA:
return rgba;
case FORMAT_BPTC_RGBF:
return rgb;
case FORMAT_BPTC_RGBFU:
return rgb;
case FORMAT_ETC:
return rgb;
case FORMAT_ETC2_R11:
return r;
case FORMAT_ETC2_R11S:
return r;
case FORMAT_ETC2_RG11:
return rg;
case FORMAT_ETC2_RG11S:
return rg;
case FORMAT_ETC2_RGB8:
return rgb;
case FORMAT_ETC2_RGBA8:
return rgba;
case FORMAT_ETC2_RGB8A1:
return rgba;
case FORMAT_ETC2_RA_AS_RG:
return rgba;
case FORMAT_DXT5_RA_AS_RG:
return rgba;
case FORMAT_ASTC_4x4:
return rgba;
case FORMAT_ASTC_4x4_HDR:
return rgba;
case FORMAT_ASTC_8x8:
return rgba;
case FORMAT_ASTC_8x8_HDR:
return rgba;
default:
ERR_PRINT("Unhandled format.");
return rgba;
}
}

Error Image::load_png_from_buffer(const Vector<uint8_t> &p_array) {
return _load_from_buffer(p_array, _png_mem_loader_func);
}
Expand Down
1 change: 1 addition & 0 deletions godot/core/io/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ class Image : public Resource {
Ref<Image> get_region(const Rect2i &p_area) const;

static String get_format_name(Format p_format);
static uint32_t get_format_component_mask(Format p_format);

Error load_png_from_buffer(const Vector<uint8_t> &p_array);
Error load_jpg_from_buffer(const Vector<uint8_t> &p_array);
Expand Down
4 changes: 0 additions & 4 deletions godot/core/os/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ SafeNumeric<uint64_t> Memory::max_usage;

SafeNumeric<uint64_t> Memory::alloc_count;

inline bool is_power_of_2(size_t x) {
return x && ((x & (x - 1U)) == 0U);
}

void *Memory::alloc_aligned_static(size_t p_bytes, size_t p_alignment) {
DEV_ASSERT(is_power_of_2(p_alignment));

Expand Down
6 changes: 6 additions & 0 deletions godot/core/typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ constexpr auto CLAMP(const T m_a, const T2 m_min, const T3 m_max) {

/* Functions to handle powers of 2 and shifting. */

// Returns `true` if a positive integer is a power of 2, `false` otherwise.
template <typename T>
inline bool is_power_of_2(const T x) {
return x && ((x & (x - 1)) == 0);
}

// Function to find the next power of 2 to an integer.
static _FORCE_INLINE_ unsigned int next_power_of_2(unsigned int x) {
if (x == 0) {
Expand Down
4 changes: 2 additions & 2 deletions godot/doc/classes/DisplayServer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<param index="3" name="callback" type="Callable" />
<description>
Shows a text dialog which uses the operating system's native look-and-feel. [param callback] should accept a single [int] parameter which corresponds to the index of the pressed button.
[b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG] feature. Supported platforms include macOS and Windows.
[b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG] feature. Supported platforms include macOS, Windows, and Android.
</description>
</method>
<method name="enable_for_stealing_focus">
Expand Down Expand Up @@ -1937,7 +1937,7 @@
The display server supports all features of [constant FEATURE_NATIVE_DIALOG_FILE], with the added functionality of Options and native dialog file access to [code]res://[/code] and [code]user://[/code] paths. See [method file_dialog_show] and [method file_dialog_with_options_show]. [b]Windows, macOS, Linux (X11/Wayland)[/b]
</constant>
<constant name="FEATURE_WINDOW_DRAG" value="27" enum="Feature">
The display server supports initiating window drag operation on demand. See [method window_start_drag].
The display server supports initiating window drag and resize operations on demand. See [method window_start_drag] and [method window_start_resize].
</constant>
<constant name="FEATURE_SCREEN_EXCLUDE_FROM_CAPTURE" value="28" enum="Feature">
Display server supports [constant WINDOW_FLAG_EXCLUDE_FROM_CAPTURE] window flag.
Expand Down
5 changes: 0 additions & 5 deletions godot/doc/classes/EditorSceneFormatImporter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
Return supported file extensions for this scene importer.
</description>
</method>
<method name="_get_import_flags" qualifiers="virtual const" deprecated="Unused by the engine, and will be removed in a future version. Implementing this has no effect.">
<return type="int" />
<description>
</description>
</method>
<method name="_get_import_options" qualifiers="virtual">
<return type="void" />
<param index="0" name="path" type="String" />
Expand Down
6 changes: 6 additions & 0 deletions godot/doc/classes/NavigationRegion2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
Bakes the [NavigationPolygon]. If [param on_thread] is set to [code]true[/code] (default), the baking is done on a separate thread.
</description>
</method>
<method name="get_bounds" qualifiers="const">
<return type="Rect2" />
<description>
Returns the axis-aligned rectangle for the region's transformed navigation mesh.
</description>
</method>
<method name="get_navigation_layer_value" qualifiers="const">
<return type="bool" />
<param index="0" name="layer_number" type="int" />
Expand Down
6 changes: 6 additions & 0 deletions godot/doc/classes/NavigationRegion3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
Bakes the [NavigationMesh]. If [param on_thread] is set to [code]true[/code] (default), the baking is done on a separate thread. Baking on separate thread is useful because navigation baking is not a cheap operation. When it is completed, it automatically sets the new [NavigationMesh]. Please note that baking on separate thread may be very slow if geometry is parsed from meshes as async access to each mesh involves heavy synchronization. Also, please note that baking on a separate thread is automatically disabled on operating systems that cannot use threads (such as Web with threads disabled).
</description>
</method>
<method name="get_bounds" qualifiers="const">
<return type="AABB" />
<description>
Returns the axis-aligned bounding box for the region's transformed navigation mesh.
</description>
</method>
<method name="get_navigation_layer_value" qualifiers="const">
<return type="bool" />
<param index="0" name="layer_number" type="int" />
Expand Down
7 changes: 7 additions & 0 deletions godot/doc/classes/NavigationServer2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,13 @@
Creates a new region.
</description>
</method>
<method name="region_get_bounds" qualifiers="const">
<return type="Rect2" />
<param index="0" name="region" type="RID" />
<description>
Returns the axis-aligned rectangle for the [param region]'s transformed navigation mesh.
</description>
</method>
<method name="region_get_closest_point" qualifiers="const">
<return type="Vector2" />
<param index="0" name="region" type="RID" />
Expand Down
7 changes: 7 additions & 0 deletions godot/doc/classes/NavigationServer3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,13 @@
Creates a new region.
</description>
</method>
<method name="region_get_bounds" qualifiers="const">
<return type="AABB" />
<param index="0" name="region" type="RID" />
<description>
Returns the axis-aligned bounding box for the [param region]'s transformed navigation mesh.
</description>
</method>
<method name="region_get_closest_point" qualifiers="const">
<return type="Vector3" />
<param index="0" name="region" type="RID" />
Expand Down
8 changes: 7 additions & 1 deletion godot/doc/classes/ParticleProcessMaterial.xml
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,10 @@
The amount of particles to spawn from the subemitter node when the particle expires.
[b]Note:[/b] This value shouldn't exceed [member GPUParticles2D.amount] or [member GPUParticles3D.amount] defined on the [i]subemitter node[/i] (not the main node), relative to the subemitter's particle lifetime. If the number of particles is exceeded, no new particles will spawn from the subemitter until enough particles have expired.
</member>
<member name="sub_emitter_amount_at_start" type="int" setter="set_sub_emitter_amount_at_start" getter="get_sub_emitter_amount_at_start">
The amount of particles to spawn from the subemitter node when the particle spawns.
[b]Note:[/b] This value shouldn't exceed [member GPUParticles2D.amount] or [member GPUParticles3D.amount] defined on the [i]subemitter node[/i] (not the main node), relative to the subemitter's particle lifetime. If the number of particles is exceeded, no new particles will spawn from the subemitter until enough particles have expired.
</member>
<member name="sub_emitter_frequency" type="float" setter="set_sub_emitter_frequency" getter="get_sub_emitter_frequency">
The frequency at which particles should be emitted from the subemitter node. One particle will be spawned every [member sub_emitter_frequency] seconds.
[b]Note:[/b] This value shouldn't exceed [member GPUParticles2D.amount] or [member GPUParticles3D.amount] defined on the [i]subemitter node[/i] (not the main node), relative to the subemitter's particle lifetime. If the number of particles is exceeded, no new particles will spawn from the subemitter until enough particles have expired.
Expand Down Expand Up @@ -521,7 +525,9 @@
</constant>
<constant name="SUB_EMITTER_AT_COLLISION" value="3" enum="SubEmitterMode">
</constant>
<constant name="SUB_EMITTER_MAX" value="4" enum="SubEmitterMode">
<constant name="SUB_EMITTER_AT_START" value="4" enum="SubEmitterMode">
</constant>
<constant name="SUB_EMITTER_MAX" value="5" enum="SubEmitterMode">
Represents the size of the [enum SubEmitterMode] enum.
</constant>
<constant name="COLLISION_DISABLED" value="0" enum="CollisionMode">
Expand Down
27 changes: 27 additions & 0 deletions godot/doc/classes/RenderingDevice.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@
[/codeblock]
</description>
</method>
<method name="buffer_get_device_address">
<return type="int" />
<param index="0" name="buffer" type="RID" />
<description>
Returns the address of the given [param buffer] which can be passed to shaders in any way to access underlying data. Buffer must have been created with this feature enabled.
[b]Note:[/b] You must check that the GPU supports this functionality by calling [method has_feature] with [constant SUPPORTS_BUFFER_DEVICE_ADDRESS] as a parameter.
</description>
</method>
<method name="buffer_update">
<return type="int" enum="Error" />
<param index="0" name="buffer" type="RID" />
Expand Down Expand Up @@ -672,6 +680,13 @@
This is only used by Vulkan in debug builds. Godot must also be started with the [code]--extra-gpu-memory-tracking[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url].
</description>
</method>
<method name="has_feature" qualifiers="const">
<return type="bool" />
<param index="0" name="feature" type="int" enum="RenderingDevice.Features" />
<description>
Returns [code]true[/code] if the [param feature] is supported by the GPU.
</description>
</method>
<method name="index_array_create">
<return type="RID" />
<param index="0" name="index_buffer" type="RID" />
Expand All @@ -688,9 +703,11 @@
<param index="1" name="format" type="int" enum="RenderingDevice.IndexBufferFormat" />
<param index="2" name="data" type="PackedByteArray" default="PackedByteArray()" />
<param index="3" name="use_restart_indices" type="bool" default="false" />
<param index="4" name="enable_device_address" type="bool" default="false" />
<description>
Creates a new index buffer. It can be accessed with the RID that is returned.
Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
Optionally, set [param enable_device_address] if you wish to use [method buffer_get_device_address] functionality and the GPU supports it.
</description>
</method>
<method name="limit_get" qualifiers="const">
Expand Down Expand Up @@ -1056,9 +1073,11 @@
<return type="RID" />
<param index="0" name="size_bytes" type="int" />
<param index="1" name="data" type="PackedByteArray" default="PackedByteArray()" />
<param index="2" name="enable_device_address" type="bool" default="false" />
<description>
Creates a new uniform buffer. It can be accessed with the RID that is returned.
Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
Optionally, set [param enable_device_address] if you wish to use [method buffer_get_device_address] functionality and the GPU supports it.
</description>
</method>
<method name="uniform_set_create">
Expand Down Expand Up @@ -1093,9 +1112,11 @@
<param index="0" name="size_bytes" type="int" />
<param index="1" name="data" type="PackedByteArray" default="PackedByteArray()" />
<param index="2" name="use_as_storage" type="bool" default="false" />
<param index="3" name="enable_device_address" type="bool" default="false" />
<description>
It can be accessed with the RID that is returned.
Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
Optionally, set [param enable_device_address] if you wish to use [method buffer_get_device_address] functionality and the GPU supports it.
</description>
</method>
<method name="vertex_format_create">
Expand Down Expand Up @@ -2047,6 +2068,9 @@
</constant>
<constant name="STORAGE_BUFFER_USAGE_DISPATCH_INDIRECT" value="1" enum="StorageBufferUsage" is_bitfield="true">
</constant>
<constant name="STORAGE_BUFFER_USAGE_DEVICE_ADDRESS" value="2" enum="StorageBufferUsage" is_bitfield="true">
Allows usage of [method buffer_get_device_address] on supported GPUs.
</constant>
<constant name="UNIFORM_TYPE_SAMPLER" value="0" enum="UniformType">
Sampler uniform.
</constant>
Expand Down Expand Up @@ -2418,6 +2442,9 @@
<constant name="PIPELINE_SPECIALIZATION_CONSTANT_TYPE_FLOAT" value="2" enum="PipelineSpecializationConstantType">
Floating-point specialization constant.
</constant>
<constant name="SUPPORTS_BUFFER_DEVICE_ADDRESS" value="6" enum="Features">
Features support for buffer device address extension.
</constant>
<constant name="LIMIT_MAX_BOUND_UNIFORM_SETS" value="0" enum="Limit">
Maximum number of uniform sets that can be bound at a given time.
</constant>
Expand Down
24 changes: 24 additions & 0 deletions godot/doc/classes/RenderingServer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2559,6 +2559,7 @@
<param index="2" name="transform_format" type="int" enum="RenderingServer.MultimeshTransformFormat" />
<param index="3" name="color_format" type="bool" default="false" />
<param index="4" name="custom_data_format" type="bool" default="false" />
<param index="5" name="use_indirect" type="bool" default="false" />
<description>
</description>
</method>
Expand Down Expand Up @@ -2593,6 +2594,29 @@
Returns the [RenderingDevice] [RID] handle of the [MultiMesh], which can be used as any other buffer on the Rendering Device.
</description>
</method>
<method name="multimesh_get_command_buffer_rd_rid" qualifiers="const">
<return type="RID" />
<param index="0" name="multimesh" type="RID" />
<description>
Returns the [RenderingDevice] [RID] handle of the [MultiMesh] command buffer. This [RID] is only valid if [code]use_indirect[/code] is set to [code]true[/code] when allocating data through [method multimesh_allocate_data]. It can be used to directly modify the instance count via buffer.
The data structure is dependent on both how many surfaces the mesh contains and whether it is indexed or not, the buffer has 5 integers in it, with the last unused if the mesh is not indexed.
Each of the values in the buffer correspond to these options:
[codeblock lang=text]
Indexed:
0 - indexCount;
1 - instanceCount;
2 - firstIndex;
3 - vertexOffset;
4 - firstInstance;
Non Indexed:
0 - vertexCount;
1 - instanceCount;
2 - firstVertex;
3 - firstInstance;
4 - unused;
[/codeblock]
</description>
</method>
<method name="multimesh_get_custom_aabb" qualifiers="const">
<return type="AABB" />
<param index="0" name="multimesh" type="RID" />
Expand Down
Loading

0 comments on commit b8fb6a9

Please sign in to comment.