mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-27 03:42:49 +00: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:
parent
29040d719c
commit
4b12bffcb1
1 changed files with 1 additions and 6 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue