[Mesa-users] GL_ACTIVE_UNIFORMS returns unexpected value
Brian Paul
brianp at vmware.com
Wed Mar 18 10:12:16 PDT 2015
On 03/18/2015 09:37 AM, Lascha Lagidse wrote:
> Hello :)
>
> I am Lascha, new to linux and first time subscribing to a mailing list.
> I heard you were great guys ;)
We try to be. :)
> So, I am currently in the process of porting the game Age of Wonders 3
> to Linux. The game is currently in open-beta on Steam, and people
> reported issues with the specifically the Mesa graphics driver. I had a
> look and it looks like this driver behaves differently on this driver
> when using glGetProgramiv and glGetActiveUniform.
>
> The vertex shader (see bottom) is attached to a program. The program is
> then linked. Note: Only this vertex shader is attached to the program;
> there is no other shader attached. Now using glGetProgramiv with
> GL_ACTIVE_UNIFORMS will return 2, but I expect it to be 3 like on the
> other drivers. According to glGetActiveUniform it is the variable 'c24'
> which is missing. My guess is that it's optimized away, for some reason.
> If I also link the fragment shader, then 'c24' is listed correctly.
>
> My goal is to retrieve the active uniforms from specifically the vertex
> shader. If I link both the vertex AND the fragment program, then there
> is no way to distinguish which uniforms belong to the vertex program and
> which belong to the fragment program (or is there?).
>
> I can't think of a nice work-around; but since this is only
> initialization code the only work-around that comes to mind is to
> serialize the info I get from glGetActiveUniform on another driver and
> use that info instead of calling glGetActiveUniform at initialization.
>
> #version 140
> uniform mat4 c20;
> uniform vec4 c24;
> uniform vec4 c25;
> in vec3 POSITION0;
> in vec2 TEXCOORD0;
> out vec2 xlv_TEXCOORD0;
> void main ()
> {
> vec4 PosWS_1;
> PosWS_1.xy = (c25.xy + (POSITION0.xy * c25.zw));
> PosWS_1.z = POSITION0.z;
> PosWS_1.w = 1.0;
> gl_Position = (c20 * PosWS_1);
> xlv_TEXCOORD0 = (c24.xy + (TEXCOORD0 * c24.zw));
> }
Which version of Mesa are you using? Would it be possible to get a
simple glut/piglit test program?
-Brian
More information about the mesa-users
mailing list