[Mesa-dev] Clean-ups and bug fixes (rebased and resent again)

Timothy Arceri timothy.arceri at collabora.com
Tue Jan 3 02:43:04 UTC 2017


14-28 have been reviewed. Big ping to the Intel guys on patches 1-14 :)

V3:
- rebased
- previously reviewed patches pushed

V2:
- some make check fixes
- rebase on master
- previously reviewed patches pushed (Thanks Emil)
- patch 56-58 are new

I started out with a goal of freeing _LinkedShaders after linking as this
would have allowed a bunch of code simplification and also reduced the
possibility of subtle bugs in i965 where a program that is currently
active is relinked but fails and then we recompile a variant of the still
active program but we would have lost things such as per stage atomic
bindings which would be deleted during the failed relink.

In the end this series grew larger than expected so for now this series
aims to switch the pipeline objects CurrentProgram array from using
gl_shader_program to gl_program. Previously the CurrentProgram array
could have contained multiple pointers to the same struct which was
confusing and we would often need to fish out the information we were
really after from the gl_program anyway. Using gl_program makes much
more sense and allows us to optimise some critical paths such as SSO
and sampler validation which are called at draw time.

In patch 49 when we finally change the pointers used in CurrentProgram
you can see some of the confusion caused by the old way of doing things
where use_shader_program() calls 
_mesa_shader_program_init_subroutine_defaults() on each stage in
gl_shader_program but we also call use_shader_program() itself for
each stage in gl_shader_program so unless we are dealing with single
stage SSO programs we will initialise subroutine defaults many
times over. 

On top of all this these changes help make shader cache cleaner
and resolves some of the problems I was having figuring out how to 
get it working for SSO.

I've tried to make the order of the patchs make sense for reviewing
but since almost everything at the start of this series is working
towards patches 32-34 reviewers may need to jump to these few 
patches at times.

Finally the patches 32-34 will need to be squashed to stop
compilation errors I've just split them up to help make reviewing
easier. I would have liked to have made patch 34 separate but the
patches have some circular dependencies that made it difficult.

I'm really happy with how this series turned out and the improvements
I was able to make along the way. Please review.




More information about the mesa-dev mailing list