diff options
Diffstat (limited to 'servers')
-rw-r--r-- | servers/physics_3d/godot_physics_server_3d.cpp | 2 | ||||
-rw-r--r-- | servers/register_server_types.cpp | 4 | ||||
-rw-r--r-- | servers/register_server_types.h | 1 | ||||
-rw-r--r-- | servers/rendering/renderer_canvas_render.cpp | 2 | ||||
-rw-r--r-- | servers/rendering/renderer_canvas_render.h | 2 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp | 4 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/renderer_storage_rd.cpp | 4 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/shaders/ssil_blur.glsl | 20 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/shaders/ssil_importance_map.glsl | 1 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/shaders/ssil_interleave.glsl | 20 | ||||
-rw-r--r-- | servers/rendering/rendering_server_default.cpp | 8 | ||||
-rw-r--r-- | servers/rendering_server.cpp | 2 | ||||
-rw-r--r-- | servers/rendering_server.h | 2 |
13 files changed, 60 insertions, 12 deletions
diff --git a/servers/physics_3d/godot_physics_server_3d.cpp b/servers/physics_3d/godot_physics_server_3d.cpp index bed9b02da1..b735283ebe 100644 --- a/servers/physics_3d/godot_physics_server_3d.cpp +++ b/servers/physics_3d/godot_physics_server_3d.cpp @@ -1671,7 +1671,7 @@ void GodotPhysicsServer3D::flush_queries() { values.push_back("flush_queries"); values.push_back(USEC_TO_SEC(OS::get_singleton()->get_ticks_usec() - time_beg)); - values.push_front("physics"); + values.push_front("physics_3d"); EngineDebugger::profiler_add_frame_data("servers", values); } #endif diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index 275a42a4e3..8bbe987cb7 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -107,7 +107,7 @@ static bool has_server_feature_callback(const String &p_feature) { return false; } -void preregister_server_types() { +void register_server_types() { shader_types = memnew(ShaderTypes); GDREGISTER_CLASS(TextServerManager); @@ -119,9 +119,7 @@ void preregister_server_types() { GDREGISTER_NATIVE_STRUCT(CaretInfo, "Rect2 leading_caret;Rect2 trailing_caret;TextServer::Direction leading_direction;TextServer::Direction trailing_direction"); Engine::get_singleton()->add_singleton(Engine::Singleton("TextServerManager", TextServerManager::get_singleton(), "TextServerManager")); -} -void register_server_types() { OS::get_singleton()->set_has_server_feature_callback(has_server_feature_callback); GDREGISTER_ABSTRACT_CLASS(DisplayServer); diff --git a/servers/register_server_types.h b/servers/register_server_types.h index cf6364eee3..32fd944bea 100644 --- a/servers/register_server_types.h +++ b/servers/register_server_types.h @@ -31,7 +31,6 @@ #ifndef REGISTER_SERVER_TYPES_H #define REGISTER_SERVER_TYPES_H -void preregister_server_types(); void register_server_types(); void unregister_server_types(); diff --git a/servers/rendering/renderer_canvas_render.cpp b/servers/rendering/renderer_canvas_render.cpp index 49417bd3a6..163a24247e 100644 --- a/servers/rendering/renderer_canvas_render.cpp +++ b/servers/rendering/renderer_canvas_render.cpp @@ -95,7 +95,7 @@ const Rect2 &RendererCanvasRender::Item::get_rect() const { case Item::Command::TYPE_PARTICLES: { const Item::CommandParticles *particles_cmd = static_cast<const Item::CommandParticles *>(c); if (particles_cmd->particles.is_valid()) { - AABB aabb = RendererRD::ParticlesStorage::get_singleton()->particles_get_aabb(particles_cmd->particles); + AABB aabb = RSG::particles_storage->particles_get_aabb(particles_cmd->particles); r = Rect2(aabb.position.x, aabb.position.y, aabb.size.x, aabb.size.y); } diff --git a/servers/rendering/renderer_canvas_render.h b/servers/rendering/renderer_canvas_render.h index 9da022341c..1724a99b20 100644 --- a/servers/rendering/renderer_canvas_render.h +++ b/servers/rendering/renderer_canvas_render.h @@ -31,8 +31,6 @@ #ifndef RENDERINGSERVERCANVASRENDER_H #define RENDERINGSERVERCANVASRENDER_H -#include "servers/rendering/renderer_rd/storage_rd/mesh_storage.h" -#include "servers/rendering/renderer_rd/storage_rd/particles_storage.h" #include "servers/rendering/renderer_storage.h" class RendererCanvasRender { diff --git a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp index 7b92e92f8c..181d7819da 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp @@ -1391,7 +1391,7 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co clear_color.r *= bg_energy; clear_color.g *= bg_energy; clear_color.b *= bg_energy; - if (render_buffers_has_volumetric_fog(p_render_data->render_buffers) || environment_is_fog_enabled(p_render_data->environment)) { + if ((p_render_data->render_buffers.is_valid() && render_buffers_has_volumetric_fog(p_render_data->render_buffers)) || environment_is_fog_enabled(p_render_data->environment)) { draw_sky_fog_only = true; RendererRD::MaterialStorage::get_singleton()->material_set_param(sky.sky_scene_state.fog_material, "clear_color", Variant(clear_color.srgb_to_linear())); } @@ -1401,7 +1401,7 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co clear_color.r *= bg_energy; clear_color.g *= bg_energy; clear_color.b *= bg_energy; - if (render_buffers_has_volumetric_fog(p_render_data->render_buffers) || environment_is_fog_enabled(p_render_data->environment)) { + if ((p_render_data->render_buffers.is_valid() && render_buffers_has_volumetric_fog(p_render_data->render_buffers)) || environment_is_fog_enabled(p_render_data->environment)) { draw_sky_fog_only = true; RendererRD::MaterialStorage::get_singleton()->material_set_param(sky.sky_scene_state.fog_material, "clear_color", Variant(clear_color.srgb_to_linear())); } diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp index 1b9e0faa00..d5166c6905 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp @@ -592,6 +592,10 @@ void RendererStorageRD::update_dirty_resources() { } bool RendererStorageRD::has_os_feature(const String &p_feature) const { + if (!RD::get_singleton()) { + return false; + } + if (p_feature == "rgtc" && RD::get_singleton()->texture_is_format_supported_for_usage(RD::DATA_FORMAT_BC5_UNORM_BLOCK, RD::TEXTURE_USAGE_SAMPLING_BIT)) { return true; } diff --git a/servers/rendering/renderer_rd/shaders/ssil_blur.glsl b/servers/rendering/renderer_rd/shaders/ssil_blur.glsl index ee21d46a74..47c56571f6 100644 --- a/servers/rendering/renderer_rd/shaders/ssil_blur.glsl +++ b/servers/rendering/renderer_rd/shaders/ssil_blur.glsl @@ -1,3 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2016, Intel Corporation +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of +// the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO +// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// File changes (yyyy-mm-dd) +// 2016-09-07: filip.strugar@intel.com: first commit +// 2020-12-05: clayjohn: convert to Vulkan and Godot +// 2021-05-27: clayjohn: convert SSAO to SSIL +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + #[compute] #version 450 diff --git a/servers/rendering/renderer_rd/shaders/ssil_importance_map.glsl b/servers/rendering/renderer_rd/shaders/ssil_importance_map.glsl index 8818f8cada..6b6b02739d 100644 --- a/servers/rendering/renderer_rd/shaders/ssil_importance_map.glsl +++ b/servers/rendering/renderer_rd/shaders/ssil_importance_map.glsl @@ -15,6 +15,7 @@ // File changes (yyyy-mm-dd) // 2016-09-07: filip.strugar@intel.com: first commit // 2020-12-05: clayjohn: convert to Vulkan and Godot +// 2021-05-27: clayjohn: convert SSAO to SSIL /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #[compute] diff --git a/servers/rendering/renderer_rd/shaders/ssil_interleave.glsl b/servers/rendering/renderer_rd/shaders/ssil_interleave.glsl index fa4309353d..9e86ac0cf0 100644 --- a/servers/rendering/renderer_rd/shaders/ssil_interleave.glsl +++ b/servers/rendering/renderer_rd/shaders/ssil_interleave.glsl @@ -1,3 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2016, Intel Corporation +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of +// the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO +// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// File changes (yyyy-mm-dd) +// 2016-09-07: filip.strugar@intel.com: first commit +// 2020-12-05: clayjohn: convert to Vulkan and Godot +// 2021-05-27: clayjohn: convert SSAO to SSIL +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + #[compute] #version 450 diff --git a/servers/rendering/rendering_server_default.cpp b/servers/rendering/rendering_server_default.cpp index c4538e0776..718f20f80a 100644 --- a/servers/rendering/rendering_server_default.cpp +++ b/servers/rendering/rendering_server_default.cpp @@ -313,7 +313,11 @@ RID RenderingServerDefault::get_test_cube() { } bool RenderingServerDefault::has_os_feature(const String &p_feature) const { - return RSG::storage->has_os_feature(p_feature); + if (RSG::storage) { + return RSG::storage->has_os_feature(p_feature); + } else { + return false; + } } void RenderingServerDefault::set_debug_generate_wireframes(bool p_generate) { @@ -384,6 +388,8 @@ void RenderingServerDefault::draw(bool p_swap_buffers, double frame_step) { RenderingServerDefault::RenderingServerDefault(bool p_create_thread) : command_queue(p_create_thread) { + RenderingServer::init(); + create_thread = p_create_thread; if (!p_create_thread) { diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 8f285aeaad..366c011f86 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -2821,7 +2821,9 @@ RenderingServer::RenderingServer() { thread_pool = memnew(RendererThreadPool); singleton = this; +} +void RenderingServer::init() { GLOBAL_DEF_RST("rendering/textures/vram_compression/import_bptc", false); GLOBAL_DEF_RST("rendering/textures/vram_compression/import_s3tc", true); GLOBAL_DEF_RST("rendering/textures/vram_compression/import_etc", false); diff --git a/servers/rendering_server.h b/servers/rendering_server.h index 1ac48053d8..c6c4b9d275 100644 --- a/servers/rendering_server.h +++ b/servers/rendering_server.h @@ -1471,7 +1471,7 @@ public: virtual void draw(bool p_swap_buffers = true, double frame_step = 0.0) = 0; virtual void sync() = 0; virtual bool has_changed() const = 0; - virtual void init() = 0; + virtual void init(); virtual void finish() = 0; /* STATUS INFORMATION */ |