[PATCH 1/5] wined3d: Fix FFP vertex shaders with ARB_explicit_attrib_location.

Matteo Bruni matteo.mystral at gmail.com
Wed Jun 1 18:36:53 CDT 2016


2016-06-02 0:59 GMT+02:00 Józef Kucia <joseph.kucia at gmail.com>:
> On Wed, Jun 1, 2016 at 11:16 PM, Matteo Bruni <mbruni at codeweavers.com> wrote:
>> Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
>> ---
>>  dlls/wined3d/glsl_shader.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
>> index e5a0e69..4e773b6 100644
>> --- a/dlls/wined3d/glsl_shader.c
>> +++ b/dlls/wined3d/glsl_shader.c
>> @@ -6363,10 +6363,15 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
>>
>>      shader_addline(buffer, "%s\n", shader_glsl_get_version(gl_info, NULL));
>>
>> +    if (shader_glsl_use_explicit_attrib_location(gl_info))
>> +        shader_addline(buffer, "#extension GL_ARB_explicit_attrib_location : enable\n");
>> +
>>      for (i = 0; i < WINED3D_FFP_ATTRIBS_COUNT; ++i)
>>      {
>>          const char *type = i < ARRAY_SIZE(attrib_info) ? attrib_info[i].type : "vec4";
>>
>> +        if (shader_glsl_use_explicit_attrib_location(gl_info))
>> +            shader_addline(buffer, "layout(location = %u) ", i);
>>          shader_addline(buffer, "%s %s vs_in%u;\n", get_attribute_keyword(gl_info), type, i);
>>      }
>>      shader_addline(buffer, "\n");
>> --
>> 2.7.3
>>
>>
>>
>
> I am not sure how I missed this... Thanks!

No problem. I guess some OpenGL implementations by default assign
attribute locations in the order they are declared. That's apparently
not the case with Mesa and the tests were pretty loud in telling me
that :)



More information about the wine-devel mailing list