[PATCH 5/5] wined3d: Prefer the core glActiveTexture function.

Matteo Bruni matteo.mystral at gmail.com
Mon Jan 5 14:01:03 CST 2015


2015-01-05 18:32 GMT+01:00 Henri Verbeet <hverbeet at gmail.com>:
> On 5 January 2015 at 17:17, Matteo Bruni <mbruni at codeweavers.com> wrote:
>> +#define MAP_GL_FUNCTION(core_func, ext_func)                                      \
>> +    {                                                                             \
>> +        if (!gl_info->gl_ops.ext.p_##core_func)                                   \
>> +            gl_info->gl_ops.ext.p_##core_func = gl_info->gl_ops.ext.p_##ext_func; \
>> +    }
>> +
>> +    MAP_GL_FUNCTION(glActiveTexture, glActiveTextureARB);
>> +#undef MAP_GL_FUNCTION
>> +
> This kind of thing doesn't exactly fill me with joy, but I guess the
> alternatives wouldn't be much better.

Yeah, this is what I came up after a while and it looks better than my
previous approaches. Also, glShaderSource and glTexImage3D will
additionally need a cast (for trivial reasons, but still...) so it's
going to get even funnier...

> Any reason this can't be part of load_gl_funcs()? (And while we're
> touching load_gl_funcs(), I don't see much of a reason we couldn't
> just inline GL_EXT_FUNCS_GEN these days.)

At this point, not really. I'm going to move it there and inline
GL_EXT_FUNCS_GEN.

>> +    /* Newer core functions */ \
>> +    USE_GL_FUNC(glActiveTexture) \
> It would probably be nice to note the exact GL version where the
> function entered core GL.

Good idea. I think I'm going to add a comment next to each line (while
keeping this entire "core" section sorted alphabetically), as opposed
to splitting the new section by version.



More information about the wine-devel mailing list