[Bf-blender-cvs] [c5862e0a06b] master: Cleanup: comments (long lines) in gpu

Campbell Barton noreply at git.blender.org
Sun Apr 21 22:35:24 CEST 2019


Commit: c5862e0a06b75767fd863673c54aab54f27d1872
Author: Campbell Barton
Date:   Mon Apr 22 01:45:43 2019 +1000
Branches: master
https://developer.blender.org/rBc5862e0a06b75767fd863673c54aab54f27d1872

Cleanup: comments (long lines) in gpu

===================================================================

M	source/blender/gpu/GPU_immediate.h
M	source/blender/gpu/GPU_matrix.h
M	source/blender/gpu/GPU_shader.h
M	source/blender/gpu/GPU_vertex_format.h
M	source/blender/gpu/intern/gpu_attr_binding.c
M	source/blender/gpu/intern/gpu_batch.c
M	source/blender/gpu/intern/gpu_codegen.c
M	source/blender/gpu/intern/gpu_framebuffer.c
M	source/blender/gpu/intern/gpu_immediate.c
M	source/blender/gpu/intern/gpu_select.c
M	source/blender/gpu/intern/gpu_select_pick.c
M	source/blender/gpu/intern/gpu_shader.c
M	source/blender/gpu/intern/gpu_texture.c
M	source/blender/gpu/intern/gpu_viewport.c
M	source/blender/gpu/shaders/gpu_shader_2D_line_dashed_frag.glsl
M	source/blender/gpu/shaders/gpu_shader_2D_line_dashed_geom.glsl
M	source/blender/gpu/shaders/gpu_shader_2D_line_dashed_uniform_color_vert.glsl
M	source/blender/gpu/shaders/gpu_shader_2D_line_dashed_width_geom.glsl
M	source/blender/gpu/shaders/gpu_shader_3D_line_dashed_uniform_color_legacy_vert.glsl
M	source/blender/gpu/shaders/gpu_shader_3D_line_dashed_uniform_color_vert.glsl
M	source/blender/gpu/shaders/gpu_shader_material.glsl

===================================================================

diff --git a/source/blender/gpu/GPU_immediate.h b/source/blender/gpu/GPU_immediate.h
index 30a6020f74a..a8e5e9d0e04 100644
--- a/source/blender/gpu/GPU_immediate.h
+++ b/source/blender/gpu/GPU_immediate.h
@@ -47,9 +47,10 @@ void immBegin(GPUPrimType, uint vertex_len);
 void immBeginAtMost(GPUPrimType, uint max_vertex_len);
 void immEnd(void); /* finishes and draws. */
 
-/* ImmBegin a batch, then use standard immFunctions as usual. */
-/* ImmEnd will finalize the batch instead of drawing. */
-/* Then you can draw it as many times as you like! Partially replaces the need for display lists. */
+/* immBegin a batch, then use standard immFunctions as usual. */
+/* immEnd will finalize the batch instead of drawing. */
+/* Then you can draw it as many times as you like!
+ * Partially replaces the need for display lists. */
 GPUBatch *immBeginBatch(GPUPrimType, uint vertex_len);
 GPUBatch *immBeginBatchAtMost(GPUPrimType, uint vertex_len);
 
diff --git a/source/blender/gpu/GPU_matrix.h b/source/blender/gpu/GPU_matrix.h
index 24a76c13e01..67fb2bb2bd4 100644
--- a/source/blender/gpu/GPU_matrix.h
+++ b/source/blender/gpu/GPU_matrix.h
@@ -123,7 +123,8 @@ const float (*GPU_matrix_normal_inverse_get(float m[3][3]))[3];
 void GPU_matrix_bind(const struct GPUShaderInterface *);
 bool GPU_matrix_dirty_get(void); /* since last bind */
 
-/* Python API needs to be able to inspect the stack so errors raise exceptions instead of crashing. */
+/* Python API needs to be able to inspect the stack so errors raise exceptions
+ * instead of crashing. */
 #ifdef USE_GPU_PY_MATRIX_API
 int GPU_matrix_stack_level_get_model_view(void);
 int GPU_matrix_stack_level_get_projection(void);
diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h
index d7addeb87b4..d174aafacce 100644
--- a/source/blender/gpu/GPU_shader.h
+++ b/source/blender/gpu/GPU_shader.h
@@ -239,7 +239,8 @@ typedef enum eGPUBuiltinShader {
    */
   GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA,
   /**
-   * Draw round points with a constant size and an outline. Take a 2D position and a color for each vertex.
+   * Draw round points with a constant size and an outline.
+   * Take a 2D position and a color for each vertex.
    *
    * \param size: uniform float
    * \param outlineWidth: uniform float
@@ -249,7 +250,8 @@ typedef enum eGPUBuiltinShader {
    */
   GPU_SHADER_2D_POINT_UNIFORM_SIZE_VARYING_COLOR_OUTLINE_AA,
   /**
-   * Draw round points with a constant size and an outline. Take a 2D position and a color for each vertex.
+   * Draw round points with a constant size and an outline.
+   * Take a 2D position and a color for each vertex.
    *
    * \param size: in float
    * \param color: in vec4
@@ -302,7 +304,8 @@ typedef enum eGPUBuiltinShader {
    */
   GPU_SHADER_3D_POINT_VARYING_SIZE_UNIFORM_COLOR,
   /**
-   * Draw round points with a constant size and an outline. Take a 3D position and a color for each vertex.
+   * Draw round points with a constant size and an outline.
+   * Take a 3D position and a color for each vertex.
    *
    * \param size: in float
    * \param color: in vec4
diff --git a/source/blender/gpu/GPU_vertex_format.h b/source/blender/gpu/GPU_vertex_format.h
index 021def5b265..7f1934431cf 100644
--- a/source/blender/gpu/GPU_vertex_format.h
+++ b/source/blender/gpu/GPU_vertex_format.h
@@ -91,12 +91,13 @@ void GPU_vertformat_alias_add(GPUVertFormat *, const char *alias);
 int GPU_vertformat_attr_id_get(const GPUVertFormat *, const char *name);
 
 /**
- * This makes the "virtual" attributes with suffixes "0", "1", "2" to access triangle data in the vertex
- * shader.
+ * This makes the "virtual" attributes with suffixes "0", "1", "2"
+ * to access triangle data in the vertex shader.
  *
  * IMPORTANT:
  * - Call this before creating the vertex buffer and after creating all attributes
- * - Only first vertex out of 3 has the correct information. Use flat output with GL_FIRST_VERTEX_CONVENTION.
+ * - Only first vertex out of 3 has the correct information.
+ *   Use flat output with #GL_FIRST_VERTEX_CONVENTION.
  */
 void GPU_vertformat_triple_load(GPUVertFormat *format);
 
diff --git a/source/blender/gpu/intern/gpu_attr_binding.c b/source/blender/gpu/intern/gpu_attr_binding.c
index 6cd350df505..e280b77f661 100644
--- a/source/blender/gpu/intern/gpu_attr_binding.c
+++ b/source/blender/gpu/intern/gpu_attr_binding.c
@@ -73,7 +73,8 @@ void get_attr_locations(const GPUVertFormat *format,
       const GPUShaderInput *input = GPU_shaderinterface_attr(shaderface, a->name[n_idx]);
 #if TRUST_NO_ONE
       assert(input != NULL);
-      /* TODO: make this a recoverable runtime error? indicates mismatch between vertex format and program */
+      /* TODO: make this a recoverable runtime error?
+       * indicates mismatch between vertex format and program. */
 #endif
       write_attr_location(binding, a_idx, input->location);
     }
diff --git a/source/blender/gpu/intern/gpu_batch.c b/source/blender/gpu/intern/gpu_batch.c
index 636a48c1623..4f5215ce9e6 100644
--- a/source/blender/gpu/intern/gpu_batch.c
+++ b/source/blender/gpu/intern/gpu_batch.c
@@ -420,7 +420,8 @@ static void batch_update_program_bindings(GPUBatch *batch, uint v_first)
 void GPU_batch_program_use_begin(GPUBatch *batch)
 {
   /* NOTE: use_program & done_using_program are fragile, depend on staying in sync with
-   *       the GL context's active program. use_program doesn't mark other programs as "not used". */
+   *       the GL context's active program.
+   *       use_program doesn't mark other programs as "not used". */
   /* TODO: make not fragile (somehow) */
 
   if (!batch->program_in_use) {
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 242544ec07f..43211fe0969 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -824,7 +824,8 @@ static char *code_generate_fragment(GPUMaterial *material,
 
   BLI_dynstr_append(ds, "}\n");
 
-  /* XXX This cannot go into gpu_shader_material.glsl because main() would be parsed and generate error */
+  /* XXX This cannot go into gpu_shader_material.glsl because main()
+   * would be parsed and generate error */
   /* Old glsl mode compat. */
   BLI_dynstr_append(ds, "#ifndef NODETREE_EXEC\n");
   BLI_dynstr_append(ds, "out vec4 fragColor;\n");
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c
index dbe1d2c8d69..a77f9ca5f11 100644
--- a/source/blender/gpu/intern/gpu_framebuffer.c
+++ b/source/blender/gpu/intern/gpu_framebuffer.c
@@ -717,7 +717,8 @@ void GPU_framebuffer_blit(GPUFrameBuffer *fb_read,
 
 /**
  * Use this if you need to custom downsample your texture and use the previous mip level as input.
- * This function only takes care of the correct texture handling. It execute the callback for each texture level.
+ * This function only takes care of the correct texture handling.
+ * It execute the callback for each texture level.
  */
 void GPU_framebuffer_recursive_downsample(GPUFrameBuffer *fb,
                                           int max_lvl,
diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c
index 3c8b76dd36c..11c4cfba8df 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -634,7 +634,9 @@ static void immEndVertex(void) /* and move on to the next vertex */
       if ((imm.unassigned_attr_bits >> a_idx) & 1) {
         const GPUVertAttr *a = &imm.vertex_format.attrs[a_idx];
 
-        /*              printf("copying %s from vertex %u to %u\n", a->name, imm.vertex_idx - 1, imm.vertex_idx); */
+#if 0
+        printf("copying %s from vertex %u to %u\n", a->name, imm.vertex_idx - 1, imm.vertex_idx);
+#endif
 
         GLubyte *data = imm.vertex_data + a->offset;
         memcpy(data, data - imm.vertex_format.stride, a->sz);
diff --git a/source/blender/gpu/intern/gpu_select.c b/source/blender/gpu/intern/gpu_select.c
index 4cfedc0708b..4268af2198d 100644
--- a/source/blender/gpu/intern/gpu_select.c
+++ b/source/blender/gpu/intern/gpu_select.c
@@ -69,7 +69,8 @@ static GPUSelectState g_select_state = {0};
 void GPU_select_begin(uint *buffer, uint bufsize, const rcti *input, char mode, int oldhits)
 {
   if (mode == GPU_SELECT_NEAREST_SECOND_PASS) {
-    /* In the case hits was '-1', don't start the second pass since it's not going to give useful results.
+    /* In the case hits was '-1',
+     * don't start the second pass since it's not going to give useful results.
      * As well as buffer overflow in 'gpu_select_query_load_id'. */
     BLI_assert(oldhits != -1);
   }
@@ -99,7 +100,8 @@ void GPU_select_begin(uint *buffer, uint bufsize, const rcti *input, char mode,
 }
 
 /**
- * loads a new selection id and ends previous query, if any. In second pass of selection it also returns
+ * loads a new selection id and ends previous query, if any.
+ * In second pass of selection it also returns
  * if id has been hit on the first pass already.
  * Thus we can skip drawing un-hit objects.
  *
diff --git a/source/blender/gpu/intern/gpu_select_pick.c b/source/blender/gpu/intern/gpu_select_pick.c
index 253c8703234..6c3e05912b0 100644
--- a/source/blender/gpu/intern/gpu_select_pick.c
+++ b/source/blender/gpu/intern/gpu_select_pick.c
@@ -318,7 +318,8 @@ void gpu_select_pick_begin(uint (*buffer)[4], uint bufsize, const rcti *input, c
     if (mode == GPU_SELECT_PICK_ALL) {
       /* Note that other depth settings (such as #GL_LEQUAL) work too,
        * since the depth is always cleared.
-       * Noting this for cases when depth picking is used where drawing calls change depth settings. */
+       * Noting this for cases when depth picking is used where
+       * drawing calls change depth settings. */
       glDepthFunc(GL_ALWAYS);
     }
     else {
diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c
index dd8035e2618..5fe23824ce2 100644
--- a/source/blender/gpu/intern/gpu_shader.c
+++ b/source/blender/gpu/intern/gpu_shader.c
@@ -557,10 +557,10 @@ static const char *string_join_array_maybe_alloc(const char **str_arr, bool *r_i
  * Example:
  * \code{.c}
  * sh 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list