Merge remote-tracking branch 'origin/master' into blender2.8
authorDalai Felinto <dfelinto@gmail.com>
Wed, 2 Nov 2016 09:48:06 +0000 (10:48 +0100)
committerDalai Felinto <dfelinto@gmail.com>
Wed, 2 Nov 2016 09:59:52 +0000 (10:59 +0100)
30 files changed:
1  2 
intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_object.cpp
intern/cycles/blender/blender_sync.cpp
release/scripts/startup/bl_ui/properties_physics_smoke.py
source/blender/alembic/intern/abc_mesh.cc
source/blender/alembic/intern/abc_points.cc
source/blender/alembic/intern/abc_points.h
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/object_deform.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/depsgraph/intern/depsgraph_tag.cc
source/blender/editors/interface/interface_icons.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/object/object_relations.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/drawvolume.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/gpu/GPU_shader.h
source/blender/gpu/intern/gpu_shader.c
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_modifier_types.h
source/blender/makesdna/DNA_smoke_types.h
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_smoke.c

Simple merge
@@@ -355,6 -357,13 +355,10 @@@ static void smokeModifier_freeDomain(Sm
                        MEM_freeN(smd->domain->effector_weights);
                smd->domain->effector_weights = NULL;
  
 -              BKE_ptcache_free_list(&(smd->domain->ptcaches[0]));
 -              smd->domain->point_cache[0] = NULL;
 -
+               if (smd->domain->coba) {
+                       MEM_freeN(smd->domain->coba);
+               }
                MEM_freeN(smd->domain);
                smd->domain = NULL;
        }
@@@ -631,8 -653,13 +638,12 @@@ void smokeModifier_copy(struct SmokeMod
                tsmd->domain->draw_velocity = smd->domain->draw_velocity;
                tsmd->domain->vector_draw_type = smd->domain->vector_draw_type;
                tsmd->domain->vector_scale = smd->domain->vector_scale;
+               if (smd->domain->coba) {
+                       tsmd->domain->coba = MEM_dupallocN(smd->domain->coba);
+               }
        }
        else if (tsmd->flow) {
 -              tsmd->flow->psys = smd->flow->psys;
                tsmd->flow->noise_texture = smd->flow->noise_texture;
  
                tsmd->flow->vel_multi = smd->flow->vel_multi;
@@@ -1512,9 -1719,28 +1512,14 @@@ static void write_modifiers(WriteData *
                        SmokeModifierData *smd = (SmokeModifierData *)md;
  
                        if (smd->type & MOD_SMOKE_TYPE_DOMAIN) {
 -                              if (smd->domain) {
 -                                      write_pointcaches(wd, &(smd->domain->ptcaches[0]));
 -
 -                                      /* create fake pointcache so that old blender versions can read it */
 -                                      smd->domain->point_cache[1] = BKE_ptcache_add(&smd->domain->ptcaches[1]);
 -                                      smd->domain->point_cache[1]->flag |= PTCACHE_DISK_CACHE | PTCACHE_FAKE_SMOKE;
 -                                      smd->domain->point_cache[1]->step = 1;
 +                              writestruct(wd, DATA, SmokeDomainSettings, 1, smd->domain);
  
 -                                      write_pointcaches(wd, &(smd->domain->ptcaches[1]));
 +                              if (smd->domain) {
+                                       if (smd->domain->coba) {
+                                               writestruct(wd, DATA, ColorBand, 1, smd->domain->coba);
+                                       }
 -                              }
 -
 -                              writestruct(wd, DATA, SmokeDomainSettings, 1, smd->domain);
 -
 -                              if (smd->domain) {
 -                                      /* cleanup the fake pointcache */
 -                                      BKE_ptcache_free_list(&smd->domain->ptcaches[1]);
 -                                      smd->domain->point_cache[1] = NULL;
                                        writestruct(wd, DATA, EffectorWeights, 1, smd->domain->effector_weights);
                                }
                        }
@@@ -209,8 -235,19 +209,11 @@@ void DEG_id_tag_update_ex(Main *bmain, 
                        if (flag & (OB_RECALC_OB | OB_RECALC_DATA)) {
                                DEG_graph_id_tag_update(bmain, graph, id);
                        }
+                       else if (flag & OB_RECALC_TIME) {
+                               DEG_graph_id_tag_update(bmain, graph, id);
+                       }
                }
        }
 -
 -#ifdef DEPSGRAPH_USE_LEGACY_TAGGING
 -      /* Special handling from the legacy depsgraph.
 -       * TODO(sergey): Need to get rid of those once all the areas
 -       * are re-formulated in terms of franular nodes.
 -       */
 -      depsgraph_legacy_handle_update_tag(bmain, id, flag);
 -#endif
  }
  
  /* Tag given ID type for update. */
@@@ -42,6 -41,8 +42,7 @@@
  #include "BLI_math.h"
  
  #include "BKE_DerivedMesh.h"
 -#include "BKE_particle.h"
+ #include "BKE_texture.h"
  
  #include "smoke_API.h"
  
@@@ -89,37 -89,7 +89,38 @@@ typedef enum GPUBuiltinShader 
        GPU_SHADER_SEP_GAUSSIAN_BLUR = 1,
        GPU_SHADER_SMOKE             = 2,
        GPU_SHADER_SMOKE_FIRE        = 3,
+       GPU_SHADER_SMOKE_COBA        = 4,
 +
 +      /* specialized drawing */
 +      GPU_SHADER_TEXT,
 +      GPU_SHADER_EDGES_FRONT_BACK_PERSP,
 +      GPU_SHADER_EDGES_FRONT_BACK_ORTHO,
 +
 +      /* for simple 2D drawing */
 +      GPU_SHADER_2D_UNIFORM_COLOR,
 +      GPU_SHADER_2D_FLAT_COLOR,
 +      GPU_SHADER_2D_SMOOTH_COLOR,
 +      /* for simple 3D drawing */
 +      GPU_SHADER_3D_UNIFORM_COLOR,
 +      GPU_SHADER_3D_FLAT_COLOR,
 +      GPU_SHADER_3D_SMOOTH_COLOR,
 +      GPU_SHADER_3D_DEPTH_ONLY,
 +      /* basic image drawing */
 +      GPU_SHADER_3D_IMAGE_MODULATE_ALPHA,
 +      GPU_SHADER_3D_IMAGE_RECT_MODULATE_ALPHA,
 +      GPU_SHADER_3D_IMAGE_DEPTH,
 +      /* points */
 +      GPU_SHADER_2D_POINT_FIXED_SIZE_UNIFORM_COLOR,
 +      GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_SMOOTH,
 +      GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_SMOOTH,
 +      GPU_SHADER_2D_POINT_UNIFORM_SIZE_VARYING_COLOR_OUTLINE_SMOOTH,
 +      GPU_SHADER_2D_POINT_VARYING_SIZE_VARYING_COLOR,
 +      GPU_SHADER_3D_POINT_FIXED_SIZE_UNIFORM_COLOR,
 +      GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR,
 +      GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_SMOOTH,
 +      GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_SMOOTH,
 +      GPU_SHADER_3D_POINT_VARYING_SIZE_UNIFORM_COLOR,
 +      GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR,
  } GPUBuiltinShader;
  
  GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader shader);
@@@ -106,37 -68,9 +106,38 @@@ static struct GPUShadersGlobal 
                GPUShader *sep_gaussian_blur;
                GPUShader *smoke;
                GPUShader *smoke_fire;
+               GPUShader *smoke_coba;
                /* cache for shader fx. Those can exist in combinations so store them here */
                GPUShader *fx_shaders[MAX_FX_SHADERS * 2];
 +              /* specialized drawing */
 +              GPUShader *text;
 +              GPUShader *edges_front_back_persp;
 +              GPUShader *edges_front_back_ortho;
 +              /* for drawing images */
 +              GPUShader *image_modulate_alpha_3D;
 +              GPUShader *image_rect_modulate_alpha_3D;
 +              GPUShader *image_depth_3D;
 +              /* for simple 2D drawing */
 +              GPUShader *uniform_color_2D;
 +              GPUShader *flat_color_2D;
 +              GPUShader *smooth_color_2D;
 +              /* for simple 3D drawing */
 +              GPUShader *uniform_color_3D;
 +              GPUShader *flat_color_3D;
 +              GPUShader *smooth_color_3D;
 +              GPUShader *depth_only_3D;
 +              /* points */
 +              GPUShader *point_fixed_size_uniform_color_2D;
 +              GPUShader *point_varying_size_varying_color_2D;
 +              GPUShader *point_uniform_size_uniform_color_smooth_2D;
 +              GPUShader *point_uniform_size_uniform_color_outline_smooth_2D;
 +              GPUShader *point_uniform_size_varying_color_outline_smooth_2D;
 +              GPUShader *point_fixed_size_uniform_color_3D;
 +              GPUShader *point_fixed_size_varying_color_3D;
 +              GPUShader *point_varying_size_uniform_color_3D;
 +              GPUShader *point_varying_size_varying_color_3D;
 +              GPUShader *point_uniform_size_uniform_color_smooth_3D;
 +              GPUShader *point_uniform_size_uniform_color_outline_smooth_3D;
        } shaders;
  } GG = {{NULL}};
  
@@@ -653,198 -624,13 +654,205 @@@ GPUShader *GPU_shader_get_builtin_shade
                                        NULL, NULL, NULL, 0, 0, 0);
                        retval = GG.shaders.smoke_fire;
                        break;
+               case GPU_SHADER_SMOKE_COBA:
+                       if (!GG.shaders.smoke_coba)
+                               GG.shaders.smoke_coba = GPU_shader_create(
+                                       datatoc_gpu_shader_smoke_vert_glsl, datatoc_gpu_shader_smoke_frag_glsl,
+                                       NULL, NULL, "#define USE_COBA;\n", 0, 0, 0);
+                       retval = GG.shaders.smoke_coba;
+                       break;
 +              case GPU_SHADER_TEXT:
 +                      if (!GG.shaders.text)
 +                              GG.shaders.text = GPU_shader_create(
 +                                      datatoc_gpu_shader_text_vert_glsl,
 +                                      datatoc_gpu_shader_text_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.text;
 +                      break;
 +              case GPU_SHADER_EDGES_FRONT_BACK_PERSP:
 +                      if (!GG.shaders.edges_front_back_persp)
 +                              GG.shaders.edges_front_back_persp = GPU_shader_create(
 +                                      datatoc_gpu_shader_edges_front_back_persp_vert_glsl,
 +                                      datatoc_gpu_shader_flat_color_alpha_test_0_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.edges_front_back_persp;
 +                      break;
 +              case GPU_SHADER_EDGES_FRONT_BACK_ORTHO:
 +                      if (!GG.shaders.edges_front_back_ortho)
 +                              GG.shaders.edges_front_back_ortho = GPU_shader_create(
 +                                      datatoc_gpu_shader_edges_front_back_ortho_vert_glsl,
 +                                      datatoc_gpu_shader_flat_color_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.edges_front_back_ortho;
 +                      break;
 +              case GPU_SHADER_3D_IMAGE_MODULATE_ALPHA:
 +                      if (!GG.shaders.image_modulate_alpha_3D)
 +                              GG.shaders.image_modulate_alpha_3D = GPU_shader_create(
 +                                      datatoc_gpu_shader_3D_image_vert_glsl,
 +                                      datatoc_gpu_shader_image_modulate_alpha_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.image_modulate_alpha_3D;
 +                      break;
 +              case GPU_SHADER_3D_IMAGE_RECT_MODULATE_ALPHA:
 +                      if (!GG.shaders.image_rect_modulate_alpha_3D)
 +                              GG.shaders.image_rect_modulate_alpha_3D = GPU_shader_create(
 +                              datatoc_gpu_shader_3D_image_vert_glsl,
 +                              datatoc_gpu_shader_image_rect_modulate_alpha_frag_glsl,
 +                              NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.image_rect_modulate_alpha_3D;
 +                      break;
 +              case GPU_SHADER_3D_IMAGE_DEPTH:
 +                      if (!GG.shaders.image_depth_3D)
 +                              GG.shaders.image_depth_3D = GPU_shader_create(
 +                                      datatoc_gpu_shader_3D_image_vert_glsl,
 +                                      datatoc_gpu_shader_image_depth_linear_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.image_depth_3D;
 +                      break;
 +              case GPU_SHADER_2D_UNIFORM_COLOR:
 +                      if (!GG.shaders.uniform_color_2D)
 +                              GG.shaders.uniform_color_2D = GPU_shader_create(
 +                                      datatoc_gpu_shader_2D_vert_glsl,
 +                                      datatoc_gpu_shader_uniform_color_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.uniform_color_2D;
 +                      break;
 +              case GPU_SHADER_2D_FLAT_COLOR:
 +                      if (!GG.shaders.flat_color_2D)
 +                              GG.shaders.flat_color_2D = GPU_shader_create(
 +                                      datatoc_gpu_shader_2D_flat_color_vert_glsl,
 +                                      datatoc_gpu_shader_flat_color_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.flat_color_2D;
 +                      break;
 +              case GPU_SHADER_2D_SMOOTH_COLOR:
 +                      if (!GG.shaders.smooth_color_2D)
 +                              GG.shaders.smooth_color_2D = GPU_shader_create(
 +                                      datatoc_gpu_shader_2D_smooth_color_vert_glsl,
 +                                      datatoc_gpu_shader_2D_smooth_color_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.smooth_color_2D;
 +                      break;
 +              case GPU_SHADER_3D_UNIFORM_COLOR:
 +                      if (!GG.shaders.uniform_color_3D)
 +                              GG.shaders.uniform_color_3D = GPU_shader_create(
 +                                      datatoc_gpu_shader_3D_vert_glsl,
 +                                      datatoc_gpu_shader_uniform_color_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.uniform_color_3D;
 +                      break;
 +              case GPU_SHADER_3D_FLAT_COLOR:
 +                      if (!GG.shaders.flat_color_3D)
 +                              GG.shaders.flat_color_3D = GPU_shader_create(
 +                                      datatoc_gpu_shader_3D_flat_color_vert_glsl,
 +                                      datatoc_gpu_shader_flat_color_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.flat_color_3D;
 +                      break;
 +              case GPU_SHADER_3D_SMOOTH_COLOR:
 +                      if (!GG.shaders.smooth_color_3D)
 +                              GG.shaders.smooth_color_3D = GPU_shader_create(
 +                                      datatoc_gpu_shader_3D_smooth_color_vert_glsl,
 +                                      datatoc_gpu_shader_3D_smooth_color_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.smooth_color_3D;
 +                      break;
 +              case GPU_SHADER_3D_DEPTH_ONLY:
 +                      if (!GG.shaders.depth_only_3D)
 +                              GG.shaders.depth_only_3D = GPU_shader_create(
 +                                      datatoc_gpu_shader_3D_vert_glsl,
 +                                      datatoc_gpu_shader_depth_only_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.depth_only_3D;
 +                      break;
 +              case GPU_SHADER_2D_POINT_FIXED_SIZE_UNIFORM_COLOR:
 +                      if (!GG.shaders.point_fixed_size_uniform_color_2D)
 +                              GG.shaders.point_fixed_size_uniform_color_2D = GPU_shader_create(
 +                                      datatoc_gpu_shader_2D_vert_glsl,
 +                                      datatoc_gpu_shader_point_uniform_color_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.point_fixed_size_uniform_color_2D;
 +                      break;
 +              case GPU_SHADER_2D_POINT_VARYING_SIZE_VARYING_COLOR:
 +                      if (!GG.shaders.point_varying_size_varying_color_2D)
 +                              GG.shaders.point_varying_size_varying_color_2D = GPU_shader_create(
 +                                      datatoc_gpu_shader_2D_point_varying_size_varying_color_vert_glsl,
 +                                      datatoc_gpu_shader_point_varying_color_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.point_varying_size_varying_color_2D;
 +                      break;
 +              case GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_SMOOTH:
 +                      if (!GG.shaders.point_uniform_size_uniform_color_smooth_2D)
 +                              GG.shaders.point_uniform_size_uniform_color_smooth_2D = GPU_shader_create(
 +                                      datatoc_gpu_shader_2D_point_uniform_size_smooth_vert_glsl,
 +                                      datatoc_gpu_shader_point_uniform_color_smooth_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.point_uniform_size_uniform_color_smooth_2D;
 +                      break;
 +              case GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_SMOOTH:
 +                      if (!GG.shaders.point_uniform_size_uniform_color_outline_smooth_2D)
 +                              GG.shaders.point_uniform_size_uniform_color_outline_smooth_2D = GPU_shader_create(
 +                                      datatoc_gpu_shader_2D_point_uniform_size_outline_smooth_vert_glsl,
 +                                      datatoc_gpu_shader_point_uniform_color_outline_smooth_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.point_uniform_size_uniform_color_outline_smooth_2D;
 +                      break;
 +              case GPU_SHADER_2D_POINT_UNIFORM_SIZE_VARYING_COLOR_OUTLINE_SMOOTH:
 +                      if (!GG.shaders.point_uniform_size_varying_color_outline_smooth_2D)
 +                              GG.shaders.point_uniform_size_varying_color_outline_smooth_2D = GPU_shader_create(
 +                                      datatoc_gpu_shader_2D_point_uniform_size_varying_color_outline_smooth_vert_glsl,
 +                                      datatoc_gpu_shader_point_varying_color_outline_smooth_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.point_uniform_size_varying_color_outline_smooth_2D;
 +                      break;
 +              case GPU_SHADER_3D_POINT_FIXED_SIZE_UNIFORM_COLOR:
 +                      if (!GG.shaders.point_fixed_size_uniform_color_3D)
 +                              GG.shaders.point_fixed_size_uniform_color_3D = GPU_shader_create(
 +                                      datatoc_gpu_shader_3D_vert_glsl,
 +                                      datatoc_gpu_shader_point_uniform_color_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.point_fixed_size_uniform_color_3D;
 +                      break;
 +              case GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR:
 +                      if (!GG.shaders.point_fixed_size_varying_color_3D)
 +                              GG.shaders.point_fixed_size_varying_color_3D = GPU_shader_create(
 +                                      datatoc_gpu_shader_3D_point_fixed_size_varying_color_vert_glsl,
 +                                      datatoc_gpu_shader_point_varying_color_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.point_fixed_size_varying_color_3D;
 +                      break;
 +              case GPU_SHADER_3D_POINT_VARYING_SIZE_UNIFORM_COLOR:
 +                      if (!GG.shaders.point_varying_size_uniform_color_3D)
 +                              GG.shaders.point_varying_size_uniform_color_3D = GPU_shader_create(
 +                                      datatoc_gpu_shader_3D_point_varying_size_vert_glsl,
 +                                      datatoc_gpu_shader_point_uniform_color_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.point_varying_size_uniform_color_3D;
 +                      break;
 +              case GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR:
 +                      if (!GG.shaders.point_varying_size_varying_color_3D)
 +                              GG.shaders.point_varying_size_varying_color_3D = GPU_shader_create(
 +                                      datatoc_gpu_shader_3D_point_varying_size_varying_color_vert_glsl,
 +                                      datatoc_gpu_shader_point_varying_color_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.point_varying_size_varying_color_3D;
 +                      break;
 +              case GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_SMOOTH:
 +                      if (!GG.shaders.point_uniform_size_uniform_color_smooth_3D)
 +                              GG.shaders.point_uniform_size_uniform_color_smooth_3D = GPU_shader_create(
 +                                      datatoc_gpu_shader_3D_point_uniform_size_smooth_vert_glsl,
 +                                      datatoc_gpu_shader_point_uniform_color_smooth_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.point_uniform_size_uniform_color_smooth_3D;
 +                      break;
 +              case GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_SMOOTH:
 +                      if (!GG.shaders.point_uniform_size_uniform_color_outline_smooth_3D)
 +                              GG.shaders.point_uniform_size_uniform_color_outline_smooth_3D = GPU_shader_create(
 +                                      datatoc_gpu_shader_3D_point_uniform_size_outline_smooth_vert_glsl,
 +                                      datatoc_gpu_shader_point_uniform_color_outline_smooth_frag_glsl,
 +                                      NULL, NULL, NULL, 0, 0, 0);
 +                      retval = GG.shaders.point_uniform_size_uniform_color_outline_smooth_3D;
 +                      break;
        }
  
        if (retval == NULL)
@@@ -954,127 -742,12 +962,132 @@@ void GPU_shader_free_builtin_shaders(vo
                GG.shaders.smoke_fire = NULL;
        }
  
 -      for (i = 0; i < 2 * MAX_FX_SHADERS; ++i) {
+       if (GG.shaders.smoke_coba) {
+               GPU_shader_free(GG.shaders.smoke_coba);
+               GG.shaders.smoke_coba = NULL;
+       }
 +      if (GG.shaders.text) {
 +              GPU_shader_free(GG.shaders.text);
 +              GG.shaders.text = NULL;
 +      }
 +
 +      if (GG.shaders.edges_front_back_persp) {
 +              GPU_shader_free(GG.shaders.edges_front_back_persp);
 +              GG.shaders.edges_front_back_persp = NULL;
 +      }
 +
 +      if (GG.shaders.edges_front_back_ortho) {
 +              GPU_shader_free(GG.shaders.edges_front_back_ortho);
 +              GG.shaders.edges_front_back_ortho = NULL;
 +      }
 +
 +      if (GG.shaders.image_modulate_alpha_3D) {
 +              GPU_shader_free(GG.shaders.image_modulate_alpha_3D);
 +              GG.shaders.image_modulate_alpha_3D = NULL;
 +      }
 +
 +      if (GG.shaders.image_rect_modulate_alpha_3D) {
 +              GPU_shader_free(GG.shaders.image_rect_modulate_alpha_3D);
 +              GG.shaders.image_rect_modulate_alpha_3D = NULL;
 +      }
 +
 +      if (GG.shaders.image_depth_3D) {
 +              GPU_shader_free(GG.shaders.image_depth_3D);
 +              GG.shaders.image_depth_3D = NULL;
 +      }
 +
 +      if (GG.shaders.uniform_color_2D) {
 +              GPU_shader_free(GG.shaders.uniform_color_2D);
 +              GG.shaders.uniform_color_2D = NULL;
 +      }
 +
 +      if (GG.shaders.flat_color_2D) {
 +              GPU_shader_free(GG.shaders.flat_color_2D);
 +              GG.shaders.flat_color_2D = NULL;
 +      }
 +
 +      if (GG.shaders.smooth_color_2D) {
 +              GPU_shader_free(GG.shaders.smooth_color_2D);
 +              GG.shaders.smooth_color_2D = NULL;
 +      }
 +
 +      if (GG.shaders.uniform_color_3D) {
 +              GPU_shader_free(GG.shaders.uniform_color_3D);
 +              GG.shaders.uniform_color_3D = NULL;
 +      }
 +
 +      if (GG.shaders.flat_color_3D) {
 +              GPU_shader_free(GG.shaders.flat_color_3D);
 +              GG.shaders.flat_color_3D = NULL;
 +      }
 +
 +      if (GG.shaders.smooth_color_3D) {
 +              GPU_shader_free(GG.shaders.smooth_color_3D);
 +              GG.shaders.smooth_color_3D = NULL;
 +      }
 +
 +      if (GG.shaders.depth_only_3D) {
 +              GPU_shader_free(GG.shaders.depth_only_3D);
 +              GG.shaders.depth_only_3D = NULL;
 +      }
 +
 +      if (GG.shaders.point_fixed_size_uniform_color_2D) {
 +              GPU_shader_free(GG.shaders.point_fixed_size_uniform_color_2D);
 +              GG.shaders.point_fixed_size_uniform_color_2D = NULL;
 +      }
 +
 +      if (GG.shaders.point_varying_size_varying_color_2D) {
 +              GPU_shader_free(GG.shaders.point_varying_size_varying_color_2D);
 +              GG.shaders.point_varying_size_varying_color_2D = NULL;
 +      }
 +
 +      if (GG.shaders.point_uniform_size_uniform_color_smooth_2D) {
 +              GPU_shader_free(GG.shaders.point_uniform_size_uniform_color_smooth_2D);
 +              GG.shaders.point_uniform_size_uniform_color_smooth_2D = NULL;
 +      }
 +
 +      if (GG.shaders.point_uniform_size_uniform_color_outline_smooth_2D) {
 +              GPU_shader_free(GG.shaders.point_uniform_size_uniform_color_outline_smooth_2D);
 +              GG.shaders.point_uniform_size_uniform_color_outline_smooth_2D = NULL;
 +      }
 +
 +      if (GG.shaders.point_uniform_size_varying_color_outline_smooth_2D) {
 +              GPU_shader_free(GG.shaders.point_uniform_size_varying_color_outline_smooth_2D);
 +              GG.shaders.point_uniform_size_varying_color_outline_smooth_2D = NULL;
 +      }
 +
 +      if (GG.shaders.point_fixed_size_uniform_color_3D) {
 +              GPU_shader_free(GG.shaders.point_fixed_size_uniform_color_3D);
 +              GG.shaders.point_fixed_size_uniform_color_3D = NULL;
 +      }
 +
 +      if (GG.shaders.point_fixed_size_varying_color_3D) {
 +              GPU_shader_free(GG.shaders.point_fixed_size_varying_color_3D);
 +              GG.shaders.point_fixed_size_varying_color_3D = NULL;
 +      }
 +
 +      if (GG.shaders.point_varying_size_uniform_color_3D) {
 +              GPU_shader_free(GG.shaders.point_varying_size_uniform_color_3D);
 +              GG.shaders.point_varying_size_uniform_color_3D = NULL;
 +      }
 +
 +      if (GG.shaders.point_varying_size_varying_color_3D) {
 +              GPU_shader_free(GG.shaders.point_varying_size_varying_color_3D);
 +              GG.shaders.point_varying_size_varying_color_3D = NULL;
 +      }
 +
 +      if (GG.shaders.point_uniform_size_uniform_color_smooth_3D) {
 +              GPU_shader_free(GG.shaders.point_uniform_size_uniform_color_smooth_3D);
 +              GG.shaders.point_uniform_size_uniform_color_smooth_3D = NULL;
 +      }
 +
 +      if (GG.shaders.point_uniform_size_uniform_color_outline_smooth_3D) {
 +              GPU_shader_free(GG.shaders.point_uniform_size_uniform_color_outline_smooth_3D);
 +              GG.shaders.point_uniform_size_uniform_color_outline_smooth_3D = NULL;
 +      }
 +
 +      for (int i = 0; i < 2 * MAX_FX_SHADERS; ++i) {
                if (GG.shaders.fx_shaders[i]) {
                        GPU_shader_free(GG.shaders.fx_shaders[i]);
                        GG.shaders.fx_shaders[i] = NULL;
Simple merge
@@@ -51,6 -53,8 +52,7 @@@
  
  #include "BKE_context.h"
  #include "BKE_depsgraph.h"
 -#include "BKE_particle.h"
+ #include "BKE_texture.h"
  
  #include "smoke_API.h"