Mesh Batch Cache: Port Texture paint wires to new batch request
[blender.git] / source / blender / draw / engines / eevee / eevee_materials.c
index 78d5231a7931a57888ccd268031f9b85432f651b..f26920c2474d7fc46fb6220cbe713e895ecd99be 100644 (file)
@@ -58,7 +58,6 @@ static struct {
        struct GPUShader *default_hair_prepass_clip_sh;
        struct GPUShader *default_lit[VAR_MAT_MAX];
        struct GPUShader *default_background;
-       struct GPUShader *default_studiolight_background;
        struct GPUShader *update_noise_sh;
 
        /* 64*64 array texture containing all LUTs and other utilitarian arrays.
@@ -597,10 +596,6 @@ void EEVEE_materials_init(EEVEE_ViewLayerData *sldata, EEVEE_StorageList *stl, E
                        datatoc_background_vert_glsl, NULL, datatoc_default_world_frag_glsl,
                        NULL);
 
-               e_data.default_studiolight_background = DRW_shader_create(
-                       datatoc_background_vert_glsl, NULL, datatoc_default_world_frag_glsl,
-                       "#define LOOKDEV\n");
-
                e_data.default_prepass_sh = DRW_shader_create(
                        datatoc_prepass_vert_glsl, NULL, datatoc_prepass_frag_glsl,
                        NULL);
@@ -969,7 +964,7 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
                float *col = ts.colorBackground;
 
                /* LookDev */
-               EEVEE_lookdev_cache_init(vedata, &grp, e_data.default_studiolight_background, psl->background_pass, wo, NULL);
+               EEVEE_lookdev_cache_init(vedata, &grp, psl->background_pass, wo, NULL);
                /* END */
 
                if (!grp && wo) {
@@ -1392,7 +1387,7 @@ static void material_transparent(
                DRW_shgroup_uniform_float(*shgrp, "roughness", rough_p, 1);
        }
 
-       const bool use_prepass = ((ma->blend_flag & MA_BL_HIDE_BACKSIDE) != 0);
+       const bool use_prepass = ((ma->blend_flag & MA_BL_HIDE_BACKFACE) != 0);
 
        DRWState all_state = (
                DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR | DRW_STATE_CULL_BACK |
@@ -1447,14 +1442,10 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sld
        const bool do_cull = (draw_ctx->v3d && (draw_ctx->v3d->flag2 & V3D_BACKFACE_CULLING));
        const bool is_active = (ob == draw_ctx->obact);
        const bool is_sculpt_mode = is_active && (draw_ctx->object_mode & OB_MODE_SCULPT) != 0;
-#if 0
-       const bool is_sculpt_mode_draw = is_sculpt_mode && (draw_ctx->v3d->flag2 & V3D_SHOW_MODE_SHADE_OVERRIDE) == 0;
-#else
        /* For now just force fully shaded with eevee when supported. */
        const bool is_sculpt_mode_draw =
                is_sculpt_mode &&
                ((ob->sculpt && ob->sculpt->pbvh) && (BKE_pbvh_type(ob->sculpt->pbvh) != PBVH_FACES));
-#endif
        const bool is_default_mode_shader = is_sculpt_mode;
 
        /* First get materials for this mesh. */
@@ -1799,7 +1790,6 @@ void EEVEE_materials_free(void)
        DRW_SHADER_FREE_SAFE(e_data.default_prepass_sh);
        DRW_SHADER_FREE_SAFE(e_data.default_prepass_clip_sh);
        DRW_SHADER_FREE_SAFE(e_data.default_background);
-       DRW_SHADER_FREE_SAFE(e_data.default_studiolight_background);
        DRW_SHADER_FREE_SAFE(e_data.update_noise_sh);
        DRW_TEXTURE_FREE_SAFE(e_data.util_tex);
        DRW_TEXTURE_FREE_SAFE(e_data.noise_tex);