[Bf-blender-cvs] [2c212aa8771] temp-gpu-compute-shaders: Cleanup: Code formatting.

Jeroen Bakker noreply at git.blender.org
Wed May 26 16:38:15 CEST 2021


Commit: 2c212aa87718de24ef25a9adba3f80908cbb9558
Author: Jeroen Bakker
Date:   Wed May 26 16:38:10 2021 +0200
Branches: temp-gpu-compute-shaders
https://developer.blender.org/rB2c212aa87718de24ef25a9adba3f80908cbb9558

Cleanup: Code formatting.

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

M	source/blender/gpu/intern/gpu_compute.cc
M	source/blender/gpu/intern/gpu_index_buffer.cc
M	source/blender/gpu/intern/gpu_index_buffer_private.hh
M	source/blender/gpu/intern/gpu_vertex_buffer_private.hh
M	source/blender/gpu/opengl/gl_shader_interface.cc
M	source/blender/gpu/opengl/gl_vertex_buffer.cc
M	source/blender/gpu/opengl/gl_vertex_buffer.hh

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

diff --git a/source/blender/gpu/intern/gpu_compute.cc b/source/blender/gpu/intern/gpu_compute.cc
index 963726538c1..7a8ae2acf9a 100644
--- a/source/blender/gpu/intern/gpu_compute.cc
+++ b/source/blender/gpu/intern/gpu_compute.cc
@@ -26,7 +26,10 @@
 extern "C" {
 #endif
 
-void GPU_compute_dispatch(GPUShader *shader, uint groups_x_len, uint groups_y_len, uint groups_z_len)
+void GPU_compute_dispatch(GPUShader *shader,
+                          uint groups_x_len,
+                          uint groups_y_len,
+                          uint groups_z_len)
 {
   blender::gpu::GPUBackend &gpu_backend = *blender::gpu::GPUBackend::get();
   GPU_shader_bind(shader);
diff --git a/source/blender/gpu/intern/gpu_index_buffer.cc b/source/blender/gpu/intern/gpu_index_buffer.cc
index e7009addde1..9526a961e12 100644
--- a/source/blender/gpu/intern/gpu_index_buffer.cc
+++ b/source/blender/gpu/intern/gpu_index_buffer.cc
@@ -326,12 +326,13 @@ void IndexBuf::squeeze_indices_short(uint min_idx, uint max_idx)
   }
 }
 
-  uint32_t *IndexBuf::unmap(const uint32_t* mapped_memory) const {
-    size_t size = size_get();
-    uint32_t *result = static_cast<uint32_t *>(MEM_mallocN(size, __func__));
-    memcpy(result, mapped_memory, size);
-    return result;
-  }
+uint32_t *IndexBuf::unmap(const uint32_t *mapped_memory) const
+{
+  size_t size = size_get();
+  uint32_t *result = static_cast<uint32_t *>(MEM_mallocN(size, __func__));
+  memcpy(result, mapped_memory, size);
+  return result;
+}
 
 }  // namespace blender::gpu
 
diff --git a/source/blender/gpu/intern/gpu_index_buffer_private.hh b/source/blender/gpu/intern/gpu_index_buffer_private.hh
index 07c163b000f..63958170e50 100644
--- a/source/blender/gpu/intern/gpu_index_buffer_private.hh
+++ b/source/blender/gpu/intern/gpu_index_buffer_private.hh
@@ -95,7 +95,7 @@ class IndexBuf {
   virtual void bind_as_ssbo(uint binding) = 0;
 
   virtual uint32_t *read() const = 0;
-  uint32_t *unmap(const uint32_t* mapped_memory) const;
+  uint32_t *unmap(const uint32_t *mapped_memory) const;
 
  private:
   inline void squeeze_indices_short(uint min_idx, uint max_idx);
diff --git a/source/blender/gpu/intern/gpu_vertex_buffer_private.hh b/source/blender/gpu/intern/gpu_vertex_buffer_private.hh
index 9143d5d601f..4aedd32e22b 100644
--- a/source/blender/gpu/intern/gpu_vertex_buffer_private.hh
+++ b/source/blender/gpu/intern/gpu_vertex_buffer_private.hh
@@ -98,7 +98,7 @@ class VertBuf {
 
   virtual void update_sub(uint start, uint len, void *data) = 0;
   virtual void *read() const = 0;
-  virtual void *unmap(const void* mapped_data) const = 0;
+  virtual void *unmap(const void *mapped_data) const = 0;
 
  protected:
   virtual void acquire_data(void) = 0;
diff --git a/source/blender/gpu/opengl/gl_shader_interface.cc b/source/blender/gpu/opengl/gl_shader_interface.cc
index ee84b2aff24..9cf072b2e8a 100644
--- a/source/blender/gpu/opengl/gl_shader_interface.cc
+++ b/source/blender/gpu/opengl/gl_shader_interface.cc
@@ -133,14 +133,8 @@ static inline int ssbo_binding(int32_t program, uint32_t ssbo_index)
   GLint binding = -1;
   GLenum property = GL_BUFFER_BINDING;
   GLint values_written = 0;
-  glGetProgramResourceiv(program,
-                         GL_SHADER_STORAGE_BLOCK,
-                         ssbo_index,
-                         1,
-                         &property,
-                         1,
-                         &values_written,
-                         &binding);
+  glGetProgramResourceiv(
+      program, GL_SHADER_STORAGE_BLOCK, ssbo_index, 1, &property, 1, &values_written, &binding);
 
   return binding;
 }
diff --git a/source/blender/gpu/opengl/gl_vertex_buffer.cc b/source/blender/gpu/opengl/gl_vertex_buffer.cc
index 69575c396fb..52e75ebaae5 100644
--- a/source/blender/gpu/opengl/gl_vertex_buffer.cc
+++ b/source/blender/gpu/opengl/gl_vertex_buffer.cc
@@ -130,7 +130,8 @@ void *GLVertBuf::read() const
   return result;
 }
 
-void *GLVertBuf::unmap(const void* mapped_data) const {
+void *GLVertBuf::unmap(const void *mapped_data) const
+{
   void *result = MEM_mallocN(vbo_size_, __func__);
   memcpy(result, mapped_data, vbo_size_);
   return result;
diff --git a/source/blender/gpu/opengl/gl_vertex_buffer.hh b/source/blender/gpu/opengl/gl_vertex_buffer.hh
index 08b3c80a04d..a81a647da55 100644
--- a/source/blender/gpu/opengl/gl_vertex_buffer.hh
+++ b/source/blender/gpu/opengl/gl_vertex_buffer.hh
@@ -48,7 +48,7 @@ class GLVertBuf : public VertBuf {
   void update_sub(uint start, uint len, void *data) override;
 
   void *read() const override;
-  void *unmap(const void* mapped_data) const override;
+  void *unmap(const void *mapped_data) const override;
 
  protected:
   void acquire_data(void) override;



More information about the Bf-blender-cvs mailing list