From add2a656daa61c42ce872fc13562246b76e23cd0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 19 Aug 2023 17:13:05 +1000 Subject: [PATCH] Cleanup: spelling, use C-style in GLSL --- .../operations/COM_OpenCLKernels.cl | 4 +- ...basic_depth_vert_conservative_no_geom.glsl | 11 ++-- .../engines/eevee/shaders/surface_lib.glsl | 2 +- .../eevee_next/shaders/eevee_bxdf_lib.glsl | 2 +- .../shaders/eevee_bxdf_sampling_lib.glsl | 2 +- .../eevee_next/shaders/eevee_camera_lib.glsl | 2 +- .../eevee_depth_of_field_accumulator_lib.glsl | 7 +-- .../eevee_depth_of_field_gather_comp.glsl | 2 +- .../eevee_depth_of_field_hole_fill_comp.glsl | 2 +- .../shaders/eevee_depth_of_field_lib.glsl | 4 +- .../eevee_depth_of_field_reduce_comp.glsl | 2 +- .../eevee_depth_of_field_scatter_vert.glsl | 2 +- .../eevee_depth_of_field_setup_comp.glsl | 2 +- .../eevee_depth_of_field_stabilize_comp.glsl | 2 +- ...evee_depth_of_field_tiles_dilate_comp.glsl | 2 +- .../eevee_next/shaders/eevee_film_lib.glsl | 2 +- .../shaders/eevee_geom_world_vert.glsl | 2 +- .../eevee_next/shaders/eevee_light_lib.glsl | 5 +- .../shaders/eevee_sampling_lib.glsl | 2 +- .../shaders/eevee_subsurface_eval_frag.glsl | 2 +- .../shaders/eevee_surf_forward_frag.glsl | 2 +- .../shaders/eevee_surf_shadow_frag.glsl | 2 +- .../shaders/eevee_surf_world_frag.glsl | 2 +- .../shaders/overlay_antialiasing_frag.glsl | 6 +- ...verlay_edit_curve_handle_vert_no_geom.glsl | 4 +- .../shaders/overlay_edit_mesh_frag.glsl | 6 +- .../shaders/overlay_edit_uv_edges_frag.glsl | 2 +- .../overlay/shaders/overlay_grid_frag.glsl | 4 +- .../overlay/shaders/overlay_grid_vert.glsl | 4 +- .../intern/shaders/common_debug_draw_lib.glsl | 2 +- .../shaders/draw_debug_draw_display_frag.glsl | 2 +- .../shaders/draw_debug_draw_display_vert.glsl | 2 +- .../draw_debug_print_display_frag.glsl | 2 +- .../draw_debug_print_display_vert.glsl | 2 +- .../shaders/common/gpu_shader_smaa_lib.glsl | 62 +++++++++---------- .../gpu_shader_3D_polyline_vert_no_geom.glsl | 2 +- 36 files changed, 83 insertions(+), 84 deletions(-) diff --git a/source/blender/compositor/operations/COM_OpenCLKernels.cl b/source/blender/compositor/operations/COM_OpenCLKernels.cl index 3b1b995208d..589eb51d5f5 100644 --- a/source/blender/compositor/operations/COM_OpenCLKernels.cl +++ b/source/blender/compositor/operations/COM_OpenCLKernels.cl @@ -2,9 +2,9 @@ * * SPDX-License-Identifier: GPL-2.0-or-later */ -/// This file contains all opencl kernels for node-operation implementations +/* This file contains all opencl kernels for node-operation implementations. */ -// Global SAMPLERS +/* Global SAMPLERS. */ const sampler_t SAMPLER_NEAREST = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST; const sampler_t SAMPLER_NEAREST_CLAMP = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST; diff --git a/source/blender/draw/engines/basic/shaders/basic_depth_vert_conservative_no_geom.glsl b/source/blender/draw/engines/basic/shaders/basic_depth_vert_conservative_no_geom.glsl index b90262d0ac5..5eb83a4d6f0 100644 --- a/source/blender/draw/engines/basic/shaders/basic_depth_vert_conservative_no_geom.glsl +++ b/source/blender/draw/engines/basic/shaders/basic_depth_vert_conservative_no_geom.glsl @@ -17,9 +17,10 @@ void main() else if (vertex_fetch_get_input_prim_type() == GPU_PRIM_TRI_STRIP) { base_vertex_id = output_triangle_id; } - /* NOTE: Triangle fan unsupported in Metal. Will be conveted upfront. */ + /* NOTE: Triangle fan unsupported in Metal. Will be converted upfront. */ + + /* Perform vertex shader calculations per input vertex. */ - /** Perform vertex shader calculations per input vertex. **/ /* input pos vertex attribute. */ vec3 in_pos[3]; /* Calculated per-vertex world pos. */ @@ -36,10 +37,10 @@ void main() pos[i] = ndc_pos[i].xyz / ndc_pos[i].w; } - /** Geometry Shader equivalent calculation + /* Geometry Shader equivalent calculation * In this no_geom mode using SSBO vertex fetch, rather than emitting 3 vertices, the vertex - * shader is invocated 3 times, and output is determined based on vertex ID within a triangle - * 0..2. **/ + * shader is innovated 3 times, and output is determined based on vertex ID within a triangle + * 0..2. */ vec3 plane = normalize(cross(pos[1] - pos[0], pos[2] - pos[0])); /* Compute NDC bound box. */ vec4 bbox = vec4(min(min(pos[0].xy, pos[1].xy), pos[2].xy), diff --git a/source/blender/draw/engines/eevee/shaders/surface_lib.glsl b/source/blender/draw/engines/eevee/shaders/surface_lib.glsl index 1eb8e40e5ae..7b4c1ca8fe4 100644 --- a/source/blender/draw/engines/eevee/shaders/surface_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/surface_lib.glsl @@ -76,7 +76,7 @@ IN_OUT ShaderPointCloudInterface # endif #else -/** Checks to ensure create-info is setup correctly. **/ +/* Checks to ensure create-info is setup correctly. */ # ifdef HAIR_SHADER # ifndef USE_SURFACE_LIB_HAIR # error Ensure CreateInfo eevee_legacy_surface_lib_hair is included if using surface library with a hair shader. diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_bxdf_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_bxdf_lib.glsl index 3eb7f569598..1f2c9536cc3 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_bxdf_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_bxdf_lib.glsl @@ -1,7 +1,7 @@ /** * BxDF evaluation functions. - **/ + */ #pragma BLENDER_REQUIRE(common_math_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_bxdf_sampling_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_bxdf_sampling_lib.glsl index 6eef54735bc..a9e2214647f 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_bxdf_sampling_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_bxdf_sampling_lib.glsl @@ -1,7 +1,7 @@ /** * Sampling of Normal Distribution Function for various BxDF. - **/ + */ #pragma BLENDER_REQUIRE(eevee_bxdf_lib.glsl) #pragma BLENDER_REQUIRE(common_math_geom_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_camera_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_camera_lib.glsl index 2611f714b59..77deeee902b 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_camera_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_camera_lib.glsl @@ -1,7 +1,7 @@ /** * Camera projection / uv functions and utils. - **/ + */ #pragma BLENDER_REQUIRE(common_math_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_accumulator_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_accumulator_lib.glsl index 8c6dfbe01ab..6fb3aab408d 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_accumulator_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_accumulator_lib.glsl @@ -3,7 +3,7 @@ * Depth of Field Gather accumulator. * We currently have only 2 which are very similar. * One is for the halfres gather passes and the other one for slight in focus regions. - **/ + */ #pragma BLENDER_REQUIRE(common_view_lib.glsl) #pragma BLENDER_REQUIRE(eevee_colorspace_lib.glsl) @@ -166,10 +166,9 @@ void dof_gather_accumulate_sample_pair(DofGatherData pair_data[2], pair_data[i].coc, pair_data[i].dist, intersection_multiplier); float weight = inter_weight * layer_weight * sample_weight; - /** - * If a CoC is larger than bordering radius we accumulate it to the general accumulator. + /* If a CoC is larger than bordering radius we accumulate it to the general accumulator. * If not, we accumulate to the ring bucket. This is to have more consistent sample occlusion. - **/ + */ float accum_weight = dof_gather_accum_weight(pair_data[i].coc, bordering_radius, first_ring); dof_gather_accumulate_sample(pair_data[i], weight * accum_weight, accum_data); dof_gather_accumulate_sample(pair_data[i], weight * (1.0 - accum_weight), ring_data); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_gather_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_gather_comp.glsl index cf8dd7a36e6..84663f53ba5 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_gather_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_gather_comp.glsl @@ -10,7 +10,7 @@ * * Outputs: * - Color * Weight, Weight, Occlusion 'CoC' Depth (mean and variance) - **/ + */ #pragma BLENDER_REQUIRE(eevee_depth_of_field_accumulator_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_hole_fill_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_hole_fill_comp.glsl index 5cdabbc2d4b..3b518d68076 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_hole_fill_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_hole_fill_comp.glsl @@ -7,7 +7,7 @@ * * We sample using an octaweb sampling pattern. We randomize the kernel center and each ring * rotation to ensure maximum coverage. - **/ + */ #pragma BLENDER_REQUIRE(eevee_depth_of_field_accumulator_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_lib.glsl index f89da641446..f3ac62caa37 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_lib.glsl @@ -1,7 +1,7 @@ /** * Depth of Field utils. - **/ + */ #pragma BLENDER_REQUIRE(common_view_lib.glsl) #pragma BLENDER_REQUIRE(common_math_lib.glsl) @@ -305,7 +305,7 @@ CocTilePrediction dof_coc_tile_prediction_get(CocTile tile) * . . . . . * * Samples are expected to be mirrored to complete the pattern. - **/ + */ ivec2 dof_square_ring_sample_offset(int ring_distance, int sample_id) { ivec2 offset; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_reduce_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_reduce_comp.glsl index 1f7f172080a..6ac3c189b1f 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_reduce_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_reduce_comp.glsl @@ -10,7 +10,7 @@ * Outputs: * - Halfres padded to avoid mipmap misalignment (so possibly not matching input size). * - Gather input color (whole mip chain), Scatter rect list, Signed CoC (whole mip chain). - **/ + */ #pragma BLENDER_REQUIRE(eevee_depth_of_field_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_scatter_vert.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_scatter_vert.glsl index 494e65f660c..2e39198cc09 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_scatter_vert.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_scatter_vert.glsl @@ -4,7 +4,7 @@ * * We only scatter one triangle per sprite and one sprite per 4 pixels to reduce vertex shader * invocations and overdraw. - **/ + */ #pragma BLENDER_REQUIRE(eevee_depth_of_field_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_setup_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_setup_comp.glsl index c017a5aa965..d1a54f5e66d 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_setup_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_setup_comp.glsl @@ -9,7 +9,7 @@ * Full-resolution color & depth buffer * Output: * Half-resolution Color, signed CoC (out_coc.x), and max slight focus abs CoC (out_coc.y). - **/ + */ #pragma BLENDER_REQUIRE(common_math_lib.glsl) #pragma BLENDER_REQUIRE(common_view_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_stabilize_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_stabilize_comp.glsl index 960097a2e2b..dd1121b423c 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_stabilize_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_stabilize_comp.glsl @@ -12,7 +12,7 @@ * - Output of setup pass (halfres). * Outputs: * - Stabilized Color and CoC (halfres). - **/ + */ #pragma BLENDER_REQUIRE(common_math_geom_lib.glsl) #pragma BLENDER_REQUIRE(eevee_colorspace_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_tiles_dilate_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_tiles_dilate_comp.glsl index dba8b5fd79d..f68f9ab8b51 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_tiles_dilate_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_tiles_dilate_comp.glsl @@ -5,7 +5,7 @@ * * Input & Output: * - Separated foreground and background CoC. 1/8th of half-res resolution. So 1/16th of full-res. - **/ + */ #pragma BLENDER_REQUIRE(eevee_depth_of_field_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_film_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_film_lib.glsl index ceca64e2acf..9aece0b9846 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_film_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_film_lib.glsl @@ -1,7 +1,7 @@ /** * Film accumulation utils functions. - **/ + */ #pragma BLENDER_REQUIRE(common_view_lib.glsl) #pragma BLENDER_REQUIRE(common_math_geom_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_geom_world_vert.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_geom_world_vert.glsl index cbf85ca56a9..dc778e4378f 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_geom_world_vert.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_geom_world_vert.glsl @@ -1,7 +1,7 @@ /** * Custom fullscreen triangle with placeholders varyings. - **/ + */ #pragma BLENDER_REQUIRE(common_view_lib.glsl) #pragma BLENDER_REQUIRE(eevee_nodetree_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_light_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_light_lib.glsl index d0525bea7d2..78756fca120 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_light_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_light_lib.glsl @@ -110,11 +110,10 @@ float light_point_light(LightData ld, const bool is_directional, vec3 L, float d if (is_directional) { return 1.0; } - /** - * Using "Point Light Attenuation Without Singularity" from Cem Yuksel + /* Using "Point Light Attenuation Without Singularity" from Cem Yuksel * http://www.cemyuksel.com/research/pointlightattenuation/pointlightattenuation.pdf * http://www.cemyuksel.com/research/pointlightattenuation/ - **/ + */ float d_sqr = sqr(dist); float r_sqr = ld.radius_squared; /* Using reformulation that has better numerical precision. */ diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_sampling_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_sampling_lib.glsl index cc8dcd44e3b..98e7f9f2c1d 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_sampling_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_sampling_lib.glsl @@ -2,7 +2,7 @@ /** * Sampling data accessors and random number generators. * Also contains some sample mapping functions. - **/ + */ #pragma BLENDER_REQUIRE(common_math_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_subsurface_eval_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_subsurface_eval_frag.glsl index 1553de52405..f9ecbee5d65 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_subsurface_eval_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_subsurface_eval_frag.glsl @@ -9,7 +9,7 @@ * * But, instead of having all the precomputed weights for all three color primaries, * we precompute a weight profile texture to be able to support per pixel AND per channel radius. - **/ + */ #pragma BLENDER_REQUIRE(gpu_shader_codegen_lib.glsl) #pragma BLENDER_REQUIRE(eevee_gbuffer_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_forward_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_forward_frag.glsl index f04f82b3e8c..1b24cd7253b 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_forward_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_forward_frag.glsl @@ -3,7 +3,7 @@ * Forward lighting evaluation: Lighting is evaluated during the geometry rasterization. * * This is used by alpha blended materials and materials using Shader to RGB nodes. - **/ + */ #pragma BLENDER_REQUIRE(common_hair_lib.glsl) #pragma BLENDER_REQUIRE(common_math_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_shadow_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_shadow_frag.glsl index 13ace0b28f5..d60ec84e38a 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_shadow_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_shadow_frag.glsl @@ -6,7 +6,7 @@ * virtual page it is supposed to go and load the physical page adress. * If a physical page exists, we then use atomicMin to mimic a less-than depth test and write to * the destination texel. - **/ + */ #pragma BLENDER_REQUIRE(common_view_lib.glsl) #pragma BLENDER_REQUIRE(common_math_lib.glsl) diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_world_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_world_frag.glsl index e9f63c3e0ab..1ebbaf64fcd 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_world_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_world_frag.glsl @@ -3,7 +3,7 @@ * Background used to shade the world. * * Outputs shading parameter per pixel using a set of randomized BSDFs. - **/ + */ #pragma BLENDER_REQUIRE(common_view_lib.glsl) #pragma BLENDER_REQUIRE(common_math_lib.glsl) diff --git a/source/blender/draw/engines/overlay/shaders/overlay_antialiasing_frag.glsl b/source/blender/draw/engines/overlay/shaders/overlay_antialiasing_frag.glsl index 606292bbe83..3059b2a9591 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_antialiasing_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_antialiasing_frag.glsl @@ -5,10 +5,10 @@ /** * We want to know how much a pixel is covered by a line. - * We replace the square pixel with acircle of the same area and try to find the intersection area. + * We replace the square pixel with a circle of the same area and try to find the intersection area. * The area we search is the circular segment. https://en.wikipedia.org/wiki/Circular_segment - * The formula for the area uses inverse trig function and is quite complexe. Instead, - * we approximate it by using the smoothstep function and a 1.05 factor to the disc radius. + * The formula for the area uses inverse trig function and is quite complex. Instead, + * we approximate it by using the smooth-step function and a 1.05 factor to the disc radius. */ #define DISC_RADIUS (M_1_SQRTPI * 1.05) #define LINE_SMOOTH_START (0.5 - DISC_RADIUS) diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl index 5316c87fdee..c18b456a89f 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl @@ -114,8 +114,8 @@ void main() offset.x = 0.0; } - /** Each output vertex falls into 10 possible positions to generate 8 output triangles between 5 - * lines. **/ + /* Each output vertex falls into 10 possible positions to generate 8 output triangles between 5 + * lines. */ /* Discard transparent border quads up-front. */ if (!(is_active_nurb != 0u)) { if (output_quad_id == 0 || output_quad_id == 3) { diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_frag.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_frag.glsl index 69dc62f6806..7f18b7ce7fa 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_frag.glsl @@ -3,10 +3,10 @@ /** * We want to know how much a pixel is covered by a line. - * We replace the square pixel with acircle of the same area and try to find the intersection area. + * We replace the square pixel with a circle of the same area and try to find the intersection area. * The area we search is the circular segment. https://en.wikipedia.org/wiki/Circular_segment - * The formula for the area uses inverse trig function and is quite complexe. Instead, - * we approximate it by using the smoothstep function and a 1.05 factor to the disc radius. + * The formula for the area uses inverse trig function and is quite complex. Instead, + * we approximate it by using the smooth-step function and a 1.05 factor to the disc radius. */ #define DISC_RADIUS (M_1_SQRTPI * 1.05) #define GRID_LINE_SMOOTH_START (0.5 - DISC_RADIUS) diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_frag.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_frag.glsl index 2a6b65a7186..a74482521a5 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_edges_frag.glsl @@ -2,7 +2,7 @@ /** * We want to know how much a pixel is covered by a line. - * We replace the square pixel with acircle of the same area and try to find the intersection area. + * We replace the square pixel with a circle of the same area and try to find the intersection area. * The area we search is the circular segment. https://en.wikipedia.org/wiki/Circular_segment * The formula for the area uses inverse trig function and is quite complex. Instead, * we approximate it by using the smooth-step function and a 1.05 factor to the disc radius. diff --git a/source/blender/draw/engines/overlay/shaders/overlay_grid_frag.glsl b/source/blender/draw/engines/overlay/shaders/overlay_grid_frag.glsl index 1a44c5ccb84..ba23559dd8c 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_grid_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_grid_frag.glsl @@ -1,8 +1,8 @@ /** * Infinite grid: - * Draw antialiased grid and axes of different sizes with smooth blending between levels of detail. + * Draw anti-aliased grid and axes of different sizes with smooth blending between levels of detail. * We draw multiple triangles to avoid float precision issues due to perspective interpolation. - **/ + */ #pragma BLENDER_REQUIRE(common_view_lib.glsl) #pragma BLENDER_REQUIRE(common_math_lib.glsl) diff --git a/source/blender/draw/engines/overlay/shaders/overlay_grid_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_grid_vert.glsl index 6a027f94f49..481bc1ac65d 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_grid_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_grid_vert.glsl @@ -1,8 +1,8 @@ /** * Infinite grid: - * Draw antialiazed grid and axes of different sizes with smooth blending between Level of details. + * Draw anti-aliased grid and axes of different sizes with smooth blending between Level of details. * We draw multiple triangles to avoid float precision issues due to perspective interpolation. - **/ + */ #pragma BLENDER_REQUIRE(common_view_lib.glsl) #pragma BLENDER_REQUIRE(common_math_lib.glsl) diff --git a/source/blender/draw/intern/shaders/common_debug_draw_lib.glsl b/source/blender/draw/intern/shaders/common_debug_draw_lib.glsl index 1a5944e3cf1..010b486b49f 100644 --- a/source/blender/draw/intern/shaders/common_debug_draw_lib.glsl +++ b/source/blender/draw/intern/shaders/common_debug_draw_lib.glsl @@ -4,7 +4,7 @@ * * Quick way to draw debug geometry. All input should be in world space and * will be rendered in the default view. No additional setup required. - **/ + */ /** Global switch option. */ bool drw_debug_draw_enable = true; diff --git a/source/blender/draw/intern/shaders/draw_debug_draw_display_frag.glsl b/source/blender/draw/intern/shaders/draw_debug_draw_display_frag.glsl index 3fc5294b024..28043854787 100644 --- a/source/blender/draw/intern/shaders/draw_debug_draw_display_frag.glsl +++ b/source/blender/draw/intern/shaders/draw_debug_draw_display_frag.glsl @@ -1,7 +1,7 @@ /** * Display debug edge list. - **/ + */ void main() { diff --git a/source/blender/draw/intern/shaders/draw_debug_draw_display_vert.glsl b/source/blender/draw/intern/shaders/draw_debug_draw_display_vert.glsl index a1fe79c35c5..5fff31e1bf7 100644 --- a/source/blender/draw/intern/shaders/draw_debug_draw_display_vert.glsl +++ b/source/blender/draw/intern/shaders/draw_debug_draw_display_vert.glsl @@ -1,7 +1,7 @@ /** * Display debug edge list. - **/ + */ void main() { diff --git a/source/blender/draw/intern/shaders/draw_debug_print_display_frag.glsl b/source/blender/draw/intern/shaders/draw_debug_print_display_frag.glsl index 4e0d980637f..452d324718c 100644 --- a/source/blender/draw/intern/shaders/draw_debug_print_display_frag.glsl +++ b/source/blender/draw/intern/shaders/draw_debug_print_display_frag.glsl @@ -1,7 +1,7 @@ /** * Display characters using an ascii table. - **/ + */ #pragma BLENDER_REQUIRE(common_math_lib.glsl) diff --git a/source/blender/draw/intern/shaders/draw_debug_print_display_vert.glsl b/source/blender/draw/intern/shaders/draw_debug_print_display_vert.glsl index 57f293cc6e8..51b166e4a17 100644 --- a/source/blender/draw/intern/shaders/draw_debug_print_display_vert.glsl +++ b/source/blender/draw/intern/shaders/draw_debug_print_display_vert.glsl @@ -1,7 +1,7 @@ /** * Display characters using an ascii table. Outputs one point per character. - **/ + */ #pragma BLENDER_REQUIRE(common_view_lib.glsl) diff --git a/source/blender/gpu/shaders/common/gpu_shader_smaa_lib.glsl b/source/blender/gpu/shaders/common/gpu_shader_smaa_lib.glsl index 03788cfc91f..993f7d6b269 100644 --- a/source/blender/gpu/shaders/common/gpu_shader_smaa_lib.glsl +++ b/source/blender/gpu/shaders/common/gpu_shader_smaa_lib.glsl @@ -292,8 +292,8 @@ * That's it! */ -//----------------------------------------------------------------------------- -// SMAA Presets +/* ---------------------------------------------------------------------------- + * SMAA Presets */ /** * Note that if you use one of these presets, the following configuration @@ -322,8 +322,8 @@ # define SMAA_CORNER_ROUNDING 25 #endif -//----------------------------------------------------------------------------- -// Configurable Defines +/* ---------------------------------------------------------------------------- + * Configurable Defines */ /** * SMAA_THRESHOLD specifies the threshold or sensitivity to edges. @@ -491,8 +491,8 @@ # define SMAA_INCLUDE_PS 1 #endif -//----------------------------------------------------------------------------- -// Texture Access Defines +/* ---------------------------------------------------------------------------- + * Texture Access Defines */ #ifndef SMAA_AREATEX_SELECT # if defined(SMAA_HLSL_3) @@ -510,8 +510,8 @@ # define SMAA_DECODE_VELOCITY(sample) sample.rg #endif -//----------------------------------------------------------------------------- -// Non-Configurable Defines +/* ---------------------------------------------------------------------------- + * Non-Configurable Defines */ #define SMAA_AREATEX_MAX_DISTANCE 16 #define SMAA_AREATEX_MAX_DISTANCE_DIAG 20 @@ -521,8 +521,8 @@ #define SMAA_SEARCHTEX_PACKED_SIZE float2(64.0, 16.0) #define SMAA_CORNER_ROUNDING_NORM (float(SMAA_CORNER_ROUNDING) / 100.0) -//----------------------------------------------------------------------------- -// Porting Functions +/* ---------------------------------------------------------------------------- + * Porting Functions */ #if defined(SMAA_HLSL_3) # define SMAATexture2D(tex) sampler2D tex @@ -628,8 +628,8 @@ float mad(float a, float b, float c) #endif /* clang-format on */ -//----------------------------------------------------------------------------- -// Misc functions +/* ---------------------------------------------------------------------------- + * Misc functions */ /** * Gathers current pixel, and the top-left neighbors. @@ -675,8 +675,8 @@ void SMAAMovc(bool4 cond, inout float4 variable, float4 value) } #if SMAA_INCLUDE_VS -//----------------------------------------------------------------------------- -// Vertex Shaders +/* ---------------------------------------------------------------------------- + * Vertex Shaders */ /** * Edge Detection Vertex Shader @@ -731,8 +731,8 @@ void SMAANeighborhoodBlendingVS(float2 texcoord, out float4 offset) #endif // SMAA_INCLUDE_VS #if SMAA_INCLUDE_PS -//----------------------------------------------------------------------------- -// Edge Detection Pixel Shaders (First Pass) +/* ---------------------------------------------------------------------------- + * Edge Detection Pixel Shaders (First Pass) */ # ifndef SMAA_LUMA_WEIGHT # define SMAA_LUMA_WEIGHT float4(0.2126, 0.7152, 0.0722, 0.0) @@ -909,8 +909,8 @@ float2 SMAADepthEdgeDetectionPS(float2 texcoord, float4 offset[3], SMAATexture2D return edges; } -//----------------------------------------------------------------------------- -// Diagonal Search Functions +/* ---------------------------------------------------------------------------- + * Diagonal Search Functions */ # if !defined(SMAA_DISABLE_DIAG_DETECTION) @@ -1081,8 +1081,8 @@ float2 SMAACalculateDiagWeights(SMAATexture2D(edgesTex), } # endif -//----------------------------------------------------------------------------- -// Horizontal/Vertical Search Functions +/* ---------------------------------------------------------------------------- + * Horizontal/Vertical Search Functions */ /** * This allows to determine how much length should we add in the last step @@ -1220,8 +1220,8 @@ float2 SMAAArea(SMAATexture2D(areaTex), float2 dist, float e1, float e2, float o return SMAA_AREATEX_SELECT(SMAASampleLevelZero(areaTex, texcoord)); } -//----------------------------------------------------------------------------- -// Corner Detection Functions +/* ---------------------------------------------------------------------------- + * Corner Detection Functions */ void SMAADetectHorizontalCornerPattern(SMAATexture2D(edgesTex), inout float2 weights, @@ -1265,8 +1265,8 @@ void SMAADetectVerticalCornerPattern(SMAATexture2D(edgesTex), # endif } -//----------------------------------------------------------------------------- -// Blending Weight Calculation Pixel Shader (Second Pass) +/* ---------------------------------------------------------------------------- + * Blending Weight Calculation Pixel Shader (Second Pass) */ float4 SMAABlendingWeightCalculationPS(float2 texcoord, float2 pixcoord, @@ -1396,8 +1396,8 @@ float4 SMAABlendingWeightCalculationPS(float2 texcoord, return weights; } -//----------------------------------------------------------------------------- -// Neighborhood Blending Pixel Shader (Third Pass) +/* ---------------------------------------------------------------------------- + * Neighborhood Blending Pixel Shader (Third Pass) */ float4 SMAANeighborhoodBlendingPS(float2 texcoord, float4 offset, @@ -1463,8 +1463,8 @@ float4 SMAANeighborhoodBlendingPS(float2 texcoord, } } -//----------------------------------------------------------------------------- -// Temporal Resolve Pixel Shader (Optional Pass) +/* ---------------------------------------------------------------------------- + * Temporal Resolve Pixel Shader (Optional Pass) */ float4 SMAAResolvePS(float2 texcoord, SMAATexture2D(currentColorTex), @@ -1500,8 +1500,8 @@ float4 SMAAResolvePS(float2 texcoord, # endif } -//----------------------------------------------------------------------------- -// Separate Multisamples Pixel Shader (Optional Pass) +/* ---------------------------------------------------------------------------- + * Separate Multisamples Pixel Shader (Optional Pass) */ # ifdef SMAALoad void SMAASeparatePS(float4 position, @@ -1516,5 +1516,5 @@ void SMAASeparatePS(float4 position, } # endif -//----------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- */ #endif // SMAA_INCLUDE_PS diff --git a/source/blender/gpu/shaders/gpu_shader_3D_polyline_vert_no_geom.glsl b/source/blender/gpu/shaders/gpu_shader_3D_polyline_vert_no_geom.glsl index 2adab6f7a35..e4f619ec5a8 100644 --- a/source/blender/gpu/shaders/gpu_shader_3D_polyline_vert_no_geom.glsl +++ b/source/blender/gpu/shaders/gpu_shader_3D_polyline_vert_no_geom.glsl @@ -132,7 +132,7 @@ void main() clip_g[1] = dot(ModelMatrix * vec4(in_pos1, 1.0), ClipPlane); #endif - /*** Geometry Shader Alternative. ***/ + /** Geometry Shader Alternative. */ vec4 p0 = clip_line_point_homogeneous_space(out_pos0, out_pos1); vec4 p1 = clip_line_point_homogeneous_space(out_pos1, out_pos0); vec2 e = normalize(((p1.xy / p1.w) - (p0.xy / p0.w)) * viewportSize.xy);