mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-10 18:48:54 +02:00
Remove unnecessary branch in trail shader
Branches have an outsize penalty in shaders as does discard. We don't need the check that the fragment is in the region anyway ans the rendering pipeline takes care of that for us, I think. At least I can see no visual difference with it removed. @jinhwanlazy please review
This commit is contained in:
@@ -7,10 +7,5 @@ in vec2 frag_pos;
|
||||
out vec4 final_color;
|
||||
|
||||
void main() {
|
||||
if (cursor_edge_x[0] <= frag_pos.x && frag_pos.x <= cursor_edge_x[1] &&
|
||||
cursor_edge_y[1] <= frag_pos.y && frag_pos.y <= cursor_edge_y[0]) {
|
||||
discard;
|
||||
} else {
|
||||
final_color = vec4(trail_color, trail_opacity);
|
||||
}
|
||||
final_color = vec4(trail_color, trail_opacity);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user