mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 11:32:13 +00:00
Merge pull request #85430 from Calinou/os-expose-rendering-driver-method
Expose RenderingServer methods to get rendering driver and method name
This commit is contained in:
commit
4b447ec4e5
@ -2778,6 +2778,8 @@
|
||||
[b]Forward Plus[/b]: High-end renderer designed for Desktop devices. Has a higher base overhead, but scales well with complex scenes. Not suitable for older devices or mobile.
|
||||
[b]Mobile[/b]: Modern renderer designed for mobile devices. Has a lower base overhead than Forward Plus, but does not scale as well to large scenes with many elements.
|
||||
[b]GL Compatibility[/b]: Low-end renderer designed for older devices. Based on the limitations of the OpenGL 3.3/ OpenGL ES 3.0 / WebGL 2 APIs.
|
||||
This can be overridden using the [code]--rendering-method <method>[/code] command line argument.
|
||||
[b]Note:[/b] The actual rendering method may be automatically changed by the engine as a result of a fallback, or a user-specified command line argument. To get the actual rendering method that is used at runtime, use [method RenderingServer.get_current_rendering_method] instead of reading this project setting's value.
|
||||
</member>
|
||||
<member name="rendering/renderer/rendering_method.mobile" type="String" setter="" getter="" default=""mobile"">
|
||||
Override for [member rendering/renderer/rendering_method] on mobile devices.
|
||||
@ -2801,7 +2803,8 @@
|
||||
Depending on the complexity of scenes, this value may be lowered or may need to be raised.
|
||||
</member>
|
||||
<member name="rendering/rendering_device/driver" type="String" setter="" getter="">
|
||||
Sets the driver to be used by the renderer when using a RenderingDevice-based renderer like the clustered renderer or the mobile renderer. This property can not be edited directly, instead, set the driver using the platform-specific overrides.
|
||||
Sets the driver to be used by the renderer when using a RenderingDevice-based renderer like the clustered renderer or the mobile renderer. This property can't be edited directly. Instead, set the driver using the platform-specific overrides. This can be overridden using the [code]--rendering-driver <driver>[/code] command line argument.
|
||||
[b]Note:[/b] The actual rendering driver may be automatically changed by the engine as a result of a fallback, or a user-specified command line argument. To get the actual rendering driver that is used at runtime, use [method RenderingServer.get_current_rendering_driver_name] instead of reading this project setting's value.
|
||||
</member>
|
||||
<member name="rendering/rendering_device/driver.android" type="String" setter="" getter="">
|
||||
Android override for [member rendering/rendering_device/driver].
|
||||
|
@ -1548,6 +1548,20 @@
|
||||
Tries to free an object in the RenderingServer. To avoid memory leaks, this should be called after using an object as memory management does not occur automatically when using RenderingServer directly.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_current_rendering_driver_name" qualifiers="const">
|
||||
<return type="String" />
|
||||
<description>
|
||||
Returns the name of the current rendering driver. This can be [code]vulkan[/code], [code]d3d12[/code], [code]metal[/code], [code]opengl3[/code], [code]opengl3_es[/code], or [code]opengl3_angle[/code]. See also [method get_current_rendering_method].
|
||||
The rendering driver is determined by [member ProjectSettings.rendering/rendering_device/driver], the [code]--rendering-driver[/code] command line argument that overrides this project setting, or an automatic fallback that is applied depending on the hardware.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_current_rendering_method" qualifiers="const">
|
||||
<return type="String" />
|
||||
<description>
|
||||
Returns the name of the current rendering method. This can be [code]forward_plus[/code], [code]mobile[/code], or [code]gl_compatibility[/code]. See also [method get_current_rendering_driver_name].
|
||||
The rendering method is determined by [member ProjectSettings.rendering/renderer/rendering_method], the [code]--rendering-method[/code] command line argument that overrides this project setting, or an automatic fallback that is applied depending on the hardware.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_default_clear_color">
|
||||
<return type="Color" />
|
||||
<description>
|
||||
|
@ -2067,6 +2067,16 @@ void RenderingServer::_particles_set_trail_bind_poses(RID p_particles, const Typ
|
||||
particles_set_trail_bind_poses(p_particles, tbposes);
|
||||
}
|
||||
|
||||
String RenderingServer::get_current_rendering_driver_name() const {
|
||||
// Needs to remain in OS, since it's actually OS that interacts with it, but it's better exposed here.
|
||||
return ::OS::get_singleton()->get_current_rendering_driver_name();
|
||||
}
|
||||
|
||||
String RenderingServer::get_current_rendering_method() const {
|
||||
// Needs to remain in OS, since it's actually OS that interacts with it, but it's better exposed here.
|
||||
return ::OS::get_singleton()->get_current_rendering_method();
|
||||
}
|
||||
|
||||
Vector<uint8_t> _convert_surface_version_1_to_surface_version_2(uint64_t p_format, Vector<uint8_t> p_vertex_data, uint32_t p_vertex_count, uint32_t p_old_stride, uint32_t p_vertex_size, uint32_t p_normal_size, uint32_t p_position_stride, uint32_t p_normal_tangent_stride) {
|
||||
Vector<uint8_t> new_vertex_data;
|
||||
new_vertex_data.resize(p_vertex_data.size());
|
||||
@ -3423,6 +3433,9 @@ void RenderingServer::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_video_adapter_type"), &RenderingServer::get_video_adapter_type);
|
||||
ClassDB::bind_method(D_METHOD("get_video_adapter_api_version"), &RenderingServer::get_video_adapter_api_version);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_current_rendering_driver_name"), &RenderingServer::get_current_rendering_driver_name);
|
||||
ClassDB::bind_method(D_METHOD("get_current_rendering_method"), &RenderingServer::get_current_rendering_method);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("make_sphere_mesh", "latitudes", "longitudes", "radius"), &RenderingServer::make_sphere_mesh);
|
||||
ClassDB::bind_method(D_METHOD("get_test_cube"), &RenderingServer::get_test_cube);
|
||||
|
||||
|
@ -1787,6 +1787,9 @@ public:
|
||||
virtual bool is_on_render_thread() = 0;
|
||||
virtual void call_on_render_thread(const Callable &p_callable) = 0;
|
||||
|
||||
String get_current_rendering_driver_name() const;
|
||||
String get_current_rendering_method() const;
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user