[Mesa-dev] Newbie task to get started

Timothy Arceri timothy.arceri at collabora.com
Tue Apr 12 09:00:16 UTC 2016


On Sun, 2016-04-10 at 21:45 +0200, Jakob Sinclair wrote:
> Hi! My name is Jakob Sinclair and I would like to start contributing
> to 
> mesa development. I was wondering if anyone has any easy tasks that I
> as 
> a newbie could start working on. I tried looking at 
> https://wiki.freedesktop.org/dri/NewbieProjects/ but it seems that
> page 
> is outdated and most of the tasks over there have already been done. 
> Thanks in advance for your help!
> 

Hi Jakob,

Not sure if you have found something to work on yet. Also I'm not sure
it fits the easy category but I did notice something recently that is a
some what self contained piece of work. Currently there are two
different ways for drivers to store and access uniforms.

In the struct gl_uniform_storage we have:

   gl_constant_value *storage

Which is used by glGetUniform and also directly in the Intel i965
driver to access uniforms.

And we have:

   unsigned num_driver_storage;
   struct gl_uniform_driver_storage *driver_storage;

Which is used by all other drivers e.g Gallium drivers, Intel i915
driver.

Ideally we would could just make use of gl_constant_value *storage and
we could get rid of all the helper functions etc used for the
driver_storage such as _mesa_propagate_uniforms_to_driver_storage()
currently gallium drivers are storing the data twice and even the intel
driver will end up calling the progate function even though it just
falls back to doing nothing.

It seems the reason driver for gl_uniform_driver_storage is historical
(please someone correct me if I'm wrong) it makes use of the
gl_program_parameter list to store uniforms in a way that predates the
glsl compilers introduction to Mesa. This list is not ideal in itself
since its just an array that needs to be regenerated as it grows
meaning we need to hold only other information such as UniformHash in
order to keep track of things that we could otherwise free also.

Anway I can see many things that could be cleaned up by reworking how
this is handled. However it also looks like a big task and there are
likely to be a number of issues that need to be solve in order to pull
it off, but it will introduce you to a number of components that make
up Mesa.

If you want to look into it further I sugest taking a look at
how get_mesa_program() in st_glsl_to_tgsi.cpp works and also the
various piece in ir_to_mesa.cpp that handle uniforms such as the
add_uniform_to_shader class.

You also might want to check with some of the developers who work on
gallium based drivers to see if this sounds like a reasonable idea
before starting as I haven't had a huge amount to do with it in that
past so I may be underestimating the work/problems involved.

Tim




More information about the mesa-dev mailing list