summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-10-28 15:43:36 +0200
committerRémi Verschelde <rverschelde@gmail.com>2021-10-28 15:43:36 +0200
commit3a6be64c12a3ba8edb646d5362c34de1a5fcc0bf (patch)
treee43708b20321cf07262918d1bd6fef02c70dabf9 /servers
parent3b11e33a099daa0978147a7550dd84ba5dd14f35 (diff)
clang-format: Various fixes to comments alignment from `clang-format` 13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
Diffstat (limited to 'servers')
-rw-r--r--servers/audio/audio_filter_sw.cpp14
-rw-r--r--servers/physics_3d/godot_soft_body_3d.cpp8
-rw-r--r--servers/physics_3d/joints/godot_generic_6dof_joint_3d.h20
-rw-r--r--servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp4
-rw-r--r--servers/rendering/renderer_rd/shaders/canvas.glsl45
-rw-r--r--servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl4
6 files changed, 43 insertions, 52 deletions
diff --git a/servers/audio/audio_filter_sw.cpp b/servers/audio/audio_filter_sw.cpp
index bcfa4c4c37..b31014bd21 100644
--- a/servers/audio/audio_filter_sw.cpp
+++ b/servers/audio/audio_filter_sw.cpp
@@ -173,28 +173,20 @@ void AudioFilterSW::prepare_coefficients(Coeffs *p_coeffs) {
p_coeffs->a2 = ((tmpgain + 1.0) - (tmpgain - 1.0) * cos_v - beta * sin_v);
} break;
- };
+ }
p_coeffs->b0 /= a0;
p_coeffs->b1 /= a0;
p_coeffs->b2 /= a0;
p_coeffs->a1 /= 0.0 - a0;
p_coeffs->a2 /= 0.0 - a0;
-
- //undenormalise
- /* p_coeffs->b0=undenormalise(p_coeffs->b0);
- p_coeffs->b1=undenormalise(p_coeffs->b1);
- p_coeffs->b2=undenormalise(p_coeffs->b2);
- p_coeffs->a1=undenormalise(p_coeffs->a1);
- p_coeffs->a2=undenormalise(p_coeffs->a2);*/
}
-void AudioFilterSW::set_stages(int p_stages) { //adjust for multiple stages
-
+void AudioFilterSW::set_stages(int p_stages) {
stages = p_stages;
}
-/* Fouriertransform kernel to obtain response */
+/* Fourier transform kernel to obtain response */
float AudioFilterSW::get_response(float p_freq, Coeffs *p_coeffs) {
float freq = p_freq / sampling_rate * Math_TAU;
diff --git a/servers/physics_3d/godot_soft_body_3d.cpp b/servers/physics_3d/godot_soft_body_3d.cpp
index f214e3603a..4b3e8cc0d9 100644
--- a/servers/physics_3d/godot_soft_body_3d.cpp
+++ b/servers/physics_3d/godot_soft_body_3d.cpp
@@ -710,9 +710,11 @@ void GodotSoftBody3D::generate_bending_constraints(int p_distance) {
// A small structure to track lists of dependent link calculations.
class LinkDeps {
public:
- int value; // A link calculation that is dependent on this one
- // Positive values = "input A" while negative values = "input B"
- LinkDeps *next; // Next dependence in the list
+ // A link calculation that is dependent on this one.
+ // Positive values = "input A" while negative values = "input B".
+ int value;
+ // Next dependence in the list.
+ LinkDeps *next;
};
typedef LinkDeps *LinkDepsPtr;
diff --git a/servers/physics_3d/joints/godot_generic_6dof_joint_3d.h b/servers/physics_3d/joints/godot_generic_6dof_joint_3d.h
index 729b3fa1f9..f37b5b981b 100644
--- a/servers/physics_3d/joints/godot_generic_6dof_joint_3d.h
+++ b/servers/physics_3d/joints/godot_generic_6dof_joint_3d.h
@@ -119,11 +119,11 @@ public:
//! Test limit
/*!
- - free means upper < lower,
- - locked means upper == lower
- - limited means upper > lower
- - limitIndex: first 3 are linear, next 3 are angular
- */
+ * - free means upper < lower,
+ * - locked means upper == lower
+ * - limited means upper > lower
+ * - limitIndex: first 3 are linear, next 3 are angular
+ */
inline bool isLimited(int limitIndex) {
return (m_upperLimit[limitIndex] >= m_lowerLimit[limitIndex]);
}
@@ -291,11 +291,11 @@ public:
//! Test limit
/*!
- - free means upper < lower,
- - locked means upper == lower
- - limited means upper > lower
- - limitIndex: first 3 are linear, next 3 are angular
- */
+ * - free means upper < lower,
+ * - locked means upper == lower
+ * - limited means upper > lower
+ * - limitIndex: first 3 are linear, next 3 are angular
+ */
bool isLimited(int limitIndex) {
if (limitIndex < 3) {
return m_linearLimits.isLimited(limitIndex);
diff --git a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp
index c69c9eeadf..13a3e814f6 100644
--- a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp
+++ b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "renderer_canvas_render_rd.h"
+
#include "core/config/project_settings.h"
#include "core/math/geometry_2d.h"
#include "core/math/math_defs.h"
@@ -1585,9 +1586,6 @@ void RendererCanvasRenderRD::light_update_shadow(RID p_rid, int p_shadow_index,
push_constant.z_far = p_far;
push_constant.pad = 0;
- /*if (i == 0)
- *p_xform_cache = projection;*/
-
LightOccluderInstance *instance = p_occluders;
while (instance) {
diff --git a/servers/rendering/renderer_rd/shaders/canvas.glsl b/servers/rendering/renderer_rd/shaders/canvas.glsl
index 2911e8b731..65a621b203 100644
--- a/servers/rendering/renderer_rd/shaders/canvas.glsl
+++ b/servers/rendering/renderer_rd/shaders/canvas.glsl
@@ -91,7 +91,6 @@ void main() {
uint instancing = draw_data.flags & FLAGS_INSTANCING_MASK;
#ifdef USE_ATTRIBUTES
-
if (instancing > 1) {
// trails
@@ -128,37 +127,37 @@ void main() {
vertex = new_vertex;
color *= pcolor;
-
} else
#endif // USE_ATTRIBUTES
+ {
+ if (instancing == 1) {
+ uint stride = 2;
+ {
+ if (bool(draw_data.flags & FLAGS_INSTANCING_HAS_COLORS)) {
+ stride += 1;
+ }
+ if (bool(draw_data.flags & FLAGS_INSTANCING_HAS_CUSTOM_DATA)) {
+ stride += 1;
+ }
+ }
+
+ uint offset = stride * gl_InstanceIndex;
+
+ mat4 matrix = mat4(transforms.data[offset + 0], transforms.data[offset + 1], vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0));
+ offset += 2;
- if (instancing == 1) {
- uint stride = 2;
- {
if (bool(draw_data.flags & FLAGS_INSTANCING_HAS_COLORS)) {
- stride += 1;
+ color *= transforms.data[offset];
+ offset += 1;
}
+
if (bool(draw_data.flags & FLAGS_INSTANCING_HAS_CUSTOM_DATA)) {
- stride += 1;
+ instance_custom = transforms.data[offset];
}
- }
-
- uint offset = stride * gl_InstanceIndex;
- mat4 matrix = mat4(transforms.data[offset + 0], transforms.data[offset + 1], vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0));
- offset += 2;
-
- if (bool(draw_data.flags & FLAGS_INSTANCING_HAS_COLORS)) {
- color *= transforms.data[offset];
- offset += 1;
- }
-
- if (bool(draw_data.flags & FLAGS_INSTANCING_HAS_CUSTOM_DATA)) {
- instance_custom = transforms.data[offset];
+ matrix = transpose(matrix);
+ world_matrix = world_matrix * matrix;
}
-
- matrix = transpose(matrix);
- world_matrix = world_matrix * matrix;
}
#if !defined(USE_ATTRIBUTES) && !defined(USE_PRIMITIVE)
diff --git a/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl b/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl
index 79f64051c0..1a47d7c5f9 100644
--- a/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl
+++ b/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl
@@ -1249,10 +1249,10 @@ void main() {
// LIGHTING
#if !defined(MODE_RENDER_DEPTH) && !defined(MODE_UNSHADED)
- { //directional light
+ { // Directional light.
+ // Do shadow and lighting in two passes to reduce register pressure.
#ifndef SHADOWS_DISABLED
- // Do shadow and lighting in two passes to reduce register pressure
uint shadow0 = 0;
uint shadow1 = 0;