fix that some drivers fail to compile a shader when a code line is NULL with length zero

Sun, 15 Jun 2025 19:46:12 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 15 Jun 2025 19:46:12 +0200
changeset 152
c3ae2b2e8ff6
parent 151
42960d0c879b
child 153
4116e2bd501b

fix that some drivers fail to compile a shader when a code line is NULL with length zero

src/shader.c file | annotate | diff | comparison | revisions
--- a/src/shader.c	Sat Jun 14 14:02:16 2025 +0200
+++ b/src/shader.c	Sun Jun 15 19:46:12 2025 +0200
@@ -53,6 +53,9 @@
         return 0;
     }
 
+    // some drivers don't like NULL strings, even when length is zero
+    if (code_pp == NULL) code_pp = "";
+
     GLint success;
     const char *code_array[4];
     GLint length_array[4];

mercurial