diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-02-25 17:11:33 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-02-25 17:13:25 +0300 |
commit | 1bbc1eed6221fcdfad9c160d2979040d44aa888e (patch) | |
tree | edfa57bfa68e1450646b4a26c8031acbb88dc140 /source/blender/gpu/shaders | |
parent | fe3264fafd1c7c15e4c7cfc86d25a6500d01a820 (diff) |
Cleanup: clang-format
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_text_frag.glsl | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_text_frag.glsl b/source/blender/gpu/shaders/gpu_shader_text_frag.glsl index 554596fa9ae..cc12e3f78a5 100644 --- a/source/blender/gpu/shaders/gpu_shader_text_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_text_frag.glsl @@ -30,20 +30,21 @@ const vec2 offsets16[16] = vec2[16](vec2(-1.5, 1.5), vec2(1.5, -1.5)); //#define GPU_NEAREST -#define sample_glyph_offset(texel, ofs) texture_1D_custom_bilinear_filter(texCoord_interp + ofs * texel) +#define sample_glyph_offset(texel, ofs) \ + texture_1D_custom_bilinear_filter(texCoord_interp + ofs * texel) float texel_fetch(int index) { - int size_x = textureSize(glyph, 0).r; - if (index >= size_x) { - return texelFetch(glyph, ivec2(index % size_x, index / size_x), 0).r; - } - return texelFetch(glyph, ivec2(index, 0), 0).r; + int size_x = textureSize(glyph, 0).r; + if (index >= size_x) { + return texelFetch(glyph, ivec2(index % size_x, index / size_x), 0).r; + } + return texelFetch(glyph, ivec2(index, 0), 0).r; } bool is_inside_box(ivec2 v) { - return all(greaterThanEqual(v, ivec2(0))) && all(lessThan(v, glyph_dim)); + return all(greaterThanEqual(v, ivec2(0))) && all(lessThan(v, glyph_dim)); } float texture_1D_custom_bilinear_filter(vec2 uv) @@ -60,7 +61,7 @@ float texture_1D_custom_bilinear_filter(vec2 uv) #ifdef GPU_NEAREST return tl; -#else //GPU_LINEAR +#else // GPU_LINEAR int offset_x = 1; int offset_y = glyph_dim.x; |