diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-06-03 11:29:32 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-06-03 12:02:56 +0300 |
commit | 3e4c8d48aab3de9211652d43f4275576dae146ce (patch) | |
tree | 0a0daffcd1a630deceb19fded3b67caafef7ea5f /source/blender/draw/engines/external/external_engine.c | |
parent | 55f8758b8757bc5af7d3aaae0436d8730e0342ba (diff) |
Cleanup: DRW: Remove builtin 3D only shader usage
Diffstat (limited to 'source/blender/draw/engines/external/external_engine.c')
-rw-r--r-- | source/blender/draw/engines/external/external_engine.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/draw/engines/external/external_engine.c b/source/blender/draw/engines/external/external_engine.c index 6e636e4dc93..2f448b784ed 100644 --- a/source/blender/draw/engines/external/external_engine.c +++ b/source/blender/draw/engines/external/external_engine.c @@ -44,6 +44,11 @@ #define EXTERNAL_ENGINE "BLENDER_EXTERNAL" +extern char datatoc_depth_frag_glsl[]; +extern char datatoc_depth_vert_glsl[]; + +extern char datatoc_common_view_lib_glsl[]; + /* *********** LISTS *********** */ /* GPUViewport.storage @@ -106,7 +111,16 @@ static void external_engine_init(void *vedata) /* Depth prepass */ if (!e_data.depth_sh) { - e_data.depth_sh = DRW_shader_create_3d_depth_only(GPU_SHADER_CFG_DEFAULT); + const GPUShaderConfigData *sh_cfg = &GPU_shader_cfg_data[GPU_SHADER_CFG_DEFAULT]; + + e_data.depth_sh = GPU_shader_create_from_arrays({ + .vert = (const char *[]){sh_cfg->lib, + datatoc_common_view_lib_glsl, + datatoc_depth_vert_glsl, + NULL}, + .frag = (const char *[]){datatoc_depth_frag_glsl, NULL}, + .defs = (const char *[]){sh_cfg->def, NULL}, + }); } if (!stl->g_data) { @@ -277,7 +291,7 @@ static void external_draw_scene(void *vedata) static void external_engine_free(void) { - /* All shaders are builtin. */ + DRW_SHADER_FREE_SAFE(e_data.depth_sh); } static const DrawEngineDataSize external_data_size = DRW_VIEWPORT_DATA_SIZE(EXTERNAL_Data); |