[Mesa-dev] [PATCH] mesa: set override_version per api version override
Martin Peres
martin.peres at linux.intel.com
Tue Jun 16 03:53:42 PDT 2015
On 16/06/15 13:38, Martin Peres wrote:
> On 12/06/15 07:30, Tapani Pälli wrote:
>>
>>
>> On 06/11/2015 09:05 PM, Jordan Justen wrote:
>>> On 2015-06-10 13:03:20, Jordan Justen wrote:
>>>> Whoops. I re-wrote this last night:
>>>>
>>>> http://cgit.freedesktop.org/~jljusten/mesa/commit/?h=cs-33&id=3ebe7b79
>>>>
>>>> On 2015-06-04 21:41:15, Tapani Pälli wrote:
>>>>> Before 9b5e92f get_gl_override was called only once, but now it is
>>>>> called for multiple APIs (GLES2, GL), version needs to be set always.
>>>>>
>>>>> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
>>>>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90797
>>>>> ---
>>>>> src/mesa/main/version.c | 36 ++++++++++++++++++++++--------------
>>>>> 1 file changed, 22 insertions(+), 14 deletions(-)
>>>>>
>>>>> diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
>>>>> index 409e5ae..5e9943c 100644
>>>>> --- a/src/mesa/main/version.c
>>>>> +++ b/src/mesa/main/version.c
>>>>> @@ -58,34 +58,42 @@ get_gl_override(gl_api api, int *version, bool
>>>>> *fwd_context,
>>>>> ? "MESA_GL_VERSION_OVERRIDE" : "MESA_GLES_VERSION_OVERRIDE";
>>>>> const char *version_str;
>>>>> int major, minor, n;
>>>>> - static int override_version = -1;
>>>>> - static bool fc_suffix = false;
>>>>> - static bool compat_suffix = false;
>>>>> + static struct override_info {
>>>>> + int version;
>>>>> + bool fc_suffix;
>>>>> + bool compat_suffix;
>>>>> + } override[API_OPENGL_LAST + 1] = {
>>>>> + { -1, false, false},
>>>>> + { -1, false, false},
>>>>> + { -1, false, false},
>>>>> + { -1, false, false},
>>>>> + };
>>>>
>>>> I did this a bit differently. Rather than one for each API, I had one
>>>> per override env var.
>>>>
>>>> If you think once per API is preferable, how about these changes to
>>>> your patch:
>>>>
>>>> override[API_OPENGL_LAST + 1] => override[]
>>>>
>>>> STATIC_ASSERT(ARRAY_SIZE(override) == API_OPENGL_LAST + 1);
>>
>> Yep, this looks cleaner
>>
>>> Oh ... and with those changes,
>>>
>>> Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
>>
>> thanks Jordan!
>
> Hey, can you please push this patch ASAP? It is getting very annoying
> to need to use MESA_GLES_VERSION_OVERRIDE instead of
> MESA_GL_VERSION_OVERRIDE to work around this bug...
>
> Thanks :)
Actually, I made the changes, reviewed, tested and pushed the patch.
Sorry for the noise :)
More information about the mesa-dev
mailing list