[Mesa-dev] [RFC 18/21] mesa/extensions: Remove extra memsets on gl_extensions

Emil Velikov emil.l.velikov at gmail.com
Mon Oct 26 10:14:09 PDT 2015


On 23 October 2015 at 19:46, Jordan Justen <jordan.l.justen at intel.com> wrote:
> On 2015-10-22 03:32:58, Emil Velikov wrote:
>> On 19 October 2015 at 23:44, Nanley Chery <nanleychery at gmail.com> wrote:
>> > From: Nanley Chery <nanley.g.chery at intel.com>
>> >
>> > Aside from those modified in this commit, all gl_extensions structs are
>> > zero-initialized by default. There is therefore no need to memset the
>> > structs to 0. Also, remove the open-coded memset in
>> > _mesa_init_extensions().
>> >
>> > Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
>> > ---
>> >  src/mesa/main/extensions.c | 18 ++++--------------
>> >  1 file changed, 4 insertions(+), 14 deletions(-)
>> >
>> > diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
>> > index 365e7ed..6cd2b27 100644
>> > --- a/src/mesa/main/extensions.c
>> > +++ b/src/mesa/main/extensions.c
>> > @@ -37,8 +37,8 @@
>> >  #include "macros.h"
>> >  #include "mtypes.h"
>> >
>> > -struct gl_extensions _mesa_extension_override_enables;
>> > -struct gl_extensions _mesa_extension_override_disables;
>> > +struct gl_extensions _mesa_extension_override_enables = {0};
>> > +struct gl_extensions _mesa_extension_override_disables = {0};
>> Side note: once ARB_compute_shader lands in for i965 we can even make
>> these local/static.
>
> I added these variables specifically so a driver could check to see
> what extensions were overridden early in context creation. Making them
> static would undo that feature...
>
> The alternative before was to add a custom environment variable. (See
> 10e03b44)
>
What I meant was that this feature feels like a (layering?) violation.
Although I do realise why you've added it, esp. since
arb_compute_shader is a large and complex beast. One can only imagine
what will happen if for every interaction between implemented
extension FOO and non-implemented (wip) extension BAR we had a similar
code around. I'm not sure it'll be pretty :)

That said I'm not suggesting that we touch it. Not at least
arb_compute_shader is complete.

Emil


More information about the mesa-dev mailing list