diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-08-24 14:50:59 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2018-08-24 14:50:59 +0200 |
commit | e68b96928bbc9814519534acd89003db33279858 (patch) | |
tree | f18f8b6dcf853d2f8bf446d13eeefe29d20c446b /drivers/gles2/shaders/ssao_minify.glsl | |
parent | 1b6d75a5996b5e3c7cfdea81953c5955e1645c1a (diff) |
Style: Fix code formatting in GLES2 shaders
Diffstat (limited to 'drivers/gles2/shaders/ssao_minify.glsl')
-rw-r--r-- | drivers/gles2/shaders/ssao_minify.glsl | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/gles2/shaders/ssao_minify.glsl b/drivers/gles2/shaders/ssao_minify.glsl index 647c762438..777a0069fc 100644 --- a/drivers/gles2/shaders/ssao_minify.glsl +++ b/drivers/gles2/shaders/ssao_minify.glsl @@ -1,7 +1,6 @@ [vertex] - -layout(location=0) in highp vec4 vertex_attrib; +layout(location = 0) in highp vec4 vertex_attrib; void main() { @@ -10,7 +9,6 @@ void main() { [fragment] - #ifdef MINIFY_START #define SDEPTH_TYPE highp sampler2D @@ -32,28 +30,23 @@ layout(location = 0) out mediump uint depth; void main() { - ivec2 ssP = ivec2(gl_FragCoord.xy); - // Rotated grid subsampling to avoid XY directional bias or Z precision bias while downsampling. - // On DX9, the bit-and can be implemented with floating-point modulo + // Rotated grid subsampling to avoid XY directional bias or Z precision bias while downsampling. + // On DX9, the bit-and can be implemented with floating-point modulo #ifdef MINIFY_START float fdepth = texelFetch(source_depth, clamp(ssP * 2 + ivec2(ssP.y & 1, ssP.x & 1), ivec2(0), from_size - ivec2(1)), source_mipmap).r; fdepth = fdepth * 2.0 - 1.0; #ifdef USE_ORTHOGONAL_PROJECTION - fdepth = ((fdepth + (camera_z_far + camera_z_near)/(camera_z_far - camera_z_near)) * (camera_z_far - camera_z_near))/2.0; + fdepth = ((fdepth + (camera_z_far + camera_z_near) / (camera_z_far - camera_z_near)) * (camera_z_far - camera_z_near)) / 2.0; #else fdepth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - fdepth * (camera_z_far - camera_z_near)); #endif fdepth /= camera_z_far; - depth = uint(clamp(fdepth*65535.0,0.0,65535.0)); + depth = uint(clamp(fdepth * 65535.0, 0.0, 65535.0)); #else depth = texelFetch(source_depth, clamp(ssP * 2 + ivec2(ssP.y & 1, ssP.x & 1), ivec2(0), from_size - ivec2(1)), source_mipmap).r; #endif - - } - - |