diff options
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_lightprobes.c')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lightprobes.c | 58 |
1 files changed, 24 insertions, 34 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index c6f413f0f82..9d90338131b 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -26,7 +26,7 @@ #include "DRW_render.h" #include "BLI_utildefines.h" -#include "BLI_dynstr.h" +#include "BLI_string_utils.h" #include "BLI_rand.h" #include "DNA_world_types.h" @@ -204,12 +204,10 @@ static void lightprobe_shaders_init(void) char *shader_str = NULL; - DynStr *ds_frag = BLI_dynstr_new(); - BLI_dynstr_append(ds_frag, datatoc_bsdf_common_lib_glsl); - BLI_dynstr_append(ds_frag, datatoc_bsdf_sampling_lib_glsl); - BLI_dynstr_append(ds_frag, datatoc_lightprobe_filter_glossy_frag_glsl); - shader_str = BLI_dynstr_get_cstring(ds_frag); - BLI_dynstr_free(ds_frag); + shader_str = BLI_string_joinN( + datatoc_bsdf_common_lib_glsl, + datatoc_bsdf_sampling_lib_glsl, + datatoc_lightprobe_filter_glossy_frag_glsl); e_data.probe_filter_glossy_sh = DRW_shader_create( datatoc_lightprobe_vert_glsl, datatoc_lightprobe_geom_glsl, shader_str, filter_defines); @@ -219,36 +217,30 @@ static void lightprobe_shaders_init(void) MEM_freeN(shader_str); - ds_frag = BLI_dynstr_new(); - BLI_dynstr_append(ds_frag, datatoc_bsdf_common_lib_glsl); - BLI_dynstr_append(ds_frag, datatoc_bsdf_sampling_lib_glsl); - BLI_dynstr_append(ds_frag, datatoc_lightprobe_filter_diffuse_frag_glsl); - shader_str = BLI_dynstr_get_cstring(ds_frag); - BLI_dynstr_free(ds_frag); + shader_str = BLI_string_joinN( + datatoc_bsdf_common_lib_glsl, + datatoc_bsdf_sampling_lib_glsl, + datatoc_lightprobe_filter_diffuse_frag_glsl); e_data.probe_filter_diffuse_sh = DRW_shader_create_fullscreen(shader_str, filter_defines); MEM_freeN(shader_str); - ds_frag = BLI_dynstr_new(); - BLI_dynstr_append(ds_frag, datatoc_bsdf_common_lib_glsl); - BLI_dynstr_append(ds_frag, datatoc_bsdf_sampling_lib_glsl); - BLI_dynstr_append(ds_frag, datatoc_lightprobe_filter_visibility_frag_glsl); - shader_str = BLI_dynstr_get_cstring(ds_frag); - BLI_dynstr_free(ds_frag); + shader_str = BLI_string_joinN( + datatoc_bsdf_common_lib_glsl, + datatoc_bsdf_sampling_lib_glsl, + datatoc_lightprobe_filter_visibility_frag_glsl); e_data.probe_filter_visibility_sh = DRW_shader_create_fullscreen(shader_str, filter_defines); MEM_freeN(shader_str); - ds_frag = BLI_dynstr_new(); - BLI_dynstr_append(ds_frag, datatoc_octahedron_lib_glsl); - BLI_dynstr_append(ds_frag, datatoc_bsdf_common_lib_glsl); - BLI_dynstr_append(ds_frag, datatoc_irradiance_lib_glsl); - BLI_dynstr_append(ds_frag, datatoc_lightprobe_lib_glsl); - BLI_dynstr_append(ds_frag, datatoc_lightprobe_grid_display_frag_glsl); - shader_str = BLI_dynstr_get_cstring(ds_frag); - BLI_dynstr_free(ds_frag); + shader_str = BLI_string_joinN( + datatoc_octahedron_lib_glsl, + datatoc_bsdf_common_lib_glsl, + datatoc_irradiance_lib_glsl, + datatoc_lightprobe_lib_glsl, + datatoc_lightprobe_grid_display_frag_glsl); e_data.probe_grid_display_sh = DRW_shader_create( datatoc_lightprobe_grid_display_vert_glsl, NULL, shader_str, filter_defines); @@ -258,13 +250,11 @@ static void lightprobe_shaders_init(void) e_data.probe_grid_fill_sh = DRW_shader_create_fullscreen( datatoc_lightprobe_grid_fill_frag_glsl, filter_defines); - ds_frag = BLI_dynstr_new(); - BLI_dynstr_append(ds_frag, datatoc_octahedron_lib_glsl); - BLI_dynstr_append(ds_frag, datatoc_bsdf_common_lib_glsl); - BLI_dynstr_append(ds_frag, datatoc_lightprobe_lib_glsl); - BLI_dynstr_append(ds_frag, datatoc_lightprobe_cube_display_frag_glsl); - shader_str = BLI_dynstr_get_cstring(ds_frag); - BLI_dynstr_free(ds_frag); + shader_str = BLI_string_joinN( + datatoc_octahedron_lib_glsl, + datatoc_bsdf_common_lib_glsl, + datatoc_lightprobe_lib_glsl, + datatoc_lightprobe_cube_display_frag_glsl); e_data.probe_cube_display_sh = DRW_shader_create( datatoc_lightprobe_cube_display_vert_glsl, NULL, shader_str, NULL); |