diff options
author | Spartan322 <Megacake1234@gmail.com> | 2024-11-12 13:46:08 -0500 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2024-11-12 13:46:59 -0500 |
commit | 3a73c6ebd18bff0fa125be58d3ac9c7a63bab61d (patch) | |
tree | c7341bd56c977259578b127886c9a88eeef11820 /servers | |
parent | 5094c2a5f7d506b0e685120f14d1df42e1e9d495 (diff) | |
parent | cb411fa960f0b7fdbd97dcdb4c90f9346360ee0e (diff) | |
download | redot-engine-3a73c6ebd18bff0fa125be58d3ac9c7a63bab61d.tar.gz |
Merge commit godotengine/godot@cb411fa960f0b7fdbd97dcdb4c90f9346360ee0e
Diffstat (limited to 'servers')
-rw-r--r-- | servers/rendering/renderer_rd/storage_rd/texture_storage.cpp | 4 | ||||
-rw-r--r-- | servers/rendering/shader_compiler.cpp | 10 | ||||
-rw-r--r-- | servers/rendering_server.cpp | 13 | ||||
-rw-r--r-- | servers/rendering_server.h | 3 |
4 files changed, 27 insertions, 3 deletions
diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp index 6a18545045..3db3173518 100644 --- a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp @@ -1668,7 +1668,9 @@ void TextureStorage::texture_rd_initialize(RID p_texture, const RID &p_rd_textur ERR_FAIL_COND(tf.array_layers != 1); texture.type = TextureStorage::TYPE_2D; } break; - case RD::TEXTURE_TYPE_2D_ARRAY: { + case RD::TEXTURE_TYPE_2D_ARRAY: + case RD::TEXTURE_TYPE_CUBE: + case RD::TEXTURE_TYPE_CUBE_ARRAY: { // RenderingDevice doesn't distinguish between Array textures and Cube textures // this condition covers TextureArrays, TextureCube, and TextureCubeArray. ERR_FAIL_COND(tf.array_layers == 1); diff --git a/servers/rendering/shader_compiler.cpp b/servers/rendering/shader_compiler.cpp index 823872d626..a453d532a8 100644 --- a/servers/rendering/shader_compiler.cpp +++ b/servers/rendering/shader_compiler.cpp @@ -491,7 +491,7 @@ String ShaderCompiler::_dump_node_code(const SL::Node *p_node, int p_level, Gene struct_code += _typestr(m->datatype); } struct_code += " "; - struct_code += m->name; + struct_code += _mkid(m->name); if (m->array_size > 0) { struct_code += "["; struct_code += itos(m->array_size); @@ -1450,7 +1450,13 @@ String ShaderCompiler::_dump_node_code(const SL::Node *p_node, int p_level, Gene } break; case SL::Node::NODE_TYPE_MEMBER: { SL::MemberNode *mnode = (SL::MemberNode *)p_node; - code = _dump_node_code(mnode->owner, p_level, r_gen_code, p_actions, p_default_actions, p_assigning) + "." + mnode->name; + String name; + if (mnode->basetype == SL::TYPE_STRUCT) { + name = _mkid(mnode->name); + } else { + name = mnode->name; + } + code = _dump_node_code(mnode->owner, p_level, r_gen_code, p_actions, p_default_actions, p_assigning) + "." + name; if (mnode->index_expression != nullptr) { code += "["; code += _dump_node_code(mnode->index_expression, p_level, r_gen_code, p_actions, p_default_actions, p_assigning); diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 4dfe48f0d6..725ef4d637 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -2069,6 +2069,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()); @@ -3425,6 +3435,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); diff --git a/servers/rendering_server.h b/servers/rendering_server.h index d3aff46832..9e72c3c2e1 100644 --- a/servers/rendering_server.h +++ b/servers/rendering_server.h @@ -1789,6 +1789,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 |