[Mesa-dev] [PATCH 00/16] Share all the driver-agnostic drirc options across all drivers

Martin Peres martin.peres at linux.intel.com
Fri Jun 5 06:03:54 PDT 2015


Right now, adding a new drirc parameter is painful because it involves
adding a new entry in the gl constant structure, making sure that the
field is set to the right value by default in osmesa drivers, adding
the parameter in every driver's drirc xml and then reading the value
at runtime to set it in the gl constant structure.

With such an error-prone process, it is no wonder that driver devs
patched only their own driver and let the other driver devs patch
their own driver. This led to drivers supporting very different
options...

I set out to fix this issue when I wanted to introduce the equivalent
of MESA_EXTENSION_OVERRIDE to drirc to make the older unigine
benchmarks work. More recently, I also noticed I needed to add
the equivalent of MESA_GL_VERSION_OVERRIDE which made it clearer
than such a shared-options approach would be beneficial.

This series unifies most of the shared options, introduces
two more options and finally fixes the unigine benchmarks!

Ultimately, I would like us to move away from environment variables
to use more the drirc options which can be set per-application
through the drirc file or by using an environment variable. Of
course, it does not always make sense to do that, but I trust your
judgement!

Martin Peres (16):
  nouveau_vieux: add the possibility to set options via drirc
  swrast: add the possibility to set options via drirc
  main: store the common option in a struct of the Const part of the GL
    context
  drirc: add the macros necessary to share options across all the
    drivers
  driconf: start sharing ForceGLSLExtensionsWarn
  driconf: start sharing ForceGLSLVersion
  driconf: start sharing AllowGLSLExtensionDirectiveMidShader
  driconf: start sharing DisableGLSLLineContinuations
  driconf: bump the maximum string size from 25 to 1024
  driconf: introduce the equivalent of MESA_EXTENSION_OVERRIDE in drirc
  driconf: start sharing DisableBlendFuncExtended
  driconf: start sharing disable_shader_bit_encoding
  driconf: introduce the equivalent of MESA_GL_VERSION_OVERRIDE in drirc
  drirc: add workarounds for Unigine Tropics
  drirc: add workarounds for Unigine Sanctuary
  drirc: add workarounds for Unigine Valley

 src/gallium/include/state_tracker/st_api.h         |  10 +-
 src/gallium/state_trackers/dri/dri_screen.c        |  29 ++---
 src/gallium/state_trackers/osmesa/osmesa.c         |   6 +-
 src/glsl/glcpp/glcpp.c                             |   4 +-
 src/glsl/glcpp/pp.c                                |   2 +-
 src/glsl/glsl_parser_extras.cpp                    |   8 +-
 src/mesa/Makefile.sources                          |   2 +
 src/mesa/drivers/dri/common/dri_util.c             |  14 ++-
 src/mesa/drivers/dri/common/drirc                  |  24 +++++
 src/mesa/drivers/dri/common/xmlconfig.h            |   2 +-
 src/mesa/drivers/dri/common/xmlpool.h              |  19 ++++
 src/mesa/drivers/dri/common/xmlpool/t_options.h    |   9 ++
 src/mesa/drivers/dri/i915/intel_context.c          |  11 +-
 src/mesa/drivers/dri/i915/intel_screen.c           |  10 +-
 src/mesa/drivers/dri/i965/brw_context.c            |  20 ++--
 src/mesa/drivers/dri/i965/intel_screen.c           |  11 +-
 src/mesa/drivers/dri/nouveau/Makefile.am           |   1 +
 src/mesa/drivers/dri/nouveau/nouveau_context.c     |  37 ++++++-
 .../drivers/dri/radeon/radeon_common_context.c     |   6 ++
 src/mesa/drivers/dri/radeon/radeon_screen.c        |  12 +++
 src/mesa/drivers/dri/swrast/swrast.c               |  35 +++++-
 src/mesa/drivers/osmesa/osmesa.c                   |   5 +
 src/mesa/drivers/x11/xm_api.c                      |   5 +-
 src/mesa/main/context.c                            |  25 +++--
 src/mesa/main/context.h                            |   5 +-
 src/mesa/main/extensions.c                         |  16 ++-
 src/mesa/main/extensions.h                         |   2 +-
 src/mesa/main/mtypes.h                             |  25 +----
 src/mesa/main/shared_options.c                     |  55 ++++++++++
 src/mesa/main/shared_options.h                     | 120 +++++++++++++++++++++
 src/mesa/main/tests/dispatch_sanity.cpp            |   6 ++
 src/mesa/main/version.c                            |  13 ++-
 src/mesa/state_tracker/st_context.c                |   4 +-
 src/mesa/state_tracker/st_extensions.c             |  22 +---
 src/mesa/state_tracker/st_manager.c                |   4 +-
 35 files changed, 453 insertions(+), 126 deletions(-)
 create mode 100644 src/mesa/main/shared_options.c
 create mode 100644 src/mesa/main/shared_options.h

-- 
2.4.2



More information about the mesa-dev mailing list