Mesa (master): mesa: use gl_program for CurrentProgram rather than gl_shader_program

Timothy Arceri tarceri at kemper.freedesktop.org
Mon Jan 23 03:55:13 UTC 2017


Module: Mesa
Branch: master
Commit: c505d6d852220f4aaaee161465dd2c579647e672
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c505d6d852220f4aaaee161465dd2c579647e672

Author: Timothy Arceri <timothy.arceri at collabora.com>
Date:   Mon Oct 31 22:39:17 2016 +1100

mesa: use gl_program for CurrentProgram rather than gl_shader_program

This makes much more sense and should be more performant in some
critical paths such as SSO validation which is called at draw time.

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.

Also it was error prone to depend on the _LinkedShader array for
programs in current use because a failed linking attempt will lose
the infomation about the current program in use which is still
valid.

V2: fix validate_io() to compare linked_stages rather than the
consumer and producer to decide if we are looking at inward
facing shader interfaces which don't need validation.

Acked-by: Edward O'Callaghan <funfunctor at folklore1984.net>

To avoid build regressions the following 2 patches were squashed in to
this commit:

mesa/meta: rewrite _mesa_shader_program_use() and _mesa_program_use()

These are rewritten to do what the function name suggests, that is
_mesa_shader_program_use() sets the use of all stage and
_mesa_program_use() sets the use of a single stage.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Acked-by: Edward O'Callaghan <funfunctor at folklore1984.net>

mesa: update active relinked program

This likely fixes a subroutine bug were
_mesa_shader_program_init_subroutine_defaults() would never have been
called for the relinked program as we previously just set
_NEW_PROGRAM as dirty and never called the _mesa_use* functions when
linking.

Acked-by: Edward O'Callaghan <funfunctor at folklore1984.net>

---

 src/mesa/drivers/common/meta.c                    |  28 ++----
 src/mesa/drivers/common/meta.h                    |   2 +-
 src/mesa/drivers/dri/i965/brw_context.c           |  10 +--
 src/mesa/drivers/dri/i965/brw_ff_gs.c             |   4 +-
 src/mesa/drivers/dri/i965/brw_gs_surface_state.c  |   8 +-
 src/mesa/drivers/dri/i965/brw_tcs_surface_state.c |   8 +-
 src/mesa/drivers/dri/i965/brw_tes_surface_state.c |   8 +-
 src/mesa/drivers/dri/i965/brw_vs_surface_state.c  |   9 +-
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c  |  10 +--
 src/mesa/drivers/dri/i965/gen6_sol.c              |  24 +++--
 src/mesa/drivers/dri/i965/gen7_l3_state.c         |   6 +-
 src/mesa/main/api_validate.c                      |  57 +++++-------
 src/mesa/main/ff_fragment_shader.cpp              |   6 +-
 src/mesa/main/mtypes.h                            |   2 +-
 src/mesa/main/pipelineobj.c                       |  76 +++++++++-------
 src/mesa/main/shader_query.cpp                    |  38 ++++----
 src/mesa/main/shaderapi.c                         | 104 +++++++++-------------
 src/mesa/main/shaderapi.h                         |   9 +-
 src/mesa/main/state.c                             |  50 ++++-------
 src/mesa/main/texstate.c                          |   5 +-
 src/mesa/main/transformfeedback.c                 |   2 +-
 src/mesa/main/uniform_query.cpp                   |  21 ++---
 src/mesa/state_tracker/st_atom_atomicbuf.c        |  20 ++---
 src/mesa/state_tracker/st_atom_constbuf.c         |  43 +++------
 src/mesa/state_tracker/st_atom_image.c            |  42 +++------
 src/mesa/state_tracker/st_atom_storagebuf.c       |  48 +++-------
 src/mesa/state_tracker/st_cb_compute.c            |   4 +-
 27 files changed, 248 insertions(+), 396 deletions(-)

Diff:   http://cgit.freedesktop.org/mesa/mesa/diff/?id=c505d6d852220f4aaaee161465dd2c579647e672



More information about the mesa-commit mailing list