summaryrefslogtreecommitdiff
path: root/shaders/ui.frag.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/ui.frag.glsl')
-rw-r--r--shaders/ui.frag.glsl3
1 files changed, 3 insertions, 0 deletions
diff --git a/shaders/ui.frag.glsl b/shaders/ui.frag.glsl
index 3c366602..0b099db3 100644
--- a/shaders/ui.frag.glsl
+++ b/shaders/ui.frag.glsl
@@ -17,6 +17,7 @@ layout(location = 1) in vec3 v_fg;
layout(location = 2) in vec3 v_bg;
layout(location = 3) in vec2 v_cell_uv;
layout(location = 4) flat in uvec4 v_effect;
+layout(location = 5) flat in vec4 v_clip;
layout(location = 0) out vec4 o_col;
@@ -31,6 +32,8 @@ float cellNoise(uint serial, uint col, uint row) {
}
void main() {
+ if (v_clip.z >= v_clip.x && (gl_FragCoord.x < v_clip.x || gl_FragCoord.x >= v_clip.z ||
+ gl_FragCoord.y < v_clip.y || gl_FragCoord.y >= v_clip.w)) discard;
float a = texture(u_atlas, v_uv).r;
bool oldLayer = (v_effect.x & 0x80000000u) != 0u;
// A block cursor is foreground chrome even though its fill occupies the