diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-09-07 17:12:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-09-07 17:23:25 +0300 |
commit | 0b2d1badecc48b5cbff5ec088b29c6e9acc5e1d0 (patch) | |
tree | 0283a5c819d1e709edfd0de814636aa83a9b1033 /source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl | |
parent | ab823176d31dc155645de733f1cd4fbd6ad74592 (diff) |
Cleanup: use post increment/decrement
When the result isn't used, prefer post increment/decrement
(already used nearly everywhere in Blender).
Diffstat (limited to 'source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl index 0428b0d408c..bd16189db32 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl @@ -256,7 +256,7 @@ void main() float coc = decode_coc(texelFetch(inputCocTex, texel, 0).rg); float max_radius = coc; vec2 noise = get_random_vector(noiseOffset) * 0.2 * clamp(max_radius * 0.2 - 4.0, 0.0, 1.0); - for (int i = 0; i < NUM_SAMPLES; ++i) { + for (int i = 0; i < NUM_SAMPLES; i++) { vec2 tc = uv + (noise + samples[i].xy) * invertedViewportSize * max_radius; /* decode_signed_coc return biggest coc. */ @@ -359,8 +359,8 @@ void main() vec v[9]; /* Add the pixels which make up our window to the pixel array. */ - for (int dX = -1; dX <= 1; ++dX) { - for (int dY = -1; dY <= 1; ++dY) { + for (int dX = -1; dX <= 1; dX++) { + for (int dY = -1; dY <= 1; dY++) { vec2 offset = vec2(float(dX), float(dY)); /* If a pixel in the window is located at (x+dX, y+dY), put it at index (dX + R)(2R + 1) + * (dY + R) of the pixel array. This will fill the pixel array, with the top left pixel of |