[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mesa3d-users
Subject:    Re: [Mesa-users] Fwd: glGetUniformLocation returns -1 for most uniforms
From:       Brian Paul <brianp () vmware ! com>
Date:       2014-09-29 14:22:20
Message-ID: 54296B1C.1020508 () vmware ! com
[Download RAW message or body]

I suggest creating a bug report for this and attaching an apitrace if 
you don't have a simple test program.

-Brian

On 09/27/2014 09:57 AM, Joel Leclerc wrote:
> oops, forgot to forward this to the list!
> 
> ---------- Forwarded message ----------
> From: *Joel Leclerc* <lkjoel@ubuntu.com <mailto:lkjoel@ubuntu.com>>
> Date: Tue, Sep 23, 2014 at 9:53 AM
> Subject: Re: [Mesa-users] glGetUniformLocation returns -1 for most uniforms
> To: Jonas Kulla <nyocurio@gmail.com <mailto:nyocurio@gmail.com>>
> 
> 
> Yes, they are used in the shader.
> 
> The shader uniforms are used in a general header file included by all
> shaders, so some of them aren't used in some shaders, but in the shaders
> that _do_ use them, they still return the same error.
> 
> On Tue, Sep 23, 2014 at 5:42 AM, Jonas Kulla <nyocurio@gmail.com
> <mailto:nyocurio@gmail.com>> wrote:
> 
> Have you made sure that the uniforms are actually used in the
> shader? If they're not, the compiler is free to optimize them out
> and return -1 for their location, as it doesn't change runtime behavior.
> 
> 2014-09-23 5:17 GMT+02:00 Joel Leclerc <lkjoel@ubuntu.com
> <mailto:lkjoel@ubuntu.com>>:
> 
> Normally, I use the proprietary nvidia GL driver to test my
> application, but now that I use the mesa backend, for some
> reason, glGetUniformLocation returns -1 on certain uniforms (for
> reasons I can't comprehend).
> 
> Here is part of my shader source:
> 
> uniform mat4 N_MVP;
> uniform bool N_UV_flip;
> uniform float N_UV_z;
> uniform float N_alpha;
> uniform bool N_3D;
> uniform float N_time;
> uniform float N_rand;
> 
> If I run glGetUniformLocation(shader->shader_handle, "N_rand"),
> it returns -1. same for N_time, and N_UV_z. However, using the
> same code for N_alpha returns 2.
> 
> This does not happen on the nvidia GL driver.
> 
> Any clues as to why? Source code is available here:
> https://github.com/MiJyn/nightmare
> <https://urldefense.proofpoint.com/v1/url?u=https://github.com/MiJyn/nightmare&k=oIv \
> Rg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D% \
> 0A&m=lA24gzmZ0BHCfT77couV4UO698DLPQVa2ZgBs5bItVM%3D%0A&s=7d2370478181627fbf2528d14302fd784abead9f23cfdac8f449d6a8690dce9b>
>  and https://github.com/MiJyn/silentponyville
> <https://urldefense.proofpoint.com/v1/url?u=https://github.com/MiJyn/silentponyville \
> &k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xp \
> BY%3D%0A&m=lA24gzmZ0BHCfT77couV4UO698DLPQVa2ZgBs5bItVM%3D%0A&s=de091d34a783d7d6714aefc9bf610add2f88e7458aa65beacc8c2667a82dea1b>
>                 
> .
> 
> --
> Joel Leclerc
> Individual software and game developer,
> Lead developer of the SythOS project.
> Main email: lkjoel@ubuntu.com <mailto:lkjoel@ubuntu.com> | Chat:
> lkjoeldev@gmail.com <mailto:lkjoeldev@gmail.com>
> Twitter: @__MiJyn__
> <https://urldefense.proofpoint.com/v1/url?u=https://twitter.com/__MiJyn__&k=oIvRg1%2 \
> BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m= \
> lA24gzmZ0BHCfT77couV4UO698DLPQVa2ZgBs5bItVM%3D%0A&s=2ae173e77e958caee8dbfac2195f49995e89d5f92994ccab03b83cc2a68fda60>
>  | Website: http://mijyn.github.io/
> <https://urldefense.proofpoint.com/v1/url?u=http://mijyn.github.io/&k=oIvRg1%2BdGAgO \
> oM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=lA24gz \
> mZ0BHCfT77couV4UO698DLPQVa2ZgBs5bItVM%3D%0A&s=02abfc5f37975e94712170fdb14028fa9c530210ce8a64a854ce0d34388932c3>
>                 
> Github: https://github.com/MiJyn
> <https://urldefense.proofpoint.com/v1/url?u=https://github.com/MiJyn&k=oIvRg1%2BdGAg \
> OoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=lA24g \
> zmZ0BHCfT77couV4UO698DLPQVa2ZgBs5bItVM%3D%0A&s=50fb449d7d2b858e84fa7595ce15c6b3771f58f5eca89db35982c005aa567b8b>
>  
> _______________________________________________
> mesa-users mailing list
> mesa-users@lists.freedesktop.org
> <mailto:mesa-users@lists.freedesktop.org>
> http://lists.freedesktop.org/mailman/listinfo/mesa-users
> <https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/lis \
> tinfo/mesa-users&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BT \
> Ls8wadB%2BiIj9xpBY%3D%0A&m=lA24gzmZ0BHCfT77couV4UO698DLPQVa2ZgBs5bItVM%3D%0A&s=1db7190cef532ebbefee6efcf17ffbd9d26fc0b4efbab313177fe9a7e6d84aa8>
>  
> 
> 
> 
> 
> --
> Joel Leclerc
> Individual software and game developer,
> Lead developer of the SythOS project.
> Main email: lkjoel@ubuntu.com <mailto:lkjoel@ubuntu.com> | Chat:
> lkjoeldev@gmail.com <mailto:lkjoeldev@gmail.com>
> Twitter: @__MiJyn__
> <https://urldefense.proofpoint.com/v1/url?u=https://twitter.com/__MiJyn__&k=oIvRg1%2 \
> BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m= \
> lA24gzmZ0BHCfT77couV4UO698DLPQVa2ZgBs5bItVM%3D%0A&s=2ae173e77e958caee8dbfac2195f49995e89d5f92994ccab03b83cc2a68fda60>
>  | Website: http://mijyn.github.io/
> <https://urldefense.proofpoint.com/v1/url?u=http://mijyn.github.io/&k=oIvRg1%2BdGAgO \
> oM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=lA24gz \
> mZ0BHCfT77couV4UO698DLPQVa2ZgBs5bItVM%3D%0A&s=02abfc5f37975e94712170fdb14028fa9c530210ce8a64a854ce0d34388932c3>
>                 
> Github: https://github.com/MiJyn
> <https://urldefense.proofpoint.com/v1/url?u=https://github.com/MiJyn&k=oIvRg1%2BdGAg \
> OoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=lA24g \
> zmZ0BHCfT77couV4UO698DLPQVa2ZgBs5bItVM%3D%0A&s=50fb449d7d2b858e84fa7595ce15c6b3771f58f5eca89db35982c005aa567b8b>
>  
> 
> 
> --
> Joel Leclerc
> Individual software and game developer,
> Lead developer of the SythOS project.
> Main email: lkjoel@ubuntu.com <mailto:lkjoel@ubuntu.com> | Chat:
> lkjoeldev@gmail.com <mailto:lkjoeldev@gmail.com>
> Twitter: @__MiJyn__
> <https://urldefense.proofpoint.com/v1/url?u=https://twitter.com/__MiJyn__&k=oIvRg1%2 \
> BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m= \
> lA24gzmZ0BHCfT77couV4UO698DLPQVa2ZgBs5bItVM%3D%0A&s=2ae173e77e958caee8dbfac2195f49995e89d5f92994ccab03b83cc2a68fda60>
>  | Website: http://mijyn.github.io/
> <https://urldefense.proofpoint.com/v1/url?u=http://mijyn.github.io/&k=oIvRg1%2BdGAgO \
> oM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=lA24gz \
> mZ0BHCfT77couV4UO698DLPQVa2ZgBs5bItVM%3D%0A&s=02abfc5f37975e94712170fdb14028fa9c530210ce8a64a854ce0d34388932c3>
>                 
> Github: https://github.com/MiJyn
> <https://urldefense.proofpoint.com/v1/url?u=https://github.com/MiJyn&k=oIvRg1%2BdGAg \
> OoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=lA24g \
> zmZ0BHCfT77couV4UO698DLPQVa2ZgBs5bItVM%3D%0A&s=50fb449d7d2b858e84fa7595ce15c6b3771f58f5eca89db35982c005aa567b8b>
>  
> 
> _______________________________________________
> mesa-users mailing list
> mesa-users@lists.freedesktop.org
> https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/list \
> info/mesa-users&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTL \
> s8wadB%2BiIj9xpBY%3D%0A&m=lA24gzmZ0BHCfT77couV4UO698DLPQVa2ZgBs5bItVM%3D%0A&s=1db7190cef532ebbefee6efcf17ffbd9d26fc0b4efbab313177fe9a7e6d84aa8
>  

_______________________________________________
mesa-users mailing list
mesa-users@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic