diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-03-11 11:06:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-11 11:06:53 +0100 |
commit | dc0d1ab3b56ed635490ad0c2d8b388e24691df57 (patch) | |
tree | 532a245e5256a7e9f0a2c5cb9862fffb79a952ad | |
parent | 01851defb5e43803bbcd6d8221a25ebbdd963119 (diff) | |
parent | f7cbeb0d1b4a2b7aca6a5995e98855f043f0e6e6 (diff) |
Merge pull request #46888 from BastiaanOlij/cleanup_storage_rendererrd
Cleanup storage RendererRD
6 files changed, 49 insertions, 68 deletions
diff --git a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp index bfb5b729ef..4e4e553605 100644 --- a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp @@ -1100,8 +1100,6 @@ void RendererSceneGIRD::SDFGI::update_cascades() { } void RendererSceneGIRD::SDFGI::debug_draw(const CameraMatrix &p_projection, const Transform &p_transform, int p_width, int p_height, RID p_render_target, RID p_texture) { - // !BAS! Need to find a nicer way then adding width/height/renderbuffer/texture as parameters - if (!debug_uniform_set.is_valid() || !RD::get_singleton()->uniform_set_is_valid(debug_uniform_set)) { Vector<RD::Uniform> uniforms; { @@ -2806,9 +2804,11 @@ RendererSceneGIRD::RendererSceneGIRD() { RendererSceneGIRD::~RendererSceneGIRD() { } -void RendererSceneGIRD::init_gi(RendererStorageRD *p_storage) { +void RendererSceneGIRD::init(RendererStorageRD *p_storage, RendererSceneSkyRD *p_sky) { storage = p_storage; + /* GI */ + { //kinda complicated to compute the amount of slots, we try to use as many as we can @@ -2861,9 +2861,9 @@ void RendererSceneGIRD::init_gi(RendererStorageRD *p_storage) { giprobe_debug_shader_version_pipelines[i].setup(giprobe_debug_shader_version_shaders[i], RD::RENDER_PRIMITIVE_TRIANGLES, rs, RD::PipelineMultisampleState(), ds, RD::PipelineColorBlendState::create_disabled(), 0); } } -} -void RendererSceneGIRD::init_sdfgi(RendererSceneSkyRD *p_sky) { + /* SDGFI */ + { Vector<String> preprocess_modes; preprocess_modes.push_back("\n#define MODE_SCROLL\n"); diff --git a/servers/rendering/renderer_rd/renderer_scene_gi_rd.h b/servers/rendering/renderer_rd/renderer_scene_gi_rd.h index 691a2e1841..c0f3318538 100644 --- a/servers/rendering/renderer_rd/renderer_scene_gi_rd.h +++ b/servers/rendering/renderer_rd/renderer_scene_gi_rd.h @@ -53,8 +53,6 @@ class RendererSceneRenderRD; class RendererSceneGIRD { private: - // !BAS! need to see which things become internal.. - RendererStorageRD *storage; /* GIPROBE INSTANCE */ @@ -652,9 +650,7 @@ public: RendererSceneGIRD(); ~RendererSceneGIRD(); - // !BAS! Can we merge these two inits? Possibly, need to check - void init_gi(RendererStorageRD *p_storage); - void init_sdfgi(RendererSceneSkyRD *p_sky); + void init(RendererStorageRD *p_storage, RendererSceneSkyRD *p_sky); void free(); SDFGI *create_sdfgi(RendererSceneEnvironmentRD *p_env, const Vector3 &p_world_position, uint32_t p_requested_history_size); diff --git a/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.cpp b/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.cpp index 6ffecc9f35..7a19495f48 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.cpp @@ -1298,7 +1298,7 @@ void RendererSceneRenderForwardClustered::_fill_instance_data(RenderListType p_r GeometryInstanceSurfaceDataCache *prev_surface = nullptr; for (uint32_t i = 0; i < element_total; i++) { GeometryInstanceSurfaceDataCache *surface = rl->elements[i + p_offset]; - GeometryInstanceForward *inst = surface->owner; + GeometryInstanceForwardClustered *inst = surface->owner; SceneState::InstanceData &instance_data = scene_state.instance_data[p_render_list][i + p_offset]; @@ -1381,7 +1381,7 @@ void RendererSceneRenderForwardClustered::_fill_render_list(RenderListType p_ren //fill list for (int i = 0; i < (int)p_instances.size(); i++) { - GeometryInstanceForward *inst = static_cast<GeometryInstanceForward *>(p_instances[i]); + GeometryInstanceForwardClustered *inst = static_cast<GeometryInstanceForwardClustered *>(p_instances[i]); Vector3 support_min = inst->transformed_aabb.get_support(-near_plane.normal); inst->depth = near_plane.distance_to(support_min); @@ -2805,13 +2805,8 @@ RID RendererSceneRenderForwardClustered::_render_buffers_get_normal_texture(RID RendererSceneRenderForwardClustered *RendererSceneRenderForwardClustered::singleton = nullptr; -void RendererSceneRenderForwardClustered::set_time(double p_time, double p_step) { - time = p_time; - RendererSceneRenderRD::set_time(p_time, p_step); -} - void RendererSceneRenderForwardClustered::_geometry_instance_mark_dirty(GeometryInstance *p_geometry_instance) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); if (ginstance->dirty_list_element.in_list()) { return; } @@ -2830,7 +2825,7 @@ void RendererSceneRenderForwardClustered::_geometry_instance_mark_dirty(Geometry geometry_instance_dirty_list.add(&ginstance->dirty_list_element); } -void RendererSceneRenderForwardClustered::_geometry_instance_add_surface_with_material(GeometryInstanceForward *ginstance, uint32_t p_surface, MaterialData *p_material, uint32_t p_material_id, uint32_t p_shader_id, RID p_mesh) { +void RendererSceneRenderForwardClustered::_geometry_instance_add_surface_with_material(GeometryInstanceForwardClustered *ginstance, uint32_t p_surface, MaterialData *p_material, uint32_t p_material_id, uint32_t p_shader_id, RID p_mesh) { bool has_read_screen_alpha = p_material->shader_data->uses_screen_texture || p_material->shader_data->uses_depth_texture || p_material->shader_data->uses_normal_texture; bool has_base_alpha = (p_material->shader_data->uses_alpha || has_read_screen_alpha); bool has_blend_alpha = p_material->shader_data->uses_blend_alpha; @@ -2854,7 +2849,7 @@ void RendererSceneRenderForwardClustered::_geometry_instance_add_surface_with_ma flags |= GeometryInstanceSurfaceDataCache::FLAG_USES_NORMAL_TEXTURE; } - if (ginstance->data->cast_double_sided_shaodows) { + if (ginstance->data->cast_double_sided_shadows) { flags |= GeometryInstanceSurfaceDataCache::FLAG_USES_DOUBLE_SIDED_SHADOWS; } @@ -2926,7 +2921,7 @@ void RendererSceneRenderForwardClustered::_geometry_instance_add_surface_with_ma sdcache->sort.priority = p_material->priority; } -void RendererSceneRenderForwardClustered::_geometry_instance_add_surface(GeometryInstanceForward *ginstance, uint32_t p_surface, RID p_material, RID p_mesh) { +void RendererSceneRenderForwardClustered::_geometry_instance_add_surface(GeometryInstanceForwardClustered *ginstance, uint32_t p_surface, RID p_material, RID p_mesh) { RID m_src; m_src = ginstance->data->material_override.is_valid() ? ginstance->data->material_override : p_material; @@ -2967,7 +2962,7 @@ void RendererSceneRenderForwardClustered::_geometry_instance_add_surface(Geometr } void RendererSceneRenderForwardClustered::_geometry_instance_update(GeometryInstance *p_geometry_instance) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); if (ginstance->data->dirty_dependencies) { ginstance->data->dependency_tracker.update_begin(); @@ -3139,7 +3134,7 @@ void RendererSceneRenderForwardClustered::_geometry_instance_dependency_changed( static_cast<RendererSceneRenderForwardClustered *>(singleton)->_geometry_instance_mark_dirty(static_cast<GeometryInstance *>(p_tracker->userdata)); } break; case RendererStorage::DEPENDENCY_CHANGED_MULTIMESH_VISIBLE_INSTANCES: { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_tracker->userdata); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_tracker->userdata); if (ginstance->data->base_type == RS::INSTANCE_MULTIMESH) { ginstance->instance_count = static_cast<RendererSceneRenderForwardClustered *>(singleton)->storage->multimesh_get_instances_to_draw(ginstance->data->base); } @@ -3157,8 +3152,8 @@ RendererSceneRender::GeometryInstance *RendererSceneRenderForwardClustered::geom RS::InstanceType type = storage->get_base_type(p_base); ERR_FAIL_COND_V(!((1 << type) & RS::INSTANCE_GEOMETRY_MASK), nullptr); - GeometryInstanceForward *ginstance = geometry_instance_alloc.alloc(); - ginstance->data = memnew(GeometryInstanceForward::Data); + GeometryInstanceForwardClustered *ginstance = geometry_instance_alloc.alloc(); + ginstance->data = memnew(GeometryInstanceForwardClustered::Data); ginstance->data->base = p_base; ginstance->data->base_type = type; @@ -3171,34 +3166,34 @@ RendererSceneRender::GeometryInstance *RendererSceneRenderForwardClustered::geom return ginstance; } void RendererSceneRenderForwardClustered::geometry_instance_set_skeleton(GeometryInstance *p_geometry_instance, RID p_skeleton) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); ERR_FAIL_COND(!ginstance); ginstance->data->skeleton = p_skeleton; _geometry_instance_mark_dirty(ginstance); ginstance->data->dirty_dependencies = true; } void RendererSceneRenderForwardClustered::geometry_instance_set_material_override(GeometryInstance *p_geometry_instance, RID p_override) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); ERR_FAIL_COND(!ginstance); ginstance->data->material_override = p_override; _geometry_instance_mark_dirty(ginstance); ginstance->data->dirty_dependencies = true; } void RendererSceneRenderForwardClustered::geometry_instance_set_surface_materials(GeometryInstance *p_geometry_instance, const Vector<RID> &p_materials) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); ERR_FAIL_COND(!ginstance); ginstance->data->surface_materials = p_materials; _geometry_instance_mark_dirty(ginstance); ginstance->data->dirty_dependencies = true; } void RendererSceneRenderForwardClustered::geometry_instance_set_mesh_instance(GeometryInstance *p_geometry_instance, RID p_mesh_instance) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); ERR_FAIL_COND(!ginstance); ginstance->mesh_instance = p_mesh_instance; _geometry_instance_mark_dirty(ginstance); } void RendererSceneRenderForwardClustered::geometry_instance_set_transform(GeometryInstance *p_geometry_instance, const Transform &p_transform, const AABB &p_aabb, const AABB &p_transformed_aabb) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); ERR_FAIL_COND(!ginstance); ginstance->transform = p_transform; ginstance->mirror = p_transform.basis.determinant() < 0; @@ -3215,24 +3210,24 @@ void RendererSceneRenderForwardClustered::geometry_instance_set_transform(Geomet ginstance->lod_model_scale = max_scale; } void RendererSceneRenderForwardClustered::geometry_instance_set_lod_bias(GeometryInstance *p_geometry_instance, float p_lod_bias) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); ERR_FAIL_COND(!ginstance); ginstance->lod_bias = p_lod_bias; } void RendererSceneRenderForwardClustered::geometry_instance_set_use_baked_light(GeometryInstance *p_geometry_instance, bool p_enable) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); ERR_FAIL_COND(!ginstance); ginstance->data->use_baked_light = p_enable; _geometry_instance_mark_dirty(ginstance); } void RendererSceneRenderForwardClustered::geometry_instance_set_use_dynamic_gi(GeometryInstance *p_geometry_instance, bool p_enable) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); ERR_FAIL_COND(!ginstance); ginstance->data->use_dynamic_gi = p_enable; _geometry_instance_mark_dirty(ginstance); } void RendererSceneRenderForwardClustered::geometry_instance_set_use_lightmap(GeometryInstance *p_geometry_instance, RID p_lightmap_instance, const Rect2 &p_lightmap_uv_scale, int p_lightmap_slice_index) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); ERR_FAIL_COND(!ginstance); ginstance->lightmap_instance = p_lightmap_instance; ginstance->lightmap_uv_scale = p_lightmap_uv_scale; @@ -3240,7 +3235,7 @@ void RendererSceneRenderForwardClustered::geometry_instance_set_use_lightmap(Geo _geometry_instance_mark_dirty(ginstance); } void RendererSceneRenderForwardClustered::geometry_instance_set_lightmap_capture(GeometryInstance *p_geometry_instance, const Color *p_sh9) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); ERR_FAIL_COND(!ginstance); if (p_sh9) { if (ginstance->lightmap_sh == nullptr) { @@ -3257,27 +3252,27 @@ void RendererSceneRenderForwardClustered::geometry_instance_set_lightmap_capture _geometry_instance_mark_dirty(ginstance); } void RendererSceneRenderForwardClustered::geometry_instance_set_instance_shader_parameters_offset(GeometryInstance *p_geometry_instance, int32_t p_offset) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); ERR_FAIL_COND(!ginstance); ginstance->shader_parameters_offset = p_offset; _geometry_instance_mark_dirty(ginstance); } void RendererSceneRenderForwardClustered::geometry_instance_set_cast_double_sided_shadows(GeometryInstance *p_geometry_instance, bool p_enable) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); ERR_FAIL_COND(!ginstance); - ginstance->data->cast_double_sided_shaodows = p_enable; + ginstance->data->cast_double_sided_shadows = p_enable; _geometry_instance_mark_dirty(ginstance); } void RendererSceneRenderForwardClustered::geometry_instance_set_layer_mask(GeometryInstance *p_geometry_instance, uint32_t p_layer_mask) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); ERR_FAIL_COND(!ginstance); ginstance->layer_mask = p_layer_mask; } void RendererSceneRenderForwardClustered::geometry_instance_free(GeometryInstance *p_geometry_instance) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); ERR_FAIL_COND(!ginstance); if (ginstance->lightmap_sh != nullptr) { geometry_instance_lightmap_sh.free(ginstance->lightmap_sh); @@ -3303,18 +3298,18 @@ void RendererSceneRenderForwardClustered::geometry_instance_pair_decal_instances } Transform RendererSceneRenderForwardClustered::geometry_instance_get_transform(GeometryInstance *p_instance) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_instance); ERR_FAIL_COND_V(!ginstance, Transform()); return ginstance->transform; } AABB RendererSceneRenderForwardClustered::geometry_instance_get_aabb(GeometryInstance *p_instance) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_instance); ERR_FAIL_COND_V(!ginstance, AABB()); return ginstance->data->aabb; } void RendererSceneRenderForwardClustered::geometry_instance_pair_gi_probe_instances(GeometryInstance *p_geometry_instance, const RID *p_gi_probe_instances, uint32_t p_gi_probe_instance_count) { - GeometryInstanceForward *ginstance = static_cast<GeometryInstanceForward *>(p_geometry_instance); + GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_geometry_instance); ERR_FAIL_COND(!ginstance); if (p_gi_probe_instance_count > 0) { ginstance->gi_probes[0] = p_gi_probe_instances[0]; @@ -3333,7 +3328,6 @@ RendererSceneRenderForwardClustered::RendererSceneRenderForwardClustered(Rendere RendererSceneRenderRD(p_storage) { singleton = this; low_end = is_low_end(); - storage = p_storage; /* SCENE SHADER */ diff --git a/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.h b/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.h index 96ab227c7c..98e2a7efcc 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.h +++ b/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.h @@ -83,8 +83,6 @@ class RendererSceneRenderForwardClustered : public RendererSceneRenderRD { ShaderCompilerRD compiler; } shader; - RendererStorageRD *storage; - /* Material */ struct ShaderData : public RendererStorageRD::ShaderData { @@ -492,7 +490,6 @@ class RendererSceneRenderForwardClustered : public RendererSceneRenderRD { static RendererSceneRenderForwardClustered *singleton; - double time; RID default_shader; RID default_material; RID overdraw_material_shader; @@ -534,7 +531,7 @@ class RendererSceneRenderForwardClustered : public RendererSceneRenderRD { Map<Size2i, RID> sdfgi_framebuffer_size_cache; struct GeometryInstanceData; - struct GeometryInstanceForward; + struct GeometryInstanceForwardClustered; struct GeometryInstanceLightmapSH { Color sh[9]; @@ -588,10 +585,10 @@ class RendererSceneRenderForwardClustered : public RendererSceneRenderRD { ShaderData *shader_shadow = nullptr; GeometryInstanceSurfaceDataCache *next = nullptr; - GeometryInstanceForward *owner = nullptr; + GeometryInstanceForwardClustered *owner = nullptr; }; - struct GeometryInstanceForward : public GeometryInstance { + struct GeometryInstanceForwardClustered : public GeometryInstance { //used during rendering bool mirror = false; bool non_uniform_scale = false; @@ -617,7 +614,7 @@ class RendererSceneRenderForwardClustered : public RendererSceneRenderRD { RID lightmap_instance; GeometryInstanceLightmapSH *lightmap_sh = nullptr; GeometryInstanceSurfaceDataCache *surface_caches = nullptr; - SelfList<GeometryInstanceForward> dirty_list_element; + SelfList<GeometryInstanceForwardClustered> dirty_list_element; struct Data { //data used less often goes into regular heap @@ -631,7 +628,7 @@ class RendererSceneRenderForwardClustered : public RendererSceneRenderRD { bool use_dynamic_gi = false; bool use_baked_light = false; - bool cast_double_sided_shaodows = false; + bool cast_double_sided_shadows = false; bool mirror = false; bool dirty_dependencies = false; @@ -640,21 +637,21 @@ class RendererSceneRenderForwardClustered : public RendererSceneRenderRD { Data *data = nullptr; - GeometryInstanceForward() : + GeometryInstanceForwardClustered() : dirty_list_element(this) {} }; static void _geometry_instance_dependency_changed(RendererStorage::DependencyChangedNotification p_notification, RendererStorage::DependencyTracker *p_tracker); static void _geometry_instance_dependency_deleted(const RID &p_dependency, RendererStorage::DependencyTracker *p_tracker); - SelfList<GeometryInstanceForward>::List geometry_instance_dirty_list; + SelfList<GeometryInstanceForwardClustered>::List geometry_instance_dirty_list; - PagedAllocator<GeometryInstanceForward> geometry_instance_alloc; + PagedAllocator<GeometryInstanceForwardClustered> geometry_instance_alloc; PagedAllocator<GeometryInstanceSurfaceDataCache> geometry_instance_surface_alloc; PagedAllocator<GeometryInstanceLightmapSH> geometry_instance_lightmap_sh; - void _geometry_instance_add_surface_with_material(GeometryInstanceForward *ginstance, uint32_t p_surface, MaterialData *p_material, uint32_t p_material_id, uint32_t p_shader_id, RID p_mesh); - void _geometry_instance_add_surface(GeometryInstanceForward *ginstance, uint32_t p_surface, RID p_material, RID p_mesh); + void _geometry_instance_add_surface_with_material(GeometryInstanceForwardClustered *ginstance, uint32_t p_surface, MaterialData *p_material, uint32_t p_material_id, uint32_t p_shader_id, RID p_mesh); + void _geometry_instance_add_surface(GeometryInstanceForwardClustered *ginstance, uint32_t p_surface, RID p_material, RID p_mesh); void _geometry_instance_mark_dirty(GeometryInstance *p_geometry_instance); void _geometry_instance_update(GeometryInstance *p_geometry_instance); void _update_dirty_geometry_instances(); @@ -761,8 +758,6 @@ public: virtual void geometry_instance_pair_decal_instances(GeometryInstance *p_geometry_instance, const RID *p_decal_instances, uint32_t p_decal_instance_count); virtual void geometry_instance_pair_gi_probe_instances(GeometryInstance *p_geometry_instance, const RID *p_gi_probe_instances, uint32_t p_gi_probe_instance_count); - virtual void set_time(double p_time, double p_step); - virtual bool free(RID p_rid); RendererSceneRenderForwardClustered(RendererStorageRD *p_storage); diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp index f9ee01e751..4cf296f0db 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp @@ -4097,17 +4097,14 @@ RendererSceneRenderRD::RendererSceneRenderRD(RendererStorageRD *p_storage) { low_end = true; } - if (!low_end) { - gi.init_gi(storage); - } - /* SKY SHADER */ sky.init(storage); + /* GI */ + if (!low_end) { - //SDFGI - gi.init_sdfgi(&sky); + gi.init(storage, &sky); } { //decals diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.h b/servers/rendering/renderer_rd/renderer_scene_render_rd.h index eefaf237a4..001cfeb74d 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_rd.h +++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.h @@ -48,6 +48,7 @@ class RendererSceneRenderRD : public RendererSceneRender { friend RendererSceneGIRD; protected: + RendererStorageRD *storage; double time; double time_step = 0; @@ -111,8 +112,6 @@ private: RS::ViewportDebugDraw debug_draw = RS::VIEWPORT_DEBUG_DRAW_DISABLED; static RendererSceneRenderRD *singleton; - RendererStorageRD *storage; - /* REFLECTION ATLAS */ struct ReflectionAtlas { @@ -1183,7 +1182,7 @@ public: return debug_draw; } - virtual void set_time(double p_time, double p_step); + void set_time(double p_time, double p_step); RID get_reflection_probe_buffer(); RID get_omni_light_buffer(); |