From 80eacf1b7a223fdcd621b2e893139345b9441fe0 Mon Sep 17 00:00:00 2001 From: Dario Date: Tue, 9 Jan 2024 20:00:00 -0300 Subject: [PATCH] Fix incorrect mapping of initial action as clear region continue to clear. --- doc/classes/RenderingDevice.xml | 2 +- misc/extension_api_validation/4.2-stable.expected | 2 +- servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp | 3 +-- servers/rendering/rendering_device.compat.inc | 2 +- servers/rendering/rendering_device.h | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml index 495bec24dcc..54f3281e17b 100644 --- a/doc/classes/RenderingDevice.xml +++ b/doc/classes/RenderingDevice.xml @@ -2170,7 +2170,7 @@ [i]Deprecated.[/i] Use [constant INITIAL_ACTION_CLEAR] instead. - + [i]Deprecated.[/i] Use [constant INITIAL_ACTION_LOAD] instead. diff --git a/misc/extension_api_validation/4.2-stable.expected b/misc/extension_api_validation/4.2-stable.expected index 53303ebec42..2c52144896b 100644 --- a/misc/extension_api_validation/4.2-stable.expected +++ b/misc/extension_api_validation/4.2-stable.expected @@ -35,7 +35,7 @@ GH-84976 Validate extension JSON: Error: Field 'classes/RenderingDevice/enums/FinalAction/values/FINAL_ACTION_CONTINUE': value changed value in new API, from 2.0 to 0. Validate extension JSON: Error: Field 'classes/RenderingDevice/enums/FinalAction/values/FINAL_ACTION_MAX': value changed value in new API, from 3.0 to 2. Validate extension JSON: Error: Field 'classes/RenderingDevice/enums/InitialAction/values/INITIAL_ACTION_CLEAR': value changed value in new API, from 0.0 to 1. -Validate extension JSON: Error: Field 'classes/RenderingDevice/enums/InitialAction/values/INITIAL_ACTION_CLEAR_REGION_CONTINUE': value changed value in new API, from 2.0 to 0. +Validate extension JSON: Error: Field 'classes/RenderingDevice/enums/InitialAction/values/INITIAL_ACTION_CLEAR_REGION_CONTINUE': value changed value in new API, from 2.0 to 1. Validate extension JSON: Error: Field 'classes/RenderingDevice/enums/InitialAction/values/INITIAL_ACTION_CONTINUE': value changed value in new API, from 5.0 to 0. Validate extension JSON: Error: Field 'classes/RenderingDevice/enums/InitialAction/values/INITIAL_ACTION_DROP': value changed value in new API, from 4.0 to 2. Validate extension JSON: Error: Field 'classes/RenderingDevice/enums/InitialAction/values/INITIAL_ACTION_KEEP': value changed value in new API, from 3.0 to 0. diff --git a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp index 28fccbaf882..283b3ee09a4 100644 --- a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp @@ -1721,8 +1721,7 @@ void RendererCanvasRenderRD::light_update_shadow(RID p_rid, int p_shadow_index, //light.basis.scale(Vector3(to_light.elements[0].length(),to_light.elements[1].length(),1)); Rect2i rect((state.shadow_texture_size / 4) * i, p_shadow_index * 2, (state.shadow_texture_size / 4), 2); - RD::InitialAction initial_action = i == 0 ? RD::INITIAL_ACTION_CLEAR : RD::INITIAL_ACTION_LOAD; - RD::DrawListID draw_list = RD::get_singleton()->draw_list_begin(state.shadow_fb, initial_action, RD::FINAL_ACTION_STORE, initial_action, RD::FINAL_ACTION_DISCARD, cc, 1.0, 0, rect); + RD::DrawListID draw_list = RD::get_singleton()->draw_list_begin(state.shadow_fb, RD::INITIAL_ACTION_CLEAR, RD::FINAL_ACTION_STORE, RD::INITIAL_ACTION_CLEAR, RD::FINAL_ACTION_DISCARD, cc, 1.0, 0, rect); Projection projection; { diff --git a/servers/rendering/rendering_device.compat.inc b/servers/rendering/rendering_device.compat.inc index f79c9c9f7c3..edc08e972de 100644 --- a/servers/rendering/rendering_device.compat.inc +++ b/servers/rendering/rendering_device.compat.inc @@ -59,8 +59,8 @@ RenderingDevice::InitialAction RenderingDevice::_convert_initial_action_84976(In case 0: // INITIAL_ACTION_CLEAR return INITIAL_ACTION_CLEAR; case 1: // INITIAL_ACTION_CLEAR_REGION - return INITIAL_ACTION_CLEAR; case 2: // INITIAL_ACTION_CLEAR_REGION_CONTINUE + return INITIAL_ACTION_CLEAR; case 3: // INITIAL_ACTION_KEEP return INITIAL_ACTION_LOAD; case 4: // INITIAL_ACTION_DROP diff --git a/servers/rendering/rendering_device.h b/servers/rendering/rendering_device.h index 6c98ccfeda9..2ccef663083 100644 --- a/servers/rendering/rendering_device.h +++ b/servers/rendering/rendering_device.h @@ -335,7 +335,7 @@ public: INITIAL_ACTION_MAX, #ifndef DISABLE_DEPRECATED INITIAL_ACTION_CLEAR_REGION = INITIAL_ACTION_CLEAR, - INITIAL_ACTION_CLEAR_REGION_CONTINUE = INITIAL_ACTION_LOAD, + INITIAL_ACTION_CLEAR_REGION_CONTINUE = INITIAL_ACTION_CLEAR, INITIAL_ACTION_KEEP = INITIAL_ACTION_LOAD, INITIAL_ACTION_DROP = INITIAL_ACTION_DISCARD, INITIAL_ACTION_CONTINUE = INITIAL_ACTION_LOAD,