[Bf-blender-cvs] [a2301b1d911] master: Geometry Nodes: Add description to curve handle input node

2022-01-24 Thread Hans Goudey
Commit: a2301b1d9110a16c84b6fcf539f8099d7eb0ae65
Author: Hans Goudey
Date:   Tue Jan 25 00:04:33 2022 -0600
Branches: master
https://developer.blender.org/rBa2301b1d9110a16c84b6fcf539f8099d7eb0ae65

Geometry Nodes: Add description to curve handle input node

The "Relative" input isn't immediately obvious unless one is familar
with that naming pattern, so an explicit description may be helpful.

===

M   source/blender/nodes/geometry/nodes/node_geo_input_curve_handles.cc

===

diff --git 
a/source/blender/nodes/geometry/nodes/node_geo_input_curve_handles.cc 
b/source/blender/nodes/geometry/nodes/node_geo_input_curve_handles.cc
index fbf6b521fd8..b1144b58c37 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_input_curve_handles.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_input_curve_handles.cc
@@ -22,7 +22,11 @@ namespace blender::nodes::node_geo_input_curve_handles_cc {
 
 static void node_declare(NodeDeclarationBuilder )
 {
-  
b.add_input(N_("Relative")).default_value(false).supports_field();
+  b.add_input(N_("Relative"))
+  .default_value(false)
+  .supports_field()
+  .description(N_("Output the handle positions relative to the 
corresponding control point "
+  "instead of in the local space of the geometry"));
   b.add_output(N_("Left")).field_source();
   b.add_output(N_("Right")).field_source();
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [114b06b3cb5] master: Cleanup: Remove unused pixel buffer in read_render_tile

2022-01-24 Thread Jesse Yurkovich
Commit: 114b06b3cb5f8d1588a9065e30eea701586b7f76
Author: Jesse Yurkovich
Date:   Mon Jan 24 20:53:19 2022 -0800
Branches: master
https://developer.blender.org/rB114b06b3cb5f8d1588a9065e30eea701586b7f76

Cleanup: Remove unused pixel buffer in read_render_tile

A left over remnant from rB1a134c4c30a643ada1b9a7a037040b5f5c173a28

Differential Revision: https://developer.blender.org/D13901

===

M   intern/cycles/blender/output_driver.cpp

===

diff --git a/intern/cycles/blender/output_driver.cpp 
b/intern/cycles/blender/output_driver.cpp
index d5cc0c60bae..f35b48493cb 100644
--- a/intern/cycles/blender/output_driver.cpp
+++ b/intern/cycles/blender/output_driver.cpp
@@ -51,8 +51,6 @@ bool BlenderOutputDriver::read_render_tile(const Tile )
 
   BL::RenderLayer b_rlay = *b_single_rlay;
 
-  vector pixels(static_cast(tile.size.x) * tile.size.y * 4);
-
   /* Copy each pass.
* TODO:copy only the required ones for better performance? */
   for (BL::RenderPass _pass : b_rlay.passes) {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [2bf519d211b] master: Cleanup: Correct location of node function declarations

2022-01-24 Thread Hans Goudey
Commit: 2bf519d211b1c51353b827f994494badfdf2569f
Author: Hans Goudey
Date:   Mon Jan 24 16:18:30 2022 -0600
Branches: master
https://developer.blender.org/rB2bf519d211b1c51353b827f994494badfdf2569f

Cleanup: Correct location of node function declarations

Currently there are many function declarations in `BKE_node.h` that
don't actually have implementations in blenkernel. This commit moves
the declarations to `NOD_composite.h`, `NOD_texture.h`, and
`NOD_shader.h` instead. This helps to clarify the purpose of the
different modules.

Differential Revision: https://developer.blender.org/D13869

===

M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node_tree_update.cc
M   source/blender/blenkernel/intern/texture.c
M   source/blender/blenloader/intern/versioning_260.c
M   source/blender/blenloader/intern/versioning_cycles.c
M   source/blender/compositor/nodes/COM_CryptomatteNode.cc
M   source/blender/compositor/operations/COM_TextureOperation.cc
M   source/blender/editors/interface/interface_eyedropper_color.c
M   source/blender/editors/render/CMakeLists.txt
M   source/blender/editors/render/render_internal.cc
M   source/blender/editors/render/render_shading.cc
M   source/blender/editors/render/render_update.cc
M   source/blender/editors/sculpt_paint/CMakeLists.txt
M   source/blender/editors/sculpt_paint/paint_cursor.c
M   source/blender/editors/sculpt_paint/paint_image.c
M   source/blender/editors/sculpt_paint/sculpt.c
M   source/blender/gpu/intern/gpu_material.c
M   source/blender/makesrna/intern/rna_layer.c
M   source/blender/makesrna/intern/rna_nodetree.c
M   source/blender/makesrna/intern/rna_scene.c
M   source/blender/nodes/NOD_composite.h
M   source/blender/nodes/NOD_shader.h
M   source/blender/nodes/NOD_texture.h
M   source/blender/render/intern/pipeline.c
M   source/blender/render/intern/texture_procedural.c

===

diff --git a/source/blender/blenkernel/BKE_node.h 
b/source/blender/blenkernel/BKE_node.h
index 2f9034f6438..cd6d58f563a 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -1179,30 +1179,6 @@ void BKE_nodetree_remove_layer_n(struct bNodeTree 
*ntree, struct Scene *scene, i
 #define SH_NODE_VECTOR_ROTATE 708
 #define SH_NODE_CURVE_FLOAT 709
 
-/* API */
-
-struct bNodeTreeExec *ntreeShaderBeginExecTree(struct bNodeTree *ntree);
-void ntreeShaderEndExecTree(struct bNodeTreeExec *exec);
-/**
-   Find an output node of the shader tree.
- *
- * \note it will only return output which is NOT in the group, which isn't how
- * render engines works but it's how the GPU shader compilation works. This we
- * can change in the future and make it a generic function, but for now it 
stays
- * private here.
- */
-struct bNode *ntreeShaderOutputNode(struct bNodeTree *ntree, int target);
-/**
- * This one needs to work on a local tree.
- *
- * TODO: This is *not* part of `blenkernel`, it's defined under 
"source/blender/nodes/".
- * This declaration should be moved out of BKE.
- */
-void ntreeGPUMaterialNodes(struct bNodeTree *localtree,
-   struct GPUMaterial *mat,
-   bool *has_surface_output,
-   bool *has_volume_output);
-
 /** \} */
 
 /*  */
@@ -1352,75 +1328,6 @@ void ntreeGPUMaterialNodes(struct bNodeTree *localtree,
 #define CMP_DEFAULT_SMAA_CONTRAST_LIMIT 0.2f
 #define CMP_DEFAULT_SMAA_CORNER_ROUNDING 0.25f
 
-/* API */
-void ntreeCompositExecTree(struct Scene *scene,
-   struct bNodeTree *ntree,
-   struct RenderData *rd,
-   int rendering,
-   int do_previews,
-   const struct ColorManagedViewSettings 
*view_settings,
-   const struct ColorManagedDisplaySettings 
*display_settings,
-   const char *view_name);
-
-/**
- * Called from render pipeline, to tag render input and output.
- * need to do all scenes, to prevent errors when you re-render 1 scene.
- */
-void ntreeCompositTagRender(struct Scene *scene);
-/**
- * Update the outputs of the render layer nodes.
- * Since the outputs depend on the render engine, this part is a bit complex:
- * - #ntreeCompositUpdateRLayers is called and loops over all render layer 
nodes.
- * - Each render layer node calls the update function of the
- *   render engine that's used for its scene.
- * - The render engine calls RE_engine_register_pass for each pass.
- * - #RE_engine_register_pass calls #node_cmp_rlayers_register_pass.
- *
- * TODO: This is *not* part of `blenkernel`, it's defined under 
"source/blender/nodes/".
- * This declaration should be moved out of 

[Bf-blender-cvs] [b64d551f3b2] KTX_support: Fix basic loading and reading RGBA KTX images.

2022-01-24 Thread Antonis Ryakiotakis
Commit: b64d551f3b2fa409b4eeefb641fc581eb6cd0bd6
Author: Antonis Ryakiotakis
Date:   Mon Jan 24 22:16:25 2022 +0100
Branches: KTX_support
https://developer.blender.org/rBb64d551f3b2fa409b4eeefb641fc581eb6cd0bd6

Fix basic loading and reading RGBA KTX images.

Blender can also show thumbnails properly now that all work is done on the CPU

===

M   source/blender/imbuf/intern/ktx.c

===

diff --git a/source/blender/imbuf/intern/ktx.c 
b/source/blender/imbuf/intern/ktx.c
index 05e539ed992..e5647a396ca 100644
--- a/source/blender/imbuf/intern/ktx.c
+++ b/source/blender/imbuf/intern/ktx.c
@@ -53,52 +53,57 @@ bool check_ktx(const unsigned char *mem, size_t size)
 struct ImBuf *imb_loadktx(const unsigned char *mem, size_t size, int flags, 
char * UNUSED(colorspace))
 {
   ktxTexture *tex;
-  KTX_error_code ktxerror = ktxTexture_CreateFromMemory(mem, size, 0, );
+  KTX_error_code ktx_error = ktxTexture_CreateFromMemory(
+  mem, size, KTX_TEXTURE_CREATE_LOAD_IMAGE_DATA_BIT, );
 
-  if (ktxerror != KTX_SUCCESS) {
+  if (ktx_error != KTX_SUCCESS) {
 return NULL;
   }
 
   ktx_size_t offset;
-  ktxerror = ktxTexture_GetImageOffset(tex, 0, 0, 0, );
+  ktx_error = ktxTexture_GetImageOffset(tex, 0, 0, 0, );
 
-  if (ktxerror != KTX_SUCCESS) {
+  if (ktx_error != KTX_SUCCESS) {
 ktxTexture_Destroy(tex);
 return NULL;
   }
 
-  ktx_uint8_t *image = ktxTexture_GetData(tex) + offset;
+  const ktx_uint8_t *image = ktxTexture_GetData(tex) + offset;
 
-  ktx_uint32_t xsize = tex->baseWidth;
-  ktx_uint32_t ysize = tex->baseHeight;
+  ktx_uint32_t x_size = tex->baseWidth;
+  ktx_uint32_t y_size = tex->baseHeight;
 
-  ImBuf *ibuf = IMB_allocImBuf(xsize, ysize, 32, (int)IB_rect);
+  ImBuf *ibuf = IMB_allocImBuf(x_size, y_size, 32, (int)IB_rect);
 
-  bool flipx = false, flipy = false;
+  bool flip_x = false, flip_y = false;
 
-  for (ktx_uint32_t i = 0; i < xsize + ysize; ++i)
-ibuf->rect[i] = image[i];
+  size_t num_pixels = (size_t)x_size * (size_t)y_size;
+  for (size_t i = 0; i < num_pixels; ++i) {
+ktx_uint8_t *c_out = (ktx_uint8_t *)(ibuf->rect + i);
+const ktx_uint8_t *c_in = image + i * 4;
 
-  char *pValue;
+for (size_t c = 0; c < 4; ++c) {
+  c_out[c] = c_in[c];
+}
+  }
+
+  const char *pValue;
   uint32_t valueLen;
-  ktxerror = ktxHashList_FindValue(>kvDataHead, KTX_ORIENTATION_KEY, 
, (void **));
-  if (ktxerror != KTX_SUCCESS) {
+  ktx_error = ktxHashList_FindValue(>kvDataHead, KTX_ORIENTATION_KEY, 
, (void **));
+  if (ktx_error == KTX_SUCCESS) {
 char cx, cy;
 if (sscanf(pValue, KTX_ORIENTATION2_FMT, , ) == 2) {
-  flipx = (cx == 'd');
-  flipy = (cy == 'd');
+  flip_x = (cx == 'd');
+  flip_y = (cy == 'd');
 }
   }
 
-  if (flipx && flipy) {
-int i;
-size_t imbuf_size = ibuf->x * ibuf->y;
-
-for (i = 0; i < imbuf_size / 2; i++) {
-  SWAP(unsigned int, ibuf->rect[i], ibuf->rect[imbuf_size - i - 1]);
+  if (flip_x && flip_y) {
+for (size_t i = 0; i < num_pixels / 2; i++) {
+  SWAP(unsigned int, ibuf->rect[i], ibuf->rect[num_pixels - i - 1]);
 }
   }
-  else if (flipy) {
+  else if (flip_y) {
 size_t i, j;
 for (j = 0; j < ibuf->y / 2; j++) {
   for (i = 0; i < ibuf->x; i++) {
@@ -117,33 +122,33 @@ struct ImBuf *imb_loadktx(const unsigned char *mem, 
size_t size, int flags, char
 
 bool imb_savektx(struct ImBuf *ibuf, const char *name, int UNUSED(flags))
 {
-  ktxTextureCreateInfo createInfo;
-  createInfo.glInternalformat = 0x8058; // GL_RGBA8
-  createInfo.baseWidth = ibuf->x;
-  createInfo.baseHeight = ibuf->y;
-  createInfo.baseDepth = 0;
-  createInfo.numDimensions = 2;
+  ktxTextureCreateInfo create_info;
+  create_info.glInternalformat = 0x8058; // GL_RGBA8
+  create_info.baseWidth = ibuf->x;
+  create_info.baseHeight = ibuf->y;
+  create_info.baseDepth = 1;
+  create_info.numDimensions = 2;
   // Note: it is not necessary to provide a full mipmap pyramid.
-  createInfo.numLevels = 1;
-  createInfo.numLayers = 1;
-  createInfo.numFaces = 1;
-  createInfo.isArray = KTX_FALSE;
-  createInfo.generateMipmaps = KTX_FALSE;
+  create_info.numLevels = 1;
+  create_info.numLayers = 1;
+  create_info.numFaces = 1;
+  create_info.isArray = KTX_FALSE;
+  create_info.generateMipmaps = KTX_TRUE;
   KTX_error_code result;
-  ktxTexture2 *tex;
-  result = ktxTexture2_Create(, KTX_TEXTURE_CREATE_ALLOC_STORAGE, 
);
+  ktxTexture1 *tex;
+  result = ktxTexture1_Create(_info, KTX_TEXTURE_CREATE_ALLOC_STORAGE, 
);
   if (KTX_SUCCESS != result) {
 return false;
   }
 
   ktxTexture *texture = ktxTexture(tex);
 
-  ktx_uint32_t level, layer, faceSlice;
+  ktx_uint32_t level, layer, face_slice;
   level = 0;
   layer = 0;
-  faceSlice = 0;
+  face_slice = 0;
   result = ktxTexture_SetImageFromMemory(
-  texture, level, layer, faceSlice, (ktx_uint8_t*)ibuf->rect, 
(size_t)ibuf->x * 

[Bf-blender-cvs] [5a0c5912a41] master: Tests: Enable new tests for geometry nodes extrude node

2022-01-24 Thread Hans Goudey
Commit: 5a0c5912a41eacd443a121177f607446f909564e
Author: Hans Goudey
Date:   Mon Jan 24 13:55:32 2022 -0600
Branches: master
https://developer.blender.org/rB5a0c5912a41eacd443a121177f607446f909564e

Tests: Enable new tests for geometry nodes extrude node

rB95981c9876483256b28

===

M   tests/python/CMakeLists.txt

===

diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index f3136d6c649..062dc5517db 100644
--- a/tests/python/CMakeLists.txt
+++ b/tests/python/CMakeLists.txt
@@ -772,6 +772,7 @@ set(geo_node_tests
   geometry
   mesh_primitives
   mesh
+  mesh/extrude
   points
   utilities
   vector

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [173291bc6dd] KTX_support: building and running with ktx now works on windows. Loading/saving most likely still broken

2022-01-24 Thread Antonis Ryakiotakis
Commit: 173291bc6dd83ee65687b4a7bc9e9a7b4d3114c8
Author: Antonis Ryakiotakis
Date:   Mon Jan 24 20:28:05 2022 +0100
Branches: KTX_support
https://developer.blender.org/rB173291bc6dd83ee65687b4a7bc9e9a7b4d3114c8

building and running with ktx now works on windows. Loading/saving most likely 
still broken

===

M   build_files/cmake/platform/platform_win32.cmake
M   source/blender/imbuf/CMakeLists.txt
M   source/blender/imbuf/intern/ktx.c
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_win32.cmake 
b/build_files/cmake/platform/platform_win32.cmake
index 0439e2fa5c2..2a4e16e56d1 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -456,6 +456,12 @@ if(WITH_IMAGE_TIFF)
   endif()
 endif()
 
+if(WITH_IMAGE_KTX)
+  set(KTX_INCLUDE ${LIBDIR}/ktx2/include)
+  set(KTX_LIBRARY ${LIBDIR}/ktx2/lib/ktx.lib)
+  set(KTX_LIBRARY_DLL ${LIBDIR}/ktx2/lib/ktx.dll)
+endif()
+
 if(WITH_JACK)
   set(JACK_INCLUDE_DIRS
 ${LIBDIR}/jack/include/jack
diff --git a/source/blender/imbuf/CMakeLists.txt 
b/source/blender/imbuf/CMakeLists.txt
index 564bb4f3e45..a14e91179d6 100644
--- a/source/blender/imbuf/CMakeLists.txt
+++ b/source/blender/imbuf/CMakeLists.txt
@@ -193,9 +193,6 @@ if(WITH_IMAGE_KTX)
list(APPEND INC
${KTX_INCLUDE}
)
-   list(APPEND INC_SYS
-   ${GLEW_INCLUDE_PATH}
-   )
list(APPEND SRC
intern/ktx.c
)
diff --git a/source/blender/imbuf/intern/ktx.c 
b/source/blender/imbuf/intern/ktx.c
index efac0fe666b..05e539ed992 100644
--- a/source/blender/imbuf/intern/ktx.c
+++ b/source/blender/imbuf/intern/ktx.c
@@ -29,9 +29,6 @@
  *  \ingroup imbuf
  */
 
-#define KTX_OPENGL 1
-#define KTX_USE_GETPROC 1
-
 #include "ktx.h"
 
 #include "IMB_imbuf.h"
@@ -45,131 +42,115 @@
 #include 
 #include 
 
-#include "GL/glew.h"
-
 static char KTX_HEAD[] = {0xAB, 0x4B, 0x54, 0x58, 0x20, 0x31, 0x31, 0xBB, 
0x0D, 0x0A, 0x1A, 0x0A};
 
 
 bool check_ktx(const unsigned char *mem, size_t size)
 {
-  return memcmp(KTX_HEAD, mem, sizeof(KTX_HEAD)) ? 0 : 1;
+  return memcmp(KTX_HEAD, mem, sizeof(KTX_HEAD)) == 0;
 }
 
 struct ImBuf *imb_loadktx(const unsigned char *mem, size_t size, int flags, 
char * UNUSED(colorspace))
 {
-   GLuint texture = 0;
-   GLenum target;
-   GLenum glerror;
-   GLboolean isMipmapped;
-   KTX_error_code ktxerror;
-   unsigned int numKeys;
-   unsigned char *keys;
-
-   /* thumbnails are run from a thread so opengl generation below will 
fail */
-   if (flags & IB_thumbnail) {
-   return NULL;
-   }
-
-   ktxerror = ktxLoadTextureM(mem, size, , , NULL, 
, , , );
-
-   if (ktxerror == KTX_SUCCESS) {
-   ImBuf *ibuf;
-   int xsize, ysize;
-   int internal_format;
-   bool flipx = false, flipy = false;
-   glEnable(target);
-
-   if (isMipmapped)
-   /* Enable bilinear mipmapping */
-   glTexParameteri(target, GL_TEXTURE_MIN_FILTER, 
GL_LINEAR_MIPMAP_NEAREST);
-   else
-   glTexParameteri(target, GL_TEXTURE_MIN_FILTER, 
GL_LINEAR);
-   glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, 
);
-   glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, 
);
-
-   ibuf = IMB_allocImBuf(xsize, ysize, 32, (int)IB_rect);
-
-   glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, 
ibuf->rect);
-   glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, 
GL_TEXTURE_COMPRESSED, _format);
-
-   glDeleteTextures(1, );
-
-   if (internal_format) {
-   flipx = flipy = true;
-   }
-   else {
-   if (keys) {
-   KTX_hash_table table;
-   ktxerror = ktxHashTable_Deserialize(numKeys, 
keys, );
-   if (ktxerror == KTX_SUCCESS) {
-   unsigned int valLength;
-   unsigned char *value;
-   ktxerror = 
ktxHashTable_FindValue(table, KTX_ORIENTATION_KEY, , (void **));
-
-   if (ktxerror == KTX_SUCCESS) {
-   if (value[6] == 'd')
-   flipy = true;
-   }
-   }
-   }
-   }
-
-   if (flipx && flipy) {
-   int i;
-   size_t imbuf_size = ibuf->x * ibuf->y;
-
-   for (i = 0; i < imbuf_size / 2; i++) {

[Bf-blender-cvs] [04c3b085188] master: Fix T94355: Cycles wrong GPU bake with adaptive sampling

2022-01-24 Thread Brecht Van Lommel
Commit: 04c3b085188616c375dd5ba3a0632665629b9208
Author: Brecht Van Lommel
Date:   Mon Jan 24 19:10:52 2022 +0100
Branches: master
https://developer.blender.org/rB04c3b085188616c375dd5ba3a0632665629b9208

Fix T94355: Cycles wrong GPU bake with adaptive sampling

===

M   intern/cycles/integrator/path_trace.cpp

===

diff --git a/intern/cycles/integrator/path_trace.cpp 
b/intern/cycles/integrator/path_trace.cpp
index 0b55d1078a8..fd697836f52 100644
--- a/intern/cycles/integrator/path_trace.cpp
+++ b/intern/cycles/integrator/path_trace.cpp
@@ -820,8 +820,15 @@ void PathTrace::tile_buffer_read()
 return;
   }
 
+  /* Read buffers back from device. */
+  tbb::parallel_for_each(path_trace_works_, [&](unique_ptr 
_trace_work) {
+path_trace_work->copy_render_buffers_from_device();
+  });
+
+  /* Read (subset of) passes from output driver. */
   PathTraceTile tile(*this);
   if (output_driver_->read_render_tile(tile)) {
+/* Copy buffers to device again. */
 tbb::parallel_for_each(path_trace_works_, [](unique_ptr 
_trace_work) {
   path_trace_work->copy_render_buffers_to_device();
 });

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [263f862ba56] master: Add workaround for broken interface query functions on Intel HD Graphics 4400 and 4600

2022-01-24 Thread Clment Foucault
Commit: 263f862ba567a8209ced7d6d6486a1f275578aa4
Author: Clment Foucault
Date:   Mon Jan 24 18:46:30 2022 +0100
Branches: master
https://developer.blender.org/rB263f862ba567a8209ced7d6d6486a1f275578aa4

Add workaround for broken interface query functions on Intel HD Graphics 4400 
and 4600

Fixes T93680

For current drivers of Intel HD Graphics 4400 and 4600, various Program 
Introspection functions appear broken and return incorrect values, causing 
crashes in the current handling of SSBOs. Disable use of this feature on those 
devices. Add checks to features that use SSBOs (Hair and Subdivision Modifier).

Reviewed By: fclem, jbakker

Maniphest Tasks: T93680

Differential Revision: https://developer.blender.org/D13806

===

M   release/scripts/addons
M   source/blender/blenkernel/intern/subdiv_modifier.c
M   source/blender/draw/intern/draw_hair.c
M   source/blender/gpu/opengl/gl_backend.cc

===

diff --git a/release/scripts/addons b/release/scripts/addons
index 6afec05c328..67f1fbca148 16
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 6afec05c3286cdea58ab269fb8dd1f5de011de4e
+Subproject commit 67f1fbca1482d9d9362a4001332e785c3fd5d230
diff --git a/source/blender/blenkernel/intern/subdiv_modifier.c 
b/source/blender/blenkernel/intern/subdiv_modifier.c
index 65809782f8f..525c4837bc4 100644
--- a/source/blender/blenkernel/intern/subdiv_modifier.c
+++ b/source/blender/blenkernel/intern/subdiv_modifier.c
@@ -92,7 +92,7 @@ bool BKE_subsurf_modifier_can_do_gpu_subdiv_ex(const Scene 
*scene,
 return false;
   }
 
-  if (!GPU_compute_shader_support()) {
+  if (!(GPU_compute_shader_support() && 
GPU_shader_storage_buffer_objects_support())) {
 return false;
   }
 
diff --git a/source/blender/draw/intern/draw_hair.c 
b/source/blender/draw/intern/draw_hair.c
index 0abb00a71a9..bf37ea45dda 100644
--- a/source/blender/draw/intern/draw_hair.c
+++ b/source/blender/draw/intern/draw_hair.c
@@ -54,7 +54,7 @@
 BLI_INLINE eParticleRefineShaderType drw_hair_shader_type_get(void)
 {
 #ifdef USE_COMPUTE_SHADERS
-  if (GPU_compute_shader_support()) {
+  if (GPU_compute_shader_support() && 
GPU_shader_storage_buffer_objects_support()) {
 return PART_REFINE_SHADER_COMPUTE;
   }
 #endif
diff --git a/source/blender/gpu/opengl/gl_backend.cc 
b/source/blender/gpu/opengl/gl_backend.cc
index 1a445ebd7eb..c32123bc15e 100644
--- a/source/blender/gpu/opengl/gl_backend.cc
+++ b/source/blender/gpu/opengl/gl_backend.cc
@@ -240,6 +240,7 @@ static void detect_workarounds()
 GLContext::unused_fb_slot_workaround = true;
 /* Turn off extensions. */
 GCaps.shader_image_load_store_support = false;
+GCaps.shader_storage_buffer_objects_support = false;
 GLContext::base_instance_support = false;
 GLContext::clear_texture_support = false;
 GLContext::copy_image_support = false;
@@ -419,6 +420,12 @@ static void detect_workarounds()
   strstr(renderer, "HD Graphics 4000")) {
 GLContext::generate_mipmap_workaround = true;
   }
+
+  /* Buggy interface query functions cause crashes when handling SSBOs 
(T93680) */
+  if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_ANY, GPU_DRIVER_ANY) &&
+(strstr(renderer, "HD Graphics 4400")|| strstr(renderer, "HD Graphics 
4600"))) {
+GCaps.shader_storage_buffer_objects_support = false;
+  }
 }  // namespace blender::gpu
 
 /** Internal capabilities. */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [1987c894e94] KTX_support: Merge branch 'master' into KTX_support

2022-01-24 Thread Antonis Ryakiotakis
Commit: 1987c894e947890c7e055cc033ef7c2c3434d2b2
Author: Antonis Ryakiotakis
Date:   Mon Jan 24 18:15:06 2022 +0100
Branches: KTX_support
https://developer.blender.org/rB1987c894e947890c7e055cc033ef7c2c3434d2b2

Merge branch 'master' into KTX_support

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [add07576a09] blender-v3.0-release: Mesh: Add versioning in 3.0 for vertex normal refactor

2022-01-24 Thread Hans Goudey
Commit: add07576a090186dde7858bcb6e68f9cf059f902
Author: Hans Goudey
Date:   Mon Jan 24 09:59:13 2022 -0600
Branches: blender-v3.0-release
https://developer.blender.org/rBadd07576a090186dde7858bcb6e68f9cf059f902

Mesh: Add versioning in 3.0 for vertex normal refactor

This tags all meshes from the future 3.1 version dirty,
since normals aren't "implicitly" read as part of `MVert`
anymore after rBcfa53e0fbeed7178.

Differential Revision: https://developer.blender.org/D13856

===

M   source/blender/blenloader/intern/versioning_300.c

===

diff --git a/source/blender/blenloader/intern/versioning_300.c 
b/source/blender/blenloader/intern/versioning_300.c
index 940a10a9e91..c9237a7325c 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -43,6 +43,7 @@
 #include "DNA_lineart_types.h"
 #include "DNA_listBase.h"
 #include "DNA_material_types.h"
+#include "DNA_mesh_types.h"
 #include "DNA_modifier_types.h"
 #include "DNA_text_types.h"
 #include "DNA_workspace_types.h"
@@ -2369,6 +2370,15 @@ void blo_do_versions_300(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
 }
   }
 
+  /* Mesh vertex normals are stored differently after 3.1 (see D12770). This 
causes an incorrect
+   * viewport display when smooth faces are loaded from the future version, so 
tag normals dirty
+   * on all meshes from future versions. */
+  if (!DNA_struct_elem_find(fd->filesdna, "MVert", "short", "no[3]")) {
+LISTBASE_FOREACH (Mesh *, mesh, >meshes) {
+  mesh->runtime.cd_dirty_vert |= CD_MASK_NORMAL;
+}
+  }
+
   /**
* Versioning code until next subversion bump goes here.
*

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [e673cfc2d70] master: Fix T95099: Have launcher wait for Blender exit

2022-01-24 Thread Jens Ehrhardt
Commit: e673cfc2d703da93e6df72fc657660b8235494e8
Author: Jens Ehrhardt
Date:   Mon Jan 24 08:43:38 2022 -0700
Branches: master
https://developer.blender.org/rBe673cfc2d703da93e6df72fc657660b8235494e8

Fix T95099: Have launcher wait for Blender exit

unity launches blender in background mode to do some
file conversions, ever since the launcher got introduced
this process broke.

The root cause here is: Unity looks up the default program
to launch .blend files with, which is now the launcher, then
launches it in background mode with a script to export the data.

The launcher however was designed to exit as quickly as
possible so there would not be an extra background process
lingering. It does not wait for blender to exit and does not
pass back any error codes.

This broke unity's workflow since it assumed if the process
exits and succeeds the data *must* be ready for reading which
no longer holds true.

This change keeps the launcher design as was previously,
*except* when launching in background mode, then it
waits and passes back any error codes, thus restoring
unity's workflow.

Differential Revision: https://developer.blender.org/D13894
Reviewed by: LazyDodo, Brecht

===

M   source/creator/blender_launcher_win32.c

===

diff --git a/source/creator/blender_launcher_win32.c 
b/source/creator/blender_launcher_win32.c
index 86b0f4f3b97..f19438ad907 100644
--- a/source/creator/blender_launcher_win32.c
+++ b/source/creator/blender_launcher_win32.c
@@ -79,7 +79,26 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE 
hPrevInstance, PWSTR pCmdLine
   BOOL success = CreateProcess(
   path, buffer, NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, 
, );
 
+  DWORD returnValue = success ? 0 : -1;
+
   if (success) {
+/* If blender-launcher is called with background command line flag,
+ * wait for the blender process to exit and return its return value. */
+BOOL background = FALSE;
+int argc = 0;
+LPWSTR *argv = CommandLineToArgvW(pCmdLine, );
+for (int i = 0; i < argc; i++) {
+  if ((wcscmp(argv[i], L"-b") == 0) || (wcscmp(argv[i], L"--background") 
== 0)) {
+background = TRUE;
+break;
+  }
+}
+
+if (background) {
+  WaitForSingleObject(procInfo.hProcess, INFINITE);
+  GetExitCodeProcess(procInfo.hProcess, );
+}
+
 /* Handles in PROCESS_INFORMATION must be closed with CloseHandle when 
they are no longer
  * needed - MSDN. Closing the handles will NOT terminate the 
thread/process that we just
  * started. */
@@ -88,5 +107,5 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE 
hPrevInstance, PWSTR pCmdLine
   }
 
   free(buffer);
-  return success ? 0 : -1;
+  return returnValue;
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [25fa5792e6e] master: Cleanup: Move the "toggle smooth brush" functionality to functions

2022-01-24 Thread Sebastian Parborg
Commit: 25fa5792e6edc339c77e75b59235a273b4e598f4
Author: Sebastian Parborg
Date:   Mon Jan 24 15:57:15 2022 +0100
Branches: master
https://developer.blender.org/rB25fa5792e6edc339c77e75b59235a273b4e598f4

Cleanup: Move the "toggle smooth brush" functionality to functions

This is so it will be easier to keep the logic to toggle on/off in sync
because they are declared close to eachother.

===

M   source/blender/editors/sculpt_paint/sculpt.c

===

diff --git a/source/blender/editors/sculpt_paint/sculpt.c 
b/source/blender/editors/sculpt_paint/sculpt.c
index 5ac13ebdd93..91e44a0b062 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -4028,13 +4028,71 @@ static void sculpt_init_mirror_clipping(Object *ob, 
SculptSession *ss)
   }
 }
 
+static void smooth_brush_toggle_on(const bContext *C, Paint *paint, 
StrokeCache *cache)
+{
+  Scene *scene = CTX_data_scene(C);
+  Brush *brush = paint->brush;
+
+  if (brush->sculpt_tool == SCULPT_TOOL_MASK) {
+cache->saved_mask_brush_tool = brush->mask_tool;
+brush->mask_tool = BRUSH_MASK_SMOOTH;
+  }
+  else if (ELEM(brush->sculpt_tool,
+SCULPT_TOOL_SLIDE_RELAX,
+SCULPT_TOOL_DRAW_FACE_SETS,
+SCULPT_TOOL_PAINT,
+SCULPT_TOOL_SMEAR)) {
+/* Do nothing, this tool has its own smooth mode. */
+  }
+  else {
+int cur_brush_size = BKE_brush_size_get(scene, brush);
+
+BLI_strncpy(cache->saved_active_brush_name,
+brush->id.name + 2,
+sizeof(cache->saved_active_brush_name));
+
+/* Switch to the smooth brush. */
+brush = BKE_paint_toolslots_brush_get(paint, SCULPT_TOOL_SMOOTH);
+if (brush) {
+  BKE_paint_brush_set(paint, brush);
+  cache->saved_smooth_size = BKE_brush_size_get(scene, brush);
+  BKE_brush_size_set(scene, brush, cur_brush_size);
+  BKE_curvemapping_init(brush->curve);
+}
+  }
+}
+
+static void smooth_brush_toggle_off(const bContext *C, Paint *paint, 
StrokeCache *cache)
+{
+  Main *bmain = CTX_data_main(C);
+  Scene *scene = CTX_data_scene(C);
+  Brush *brush = BKE_paint_brush(paint);
+
+  if (brush->sculpt_tool == SCULPT_TOOL_MASK) {
+brush->mask_tool = cache->saved_mask_brush_tool;
+  }
+  else if (ELEM(brush->sculpt_tool,
+SCULPT_TOOL_SLIDE_RELAX,
+SCULPT_TOOL_DRAW_FACE_SETS,
+SCULPT_TOOL_PAINT,
+SCULPT_TOOL_SMEAR)) {
+/* Do nothing. */
+  }
+  else {
+/* Try to switch back to the saved/previous brush. */
+BKE_brush_size_set(scene, brush, cache->saved_smooth_size);
+brush = (Brush *)BKE_libblock_find_name(bmain, ID_BR, 
cache->saved_active_brush_name);
+if (brush) {
+  BKE_paint_brush_set(paint, brush);
+}
+  }
+}
+
 /* Initialize the stroke cache invariants from operator properties. */
 static void sculpt_update_cache_invariants(
 bContext *C, Sculpt *sd, SculptSession *ss, wmOperator *op, const float 
mouse[2])
 {
   StrokeCache *cache = MEM_callocN(sizeof(StrokeCache), "stroke cache");
-  Main *bmain = CTX_data_main(C);
-  Scene *scene = CTX_data_scene(C);
   UnifiedPaintSettings *ups = 
_data_tool_settings(C)->unified_paint_settings;
   Brush *brush = BKE_paint_brush(>paint);
   ViewContext *vc = paint_stroke_view_context(op->customdata);
@@ -4099,35 +4157,9 @@ static void sculpt_update_cache_invariants(
 
   /* Alt-Smooth. */
   if (cache->alt_smooth) {
-if (brush->sculpt_tool == SCULPT_TOOL_MASK) {
-  cache->saved_mask_brush_tool = brush->mask_tool;
-  brush->mask_tool = BRUSH_MASK_SMOOTH;
-}
-else if (ELEM(brush->sculpt_tool,
-  SCULPT_TOOL_SLIDE_RELAX,
-  SCULPT_TOOL_DRAW_FACE_SETS,
-  SCULPT_TOOL_PAINT,
-  SCULPT_TOOL_SMEAR)) {
-  /* Do nothing, this tool has its own smooth mode. */
-}
-else {
-  Paint *p = >paint;
-  Brush *br;
-  int size = BKE_brush_size_get(scene, brush);
-
-  BLI_strncpy(cache->saved_active_brush_name,
-  brush->id.name + 2,
-  sizeof(cache->saved_active_brush_name));
-
-  br = (Brush *)BKE_libblock_find_name(bmain, ID_BR, "Smooth");
-  if (br) {
-BKE_paint_brush_set(p, br);
-brush = br;
-cache->saved_smooth_size = BKE_brush_size_get(scene, brush);
-BKE_brush_size_set(scene, brush, size);
-BKE_curvemapping_init(brush->curve);
-  }
-}
+smooth_brush_toggle_on(C, >paint, cache);
+/* Refresh the brush pointer in case we switched brush in the toggle 
function. */
+brush = BKE_paint_brush(>paint);
   }
 
   copy_v2_v2(cache->mouse, cache->initial_mouse);
@@ -4135,9 +4167,7 @@ static void sculpt_update_cache_invariants(
   copy_v2_v2(ups->tex_mouse, cache->initial_mouse);
 
   /* Truly temporary data 

[Bf-blender-cvs] [a215d7e230d] master: Hook up invert and smooth mode to weight and vertex paint

2022-01-24 Thread Sebastian Parborg
Commit: a215d7e230d3286abbed0108a46359ce57104bc1
Author: Sebastian Parborg
Date:   Mon Jan 24 15:10:25 2022 +0100
Branches: master
https://developer.blender.org/rBa215d7e230d3286abbed0108a46359ce57104bc1

Hook up invert and smooth mode to weight and vertex paint

Previously weight paint wasn't hooked up to the "Smooth" and "Invert" modes.
With this patch it is not possible to use the "Smooth" and "Invert"
modifiers for the draw keybindings.

Reviewed By: Campbell Barton

Differential Revision: http://developer.blender.org/D13857

===

M   source/blender/editors/sculpt_paint/paint_vertex.c
M   source/blender/makesdna/DNA_brush_enums.h

===

diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c 
b/source/blender/editors/sculpt_paint/paint_vertex.c
index df323baa2a9..75d4237d157 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -32,6 +32,7 @@
 #include "BLI_listbase.h"
 #include "BLI_math.h"
 #include "BLI_rect.h"
+#include "BLI_string.h"
 #include "BLI_task.h"
 
 #include "DNA_brush_types.h"
@@ -43,9 +44,11 @@
 #include "RNA_access.h"
 
 #include "BKE_brush.h"
+#include "BKE_colortools.h"
 #include "BKE_context.h"
 #include "BKE_deform.h"
 #include "BKE_layer.h"
+#include "BKE_lib_id.h"
 #include "BKE_main.h"
 #include "BKE_mesh.h"
 #include "BKE_mesh_mapping.h"
@@ -1470,14 +1473,48 @@ struct WPaintData {
   bool precomputed_weight_ready;
 };
 
+static void smooth_brush_toggle_on(const bContext *C, Paint *paint, 
StrokeCache *cache)
+{
+  Scene *scene = CTX_data_scene(C);
+  Brush *brush = paint->brush;
+  int cur_brush_size = BKE_brush_size_get(scene, brush);
+
+  BLI_strncpy(
+  cache->saved_active_brush_name, brush->id.name + 2, 
sizeof(cache->saved_active_brush_name));
+
+  /* Switch to the blur (smooth) brush. */
+  brush = BKE_paint_toolslots_brush_get(paint, WPAINT_TOOL_BLUR);
+  if (brush) {
+BKE_paint_brush_set(paint, brush);
+cache->saved_smooth_size = BKE_brush_size_get(scene, brush);
+BKE_brush_size_set(scene, brush, cur_brush_size);
+BKE_curvemapping_init(brush->curve);
+  }
+}
+
+static void smooth_brush_toggle_off(const bContext *C, Paint *paint, 
StrokeCache *cache)
+{
+  Main *bmain = CTX_data_main(C);
+  Scene *scene = CTX_data_scene(C);
+  Brush *brush = BKE_paint_brush(paint);
+  /* The current brush should match with what we have stored in the cache. */
+  BLI_assert(brush == cache->brush);
+
+  /* Try to switch back to the saved/previous brush. */
+  BKE_brush_size_set(scene, brush, cache->saved_smooth_size);
+  brush = (Brush *)BKE_libblock_find_name(bmain, ID_BR, 
cache->saved_active_brush_name);
+  if (brush) {
+BKE_paint_brush_set(paint, brush);
+  }
+}
+
 /* Initialize the stroke cache invariants from operator properties */
 static void vwpaint_update_cache_invariants(
-bContext *C, const VPaint *vp, SculptSession *ss, wmOperator *op, const 
float mouse[2])
+bContext *C, VPaint *vp, SculptSession *ss, wmOperator *op, const float 
mouse[2])
 {
   StrokeCache *cache;
   Scene *scene = CTX_data_scene(C);
   UnifiedPaintSettings *ups = 
_data_tool_settings(C)->unified_paint_settings;
-  const Brush *brush = vp->paint.brush;
   ViewContext *vc = paint_stroke_view_context(op->customdata);
   Object *ob = CTX_data_active_object(C);
   float mat[3][3];
@@ -1513,7 +1550,12 @@ static void vwpaint_update_cache_invariants(
 ups->draw_inverted = false;
   }
 
+  if (cache->alt_smooth) {
+smooth_brush_toggle_on(C, >paint, cache);
+  }
+
   copy_v2_v2(cache->mouse, cache->initial_mouse);
+  Brush *brush = vp->paint.brush;
   /* Truly temporary data that isn't stored in properties */
   cache->vc = vc;
   cache->brush = brush;
@@ -1715,15 +1757,15 @@ static bool wpaint_stroke_test_start(bContext *C, 
wmOperator *op, const float mo
 wpd->mirror.lock = tmpflags;
   }
 
-  if (ELEM(vp->paint.brush->weightpaint_tool, WPAINT_TOOL_SMEAR, 
WPAINT_TOOL_BLUR)) {
-wpd->precomputed_weight = MEM_mallocN(sizeof(float) * me->totvert, 
__func__);
-  }
-
   /* If not previously created, create vertex/weight paint mode session data */
   vertex_paint_init_stroke(depsgraph, ob);
   vwpaint_update_cache_invariants(C, vp, ss, op, mouse);
   vertex_paint_init_session_data(ts, ob);
 
+  if (ELEM(vp->paint.brush->weightpaint_tool, WPAINT_TOOL_SMEAR, 
WPAINT_TOOL_BLUR)) {
+wpd->precomputed_weight = MEM_mallocN(sizeof(float) * me->totvert, 
__func__);
+  }
+
   if (ob->sculpt->mode.wpaint.dvert_prev != NULL) {
 MDeformVert *dv = ob->sculpt->mode.wpaint.dvert_prev;
 for (int i = 0; i < me->totvert; i++, dv++) {
@@ -2395,7 +2437,7 @@ static void wpaint_stroke_update_step(bContext *C, struct 
PaintStroke *stroke, P
   wpi.vgroup_validmap = wpd->vgroup_validmap;
   wpi.vgroup_locked = wpd->vgroup_locked;
   wpi.vgroup_unlocked = wpd->vgroup_unlocked;

[Bf-blender-cvs] [0928fe87102] master: Fix T94651: Cycles error with pointcloud vector attribute

2022-01-24 Thread Brecht Van Lommel
Commit: 0928fe8710291c4eec1e62fa06c06fc193252ae4
Author: Brecht Van Lommel
Date:   Mon Jan 24 15:53:48 2022 +0100
Branches: master
https://developer.blender.org/rB0928fe8710291c4eec1e62fa06c06fc193252ae4

Fix T94651: Cycles error with pointcloud vector attribute

===

M   intern/cycles/kernel/geom/point.h

===

diff --git a/intern/cycles/kernel/geom/point.h 
b/intern/cycles/kernel/geom/point.h
index 52a1e77d71a..23764d49095 100644
--- a/intern/cycles/kernel/geom/point.h
+++ b/intern/cycles/kernel/geom/point.h
@@ -81,7 +81,7 @@ ccl_device float3 point_attribute_float3(KernelGlobals kg,
 #  endif
 
   if (desc.element == ATTR_ELEMENT_VERTEX) {
-return float4_to_float3(kernel_tex_fetch(__attributes_float4, desc.offset 
+ sd->prim));
+return kernel_tex_fetch(__attributes_float3, desc.offset + sd->prim);
   }
   else {
 return make_float3(0.0f, 0.0f, 0.0f);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [796ef560b48] master: Fix `Image.gl_touch` not loading image.

2022-01-24 Thread Jeroen Bakker
Commit: 796ef560b48cec5e22d4bb562ce695ad7a91e321
Author: Jeroen Bakker
Date:   Mon Jan 24 15:32:04 2022 +0100
Branches: master
https://developer.blender.org/rB796ef560b48cec5e22d4bb562ce695ad7a91e321

Fix `Image.gl_touch` not loading image.

Same fix as for {rBc09f61a9157ddee0e186db52fb7ac0f4cdae09da}

===

M   source/blender/makesrna/intern/rna_image_api.c

===

diff --git a/source/blender/makesrna/intern/rna_image_api.c 
b/source/blender/makesrna/intern/rna_image_api.c
index 7d2697c8770..1c04805be8b 100644
--- a/source/blender/makesrna/intern/rna_image_api.c
+++ b/source/blender/makesrna/intern/rna_image_api.c
@@ -243,7 +243,7 @@ static int rna_Image_gl_touch(
 
   BKE_image_tag_time(image);
 
-  if (image->gputexture[TEXTARGET_2D][0] == NULL) {
+  if (image->gputexture[TEXTARGET_2D][0][IMA_TEXTURE_RESOLUTION_FULL] == NULL) 
{
 error = rna_Image_gl_load(image, reports, frame, layer_index, pass_index);
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [578baf95e0e] master: Cleanup: Remove unused enum

2022-01-24 Thread Germano Cavalcante
Commit: 578baf95e0ec1e3e6c12eb286cfc04f6fa5ec2f6
Author: Germano Cavalcante
Date:   Mon Jan 24 10:00:02 2022 -0300
Branches: master
https://developer.blender.org/rB578baf95e0ec1e3e6c12eb286cfc04f6fa5ec2f6

Cleanup: Remove unused enum

The `SCULPT_TRANSFORM_DISPLACEMENT_INCREMENTAL` value is not actually
being used.

Keeping it in the code only complicates its readability.

===

M   source/blender/blenkernel/BKE_paint.h
M   source/blender/editors/sculpt_paint/sculpt_intern.h
M   source/blender/editors/sculpt_paint/sculpt_transform.c

===

diff --git a/source/blender/blenkernel/BKE_paint.h 
b/source/blender/blenkernel/BKE_paint.h
index 89e794cd2fc..4019c4d62c4 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -617,10 +617,6 @@ typedef struct SculptSession {
   float init_pivot_rot[4];
   float init_pivot_scale[3];
 
-  float prev_pivot_pos[3];
-  float prev_pivot_rot[4];
-  float prev_pivot_scale[3];
-
   union {
 struct {
   struct SculptVertexPaintGeomMap gmap;
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h 
b/source/blender/editors/sculpt_paint/sculpt_intern.h
index f84380b4f64..8de9fa3763b 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -376,14 +376,6 @@ typedef enum SculptFilterOrientation {
   SCULPT_FILTER_ORIENTATION_VIEW = 2,
 } SculptFilterOrientation;
 
-/* Defines how transform tools are going to apply its displacement. */
-typedef enum SculptTransformDisplacementMode {
-  /* Displaces the elements from their original coordinates. */
-  SCULPT_TRANSFORM_DISPLACEMENT_ORIGINAL = 0,
-  /* Displaces the elements incrementally from their previous position. */
-  SCULPT_TRANSFORM_DISPLACEMENT_INCREMENTAL = 1,
-} SculptTransformDisplacementMode;
-
 #define SCULPT_CLAY_STABILIZER_LEN 10
 
 typedef struct AutomaskingSettings {
@@ -452,9 +444,6 @@ typedef struct FilterCache {
 
   int active_face_set;
 
-  /* Transform. */
-  SculptTransformDisplacementMode transform_displacement_mode;
-
   /* Auto-masking. */
   AutomaskingCache *automasking;
 } FilterCache;
diff --git a/source/blender/editors/sculpt_paint/sculpt_transform.c 
b/source/blender/editors/sculpt_paint/sculpt_transform.c
index bfbe545d1ef..b91e05f226e 100644
--- a/source/blender/editors/sculpt_paint/sculpt_transform.c
+++ b/source/blender/editors/sculpt_paint/sculpt_transform.c
@@ -70,10 +70,6 @@ void ED_sculpt_init_transform(struct bContext *C, Object *ob)
   copy_v4_v4(ss->init_pivot_rot, ss->pivot_rot);
   copy_v3_v3(ss->init_pivot_scale, ss->pivot_scale);
 
-  copy_v3_v3(ss->prev_pivot_pos, ss->pivot_pos);
-  copy_v4_v4(ss->prev_pivot_rot, ss->pivot_rot);
-  copy_v3_v3(ss->prev_pivot_scale, ss->pivot_scale);
-
   SCULPT_undo_push_begin(ob, "Transform");
   BKE_sculpt_update_object_for_edit(depsgraph, ob, false, false, false);
 
@@ -81,13 +77,10 @@ void ED_sculpt_init_transform(struct bContext *C, Object 
*ob)
 
   SCULPT_vertex_random_access_ensure(ss);
   SCULPT_filter_cache_init(C, ob, sd, SCULPT_UNDO_COORDS);
-
-  ss->filter_cache->transform_displacement_mode = 
SCULPT_TRANSFORM_DISPLACEMENT_ORIGINAL;
 }
 
 static void sculpt_transform_matrices_init(SculptSession *ss,
const char symm,
-   const 
SculptTransformDisplacementMode t_mode,
float r_transform_mats[8][4][4])
 {
 
@@ -96,18 +89,9 @@ static void sculpt_transform_matrices_init(SculptSession *ss,
   transform_mat[4][4];
 
   float start_pivot_pos[3], start_pivot_rot[4], start_pivot_scale[3];
-  switch (t_mode) {
-case SCULPT_TRANSFORM_DISPLACEMENT_ORIGINAL:
-  copy_v3_v3(start_pivot_pos, ss->init_pivot_pos);
-  copy_v4_v4(start_pivot_rot, ss->init_pivot_rot);
-  copy_v3_v3(start_pivot_scale, ss->init_pivot_scale);
-  break;
-case SCULPT_TRANSFORM_DISPLACEMENT_INCREMENTAL:
-  copy_v3_v3(start_pivot_pos, ss->prev_pivot_pos);
-  copy_v4_v4(start_pivot_rot, ss->prev_pivot_rot);
-  copy_v3_v3(start_pivot_scale, ss->prev_pivot_scale);
-  break;
-  }
+  copy_v3_v3(start_pivot_pos, ss->init_pivot_pos);
+  copy_v4_v4(start_pivot_rot, ss->init_pivot_rot);
+  copy_v3_v3(start_pivot_scale, ss->init_pivot_scale);
 
   for (int i = 0; i < PAINT_SYMM_AREAS; i++) {
 ePaintSymmetryAreas v_symm = i;
@@ -167,25 +151,15 @@ static void sculpt_transform_task_cb(void *__restrict 
userdata,
   BKE_pbvh_vertex_iter_begin (ss->pbvh, node, vd, PBVH_ITER_UNIQUE) {
 SCULPT_orig_vert_data_update(_data, );
 float transformed_co[3], orig_co[3], disp[3];
-float *start_co;
 float fade = vd.mask ? *vd.mask : 0.0f;
 copy_v3_v3(orig_co, orig_data.co);
 char symm_area = SCULPT_get_vertex_symm_area(orig_co);
 
-switch 

[Bf-blender-cvs] [43a4948e6d0] temp-T94185-id-remapper-ui: Remove confusing name _old(

2022-01-24 Thread Jeroen Bakker
Commit: 43a4948e6d08fb1c03197d261cddc2dcff0ba0f0
Author: Jeroen Bakker
Date:   Mon Jan 24 12:28:38 2022 +0100
Branches: temp-T94185-id-remapper-ui
https://developer.blender.org/rB43a4948e6d08fb1c03197d261cddc2dcff0ba0f0

Remove confusing name _old(

===

M   source/blender/editors/include/ED_util.h
M   source/blender/editors/util/ed_util.c
M   source/blender/windowmanager/intern/wm_init_exit.c

===

diff --git a/source/blender/editors/include/ED_util.h 
b/source/blender/editors/include/ED_util.h
index 051971a8aa5..4e794838b2f 100644
--- a/source/blender/editors/include/ED_util.h
+++ b/source/blender/editors/include/ED_util.h
@@ -61,7 +61,7 @@ bool ED_editors_flush_edits(struct Main *bmain);
  *
  * \param new_id: may be NULL to unlink \a old_id.
  */
-void ED_spacedata_id_remap_old(struct ScrArea *area,
+void ED_spacedata_id_remap_single(struct ScrArea *area,
struct SpaceLink *sl,
struct ID *old_id,
struct ID *new_id);
diff --git a/source/blender/editors/util/ed_util.c 
b/source/blender/editors/util/ed_util.c
index a8fe52355c9..0320a2a9a1a 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -445,7 +445,10 @@ void ED_spacedata_id_remap(struct ScrArea *area,
   }
 }
 
-void ED_spacedata_id_remap_old(struct ScrArea *area, struct SpaceLink *sl, ID 
*old_id, ID *new_id)
+void ED_spacedata_id_remap_single(struct ScrArea *area,
+  struct SpaceLink *sl,
+  ID *old_id,
+  ID *new_id)
 {
   SpaceType *st = BKE_spacetype_from_id(sl->spacetype);
 
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c 
b/source/blender/windowmanager/intern/wm_init_exit.c
index bd1c6fcce64..6caac79c4d5 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -252,7 +252,7 @@ void WM_init(bContext *C, int argc, const char **argv)
   BKE_region_callback_free_gizmomap_set(wm_gizmomap_remove);
   BKE_region_callback_refresh_tag_gizmomap_set(WM_gizmomap_tag_refresh);
   
BKE_library_callback_remap_editor_id_reference_set(WM_main_remap_editor_id_reference);
-  BKE_spacedata_callback_id_remap_set(ED_spacedata_id_remap_old);
+  BKE_spacedata_callback_id_remap_set(ED_spacedata_id_remap_single);
   DEG_editors_set_update_cb(ED_render_id_flush_update, ED_render_scene_update);
 
   ED_spacetypes_init();

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [626db356a62] temp-T94185-id-remapper-ui: Performance: Remap multiple items in UI

2022-01-24 Thread Jeroen Bakker
Commit: 626db356a62d9c71179cb54c03b148a551ec5940
Author: Jeroen Bakker
Date:   Mon Jan 24 09:57:53 2022 +0100
Branches: temp-T94185-id-remapper-ui
https://developer.blender.org/rB626db356a62d9c71179cb54c03b148a551ec5940

Performance: Remap multiple items in UI

iDuring sprite fright loading of complex scenes would spend a long time in 
remapping ID's
The remapping process is done on a per ID instance that resulted in a very time 
consuming
process that goes over every possible ID reference to find out if it needs to 
be updated.

If there are N of references to ID blocks and there are M ID blocks that needed 
to be remapped
it would take N*M checks. These checks are scattered around the place and 
memory.
Each reference would only be updated at most once, but most of the time no 
update is needed at all.

Idea: By grouping the changes together will reduce the number of checks 
resulting in improved performance.
This would only require N checks. Additional benefits is improved data locality 
as data is only loaded once
in the L2 cache.

It has be implemented for the resyncing process and UI editors.
On an Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz 16Gig the resyncing process went
from 170 seconds to 145 seconds (during hotspot recording).

After this patch has been applied we could add similar approach
to references (references between data blocks) and functionality (tagged 
deletion).
In my understanding this could reduce the resyncing process to less than a 
second.
Opening the village production file between 10 and 20 seconds.

Flame graphs showing that UI remapping isn't visible anymore 
(`WM_main_remap_editor_id_reference`)
* Master {F12769210 size=full}
* This patch {F12769211 size=full}

===

M   source/blender/blenkernel/intern/lib_id_delete.c

===

diff --git a/source/blender/blenkernel/intern/lib_id_delete.c 
b/source/blender/blenkernel/intern/lib_id_delete.c
index a1d6fa232ed..f4dd67cac28 100644
--- a/source/blender/blenkernel/intern/lib_id_delete.c
+++ b/source/blender/blenkernel/intern/lib_id_delete.c
@@ -326,6 +326,7 @@ static size_t id_delete(Main *bmain, const bool 
do_tagged_deletion)
   ID_REMAP_FORCE_NEVER_NULL_USAGE |
   
ID_REMAP_FORCE_INTERNAL_RUNTIME_POINTERS));
 }
+BKE_id_remapper_free(remapper);
   }
 
   BKE_main_unlock(bmain);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [4b1f243e4d7] master: Cleanup: sort struct forward declarations

2022-01-24 Thread Campbell Barton
Commit: 4b1f243e4d76dc9b3e92a8c2bf43414bcda4b2c3
Author: Campbell Barton
Date:   Mon Jan 24 21:16:06 2022 +1100
Branches: master
https://developer.blender.org/rB4b1f243e4d76dc9b3e92a8c2bf43414bcda4b2c3

Cleanup: sort struct forward declarations

===

M   source/blender/blenkernel/BKE_blendfile_link_append.h
M   source/blender/blenkernel/BKE_curve_to_mesh.hh
M   source/blender/blenkernel/BKE_duplilist.h
M   source/blender/blenkernel/BKE_idtype.h
M   source/blender/blenkernel/BKE_node_tree_update.h
M   source/blender/blenkernel/BKE_shrinkwrap.h
M   source/blender/blenkernel/BKE_subdiv_eval.h
M   source/blender/depsgraph/intern/builder/deg_builder_relations.h
M   source/blender/draw/intern/draw_common.h
M   source/blender/draw/intern/draw_view_data.h
M   source/blender/editors/asset/ED_asset_catalog.h
M   source/blender/editors/asset/ED_asset_mark_clear.h
M   source/blender/editors/include/ED_image.h
M   source/blender/editors/include/UI_interface.hh
M   source/blender/editors/include/UI_tree_view.hh
M   source/blender/editors/space_file/file_intern.h
M   source/blender/editors/space_node/node_context_path.cc
M   source/blender/editors/space_outliner/tree/tree_display.hh
M   source/blender/editors/space_sequencer/sequencer_intern.h
M   source/blender/editors/space_spreadsheet/spreadsheet_intern.hh
M   source/blender/gpu/GPU_viewport.h
M   source/blender/makesdna/DNA_node_types.h
M   source/blender/render/RE_bake.h
M   source/blender/render/RE_texture_margin.h
M   source/blender/sequencer/SEQ_utils.h
M   source/blender/sequencer/intern/utils.h

===

diff --git a/source/blender/blenkernel/BKE_blendfile_link_append.h 
b/source/blender/blenkernel/BKE_blendfile_link_append.h
index e55a2d15dcc..983c93223a1 100644
--- a/source/blender/blenkernel/BKE_blendfile_link_append.h
+++ b/source/blender/blenkernel/BKE_blendfile_link_append.h
@@ -30,8 +30,8 @@ struct LibraryLink_Params;
 struct Main;
 struct ReportList;
 struct Scene;
-struct ViewLayer;
 struct View3D;
+struct ViewLayer;
 
 typedef struct BlendfileLinkAppendContext BlendfileLinkAppendContext;
 typedef struct BlendfileLinkAppendContextItem BlendfileLinkAppendContextItem;
diff --git a/source/blender/blenkernel/BKE_curve_to_mesh.hh 
b/source/blender/blenkernel/BKE_curve_to_mesh.hh
index cf5c8b87ede..10649e8703f 100644
--- a/source/blender/blenkernel/BKE_curve_to_mesh.hh
+++ b/source/blender/blenkernel/BKE_curve_to_mesh.hh
@@ -16,8 +16,8 @@
 
 #pragma once
 
-struct Mesh;
 struct CurveEval;
+struct Mesh;
 
 /** \file
  * \ingroup bke
diff --git a/source/blender/blenkernel/BKE_duplilist.h 
b/source/blender/blenkernel/BKE_duplilist.h
index 5eff84b8c9e..303a83d921f 100644
--- a/source/blender/blenkernel/BKE_duplilist.h
+++ b/source/blender/blenkernel/BKE_duplilist.h
@@ -27,11 +27,11 @@ extern "C" {
 #endif
 
 struct Depsgraph;
+struct ID;
 struct ListBase;
 struct Object;
 struct ParticleSystem;
 struct Scene;
-struct ID;
 
 /*  */
 /* Dupli-Geometry */
diff --git a/source/blender/blenkernel/BKE_idtype.h 
b/source/blender/blenkernel/BKE_idtype.h
index f83675fbb7e..df50f773a46 100644
--- a/source/blender/blenkernel/BKE_idtype.h
+++ b/source/blender/blenkernel/BKE_idtype.h
@@ -31,11 +31,11 @@
 extern "C" {
 #endif
 
+struct BPathForeachPathData;
 struct BlendDataReader;
 struct BlendExpander;
 struct BlendLibReader;
 struct BlendWriter;
-struct BPathForeachPathData;
 struct ID;
 struct LibraryForeachIDData;
 struct Main;
diff --git a/source/blender/blenkernel/BKE_node_tree_update.h 
b/source/blender/blenkernel/BKE_node_tree_update.h
index f77bd83a8ef..443ceafb073 100644
--- a/source/blender/blenkernel/BKE_node_tree_update.h
+++ b/source/blender/blenkernel/BKE_node_tree_update.h
@@ -20,12 +20,12 @@
  * \ingroup bke
  */
 
+struct ID;
+struct Main;
 struct bNode;
+struct bNodeLink;
 struct bNodeSocket;
 struct bNodeTree;
-struct bNodeLink;
-struct Main;
-struct ID;
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h 
b/source/blender/blenkernel/BKE_shrinkwrap.h
index 510d6773f6d..ea816812344 100644
--- a/source/blender/blenkernel/BKE_shrinkwrap.h
+++ b/source/blender/blenkernel/BKE_shrinkwrap.h
@@ -47,8 +47,8 @@ struct MDeformVert;
 struct Mesh;
 struct ModifierEvalContext;
 struct Object;
-struct ShrinkwrapModifierData;
 struct ShrinkwrapGpencilModifierData;
+struct ShrinkwrapModifierData;
 struct SpaceTransform;
 
 /* Information about boundary edges in the mesh. */
diff --git a/source/blender/blenkernel/BKE_subdiv_eval.h 
b/source/blender/blenkernel/BKE_subdiv_eval.h
index 2eb64ae795d..23bcdcce276 100644
--- a/source/blender/blenkernel/BKE_subdiv_eval.h
+++ b/source/blender/blenkernel/BKE_subdiv_eval.h
@@ -30,8 +30,8 @@ extern "C" {
 #endif
 
 

[Bf-blender-cvs] [7708a848c96] master: Cleanup: sort cmake file lists

2022-01-24 Thread Campbell Barton
Commit: 7708a848c96915425b37db937478b4ecd227fc0d
Author: Campbell Barton
Date:   Mon Jan 24 21:23:30 2022 +1100
Branches: master
https://developer.blender.org/rB7708a848c96915425b37db937478b4ecd227fc0d

Cleanup: sort cmake file lists

===

M   source/blender/blenlib/CMakeLists.txt
M   source/blender/compositor/CMakeLists.txt
M   source/blender/draw/CMakeLists.txt
M   source/blender/gpu/CMakeLists.txt
M   source/blender/nodes/composite/CMakeLists.txt

===

diff --git a/source/blender/blenlib/CMakeLists.txt 
b/source/blender/blenlib/CMakeLists.txt
index 90c6760019a..e9446f36c83 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -252,9 +252,9 @@ set(SRC
   BLI_math_solvers.h
   BLI_math_statistics.h
   BLI_math_time.h
-  BLI_math_vector.h
-  BLI_math_vec_types.hh
   BLI_math_vec_mpq_types.hh
+  BLI_math_vec_types.hh
+  BLI_math_vector.h
   BLI_memarena.h
   BLI_memblock.h
   BLI_memiter.h
diff --git a/source/blender/compositor/CMakeLists.txt 
b/source/blender/compositor/CMakeLists.txt
index d5d8154d7ee..b9b365a3175 100644
--- a/source/blender/compositor/CMakeLists.txt
+++ b/source/blender/compositor/CMakeLists.txt
@@ -38,8 +38,8 @@ set(INC
   ../render/intern
   ../../../extern/clew/include
   ../../../intern/atomic
-  ../../../intern/guardedalloc
   ../../../intern/clog
+  ../../../intern/guardedalloc
 
   # dna_type_offsets.h
   ${CMAKE_CURRENT_BINARY_DIR}/../makesdna/intern
@@ -140,6 +140,8 @@ set(SRC
   nodes/COM_OutputFileNode.h
   nodes/COM_RenderLayersNode.cc
   nodes/COM_RenderLayersNode.h
+  nodes/COM_SceneTimeNode.cc
+  nodes/COM_SceneTimeNode.h
   nodes/COM_SwitchNode.cc
   nodes/COM_SwitchNode.h
   nodes/COM_SwitchViewNode.cc
@@ -150,8 +152,6 @@ set(SRC
   nodes/COM_TimeNode.h
   nodes/COM_ValueNode.cc
   nodes/COM_ValueNode.h
-  nodes/COM_SceneTimeNode.cc
-  nodes/COM_SceneTimeNode.h
 
   # output nodes
   nodes/COM_CompositorNode.cc
@@ -573,10 +573,10 @@ set(SRC
   operations/COM_IDMaskOperation.cc
   operations/COM_IDMaskOperation.h
 
-  operations/COM_DotproductOperation.cc
-  operations/COM_DotproductOperation.h
   operations/COM_ConvertColorSpaceOperation.cc
   operations/COM_ConvertColorSpaceOperation.h
+  operations/COM_DotproductOperation.cc
+  operations/COM_DotproductOperation.h
 
   # Matte operation
   operations/COM_BoxMaskOperation.cc
diff --git a/source/blender/draw/CMakeLists.txt 
b/source/blender/draw/CMakeLists.txt
index 8dd7e3d7dbf..f0e2e2bafd1 100644
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@ -212,8 +212,8 @@ set(SRC
   intern/draw_manager_profiling.h
   intern/draw_manager_testing.h
   intern/draw_manager_text.h
-  intern/draw_shader_shared.h
   intern/draw_shader.h
+  intern/draw_shader_shared.h
   intern/draw_subdivision.h
   intern/draw_texture_pool.h
   intern/draw_view.h
diff --git a/source/blender/gpu/CMakeLists.txt 
b/source/blender/gpu/CMakeLists.txt
index bb7e9e8b26f..4bb66b78dd0 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -404,40 +404,40 @@ set(SHADER_CREATE_INFOS
 #../draw/engines/workbench/shaders/workbench_effect_cavity_info.hh
 #../draw/engines/workbench/shaders/workbench_prepass_info.hh
 ../draw/intern/shaders/draw_fullscreen_info.hh
-../draw/intern/shaders/draw_view_info.hh
 ../draw/intern/shaders/draw_object_infos_info.hh
+../draw/intern/shaders/draw_view_info.hh
 
 shaders/infos/gpu_clip_planes_info.hh
-shaders/infos/gpu_srgb_to_framebuffer_space_info.hh
-shaders/infos/gpu_shader_3D_image_modulate_alpha_info.hh
+shaders/infos/gpu_shader_2D_area_borders_info.hh
 shaders/infos/gpu_shader_2D_checker_info.hh
 shaders/infos/gpu_shader_2D_diag_stripes_info.hh
-shaders/infos/gpu_shader_2D_uniform_color_info.hh
 shaders/infos/gpu_shader_2D_flat_color_info.hh
-shaders/infos/gpu_shader_2D_smooth_color_info.hh
-shaders/infos/gpu_shader_2D_image_overlays_merge_info.hh
-shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh
-shaders/infos/gpu_shader_2D_image_info.hh
 shaders/infos/gpu_shader_2D_image_color_info.hh
 shaders/infos/gpu_shader_2D_image_desaturate_color_info.hh
-shaders/infos/gpu_shader_2D_image_shuffle_color_info.hh
+shaders/infos/gpu_shader_2D_image_info.hh
+shaders/infos/gpu_shader_2D_image_multi_rect_color_info.hh
+shaders/infos/gpu_shader_2D_image_overlays_merge_info.hh
+shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh
 shaders/infos/gpu_shader_2D_image_rect_color_info.hh
-shaders/infos/gpu_shader_text_info.hh
-shaders/infos/gpu_shader_keyframe_shape_info.hh
-shaders/infos/gpu_shader_3D_flat_color_info.hh
-shaders/infos/gpu_shader_3D_uniform_color_info.hh
-shaders/infos/gpu_shader_3D_smooth_color_info.hh
-shaders/infos/gpu_shader_3D_depth_only_info.hh
-shaders/infos/gpu_shader_2D_point_varying_size_varying_color_info.hh

[Bf-blender-cvs] [f9b6a257bd0] master: Cleanup: clang-format

2022-01-24 Thread Campbell Barton
Commit: f9b6a257bd054cb4ade2c2f84f3707a9bd4896f2
Author: Campbell Barton
Date:   Mon Jan 24 21:15:25 2022 +1100
Branches: master
https://developer.blender.org/rBf9b6a257bd054cb4ade2c2f84f3707a9bd4896f2

Cleanup: clang-format

===

M   build_files/build_environment/cmake/versions.cmake
M   source/blender/editors/space_node/node_select.cc
M   source/blender/editors/transform/transform_convert_mesh.c
M   source/blender/makesdna/DNA_space_types.h

===

diff --git a/build_files/build_environment/cmake/versions.cmake 
b/build_files/build_environment/cmake/versions.cmake
index cc811cef06f..7abde5e5fc3 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -506,4 +506,3 @@ set(BROTLI_URI 
https://github.com/google/brotli/archive/refs/tags/${BROTLI_VERSI
 set(BROTLI_HASH 
f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46)
 set(BROTLI_HASH_TYPE SHA256)
 set(BROTLI_FILE brotli-${BROTLI_VERSION}.tar.gz)
-
diff --git a/source/blender/editors/space_node/node_select.cc 
b/source/blender/editors/space_node/node_select.cc
index 46b9bd3de53..2751a53e8af 100644
--- a/source/blender/editors/space_node/node_select.cc
+++ b/source/blender/editors/space_node/node_select.cc
@@ -1310,4 +1310,4 @@ void NODE_OT_find_node(wmOperatorType *ot)
 
 /** \} */
 
-}
+}  // namespace blender::ed::space_node
diff --git a/source/blender/editors/transform/transform_convert_mesh.c 
b/source/blender/editors/transform/transform_convert_mesh.c
index 55f2bfd37db..e00522f0f88 100644
--- a/source/blender/editors/transform/transform_convert_mesh.c
+++ b/source/blender/editors/transform/transform_convert_mesh.c
@@ -1650,7 +1650,7 @@ void createTransEditVerts(TransInfo *t)
   else if (prop_mode || BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
 float *bweight = (cd_vert_bweight_offset != -1) ?
  BM_ELEM_CD_GET_VOID_P(eve, 
cd_vert_bweight_offset) :
- (cd_vert_crease_offset != -1) ?
+ (cd_vert_crease_offset != -1) ?
  BM_ELEM_CD_GET_VOID_P(eve, cd_vert_crease_offset) 
:
  NULL;
 
diff --git a/source/blender/makesdna/DNA_space_types.h 
b/source/blender/makesdna/DNA_space_types.h
index af2e21a90bb..4e12f135242 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -68,7 +68,7 @@ typedef struct SpaceProperties_Runtime 
SpaceProperties_Runtime;
 #ifdef __cplusplus
 namespace blender::ed::space_node {
 struct SpaceNode_Runtime;
-}  // namespace blender::nodes
+}  // namespace blender::ed::space_node
 using SpaceNode_Runtime = blender::ed::space_node::SpaceNode_Runtime;
 #else
 typedef struct SpaceNode_Runtime SpaceNode_Runtime;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [91a571c26ad] asset-greasepencil: Merge branch 'master' into asset-greasepencil

2022-01-24 Thread Antonio Vazquez
Commit: 91a571c26adca169f33e9cb39b6633b2a253bf58
Author: Antonio Vazquez
Date:   Mon Jan 24 10:48:43 2022 +0100
Branches: asset-greasepencil
https://developer.blender.org/rB91a571c26adca169f33e9cb39b6633b2a253bf58

Merge branch 'master' into asset-greasepencil

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8a2dabcc011] temp-T94185-id-remapper-ui: Performance: Remap multiple items in UI

2022-01-24 Thread Jeroen Bakker
Commit: 8a2dabcc011df82375a8a721eea4610ab5a40f3f
Author: Jeroen Bakker
Date:   Mon Jan 24 09:57:53 2022 +0100
Branches: temp-T94185-id-remapper-ui
https://developer.blender.org/rB8a2dabcc011df82375a8a721eea4610ab5a40f3f

Performance: Remap multiple items in UI

iDuring sprite fright loading of complex scenes would spend a long time in 
remapping ID's
The remapping process is done on a per ID instance that resulted in a very time 
consuming
process that goes over every possible ID reference to find out if it needs to 
be updated.

If there are N of references to ID blocks and there are M ID blocks that needed 
to be remapped
it would take N*M checks. These checks are scattered around the place and 
memory.
Each reference would only be updated at most once, but most of the time no 
update is needed at all.

Idea: By grouping the changes together will reduce the number of checks 
resulting in improved performance.
This would only require N checks. Additional benefits is improved data locality 
as data is only loaded once
in the L2 cache.

It has be implemented for the resyncing process and UI editors.
On an Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz 16Gig the resyncing process went
from 170 seconds to 145 seconds (during hotspot recording).

After this patch has been applied we could add similar approach
to references (references between data blocks) and functionality (tagged 
deletion).
In my understanding this could reduce the resyncing process to less than a 
second.
Opening the village production file between 10 and 20 seconds.

Flame graphs showing that UI remapping isn't visible anymore 
(`WM_main_remap_editor_id_reference`)
* Master {F12769210 size=full}
* This patch {F12769211 size=full}

===

M   source/blender/blenkernel/BKE_lib_remap.h
M   source/blender/blenkernel/BKE_screen.h
M   source/blender/blenkernel/CMakeLists.txt
M   source/blender/blenkernel/intern/lib_id_delete.c
A   source/blender/blenkernel/intern/lib_id_remapper.cc
A   source/blender/blenkernel/intern/lib_id_remapper_test.cc
M   source/blender/blenkernel/intern/lib_override.c
M   source/blender/blenkernel/intern/lib_remap.c
M   source/blender/editors/include/ED_util.h
M   source/blender/editors/space_action/space_action.c
M   source/blender/editors/space_buttons/space_buttons.c
M   source/blender/editors/space_clip/space_clip.c
M   source/blender/editors/space_file/space_file.c
M   source/blender/editors/space_graph/space_graph.c
M   source/blender/editors/space_image/space_image.c
M   source/blender/editors/space_nla/space_nla.c
M   source/blender/editors/space_node/space_node.cc
M   source/blender/editors/space_outliner/space_outliner.cc
M   source/blender/editors/space_sequencer/space_sequencer.c
M   source/blender/editors/space_spreadsheet/space_spreadsheet.cc
M   source/blender/editors/space_text/space_text.c
M   source/blender/editors/space_view3d/space_view3d.c
M   source/blender/editors/util/ed_util.c
M   source/blender/windowmanager/WM_api.h
M   source/blender/windowmanager/intern/wm_event_system.c
M   source/blender/windowmanager/intern/wm_init_exit.c

===

diff --git a/source/blender/blenkernel/BKE_lib_remap.h 
b/source/blender/blenkernel/BKE_lib_remap.h
index d8842dbce7f..24b645c6238 100644
--- a/source/blender/blenkernel/BKE_lib_remap.h
+++ b/source/blender/blenkernel/BKE_lib_remap.h
@@ -38,6 +38,9 @@
 extern "C" {
 #endif
 
+struct ID;
+struct IDRemapper;
+
 /* BKE_libblock_free, delete are declared in BKE_lib_id.h for convenience. */
 
 /* Also IDRemap->flag. */
@@ -97,6 +100,19 @@ enum {
   ID_REMAP_FORCE_OBDATA_IN_EDITMODE = 1 << 9,
 };
 
+/**
+ * Replace all references in given Main using the given \a mappings
+ *
+ * \note Is preferred over BKE_libblock_remap_locked due to performance.
+ */
+void BKE_libblock_remap_multiple_locked(struct Main *bmain,
+const struct IDRemapper *mappings,
+const short remap_flags);
+
+void BKE_libblock_remap_multiple(struct Main *bmain,
+ const struct IDRemapper *mappings,
+ const short remap_flags);
+
 /**
  * Replace all references in given Main to \a old_id by \a new_id
  * (if \a new_id is NULL, it unlinks \a old_id).
@@ -146,12 +162,61 @@ void BKE_libblock_relink_to_newid(struct Main *bmain, 
struct ID *id, int remap_f
 ATTR_NONNULL();
 
 typedef void (*BKE_library_free_notifier_reference_cb)(const void *);
-typedef void (*BKE_library_remap_editor_id_reference_cb)(struct ID *, struct 
ID *);
+typedef void (*BKE_library_remap_editor_id_reference_cb)(const struct 
IDRemapper *mappings);
 
 void 
BKE_library_callback_free_notifier_reference_set(BKE_library_free_notifier_reference_cb
 func);
 void