<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-text-flowed" style="font-family: -moz-fixed;
font-size: 14px;" lang="x-unicode">Hello :)<br>
<br>
I am Lascha, new to linux and first time subscribing to a mailing
list. I heard you were great guys ;)<br>
<br>
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.
<br>
<br>
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.
<br>
<br>
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?).
<br>
<br>
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.
<br>
<br>
#version 140
<br>
uniform mat4 c20;
<br>
uniform vec4 c24;
<br>
uniform vec4 c25;
<br>
in vec3 POSITION0;
<br>
in vec2 TEXCOORD0;
<br>
out vec2 xlv_TEXCOORD0;
<br>
void main ()
<br>
{
<br>
vec4 PosWS_1;
<br>
PosWS_1.xy = (c25.xy + (POSITION0.xy * c25.zw));
<br>
PosWS_1.z = POSITION0.z;
<br>
PosWS_1.w = 1.0;
<br>
gl_Position = (c20 * PosWS_1);
<br>
xlv_TEXCOORD0 = (c24.xy + (TEXCOORD0 * c24.zw));
<br>
}
<br>
<br>
Kind regards,
<br>
Lascha
<br>
</div>
</body>
</html>