[Mesa-dev] [PATCH 2/3] state_tracker: allow to utilize GLSL workaround for broken apps in Gallium

Vadim Girlin vadimgirlin at gmail.com
Thu Aug 23 23:07:49 PDT 2012


On Wed, 2012-08-22 at 19:08 +0300, Maxim Levitsky wrote:
> On Wed, 2012-08-22 at 19:54 +0400, Vadim Girlin wrote: 
> > On Wed, 2012-08-22 at 11:31 -0400, Alex Deucher wrote:
> > > On Wed, Aug 22, 2012 at 11:24 AM, Vadim Girlin <vadimgirlin at gmail.com> wrote:
> > > > On Wed, 2012-08-22 at 11:23 +0300, Maxim Levitsky wrote:
> > > >> Currently Gallium has no way to activate the
> > > >> 'force_glsl_extensions_warn' workaround that allows
> > > >> buggy apps that use GLSL extensions without asking for them to work.
> > > >>
> > > >> Since gallium mesa state tracker is essentially split into two,
> > > >> (dri (src/gallium/state_trackers/dri) and mesa (src/mesa/state_tracker))
> > > >> and only former has access to driconf options while later knows nothing
> > > >> about dri, I added this support by reading an environment variable.
> > > >>
> > > >> export force_glsl_extensions_warn=true
> > > >>
> > > >
> > > > I just remembered that I sent some patches for passing the driconf
> > > > options to the state tracker but then forgot about them completely.
> > > >
> > > > Feel free to reuse anything from that series if it might help:
> > > >
> > > > http://lists.freedesktop.org/archives/mesa-dev/2012-April/020729.html
> > > 
> > > Series looks good to me.  Looks like Michel added his reviewed-by at
> > > the time as well.  
> > 
> > Yes, it was reviewed, but then I found that it breaks swrast build due
> > to missing driver descriptor, so I asked if it's OK to simply add the
> > descriptor to swrast and it seems I'm still waiting for the answer... :)
> > 
> > > If it still applies, I'd say go ahead and commit it.
> > 
> > I'll check if it still works and if it's enough to run Unigine apps
> > correctly with current mesa. IIRC it doesn't contain GLSL version hacks
> > as in Maxim's patch 3, so possibly it should be included too, and maybe
> > something else.
> Unless you enable 'ambient occlusion' in Heaven, just GLSL force
> extension hack (which is included in this series), is enough.
> 
> With it, it starts using  ARB_shader_bit_encoding extension, and to make
> it aviable you need my patch #3, but even that is not enough as demo
> introduces unrelated compile error, when extension is enabled.
> I have a local hack to override this, but its not worth looking at.
> Just for reference I attach it.

It seems the support for this extension (ARB_shader_bit_encoding) in
Unigine is too broken, so I guess we could disable it completely for
those apps instead of applying multiple hacks/workarounds for
compatibility. Currently we can do it using the environment variable:

	MESA_EXTENSION_OVERRIDE=-GL_ARB_shader_bit_encoding

AFAICS with Heaven 3.0 and r600g it's enough to disable the extension as
shown above and use "force_glsl_extensions_warn=true" to run that demo
without noticeable problems on current git mesa.

Probably we might want to add similar config option (extension override)
to ".drirc", so the users will be able to use the config file with
app-specific compatibility options instead of playing with env vars.

Vadim

> 
> Today I will test this patch series,
> and thanks for telling about it, as I was about to stop being lazy and
> implement the same thing.
> 
> 
> Best regards,
> Maxim Levitsky





More information about the mesa-dev mailing list