summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/forward_clustered
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-12-17 12:26:51 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-12-17 12:26:51 +0100
commit676f60b0ccd38df41648b942fe9b437ac3ea954a (patch)
tree0a1fa5f3c1f8bfa4a25e72eb6abb6b6ee51230eb /servers/rendering/renderer_rd/forward_clustered
parent376290ea86b70c15452ec97e1cd1937c319383b1 (diff)
parent1b330820bf4c145060462624534dea81055a8bf0 (diff)
Merge pull request #70132 from clayjohn/RT-update
Implement render_target_was_used API so that Viewports can properly check if they have been used.
Diffstat (limited to 'servers/rendering/renderer_rd/forward_clustered')
-rw-r--r--servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp2
-rw-r--r--servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h1
2 files changed, 3 insertions, 0 deletions
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 bd27eeb981..c853ae6c69 100644
--- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp
+++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp
@@ -348,6 +348,7 @@ void RenderForwardClustered::_render_list_template(RenderingDevice::DrawListID p
#endif
material_uniform_set = surf->material_uniform_set;
shader = surf->shader;
+ surf->material->set_as_used();
#ifdef DEBUG_ENABLED
}
#endif
@@ -3378,6 +3379,7 @@ void RenderForwardClustered::_geometry_instance_add_surface_with_material(Geomet
sdcache->flags = flags;
sdcache->shader = p_material->shader_data;
+ sdcache->material = p_material;
sdcache->material_uniform_set = p_material->uniform_set;
sdcache->surface = mesh_storage->mesh_get_surface(p_mesh, p_surface);
sdcache->primitive = mesh_storage->mesh_surface_get_primitive(sdcache->surface);
diff --git a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h
index d9145b5818..a5e8bb76d9 100644
--- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h
+++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h
@@ -441,6 +441,7 @@ class RenderForwardClustered : public RendererSceneRenderRD {
void *surface = nullptr;
RID material_uniform_set;
SceneShaderForwardClustered::ShaderData *shader = nullptr;
+ SceneShaderForwardClustered::MaterialData *material = nullptr;
void *surface_shadow = nullptr;
RID material_uniform_set_shadow;