Commit: e530d0ccaa5afaa04153d602d13b98ddb4913627
Author: Clément Foucault
Date:   Sat Feb 3 01:49:29 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBe530d0ccaa5afaa04153d602d13b98ddb4913627

Eevee: Perf: Put transparent sorting before the render loop.

===================================================================

M       source/blender/draw/engines/eevee/eevee_engine.c
M       source/blender/draw/engines/eevee/eevee_render.c

===================================================================

diff --git a/source/blender/draw/engines/eevee/eevee_engine.c 
b/source/blender/draw/engines/eevee/eevee_engine.c
index 152c4a595d0..e73c170fecf 100644
--- a/source/blender/draw/engines/eevee/eevee_engine.c
+++ b/source/blender/draw/engines/eevee/eevee_engine.c
@@ -177,6 +177,9 @@ static void eevee_draw_background(void *vedata)
        DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
        DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get();
 
+       /* Sort transparents before the loop. */
+       DRW_pass_sort_shgroup_z(psl->transparent_pass);
+
        /* Number of iteration: needed for all temporal effect (SSR, TAA)
         * when using opengl render. */
        int loop_ct = DRW_state_is_image_render() ? 4 : 1;
@@ -273,7 +276,6 @@ static void eevee_draw_background(void *vedata)
                EEVEE_volumes_resolve(sldata, vedata);
 
                /* Transparent */
-               DRW_pass_sort_shgroup_z(psl->transparent_pass);
                DRW_draw_pass(psl->transparent_pass);
 
                /* Post Process */
diff --git a/source/blender/draw/engines/eevee/eevee_render.c 
b/source/blender/draw/engines/eevee/eevee_render.c
index 68d575df11c..b2a9e177790 100644
--- a/source/blender/draw/engines/eevee/eevee_render.c
+++ b/source/blender/draw/engines/eevee/eevee_render.c
@@ -391,6 +391,9 @@ void EEVEE_render_draw(EEVEE_Data *vedata, struct 
RenderEngine *engine, struct D
        EEVEE_lights_cache_finish(sldata);
        EEVEE_lightprobes_cache_finish(sldata, vedata);
 
+       /* Sort transparents before the loop. */
+       DRW_pass_sort_shgroup_z(psl->transparent_pass);
+
        if ((view_layer->passflag & (SCE_PASS_SUBSURFACE_COLOR |
                                     SCE_PASS_SUBSURFACE_DIRECT |
                                     SCE_PASS_SUBSURFACE_INDIRECT)) != 0)
@@ -475,7 +478,6 @@ void EEVEE_render_draw(EEVEE_Data *vedata, struct 
RenderEngine *engine, struct D
                /* Mist output */
                EEVEE_mist_output_accumulate(sldata, vedata);
                /* Transparent */
-               DRW_pass_sort_shgroup_z(psl->transparent_pass);
                DRW_draw_pass(psl->transparent_pass);
                /* Result Z */
                eevee_render_result_z(rr, viewname, vedata, sldata);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to