Skip to content

Commit 2e4d5c2

Browse files
committed
Merge pull request #113277 from blueskythlikesclouds/d3d12-framebuffer-clear-fix
Fix framebuffers getting cleared multiple times on D3D12.
2 parents e55bc69 + 3e997f5 commit 2e4d5c2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/d3d12/rendering_device_driver_d3d12.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4752,7 +4752,6 @@ void RenderingDeviceDriverD3D12::command_begin_render_pass(CommandBufferID p_cmd
47524752
command_next_render_subpass(p_cmd_buffer, p_cmd_buffer_type);
47534753

47544754
AttachmentClear *clears = ALLOCA_ARRAY(AttachmentClear, pass_info->attachments.size());
4755-
Rect2i *clear_rects = ALLOCA_ARRAY(Rect2i, pass_info->attachments.size());
47564755
uint32_t num_clears = 0;
47574756

47584757
for (uint32_t i = 0; i < pass_info->attachments.size(); i++) {
@@ -4778,13 +4777,12 @@ void RenderingDeviceDriverD3D12::command_begin_render_pass(CommandBufferID p_cmd
47784777
if (!clear.aspect.is_empty()) {
47794778
clear.value = p_attachment_clears[i];
47804779
clears[num_clears] = clear;
4781-
clear_rects[num_clears] = p_rect;
47824780
num_clears++;
47834781
}
47844782
}
47854783

47864784
if (num_clears) {
4787-
command_render_clear_attachments(p_cmd_buffer, VectorView(clears, num_clears), VectorView(clear_rects, num_clears));
4785+
command_render_clear_attachments(p_cmd_buffer, VectorView(clears, num_clears), VectorView(p_rect));
47884786
}
47894787
}
47904788

0 commit comments

Comments
 (0)