@@ -929,12 +929,12 @@ static struct fx_framebuffer *get_main_buffer_blur(struct fx_gles_render_pass *p
929929 struct fx_blur_plugin_info * found = fx_renderer_get_plugin (& renderer -> wlr_renderer , fx_options -> blur_id );
930930 if (found == NULL ) {
931931 wlr_log (WLR_ERROR , "invalid custom blur given" );
932- return NULL ;
932+ return fx_options -> current_buffer ;
933933 }
934934
935935 if (!(found -> state & BLUR_READY )) {
936936 wlr_log (WLR_ERROR , "custom blur %s hasn't been readied for renderer" , found -> id );
937- return NULL ;
937+ return fx_options -> current_buffer ;
938938 }
939939
940940 blur_user_data = found -> user_data ;
@@ -965,8 +965,8 @@ static struct fx_framebuffer *get_main_buffer_blur(struct fx_gles_render_pass *p
965965 // Artifacts with NEAREST filter
966966 fx_options -> tex_options .base .filter_mode = WLR_SCALE_FILTER_BILINEAR ;
967967
968- if (blur -> prepare != NULL && !blur -> prepare (& damage , pass , fx_options , & blur_user_data )) {
969- return NULL ;
968+ if (blur -> prepare != NULL && !blur -> prepare (& damage , pass , fx_options , blur_user_data )) {
969+ return fx_options -> current_buffer ;
970970 }
971971
972972 // Render additional blur effects like saturation, noise, contrast, etc...
@@ -1027,7 +1027,15 @@ void fx_render_pass_add_blur(struct fx_gles_render_pass *pass,
10271027
10281028 const bool has_strength = fx_options -> blur_strength < 1.0 ;
10291029 struct fx_framebuffer * buffer = pass -> fx_effect_framebuffers -> optimized_blur_buffer ;
1030- if (!buffer || !fx_options -> use_optimized_blur || has_strength ) {
1030+ bool use_optimized_blur = buffer && fx_options -> use_optimized_blur && !has_strength ;
1031+ if (use_optimized_blur && fx_options -> blur_data -> id != NULL ) {
1032+ struct fx_blur_plugin_info * info = fx_renderer_get_plugin (& renderer -> wlr_renderer , fx_options -> blur_data -> id );
1033+ if (info -> blur_impl -> supports_optimized_blur && !info -> blur_impl -> supports_optimized_blur (info -> user_data )) {
1034+ use_optimized_blur = false;
1035+ }
1036+ }
1037+
1038+ if (!use_optimized_blur ) {
10311039 if (!buffer ) {
10321040 wlr_log (WLR_ERROR , "Warning: Failed to use optimized blur" );
10331041 }
@@ -1036,7 +1044,9 @@ void fx_render_pass_add_blur(struct fx_gles_render_pass *pass,
10361044
10371045 // Render the blur into its own buffer
10381046 struct fx_render_blur_pass_options blur_options = * fx_options ;
1047+ blur_options .blur_id = blur_options .blur_data -> id ;
10391048 blur_options .tex_options .base .clip = & translucent_region ;
1049+
10401050 if (fx_options -> use_optimized_blur && has_strength
10411051 // If the optimized blur hasn't been rendered yet
10421052 && pass -> fx_effect_framebuffers -> optimized_no_blur_buffer ) {
@@ -1046,7 +1056,6 @@ void fx_render_pass_add_blur(struct fx_gles_render_pass *pass,
10461056 } else {
10471057 blur_options .current_buffer = pass -> buffer ;
10481058 }
1049- blur_options .blur_id = blur_options .blur_data -> id ;
10501059 buffer = get_main_buffer_blur (pass , & blur_options );
10511060 if (!buffer ) {
10521061 goto damage_finish ;
0 commit comments