Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown uniform _main_pos_map_0[0] in cursor and borders programs #456

Closed
kbielefe opened this issue Apr 12, 2018 · 13 comments
Closed

Unknown uniform _main_pos_map_0[0] in cursor and borders programs #456

kbielefe opened this issue Apr 12, 2018 · 13 comments

Comments

@kbielefe
Copy link

I am getting the following error:

[101 21:40:02.433905] Unknown uniform in cursor program

If I comment out that fatal error and the check for leftover uniforms, I get:

[101 21:44:40.638541] Unknown uniform in borders program: _main_pos_map_0[0]

Commenting out that fatal error and check for leftover uniforms makes kitty work correctly, as far as I can tell.

$ python . --debug-config
python3 setup.py 
CC: gcc (7, 3)
kitty 0.8.4 (cc910f6b79) created by Kovid Goyal
Linux karl-home-desktop 4.15.15-1-ARCH #1 SMP PREEMPT Sat Mar 31 23:59:25 UTC 2018 x86_64
Running under: X11
Arch Linux \r (\l)
LSB_VERSION=1.4
DISTRIB_ID=Arch
DISTRIB_RELEASE=rolling
DISTRIB_DESCRIPTION="Arch Linux"
Loaded config files: /home/karl/.config/kitty/kitty.conf

Config options different from defaults:
background_opacity   0.8
font_family          Inconsolata
font_size            14.0
inactive_text_alpha  0.8

libGL is from the nvidia-340xx-utils package, which seems to be the main difference from my computer at work which works fine.

@kovidgoyal
Copy link
Owner

That's a broken GL driver. Not much I can do about it. You can make it work by ignoring the sanity checks, but that just means other random things might break later on.

@kovidgoyal
Copy link
Owner

To elaborate, the GL driver is incorrectly treating const variables in the shaders as uniforms.

@eefano
Copy link

eefano commented Apr 26, 2018

You are basically cutting out all the pre-gtx nvidia card owners from using your program. Not a smart move, imho. Maybe you should use older GLSL specifications in your shaders or provide a workaround.

@kovidgoyal
Copy link
Owner

I'm widely known for my extreme stupidity.

Repository owner locked as resolved and limited conversation to collaborators Apr 27, 2018
Repository owner unlocked this conversation Nov 11, 2019
@omeid
Copy link

omeid commented May 18, 2020

Here is a patch that ignores that error, everything seems to work okay with Nvidia 440xx so far.

shaders.c	2020-05-09 15:18:21.000000000 +1000
--- shaders.c	2020-05-18 15:18:09.424911404 +1000
*************** init_borders_program(void) {
*** 666,672 ****
          else if SET_LOC(active_border_color);
          else if SET_LOC(inactive_border_color);
          else if SET_LOC(bell_border_color);
!         else { fatal("Unknown uniform in borders program: %s", p->uniforms[i].name); return; }
      }
      if (left) { fatal("Left over uniforms in borders program"); return; }
  #undef SET_LOC
--- 666,676 ----
          else if SET_LOC(active_border_color);
          else if SET_LOC(inactive_border_color);
          else if SET_LOC(bell_border_color);
!         else if (strcmp(p->uniforms[i].name, "_main_pos_map_0[0]") == 0){
!           left++;
!           log_error("ignoring unexpected uniform %i -> _main_pos_map_0[0]", i);
!         }
!         else { fatal("Unknown uniform in borders program: %s, %i", p->uniforms[i].name, i); return; }
      }
      if (left) { fatal("Left over uniforms in borders program"); return; }
  #undef SET_LOC

@kovidgoyal
Copy link
Owner

That will break when kitty tries to draw borders around a window.

@omeid
Copy link

omeid commented May 18, 2020

How can I trigger drawing of borders? I am using i3, so that might be why I don't see it?

@omeid
Copy link

omeid commented May 18, 2020

i tried new_window and new_os_window and it draws borders fine. 🤔

@kovidgoyal
Copy link
Owner

Use a layout other than stack and have multipe kitty windows in a single
OS window.

@omeid
Copy link

omeid commented May 18, 2020

Created multiple new_window inside a single OS window, changed layout in various ways, cycling with next_layout, everything seems okay.

@omeid
Copy link

omeid commented May 18, 2020

For clarity, here is a git diff instead of a diff-patch:

diff --git a/kitty/shaders.c b/kitty/shaders.c
index 342c2d8d..0933c06b 100644
--- a/kitty/shaders.c
+++ b/kitty/shaders.c
@@ -666,7 +666,11 @@ init_borders_program(void) {
         else if SET_LOC(active_border_color);
         else if SET_LOC(inactive_border_color);
         else if SET_LOC(bell_border_color);
-        else { fatal("Unknown uniform in borders program: %s", p->uniforms[i].name); return; }
+        else if (strcmp(p->uniforms[i].name, "_main_pos_map_0[0]") == 0){
+          left++;
+          log_error("ignoring unexpected uniform %i -> _main_pos_map_0[0]", i);
+        }
+        else { fatal("Unknown uniform in borders program: %s, %i", p->uniforms[i].name, i); return; }
     }
     if (left) { fatal("Left over uniforms in borders program"); return; }
 #undef SET_LOC

@omeid
Copy link

omeid commented May 18, 2020

Legend!

@vegalou
Copy link

vegalou commented Nov 21, 2023

Met same problem, Kitty crashed during starting.

OS: PuppyLinux FOCAL 20.02

After update Nvidia display driver from v.340 to v.390. Kitty startup successfully.

The bug is OS display driver too OLD. Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants