[Mesa-dev] [PATCH 5/8] main: enable NV_primitive_restart extension by default

Brian Paul brianp at vmware.com
Fri May 11 14:41:54 PDT 2012


On 05/11/2012 11:35 AM, Marek Olšák wrote:
> On Fri, May 11, 2012 at 7:17 PM, Brian Paul<brianp at vmware.com>  wrote:
>> On 05/11/2012 11:08 AM, Marek Olšák wrote:
>>>
>>> I think a more preferable way to enable an extension for everybody by
>>> default is to do something like this:
>>>
>>>> diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
>>>> index a843a40..71b7721 100644
>>>> --- a/src/mesa/main/extensions.c
>>>> +++ b/src/mesa/main/extensions.c
>>>> @@ -298,7 +298,7 @@ static const struct extension extension_table[] = {
>>>>      { "GL_NV_light_max_exponent",
>>>> o(NV_light_max_exponent),                   GL,             1999 },
>>>>      { "GL_NV_packed_depth_stencil",
>>>> o(EXT_packed_depth_stencil),                GL,             2000 },
>>>>      { "GL_NV_point_sprite",                         o(NV_point_sprite),
>>>>                        GL,             2001 },
>>>> -   { "GL_NV_primitive_restart",
>>>>   o(NV_primitive_restart),                    GL,             2002 },
>>>> +   { "GL_NV_primitive_restart",                    o(dummy_true),
>>>>                         GL,             2002 },
>>>>      { "GL_NV_texgen_reflection",
>>>>   o(NV_texgen_reflection),                    GL,             1999 },
>>>>      { "GL_NV_texture_barrier",
>>>>   o(NV_texture_barrier),                      GL,             2009 },
>>>>      { "GL_NV_texture_env_combine4",
>>>> o(NV_texture_env_combine4),                 GL,             1999 },
>>>> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
>>>> index 06ca0d5..8086bb5 100644
>>>> --- a/src/mesa/main/mtypes.h
>>>> +++ b/src/mesa/main/mtypes.h
>>>> @@ -2982,7 +2982,6 @@ struct gl_extensions
>>>>      GLboolean NV_fragment_program_option;
>>>>      GLboolean NV_light_max_exponent;
>>>>      GLboolean NV_point_sprite;
>>>> -   GLboolean NV_primitive_restart;
>>>>      GLboolean NV_texture_barrier;
>>>>      GLboolean NV_texgen_reflection;
>>>>      GLboolean NV_texture_env_combine4;
>>>
>>>
>>> And fixing all occurences of gl_extensions::NV_primitive_restart. Both
>>> ways are equivalent though, so it's really just about whether we
>>> should allow drivers to disable the extension.
>>
>>
>> FWIW, I know of at least one application which performs faster with the
>> vmware driver when NV_primitive_restart is disabled (and the app does it's
>> own work-around) rather than to use the software-based primitive restart
>> path.
>>
>> So setting MESA_EXTENSION_OVERRIDE=-GL_NV_primitive_restart should be an
>> option.  The o(dummy_true) convention might prevent that, but I haven't
>> tested that...
>
> In that case, I think we should disable it in the state tracker if
> there's no driver support. If it's faster for svga, it's very likely
> faster for the other DX9-level drivers too.

Some Viewperf tests use primitive restart and we wanted to support it 
with our vmware driver.  So I'd like to at least be able to do "export
MESA_EXTENSION_OVERRIDE=GL_NV_primitive_restart" and see the extension 
supported (as a software/VBO fallback).

-Brian


More information about the mesa-dev mailing list