diff options
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_deferred.c')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_deferred.c | 81 |
1 files changed, 54 insertions, 27 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c b/source/blender/draw/engines/workbench/workbench_deferred.c index e0bf8da438b..bcce507da24 100644 --- a/source/blender/draw/engines/workbench/workbench_deferred.c +++ b/source/blender/draw/engines/workbench/workbench_deferred.c @@ -385,33 +385,60 @@ void workbench_deferred_engine_init(WORKBENCH_Data *vedata) const char *shadow_frag = datatoc_gpu_shader_depth_only_frag_glsl; #endif /* TODO only compile on demand */ - e_data.shadow_pass_sh = DRW_shader_create(datatoc_workbench_shadow_vert_glsl, - datatoc_workbench_shadow_geom_glsl, - shadow_frag, - "#define SHADOW_PASS\n" - "#define DOUBLE_MANIFOLD\n"); - e_data.shadow_pass_manifold_sh = DRW_shader_create(datatoc_workbench_shadow_vert_glsl, - datatoc_workbench_shadow_geom_glsl, - shadow_frag, - "#define SHADOW_PASS\n"); - e_data.shadow_fail_sh = DRW_shader_create(datatoc_workbench_shadow_vert_glsl, - datatoc_workbench_shadow_geom_glsl, - shadow_frag, - "#define SHADOW_FAIL\n" - "#define DOUBLE_MANIFOLD\n"); - e_data.shadow_fail_manifold_sh = DRW_shader_create(datatoc_workbench_shadow_vert_glsl, - datatoc_workbench_shadow_geom_glsl, - shadow_frag, - "#define SHADOW_FAIL\n"); - e_data.shadow_caps_sh = DRW_shader_create(datatoc_workbench_shadow_vert_glsl, - datatoc_workbench_shadow_caps_geom_glsl, - shadow_frag, - "#define SHADOW_FAIL\n" - "#define DOUBLE_MANIFOLD\n"); - e_data.shadow_caps_manifold_sh = DRW_shader_create(datatoc_workbench_shadow_vert_glsl, - datatoc_workbench_shadow_caps_geom_glsl, - shadow_frag, - "#define SHADOW_FAIL\n"); + e_data.shadow_pass_sh = GPU_shader_create_from_arrays({ + .vert = (const char *[]){datatoc_common_view_lib_glsl, + datatoc_workbench_shadow_vert_glsl, + NULL}, + .geom = (const char *[]){datatoc_workbench_shadow_geom_glsl, NULL}, + .frag = (const char *[]){shadow_frag, NULL}, + .defs = (const char *[]){"#define SHADOW_PASS\n" + "#define DOUBLE_MANIFOLD\n", + NULL}, + }); + e_data.shadow_pass_manifold_sh = GPU_shader_create_from_arrays({ + .vert = (const char *[]){datatoc_common_view_lib_glsl, + datatoc_workbench_shadow_vert_glsl, + NULL}, + .geom = (const char *[]){datatoc_workbench_shadow_geom_glsl, NULL}, + .frag = (const char *[]){shadow_frag, NULL}, + .defs = (const char *[]){"#define SHADOW_PASS\n", NULL}, + }); + e_data.shadow_fail_sh = GPU_shader_create_from_arrays({ + .vert = (const char *[]){datatoc_common_view_lib_glsl, + datatoc_workbench_shadow_vert_glsl, + NULL}, + .geom = (const char *[]){datatoc_workbench_shadow_geom_glsl, NULL}, + .frag = (const char *[]){shadow_frag, NULL}, + .defs = (const char *[]){"#define SHADOW_FAIL\n" + "#define DOUBLE_MANIFOLD\n", + NULL}, + }); + e_data.shadow_fail_manifold_sh = GPU_shader_create_from_arrays({ + .vert = (const char *[]){datatoc_common_view_lib_glsl, + datatoc_workbench_shadow_vert_glsl, + NULL}, + .geom = (const char *[]){datatoc_workbench_shadow_geom_glsl, NULL}, + .frag = (const char *[]){shadow_frag, NULL}, + .defs = (const char *[]){"#define SHADOW_FAIL\n", NULL}, + }); + e_data.shadow_caps_sh = GPU_shader_create_from_arrays({ + .vert = (const char *[]){datatoc_common_view_lib_glsl, + datatoc_workbench_shadow_vert_glsl, + NULL}, + .geom = (const char *[]){datatoc_workbench_shadow_caps_geom_glsl, NULL}, + .frag = (const char *[]){shadow_frag, NULL}, + .defs = (const char *[]){"#define SHADOW_FAIL\n" + "#define DOUBLE_MANIFOLD\n", + NULL}, + }); + e_data.shadow_caps_manifold_sh = GPU_shader_create_from_arrays({ + .vert = (const char *[]){datatoc_common_view_lib_glsl, + datatoc_workbench_shadow_vert_glsl, + NULL}, + .geom = (const char *[]){datatoc_workbench_shadow_caps_geom_glsl, NULL}, + .frag = (const char *[]){shadow_frag, NULL}, + .defs = (const char *[]){"#define SHADOW_FAIL\n", NULL}, + }); e_data.ghost_resolve_sh = DRW_shader_create_fullscreen( datatoc_workbench_ghost_resolve_frag_glsl, NULL); |