From 2df767d31eb0994c6e9dae2758a9d535b5b51b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Mon, 1 Aug 2022 21:59:13 +0200 Subject: Fix uniform set creation error due to null RID --- .../renderer_rd/forward_clustered/render_forward_clustered.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'servers/rendering/renderer_rd/forward_clustered') 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 7eddc1fb5b..827cce6047 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp @@ -2662,7 +2662,11 @@ RID RenderForwardClustered::_setup_sdfgi_render_pass_uniform_set(RID p_albedo_te RD::Uniform u; u.binding = 1; u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER; - u.append_id(scene_state.instance_buffer[RENDER_LIST_SECONDARY]); + RID instance_buffer = scene_state.instance_buffer[RENDER_LIST_SECONDARY]; + if (instance_buffer == RID()) { + instance_buffer = scene_shader.default_vec4_xform_buffer; // any buffer will do since its not used + } + u.append_id(instance_buffer); uniforms.push_back(u); } { -- cgit v1.2.3