From 3e997f5edb8f4969339f59a60afa38ad8713d8a1 Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Fri, 28 Nov 2025 15:59:14 +0300 Subject: [PATCH] Fix framebuffers getting cleared multiple times on D3D12. --- drivers/d3d12/rendering_device_driver_d3d12.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/d3d12/rendering_device_driver_d3d12.cpp b/drivers/d3d12/rendering_device_driver_d3d12.cpp index 4098ecea673..47188bfc003 100644 --- a/drivers/d3d12/rendering_device_driver_d3d12.cpp +++ b/drivers/d3d12/rendering_device_driver_d3d12.cpp @@ -4753,7 +4753,6 @@ void RenderingDeviceDriverD3D12::command_begin_render_pass(CommandBufferID p_cmd command_next_render_subpass(p_cmd_buffer, p_cmd_buffer_type); AttachmentClear *clears = ALLOCA_ARRAY(AttachmentClear, pass_info->attachments.size()); - Rect2i *clear_rects = ALLOCA_ARRAY(Rect2i, pass_info->attachments.size()); uint32_t num_clears = 0; for (uint32_t i = 0; i < pass_info->attachments.size(); i++) { @@ -4779,13 +4778,12 @@ void RenderingDeviceDriverD3D12::command_begin_render_pass(CommandBufferID p_cmd if (!clear.aspect.is_empty()) { clear.value = p_attachment_clears[i]; clears[num_clears] = clear; - clear_rects[num_clears] = p_rect; num_clears++; } } if (num_clears) { - command_render_clear_attachments(p_cmd_buffer, VectorView(clears, num_clears), VectorView(clear_rects, num_clears)); + command_render_clear_attachments(p_cmd_buffer, VectorView(clears, num_clears), VectorView(p_rect)); } }