Cleanup: style
authorCampbell Barton <ideasman42@gmail.com>
Thu, 19 Jul 2018 06:06:37 +0000 (16:06 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 19 Jul 2018 06:06:37 +0000 (16:06 +1000)
31 files changed:
release/scripts/modules/rna_prop_ui.py
release/scripts/startup/bl_operators/wm.py
release/scripts/startup/bl_ui/properties_physics_common.py
release/scripts/startup/bl_ui/properties_scene.py
source/blender/blenkernel/intern/subdiv_converter.h
source/blender/blenkernel/intern/subdiv_mesh.c
source/blender/blenlib/intern/hash_mm3.c
source/blender/compositor/nodes/COM_CryptomatteNode.cpp
source/blender/compositor/operations/COM_CryptomatteOperation.cpp
source/blender/depsgraph/DEG_depsgraph.h
source/blender/depsgraph/intern/builder/deg_builder_map.cc
source/blender/depsgraph/intern/builder/deg_builder_nodes.h
source/blender/draw/engines/workbench/workbench_data.c
source/blender/draw/engines/workbench/workbench_volume.c
source/blender/draw/intern/draw_cache.c
source/blender/editors/render/render_preview.c
source/blender/gpu/GPU_common.h
source/blender/gpu/intern/gpu_attr_binding.c
source/blender/gpu/intern/gpu_attr_binding_private.h
source/blender/gpu/intern/gpu_batch_private.h
source/blender/gpu/intern/gpu_buffer_id.cpp
source/blender/gpu/intern/gpu_immediate.c
source/blender/gpu/intern/gpu_immediate_util.c
source/blender/gpu/intern/gpu_shader_interface.c
source/blender/gpu/intern/gpu_vertex_array_id.cpp
source/blender/gpu/intern/gpu_vertex_format.c
source/blender/gpu/intern/gpu_vertex_format_private.h
source/blender/makesrna/intern/rna_nodetree.c
source/blender/nodes/composite/nodes/node_composite_cryptomatte.c
source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.c
source/blender/python/gpu/gpu_py_types.c

index 8453077be859c4828d2643bfea4f52ca74919462..0d17c11456efb782a0b5c49f0e1d82ee45d9d932 100644 (file)
@@ -170,7 +170,7 @@ def draw(layout, context, context_member, property_type, use_edit=True):
         else:
             row = box.row(align=True)
 
-        row.alignment = "RIGHT"
+        row.alignment = 'RIGHT'
 
         row.label(text=key, translate=False)
 
index 3f0cdfa606b656e485b8ae8418c7c899f797177c..0ccdd3cf5c6ca679806b20f122f73de2a25a1883 100644 (file)
@@ -2440,9 +2440,9 @@ class WM_OT_studiolight_install(Operator):
     )
     orientation: EnumProperty(
         items=(
-            ("MATCAP", "MatCap", ""),
-            ("WORLD", "World", ""),
-            ("CAMERA", "Camera", ""),
+            ('MATCAP', "MatCap", ""),
+            ('WORLD', "World", ""),
+            ('CAMERA', "Camera", ""),
         )
     )
 
index bed5617c76cfc3d2eba039ea60fc496a3132bf53..2da84ad84da77f3dff4f5e2562675b22be061d4f 100644 (file)
@@ -132,7 +132,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
         cache_info = cache.info
         if cache_info:
             col = layout.column()
-            col.alignment = "RIGHT"
+            col.alignment = 'RIGHT'
             col.label(text=cache_info)
     else:
         if cachetype in {'SMOKE', 'DYNAMIC_PAINT'}:
@@ -156,7 +156,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
         cache_info = cache.info
         if cachetype != 'SMOKE' and cache_info:  # avoid empty space.
             col = layout.column(align=True)
-            col.alignment = "RIGHT"
+            col.alignment = 'RIGHT'
             col.label(text=cache_info)
 
         can_bake = True
@@ -186,7 +186,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
                 can_bake = False
 
                 col = layout.column(align=True)
-                col.alignment = "RIGHT"
+                col.alignment = 'RIGHT'
 
                 col.separator()
 
index 1b21ac8fcdf9c552cccf410b6ad333d90807504a..38bfc6ad294cdbc09485bbf5909d7db9376678fc 100644 (file)
@@ -215,7 +215,7 @@ class SCENE_PT_keyframing_settings(SceneButtonsPanel, SceneKeyingSetsPanel, Pane
         flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True)
 
         col = flow.column(align=True)
-        col.alignment = "RIGHT"
+        col.alignment = 'RIGHT'
         col.label(text="General Override")
 
         self.draw_keyframing_settings(context, col, ks, None)
@@ -225,7 +225,7 @@ class SCENE_PT_keyframing_settings(SceneButtonsPanel, SceneKeyingSetsPanel, Pane
             col.separator()
 
             col = flow.column(align=True)
-            col.alignment = "RIGHT"
+            col.alignment = 'RIGHT'
             col.label(text="Active Set Override")
 
             self.draw_keyframing_settings(context, col, ks, ksp)
@@ -272,7 +272,7 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
         ksp = ks.paths.active
         if ksp:
             col = flow.column(align=True)
-            col.alignment = "RIGHT"
+            col.alignment = 'RIGHT'
 
             col.template_any_ID(ksp, "id", "id_type", text="Target ID-Block")
 
index 748d97f4178a6bf822a5b1b1b8ced770ccd3db1a..4c552a9164ea547d1c3fa465198bc8f06353cb92 100644 (file)
@@ -23,8 +23,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifndef __BKE_SUBDIV_CONVERTER_H__
-#define __BKE_SUBDIV_CONVERTER_H__
+#ifndef __SUBDIV_CONVERTER_H__
+#define __SUBDIV_CONVERTER_H__
 
 #include "BKE_subdiv.h"
 
@@ -54,4 +54,4 @@ void BKE_subdiv_converter_free(struct OpenSubdiv_Converter *converter);
 int BKE_subdiv_converter_fvar_linear_from_settings(
         const SubdivSettings *settings);
 
-#endif  /* __BKE_SUBDIV_CONVERTER_H__ */
+#endif  /* __SUBDIV_CONVERTER_H__ */
index 8a58605ba195d592b3b09d1a28fe5582dfbf5a52..c2a10483e2647f80eba0bedaac8133c7bb2fbe08 100644 (file)
@@ -152,7 +152,7 @@ static void edges_of_ptex_get(
 typedef struct VerticesForInterpolation {
        /* This field points to a vertex data which is to be used for interpolation.
         * The idea is to avoid unnecessary allocations for regular faces, where
-        * we can simply 
+        * we can simply
         */
        const CustomData *vertex_data;
        /* Vertices data calculated for ptex corners. There are always 4 elements
@@ -176,7 +176,7 @@ typedef struct VerticesForInterpolation {
 static void vertex_interpolation_init(
         const SubdivMeshContext *ctx,
         VerticesForInterpolation *vertex_interpolation,
-               const MPoly *coarse_poly)
+        const MPoly *coarse_poly)
 {
        const Mesh *coarse_mesh = ctx->coarse_mesh;
        const MLoop *coarse_mloop = coarse_mesh->mloop;
@@ -234,7 +234,8 @@ static void vertex_interpolation_from_ptex(
 {
        if (coarse_poly->totloop == 4) {
                /* Nothing to do, all indices and data is already assigned. */
-       } else {
+       }
+       else {
                const CustomData *vertex_data = &ctx->coarse_mesh->vdata;
                const Mesh *coarse_mesh = ctx->coarse_mesh;
                const MLoop *coarse_mloop = coarse_mesh->mloop;
@@ -287,7 +288,7 @@ static void vertex_interpolation_end(
 typedef struct LoopsForInterpolation {
  /* This field points to a loop data which is to be used for interpolation.
         * The idea is to avoid unnecessary allocations for regular faces, where
-        * we can simply 
+        * we can simply
         */
        const CustomData *loop_data;
        /* Loops data calculated for ptex corners. There are always 4 elements
@@ -311,7 +312,7 @@ typedef struct LoopsForInterpolation {
 static void loop_interpolation_init(
         const SubdivMeshContext *ctx,
         LoopsForInterpolation *loop_interpolation,
-               const MPoly *coarse_poly)
+        const MPoly *coarse_poly)
 {
        const Mesh *coarse_mesh = ctx->coarse_mesh;
        if (coarse_poly->totloop == 4) {
@@ -363,7 +364,8 @@ static void loop_interpolation_from_ptex(
 {
        if (coarse_poly->totloop == 4) {
                /* Nothing to do, all indices and data is already assigned. */
-       } else {
+       }
+       else {
                const CustomData *loop_data = &ctx->coarse_mesh->ldata;
                const Mesh *coarse_mesh = ctx->coarse_mesh;
                const MLoop *coarse_mloop = coarse_mesh->mloop;
@@ -481,9 +483,10 @@ static void subdiv_evaluate_vertices(SubdivMeshContext *ctx,
        vertex_interpolation_end(&vertex_interpolation);
 }
 
-static void subdiv_copy_edge_data(SubdivMeshContext *ctx,
-                                     MEdge *subdiv_edge,
-                                  const MEdge *coarse_edge)
+static void subdiv_copy_edge_data(
+        SubdivMeshContext *ctx,
+        MEdge *subdiv_edge,
+        const MEdge *coarse_edge)
 {
        if (coarse_edge == NULL) {
                subdiv_edge->crease = 0;
@@ -586,11 +589,12 @@ static void subdiv_create_edges(SubdivMeshContext *ctx, int poly_index)
                EdgesOfPtex edges_of_ptex;
                edges_of_ptex_get(ctx, &edges_of_ptex, coarse_poly, i);
                /* Create bottom row of edges (0-1, 1-2). */
-               subdiv_edge = subdiv_create_edges_row(ctx,
-                                                     subdiv_edge,
-                                                     edges_of_ptex.first_edge,
-                                                 start_ptex_face_vertex_index,
-                                                     resolution);
+               subdiv_edge = subdiv_create_edges_row(
+                       ctx,
+                       subdiv_edge,
+                       edges_of_ptex.first_edge,
+                       start_ptex_face_vertex_index,
+                       resolution);
                /* Create remaining edges. */
                for (int row = 0; row < resolution - 1; row++) {
                        const int start_row_vertex_index =
index 5ead9ceca6354edaa7d1e7910a59845ee65baaa2..105c1f46832cd7fd717aeb58c4bfdb9a24b0bc5e 100644 (file)
@@ -92,7 +92,7 @@ BLI_INLINE uint64_t fmix64(uint64_t k)
 
 uint32_t BLI_hash_mm3(const unsigned char *in, size_t len, uint32_t seed)
 {
-       const uint8_t *data = (const uint8_t*)in;
+       const uint8_t *data = (const uint8_t *)in;
        const int nblocks = len / 4;
 
        uint32_t h1 = seed;
@@ -102,23 +102,23 @@ uint32_t BLI_hash_mm3(const unsigned char *in, size_t len, uint32_t seed)
 
        /* body */
 
-       const uint32_t *blocks = (const uint32_t *)(data + nblocks*4);
+       const uint32_t *blocks = (const uint32_t *)(data + nblocks * 4);
 
        for (int i = -nblocks; i; i++) {
-               uint32_t k1 = getblock32(blocks,i);
+               uint32_t k1 = getblock32(blocks, i);
 
                k1 *= c1;
-               k1 = ROTL32(k1,15);
+               k1 = ROTL32(k1, 15);
                k1 *= c2;
 
                h1 ^= k1;
-               h1 = ROTL32(h1,13);
-               h1 = h1*5+0xe6546b64;
+               h1 = ROTL32(h1, 13);
+               h1 = h1 * 5 + 0xe6546b64;
        }
 
        /* tail */
 
-       const uint8_t *tail = (const uint8_t*)(data + nblocks*4);
+       const uint8_t *tail = (const uint8_t *)(data + nblocks * 4);
 
        uint32_t k1 = 0;
 
@@ -132,10 +132,10 @@ uint32_t BLI_hash_mm3(const unsigned char *in, size_t len, uint32_t seed)
                case 1:
                        k1 ^= tail[0];
                        k1 *= c1;
-                       k1 = ROTL32(k1,15);
+                       k1 = ROTL32(k1, 15);
                        k1 *= c2;
                        h1 ^= k1;
-       };
+       }
 
        /* finalization */
 
index bc115e66c2069b72130495850e72dd3027a299c7..648ea4556ade30ea2aba5cdcedae26ace70db9d2 100644 (file)
@@ -62,7 +62,7 @@ void CryptomatteNode::convertToOperations(NodeConverter &converter, const Compos
        bNode *node = this->getbNode();
        NodeCryptomatte *cryptoMatteSettings = (NodeCryptomatte *)node->storage;
 
-       CryptomatteOperation *operation = new CryptomatteOperation(getNumberOfInputSockets()-1);
+       CryptomatteOperation *operation = new CryptomatteOperation(getNumberOfInputSockets() - 1);
        if (cryptoMatteSettings) {
                if (cryptoMatteSettings->matte_id) {
                        /* Split the string by commas, ignoring white space. */
@@ -83,7 +83,7 @@ void CryptomatteNode::convertToOperations(NodeConverter &converter, const Compos
                                                operation->addObjectIndex(atof(token.substr(1, token.length() - 2).c_str()));
                                        }
                                        else {
-                                               uint32_t hash = BLI_hash_mm3((const unsigned char*)token.c_str(), token.length(), 0);
+                                               uint32_t hash = BLI_hash_mm3((const unsigned char *)token.c_str(), token.length(), 0);
                                                operation->addObjectIndex(hash_to_float(hash));
                                        }
                                }
@@ -93,14 +93,14 @@ void CryptomatteNode::convertToOperations(NodeConverter &converter, const Compos
 
        converter.addOperation(operation);
 
-       for (int i = 0; i < getNumberOfInputSockets()-1; ++i) {
+       for (int i = 0; i < getNumberOfInputSockets() - 1; ++i) {
                converter.mapInputSocket(this->getInputSocket(i + 1), operation->getInputSocket(i));
        }
 
        SeparateChannelOperation *separateOperation = new SeparateChannelOperation;
        separateOperation->setChannel(3);
        converter.addOperation(separateOperation);
-       
+
        SetAlphaOperation *operationAlpha = new SetAlphaOperation();
        converter.addOperation(operationAlpha);
 
@@ -117,5 +117,5 @@ void CryptomatteNode::convertToOperations(NodeConverter &converter, const Compos
        converter.mapOutputSocket(outputSocketMatte, separateOperation->getOutputSocket(0));
        converter.mapOutputSocket(outputSocketImage, operationAlpha->getOutputSocket(0));
        converter.mapOutputSocket(outputSocketPick, clearAlphaOperation->getOutputSocket(0));
-       
+
 }
index 9dd36863d37dfcbb18e8d074d2434eaeefa99dfd..f3fa81075c61ade7a85b3d5055ce3d6ec6476dc1 100644 (file)
@@ -63,7 +63,7 @@ void CryptomatteOperation::executePixel(float output[4],
                        output[1] = ((float) ((m3hash << 8)) / (float) UINT32_MAX);
                        output[2] = ((float) ((m3hash << 16)) / (float) UINT32_MAX);
                }
-               for(size_t i = 0; i < m_objectIndex.size(); i++) {
+               for (size_t i = 0; i < m_objectIndex.size(); i++) {
                        if (m_objectIndex[i] == input[0]) {
                                output[3] += input[1];
                        }
index 71376d94ca872d9b1ebe661a9463ab969ddcff4a..2e566752a6fdd902ea45802479b17330d816dbe4 100644 (file)
@@ -269,9 +269,9 @@ void DEG_debug_print_eval_parent_typed(struct Depsgraph *depsgraph,
                                        const void *parent_address);
 
 void DEG_debug_print_eval_time(struct Depsgraph *depsgraph,
-                               const charfunction_name,
-                               const charobject_name,
-                               const voidobject_address,
+                               const char *function_name,
+                               const char *object_name,
+                               const void *object_address,
                                float time);
 
 #ifdef __cplusplus
index 218483d1dc53a50aaa726331de46f21309c343d3..cde7b9721b7735b580f2aa4db72fbcce25c993a7 100644 (file)
 
 namespace DEG {
 
-BuilderMap::BuilderMap() {
+BuilderMap::BuilderMap()
+{
        set = BLI_gset_ptr_new("deg builder gset");
 }
 
 
-BuilderMap::~BuilderMap() {
+BuilderMap::~BuilderMap()
+{
        BLI_gset_free(set, NULL);
 }
 
-bool BuilderMap::checkIsBuilt(ID *id) {
+bool BuilderMap::checkIsBuilt(ID *id)
+{
        return BLI_gset_haskey(set, id);
 }
 
-void BuilderMap::tagBuild(ID *id) {
+void BuilderMap::tagBuild(ID *id)
+{
        BLI_gset_insert(set, id);
 }
 
-bool BuilderMap::checkIsBuiltAndTag(ID *id) {
+bool BuilderMap::checkIsBuiltAndTag(ID *id)
+{
        void **key_p;
        if (!BLI_gset_ensure_p_ex(set, id, &key_p)) {
                *key_p = id;
index 6899a86b3e9329b1f17ace6717285cdca93d788d..66293a91e85acc4755d9e3055bbbc333347e3766 100644 (file)
@@ -158,7 +158,7 @@ struct DepsgraphNodeBuilder {
                                               const char *name = "",
                                               int name_tag = -1);
 
-       void build_id(IDid);
+       void build_id(ID *id);
        void build_layer_collections(ListBase *lb);
        void build_view_layer(Scene *scene,
                              ViewLayer *view_layer,
index 07df067f3245a27136ef20626e380db934b07669..5c3ab5f66885bcfcb8ecf6e187ec2f9875894dd3 100644 (file)
@@ -33,11 +33,11 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd)
 
        if (wpd->shading.light == V3D_LIGHTING_MATCAP) {
                wpd->studio_light = BKE_studiolight_find(
-                               wpd->shading.matcap, STUDIOLIGHT_ORIENTATION_VIEWNORMAL);
+                       wpd->shading.matcap, STUDIOLIGHT_ORIENTATION_VIEWNORMAL);
        }
        else {
                wpd->studio_light = BKE_studiolight_find(
-                               wpd->shading.studio_light, STUDIOLIGHT_ORIENTATION_CAMERA | STUDIOLIGHT_ORIENTATION_WORLD);
+                       wpd->shading.studio_light, STUDIOLIGHT_ORIENTATION_CAMERA | STUDIOLIGHT_ORIENTATION_WORLD);
        }
        wpd->shadow_multiplier = 1.0 - wpd->shading.shadow_intensity;
 
index f28bfd01ae8aeaebe635c1dc4d80b30f3f08db93..ea4152486af16b235c78195e1e08e24b1b86b411 100644 (file)
@@ -19,7 +19,7 @@
  *
  */
 
-/** \file workbench_volumed.c
+/** \file workbench_volume.c
  *  \ingroup draw_engine
  */
 
index bb73a8c1b194cdeb477d6d2340efe5408adda47f..dff863b11bb6329d260214ea52e85292ff61385f 100644 (file)
@@ -901,7 +901,7 @@ GPUBatch *DRW_cache_empty_capsule_cap_get(void)
                        float v[3] = {0.0f, 0.0f, 0.0f};
                        copy_v2_v2(v, p[(i) % NSEGMENTS]);
                        GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
-                       copy_v2_v2(v, p[(i+1) % NSEGMENTS]);
+                       copy_v2_v2(v, p[(i + 1) % NSEGMENTS]);
                        GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
                }
 
index 6ced3f2e430542e6d42cb034caf18c06f41019c8..450897382dd055169a38dc017ac0085ccaf903b6 100644 (file)
@@ -828,7 +828,7 @@ static void shader_preview_free(void *customdata)
        ShaderPreview *sp = customdata;
        Main *pr_main = sp->pr_main;
 
-       if (sp->id_copy){
+       if (sp->id_copy) {
                switch (GS(sp->id_copy->name)) {
                        case ID_MA:
                                BKE_material_free((Material *)sp->id_copy);
index 7d86a6ec8a53da64f8b65e9249a1732bd4617dde..3acc7fad5c2e9d0849f99f82eae8b8756a049af5 100644 (file)
 #define PROGRAM_NO_OPTI 0
 
 #if defined(NDEBUG)
-  #define TRUST_NO_ONE 0
+#  define TRUST_NO_ONE 0
 #else
   /* strict error checking, enabled for debug builds during early development */
-  #define TRUST_NO_ONE 1
+#  define TRUST_NO_ONE 1
 #endif
 
 #if defined(WITH_OPENGL)
-  #include <GL/glew.h>
+#  include <GL/glew.h>
 #endif
 
 #include <stdbool.h>
@@ -48,7 +48,7 @@
 #include "BLI_sys_types.h"
 
 #if TRUST_NO_ONE
-  #include <assert.h>
+#  include <assert.h>
 #endif
 
 /* GPU_INLINE */
index e66fac390f1fbe1a3f76d0c8f2621fc8ee0ef366..398b97c7f9d5d5f7df644d87ad08c0fab3b98310 100644 (file)
@@ -35,7 +35,7 @@
 #include <stdlib.h>
 
 #if GPU_VERT_ATTR_MAX_LEN != 16
-  #error "attrib binding code assumes GPU_VERT_ATTR_MAX_LEN = 16"
+#  error "attrib binding code assumes GPU_VERT_ATTR_MAX_LEN = 16"
 #endif
 
 void AttribBinding_clear(GPUAttrBinding *binding)
index 240509de0d4b0bb53ef9bdff1bb0b298973e5b50..cb338b10aa43fd00e9b3dfc6899f92e471cd3031 100644 (file)
 #include "GPU_vertex_format.h"
 #include "GPU_shader_interface.h"
 
-void AttribBinding_clear(GPUAttrBinding*);
+void AttribBinding_clear(GPUAttrBinding *binding);
 
-void get_attrib_locations(const GPUVertFormat*, GPUAttrBinding*, const GPUShaderInterface*);
-unsigned read_attrib_location(const GPUAttrBinding*, unsigned a_idx);
+void get_attrib_locations(
+        const GPUVertFormat *format, GPUAttrBinding *binding, const GPUShaderInterface *shaderface);
+unsigned read_attrib_location(
+        const GPUAttrBinding *binding, unsigned a_idx);
 
 #endif /* __GPU_ATTR_BINDING_PRIVATE_H__ */
index 0b25c0aef05440e20f54c51ce2a9393176b29dc0..51040ff751a36acb5ac589755cbe70797efa4e59 100644 (file)
@@ -41,10 +41,10 @@ extern "C" {
 #include "GPU_context.h"
 #include "GPU_shader_interface.h"
 
-void gpu_batch_remove_interface_ref(GPUBatch*, const GPUShaderInterface*);
+void gpu_batch_remove_interface_ref(GPUBatch *batch, const GPUShaderInterface *interface);
 
-void gpu_context_add_batch(GPUContext*, GPUBatch*);
-void gpu_context_remove_batch(GPUContext*, GPUBatch*);
+void gpu_context_add_batch(GPUContext *ctx, GPUBatch *batch);
+void gpu_context_remove_batch(GPUContext *ctx, GPUBatch *batch);
 
 #ifdef __cplusplus
 }
index c1aaf1945aa108621ba5d0588cddcb0179167ac7..f3faba9c76658baa2fe8ec0b5558d4ff3d3683df 100644 (file)
@@ -37,7 +37,7 @@
 #define ORPHAN_DEBUG 0
 
 #if ORPHAN_DEBUG
-       #include <cstdio>
+#  include <cstdio>
 #endif
 
 static std::vector<GLuint> orphaned_buffer_ids;
index 06b487fbb257fad9fb7ef04b429cd3bc090ada80..66a467e339e18d38038f940a1ffaa87bbdd4e6ba 100644 (file)
@@ -701,17 +701,17 @@ void immVertex2iv(uint attrib_id, const int data[2])
 /* --- generic uniform functions --- */
 
 #if 0
-  #if TRUST_NO_ONE
-    #define GET_UNIFORM const GPUShaderInput* uniform = GPU_shaderinterface_uniform(imm.shader_interface, name); assert(uniform);
-  #else
-    #define GET_UNIFORM const GPUShaderInput* uniform = GPU_shaderinterface_uniform(imm.shader_interface, name);
-  #endif
+#  if TRUST_NO_ONE
+#    define GET_UNIFORM const GPUShaderInput* uniform = GPU_shaderinterface_uniform(imm.shader_interface, name); assert(uniform);
+#  else
+#    define GET_UNIFORM const GPUShaderInput* uniform = GPU_shaderinterface_uniform(imm.shader_interface, name);
+#  endif
 #else
        /* NOTE: It is possible to have uniform fully optimized out from the shader.
         *       In this case we can't assert failure or allow NULL-pointer dereference.
         * TODO(sergey): How can we detect existing-but-optimized-out uniform but still
         *               catch typos in uniform names passed to immUniform*() functions? */
-  #define GET_UNIFORM const GPUShaderInput* uniform = GPU_shaderinterface_uniform(imm.shader_interface, name); if (uniform == NULL) return;
+#  define GET_UNIFORM const GPUShaderInput* uniform = GPU_shaderinterface_uniform(imm.shader_interface, name); if (uniform == NULL) return;
 #endif
 
 void immUniform1f(const char *name, float x)
index cf594367bdf6eaa02d93ca3627c9a3aecd2415eb..8384ef3b5d03b5e691fdb75f073de82d82dd0613 100644 (file)
@@ -18,7 +18,7 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/gpu/intern/gpu_imm_util.c
+/** \file blender/gpu/intern/gpu_immediate_util.c
  *  \ingroup gpu
  *
  * GPU immediate mode drawing utilities
index 7e1d942da2dee65802a595f4b644e4311f9ecb77..4b8413d0cc3c7a92b2edb0726c4a12380a90bd88 100644 (file)
@@ -39,7 +39,7 @@
 #define DEBUG_SHADER_INTERFACE 0
 
 #if DEBUG_SHADER_INTERFACE
- #include <stdio.h>
+#  include <stdio.h>
 #endif
 
 static const char *BuiltinUniform_name(GPUUniformBuiltin u)
index 2f29bbfbc33423faf4353eff821da9862be3c153..64f704bb107b982ab1a9b65089d1a9b7ba7f1846 100644 (file)
@@ -23,7 +23,7 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/gpu/gpu_vertex_array_id.cpp
+/** \file blender/gpu/intern/gpu_vertex_array_id.cpp
  *  \ingroup gpu
  *
  * Manage GL vertex array IDs in a thread-safe way
@@ -58,7 +58,7 @@ static bool thread_is_main() {
 
 struct GPUContext {
        GLuint default_vao;
-       std::unordered_set<GPUBatch*> batches; /* Batches that have VAOs from this context */
+       std::unordered_set<GPUBatch *> batches; /* Batches that have VAOs from this context */
        std::vector<GLuint> orphaned_vertarray_ids;
        std::mutex orphans_mutex; /* todo: try spinlock instead */
 #if TRUST_NO_ONE
@@ -73,12 +73,12 @@ struct GPUContext {
 
 #if defined(_MSC_VER) && (_MSC_VER == 1800)
 #define thread_local __declspec(thread)
-thread_local GPUContextactive_ctx = NULL;
+thread_local GPUContext *active_ctx = NULL;
 #else
-static thread_local GPUContextactive_ctx = NULL;
+static thread_local GPUContext *active_ctx = NULL;
 #endif
 
-static void clear_orphans(GPUContextctx)
+static void clear_orphans(GPUContext *ctx)
 {
        ctx->orphans_mutex.lock();
        if (!ctx->orphaned_vertarray_ids.empty()) {
@@ -89,19 +89,19 @@ static void clear_orphans(GPUContext* ctx)
        ctx->orphans_mutex.unlock();
 }
 
-GPUContextGPU_context_create(void)
+GPUContext *GPU_context_create(void)
 {
 #if TRUST_NO_ONE
        /* assert(thread_is_main()); */
 #endif
-       GPUContextctx = new GPUContext;
+       GPUContext *ctx = new GPUContext;
        glGenVertexArrays(1, &ctx->default_vao);
        GPU_context_active_set(ctx);
        return ctx;
 }
 
 /* to be called after GPU_context_active_set(ctx_to_destroy) */
-void GPU_context_discard(GPUContextctx)
+void GPU_context_discard(GPUContext *ctx)
 {
 #if TRUST_NO_ONE
        /* Make sure no other thread has locked it. */
@@ -120,7 +120,7 @@ void GPU_context_discard(GPUContext* ctx)
 }
 
 /* ctx can be NULL */
-void GPU_context_active_set(GPUContextctx)
+void GPU_context_active_set(GPUContext *ctx)
 {
 #if TRUST_NO_ONE
        if (active_ctx) {
@@ -140,7 +140,7 @@ void GPU_context_active_set(GPUContext* ctx)
        active_ctx = ctx;
 }
 
-GPUContextGPU_context_active_get(void)
+GPUContext *GPU_context_active_get(void)
 {
        return active_ctx;
 }
@@ -168,7 +168,7 @@ GLuint GPU_vao_alloc(void)
 }
 
 /* this can be called from multiple thread */
-void GPU_vao_free(GLuint vao_id, GPUContextctx)
+void GPU_vao_free(GLuint vao_id, GPUContext *ctx)
 {
 #if TRUST_NO_ONE
        assert(ctx);
@@ -183,12 +183,12 @@ void GPU_vao_free(GLuint vao_id, GPUContext* ctx)
        }
 }
 
-void gpu_context_add_batch(GPUContext* ctx, GPUBatch* batch)
+void gpu_context_add_batch(GPUContext *ctx, GPUBatch *batch)
 {
        ctx->batches.emplace(batch);
 }
 
-void gpu_context_remove_batch(GPUContext* ctx, GPUBatch* batch)
+void gpu_context_remove_batch(GPUContext *ctx, GPUBatch *batch)
 {
        ctx->orphans_mutex.lock();
        ctx->batches.erase(batch);
index f1f75f449d4ff35938751bbf45f522b0e233599f..eef4945d9ef2ebab8105b2156111f749cd39b931 100644 (file)
@@ -37,7 +37,7 @@
 #define PACK_DEBUG 0
 
 #if PACK_DEBUG
-  #include <stdio.h>
+#  include <stdio.h>
 #endif
 
 void GPU_vertformat_clear(GPUVertFormat *format)
index 4ce3ebba714f551671d20e667fb90c5a1ac0883f..e4fe61e8697bb15242a90205debdb8a0694e3519 100644 (file)
@@ -32,8 +32,8 @@
 #ifndef __GPU_VERTEX_FORMAT_PRIVATE_H__
 #define __GPU_VERTEX_FORMAT_PRIVATE_H__
 
-void VertexFormat_pack(GPUVertFormat*);
+void VertexFormat_pack(GPUVertFormat *format);
 uint padding(uint offset, uint alignment);
-uint vertex_buffer_size(const GPUVertFormat*, uint vertex_len);
+uint vertex_buffer_size(const GPUVertFormat *format, uint vertex_len);
 
 #endif /* __GPU_VERTEX_FORMAT_PRIVATE_H__ */
index e672ae0e6f76fd2843b0f4cadf987449c677da0b..b9a8f306baf26e21093c63af38025157cba09ae9 100644 (file)
@@ -6976,8 +6976,9 @@ static void def_cmp_cryptomatte(StructRNA *srna)
 
        RNA_def_struct_sdna_from(srna, "NodeCryptomatte", "storage");
        prop = RNA_def_property(srna, "matte_id", PROP_STRING, PROP_NONE);
-       RNA_def_property_string_funcs(prop, "rna_NodeCryptomatte_matte_get", "rna_NodeCryptomatte_matte_length",
-                                                                 "rna_NodeCryptomatte_matte_set");
+       RNA_def_property_string_funcs(
+               prop, "rna_NodeCryptomatte_matte_get", "rna_NodeCryptomatte_matte_length",
+               "rna_NodeCryptomatte_matte_set");
        RNA_def_property_ui_text(prop, "Matte Objects", "List of object and material crypto IDs to include in matte");
        RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 
index 0231e4717b26fa621bd4421846c32a58a8b649c1..bf9ab4a5064e85520c4b29dad6f8cb839aef9309 100644 (file)
 
 static inline float hash_to_float(uint32_t hash)
 {
-       uint32_t mantissa = hash & (( 1 << 23) - 1);
+       uint32_t mantissa = hash & ((1 << 23) - 1);
        uint32_t exponent = (hash >> 23) & ((1 << 8) - 1);
-       exponent = MAX2(exponent, (uint32_t) 1);
-       exponent = MIN2(exponent, (uint32_t) 254);
+       exponent = MAX2(exponent, (uint32_t)1);
+       exponent = MIN2(exponent, (uint32_t)254);
        exponent = exponent << 23;
        uint32_t sign = (hash >> 31);
        sign = sign << 31;
@@ -54,7 +54,7 @@ static inline float hash_to_float(uint32_t hash)
        return f;
 }
 
-static void cryptomatte_add(NodeCryptomatten, float f)
+static void cryptomatte_add(NodeCryptomatte *n, float f)
 {
        /* Turn the number into a string. */
        char number[32];
@@ -72,16 +72,16 @@ static void cryptomatte_add(NodeCryptomatte* n, float f)
                        }
 
                        /* Find the next seprator. */
-                       char* token_end = strchr(n->matte_id+start, ',');
-                       if (token_end == NULL || token_end == n->matte_id+start) {
-                               token_end = n->matte_id+end;
+                       char *token_end = strchr(n->matte_id + start, ',');
+                       if (token_end == NULL || token_end == n->matte_id + start) {
+                               token_end = n->matte_id + end;
                        }
                        /* Be aware that token_len still contains any trailing white space. */
                        token_len = token_end - (n->matte_id + start);
 
                        /* If this has a leading bracket, assume a raw floating point number and look for the closing bracket. */
                        if (n->matte_id[start] == '<') {
-                               if (strncmp(n->matte_id+start, number, strlen(number)) == 0) {
+                               if (strncmp(n->matte_id + start, number, strlen(number)) == 0) {
                                        /* This number is already there, so continue. */
                                        return;
                                }
@@ -89,16 +89,16 @@ static void cryptomatte_add(NodeCryptomatte* n, float f)
                        else {
                                /* Remove trailing white space */
                                size_t name_len = token_len;
-                               while (n->matte_id[start+name_len] == ' ' && name_len > 0) {
+                               while (n->matte_id[start + name_len] == ' ' && name_len > 0) {
                                        name_len--;
                                }
                                /* Calculate the hash of the token and compare. */
-                               uint32_t hash = BLI_hash_mm3((const unsigned char*)(n->matte_id+start), name_len, 0);
+                               uint32_t hash = BLI_hash_mm3((const unsigned char *)(n->matte_id + start), name_len, 0);
                                if (f == hash_to_float(hash)) {
                                        return;
                                }
                        }
-                       start += token_len+1;
+                       start += token_len + 1;
                }
        }
 
@@ -107,12 +107,12 @@ static void cryptomatte_add(NodeCryptomatte* n, float f)
                return;
        }
 
-       if(n->matte_id) {
+       if (n->matte_id) {
                BLI_dynstr_append(new_matte, n->matte_id);
                MEM_freeN(n->matte_id);
        }
 
-       if(BLI_dynstr_get_len(new_matte) > 0) {
+       if (BLI_dynstr_get_len(new_matte) > 0) {
                BLI_dynstr_append(new_matte, ",");
        }
        BLI_dynstr_append(new_matte, number);
@@ -120,7 +120,7 @@ static void cryptomatte_add(NodeCryptomatte* n, float f)
        BLI_dynstr_free(new_matte);
 }
 
-static void cryptomatte_remove(NodeCryptomatte*n, float f)
+static void cryptomatte_remove(NodeCryptomatte *n, float f)
 {
        if (n->matte_id == NULL || strlen(n->matte_id) == 0) {
                /* Empty string, nothing to remove. */
@@ -150,9 +150,9 @@ static void cryptomatte_remove(NodeCryptomatte*n, float f)
                }
 
                /* Find the next seprator. */
-               char* token_end = strchr(n->matte_id+start+1, ',');
-               if (token_end == NULL || token_end == n->matte_id+start) {
-                       token_end = n->matte_id+end;
+               char *token_end = strchr(n->matte_id + start + 1, ',');
+               if (token_end == NULL || token_end == n->matte_id + start) {
+                       token_end = n->matte_id + end;
                }
                /* Be aware that token_len still contains any trailing white space. */
                token_len = token_end - (n->matte_id + start);
@@ -162,7 +162,7 @@ static void cryptomatte_remove(NodeCryptomatte*n, float f)
                }
                /* If this has a leading bracket, assume a raw floating point number and look for the closing bracket. */
                else if (n->matte_id[start] == '<') {
-                       if (strncmp(n->matte_id+start, number, strlen(number)) == 0) {
+                       if (strncmp(n->matte_id + start, number, strlen(number)) == 0) {
                                /* This number is already there, so skip it. */
                                skip = true;
                        }
@@ -170,11 +170,11 @@ static void cryptomatte_remove(NodeCryptomatte*n, float f)
                else {
                        /* Remove trailing white space */
                        size_t name_len = token_len;
-                       while (n->matte_id[start+name_len] == ' ' && name_len > 0) {
+                       while (n->matte_id[start + name_len] == ' ' && name_len > 0) {
                                name_len--;
                        }
                        /* Calculate the hash of the token and compare. */
-                       uint32_t hash = BLI_hash_mm3((const unsigned char*)(n->matte_id+start), name_len, 0);
+                       uint32_t hash = BLI_hash_mm3((const unsigned char *)(n->matte_id + start), name_len, 0);
                        if (f == hash_to_float(hash)) {
                                skip = true;
                        }
@@ -186,26 +186,26 @@ static void cryptomatte_remove(NodeCryptomatte*n, float f)
                        else {
                                BLI_dynstr_append(new_matte, ", ");
                        }
-                       BLI_dynstr_nappend(new_matte, n->matte_id+start, token_len);
+                       BLI_dynstr_nappend(new_matte, n->matte_id + start, token_len);
                }
-               start += token_len+1;
+               start += token_len + 1;
        }
 
-       if(n->matte_id) {
+       if (n->matte_id) {
                MEM_freeN(n->matte_id);
                n->matte_id = NULL;
        }
-       if(BLI_dynstr_get_len(new_matte) > 0) {
+       if (BLI_dynstr_get_len(new_matte) > 0) {
                n->matte_id = BLI_dynstr_get_cstring(new_matte);
        }
        BLI_dynstr_free(new_matte);
 }
 
 static bNodeSocketTemplate outputs[] = {
-       {       SOCK_RGBA,      0, N_("Image")},
-       {       SOCK_FLOAT, 0, N_("Matte")},
-       {       SOCK_RGBA,      0, N_("Pick")},
-       {       -1, 0, ""       }
+       {   SOCK_RGBA,  0, N_("Image")},
+       {   SOCK_FLOAT, 0, N_("Matte")},
+       {   SOCK_RGBA,  0, N_("Pick")},
+       {   -1, 0, ""   }
 };
 
 void ntreeCompositCryptomatteSyncFromAdd(bNodeTree *UNUSED(ntree), bNode *node)
@@ -235,7 +235,7 @@ bNodeSocket *ntreeCompositCryptomatteAddSocket(bNodeTree *ntree, bNode *node)
        NodeCryptomatte *n = node->storage;
        char sockname[32];
        n->num_inputs++;
-       BLI_snprintf(sockname, sizeof(sockname), "Crypto %.2d", n->num_inputs-1);
+       BLI_snprintf(sockname, sizeof(sockname), "Crypto %.2d", n->num_inputs - 1);
        bNodeSocket *sock = nodeAddStaticSocket(ntree, node, SOCK_IN, SOCK_RGBA, PROP_NONE, NULL, sockname);
        return sock;
 }
index 5fff2548ba1ca478ff9fb50658ca06613f5b990e..83e4bf1731be0886abc2047c27e15d22dc222ec1 100644 (file)
@@ -40,7 +40,7 @@ static bNodeSocketTemplate sh_node_bsdf_hair_principled_in[] = {
        {       SOCK_FLOAT,             1, N_("Radial Roughness"),                      0.3f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
        {       SOCK_FLOAT,             1, N_("Coat"),                                          0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
        {       SOCK_FLOAT,             1, N_("IOR"),                                           1.55f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f},
-       {       SOCK_FLOAT,             1, N_("Offset"),                                        2.f*((float)M_PI)/180.f, 0.0f, 0.0f, 0.0f, -M_PI_2, M_PI_2, PROP_ANGLE},
+       {       SOCK_FLOAT,             1, N_("Offset"),                                        2.0f * ((float)M_PI) / 180.f, 0.0f, 0.0f, 0.0f, -M_PI_2, M_PI_2, PROP_ANGLE},
        {       SOCK_FLOAT,     1, N_("Random Color"),                          0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
        {       SOCK_FLOAT,     1, N_("Random Roughness"),                      0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
        {       SOCK_FLOAT,             1, N_("Random"),                                        0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE},
index 0a21da5682b0df1342328f18dfbd4ab2512328e1..4e564fdf84917b6e9f11b7999126b201580fab44 100644 (file)
@@ -32,8 +32,6 @@
 
 #include "BLI_math.h"
 
-#include "GPU_batch.h"
-
 #include "MEM_guardedalloc.h"
 
 #include "../generic/py_capi_utils.h"