gl_cmap shader compilation failed

Sylvain Munaut tnt at 246tnt.com
Tue Jan 19 08:18:24 UTC 2021


Hi,

> [!] gl_cmap shader compilation failed (cmap_simple.glsl)
> [w] Color map shader 'simple' failed to load, will use fallback
> [!] gl_cmap shader compilation failed (cmap_bicubic.glsl)
> [w] Color map shader 'bicubic' failed to load, will use fallback
> [!] gl_cmap shader compilation failed (cmap_fallback.glsl)
> [!] Color map shader 'fallback' failed, aborting
> gr::log :ERROR: qt_sink_c0 - Failed to initialize fosphor

:/

In theory it's supposed to print the compile log from the driver
(which ideally would show why it failed), but apparently the driver
didn't return any logs so that mean I have no clue whatsoever why it
would have failed

Try to add some more debugging to the GL calls preceding the error :


--- a/lib/fosphor/gl_cmap.c
+++ b/lib/fosphor/gl_cmap.c
@@ -60,6 +60,15 @@ struct fosphor_gl_cmap_ctx {
 /* Helpers / Internal API
        */
 /* --------------------------------------------------------------------------
*/

+static void
+gl_check(const char *s)
+{
+       GLenum x;
+       if ((x = glGetError()) != GL_NO_ERROR) {
+               fprintf(stderr, "[!] GL Error %d at %s\n", x, s);
+       }
+}
+
 static int
 gl_cmap_init_shader(struct gl_cmap_shader *shader, const char *name)
 {
@@ -73,11 +82,15 @@ gl_cmap_init_shader(struct gl_cmap_shader *shader,
const char *name)

        /* Allocate shader */
        shader->prog = glCreateProgram();
+       gl_check("glCreateProgram");
        shader->shader = glCreateShader(GL_FRAGMENT_SHADER);
+       gl_check("glCreateShader");

        /* Compile / Link / Attach */
        glShaderSource(shader->shader, 1, (const char **)&shader_src, NULL);
+       gl_check("glShaderSource");
        glCompileShader(shader->shader);
+       gl_check("glCompileShader");

        /* Check success and compile log */
        glGetShaderiv(shader->shader, GL_COMPILE_STATUS, &orv);




> The app is running, but the render area of the spectrum is completely blank.
>
> I am on your "gr3.8" branch. OpenCL is exactly the same as on Ubuntu 18.04 (I need the older 340 Nvidia driver on my old NVS 4200M, if you remember), GLFW is the latest master. Everything compiles just fine, only at runtime this issue presents itself.

This is unrelated to OpenCL.
Theses shaders are purely OpenGL stuff.

Cheers,

    Sylvain


More information about the osmocom-sdr mailing list