@@ -3364,27 +3364,15 @@ void reshade::runtime::update_effects()
3364
3364
void reshade::runtime::render_effects (api::command_list *cmd_list, api::resource_view rtv, api::resource_view rtv_srgb)
3365
3365
{
3366
3366
// Cannot render effects twice in a frame or while they are still loading
3367
- if (is_loading () || _effects_rendered_this_frame || rtv == 0 )
3367
+ if (is_loading () || _effects_rendered_this_frame)
3368
3368
return ;
3369
3369
3370
3370
_effects_rendered_this_frame = true ;
3371
3371
3372
- if (rtv_srgb == 0 )
3373
- rtv_srgb = rtv;
3374
-
3375
3372
// Nothing to do here if effects are disabled globally
3376
3373
if (!_effects_enabled || _techniques.empty ())
3377
3374
return ;
3378
3375
3379
- const api::resource back_buffer_resource = _device->get_resource_from_view (rtv);
3380
-
3381
- #if RESHADE_ADDON
3382
- // Ensure format of the effect color resource matches that of the input back buffer resource (so that the copy to the effect color resource succeeds)
3383
- // TODO: Technically would need to recompile effects as well to update 'BUFFER_COLOR_BIT_DEPTH' etc.
3384
- if (!_is_in_present_call && !update_effect_color_tex (_device->get_resource_desc (back_buffer_resource).texture .format ))
3385
- return ;
3386
- #endif
3387
-
3388
3376
#ifdef NDEBUG
3389
3377
// Lock input so it cannot be modified by other threads while we are reading it here
3390
3378
// TODO: This does not catch input happening between now and 'on_present'
@@ -3613,7 +3601,19 @@ void reshade::runtime::render_effects(api::command_list *cmd_list, api::resource
3613
3601
}
3614
3602
}
3615
3603
3604
+ if (rtv == 0 )
3605
+ return ;
3606
+ if (rtv_srgb == 0 )
3607
+ rtv_srgb = rtv;
3608
+
3609
+ const api::resource back_buffer_resource = _device->get_resource_from_view (rtv);
3610
+
3616
3611
#if RESHADE_ADDON
3612
+ // Ensure format of the effect color resource matches that of the input back buffer resource (so that the copy to the effect color resource succeeds)
3613
+ // TODO: Technically would need to recompile effects as well to update 'BUFFER_COLOR_BIT_DEPTH' etc.
3614
+ if (!_is_in_present_call && !update_effect_color_tex (_device->get_resource_desc (back_buffer_resource).texture .format ))
3615
+ return ;
3616
+
3617
3617
invoke_addon_event<addon_event::reshade_begin_effects>(this , cmd_list, rtv, rtv_srgb);
3618
3618
#endif
3619
3619
0 commit comments