Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_effect_aa.c
| Show All 34 Lines | void workbench_aa_create_pass(WORKBENCH_Data *vedata, GPUTexture **tx) | ||||
| if (draw_ctx->evil_C != NULL) { | if (draw_ctx->evil_C != NULL) { | ||||
| struct wmWindowManager *wm = CTX_wm_manager(draw_ctx->evil_C); | struct wmWindowManager *wm = CTX_wm_manager(draw_ctx->evil_C); | ||||
| wpd->is_playback = ED_screen_animation_playing(wm) != NULL; | wpd->is_playback = ED_screen_animation_playing(wm) != NULL; | ||||
| } | } | ||||
| else { | else { | ||||
| wpd->is_playback = false; | wpd->is_playback = false; | ||||
| } | } | ||||
| if (TAA_ENABLED(wpd)) { | if (workbench_is_taa_enabled(wpd)) { | ||||
| psl->effect_aa_pass = workbench_taa_create_pass(vedata, tx); | psl->effect_aa_pass = workbench_taa_create_pass(vedata, tx); | ||||
| } | } | ||||
| else if (FXAA_ENABLED(wpd)) { | else if (workbench_is_fxaa_enabled(wpd)) { | ||||
| psl->effect_aa_pass = workbench_fxaa_create_pass(tx); | psl->effect_aa_pass = workbench_fxaa_create_pass(tx); | ||||
| effect_info->jitter_index = 0; | effect_info->jitter_index = 0; | ||||
| } | } | ||||
| else { | else { | ||||
| psl->effect_aa_pass = NULL; | psl->effect_aa_pass = NULL; | ||||
| } | } | ||||
| } | } | ||||
| Show All 13 Lines | |||||
| { | { | ||||
| WORKBENCH_StorageList *stl = vedata->stl; | WORKBENCH_StorageList *stl = vedata->stl; | ||||
| WORKBENCH_PrivateData *wpd = stl->g_data; | WORKBENCH_PrivateData *wpd = stl->g_data; | ||||
| WORKBENCH_FramebufferList *fbl = vedata->fbl; | WORKBENCH_FramebufferList *fbl = vedata->fbl; | ||||
| WORKBENCH_PassList *psl = vedata->psl; | WORKBENCH_PassList *psl = vedata->psl; | ||||
| WORKBENCH_EffectInfo *effect_info = stl->effects; | WORKBENCH_EffectInfo *effect_info = stl->effects; | ||||
| DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); | DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); | ||||
| if (FXAA_ENABLED(wpd)) { | if (workbench_is_fxaa_enabled(wpd)) { | ||||
| GPU_framebuffer_bind(fbl->effect_fb); | GPU_framebuffer_bind(fbl->effect_fb); | ||||
| workspace_aa_draw_transform(tx, wpd); | workspace_aa_draw_transform(tx, wpd); | ||||
| GPU_framebuffer_bind(dfbl->color_only_fb); | GPU_framebuffer_bind(dfbl->color_only_fb); | ||||
| DRW_draw_pass(psl->effect_aa_pass); | DRW_draw_pass(psl->effect_aa_pass); | ||||
| } | } | ||||
| else if (TAA_ENABLED(wpd)) { | else if (workbench_is_taa_enabled(wpd)) { | ||||
| /* | /* | ||||
| * when drawing the first TAA frame, we transform directly to the | * when drawing the first TAA frame, we transform directly to the | ||||
| * color_only_fb as the TAA shader is just performing a direct copy. | * color_only_fb as the TAA shader is just performing a direct copy. | ||||
| * the workbench_taa_draw_screen_end will fill the history buffer | * the workbench_taa_draw_screen_end will fill the history buffer | ||||
| * for the other iterations. | * for the other iterations. | ||||
| */ | */ | ||||
| if (effect_info->jitter_index == 1) { | if (effect_info->jitter_index == 1) { | ||||
| GPU_framebuffer_bind(dfbl->color_only_fb); | GPU_framebuffer_bind(dfbl->color_only_fb); | ||||
| Show All 15 Lines | |||||