[Mesa-dev] [PATCH 00/17] i965 ARB_get_program_binary support

Timothy Arceri tarceri at itsqueeze.com
Thu Nov 9 10:46:56 UTC 2017


On 09/11/17 17:42, Jordan Justen wrote:
> git://people.freedesktop.org/~jljusten/mesa i965-get-program-binary-v1
> 
> This series adds i965 support for ARB_get_program_binary with greater
> than 0 supported formats. Today we support this extension, but
> advertise support for 0 formats. This series allows i965 to advertise
> support for 1 format.
> 
> This series defines a common Mesa format for ARB_get_program_binary,
> along with helper functions to read and write the format. We also
> define an OpenGL Mesa spec to be used with this binary format. The
> binary saved can only be reloaded on the exact same Mesa build using
> the exact same hardware.
> 
> The i965 implementation saves out a serialize nir represenation of the
> program. Later we can add support for saving the gen binary program as
> well. (We will still need the nir program for state based recompiles.)
> 
> This implementation passes piglit, deqp and glcts functions.

Nice to see this finally implemented :) Do the test suites actually test 
the extension? I'm assuming piglit doesn't.

> It also
> works with Dota 2, which appears to make use of the extension.

Would be interesting to try Dead Island with this if you have it. It 
should fix this bug: https://bugs.freedesktop.org/show_bug.cgi?id=85564

Dying Light is another game that uses the extension.

> 
> Jordan Justen (17):
>    docs/specs: Add GL_MESA_program_binary_formats extension spec
>    include/GL: Add GL_MESA_program_binary_formats
>    compiler: Fold shader_cache in with libglsl sources
>    glsl: Split out shader program serialization
>    main, glsl: Add UniformDataDefaults which stores uniform defaults
>    i965: Add brw_program_deserialize_nir
>    i965: Free serialized nir after deserializing
>    i965: Add brw_program_serialize_nir
>    i965: Fix memory leak when serializing nir
>    main: Allow non-zero NUM_PROGRAM_BINARY_FORMATS
>    main: Support 1 Mesa format with get for GL_PROGRAM_BINARY_FORMATS
>    main: Support calling driver for GL_PROGRAM_BINARY_LENGTH
>    main: Support calling driver for GetProgramBinary
>    main: Support calling driver for ProgramBinary
>    main: Clear shader program data whenever ProgramBinary is called
>    util: Add Mesa ARB_get_program_binary helper functions
>    i965: Add ARB_get_program_binary support using nir_serialization
> 
>   docs/specs/MESA_program_binary_formats.txt      |   59 ++
>   docs/specs/enums.txt                            |    3 +
>   include/GL/gl.h                                 |    8 +
>   src/compiler/Android.glsl.mk                    |    3 +-
>   src/compiler/Makefile.glsl.am                   |    3 +-
>   src/compiler/Makefile.sources                   |    8 +-
>   src/compiler/glsl/link_uniform_initializers.cpp |    2 +
>   src/compiler/glsl/link_uniforms.cpp             |    3 +
>   src/compiler/glsl/meson.build                   |    2 +
>   src/compiler/glsl/serialize.cpp                 | 1252 +++++++++++++++++++++++
>   src/compiler/glsl/serialize.h                   |   50 +
>   src/compiler/glsl/shader_cache.cpp              | 1185 +--------------------
>   src/compiler/shader_info.h                      |    1 +
>   src/mapi/glapi/registry/gl.xml                  |    2 +-
>   src/mesa/drivers/dri/i965/Makefile.sources      |    1 +
>   src/mesa/drivers/dri/i965/brw_context.c         |    9 +
>   src/mesa/drivers/dri/i965/brw_context.h         |   16 +
>   src/mesa/drivers/dri/i965/brw_disk_cache.c      |   31 +-
>   src/mesa/drivers/dri/i965/brw_link.cpp          |    9 +-
>   src/mesa/drivers/dri/i965/brw_program.c         |   35 +
>   src/mesa/drivers/dri/i965/brw_program.h         |    7 +
>   src/mesa/drivers/dri/i965/brw_program_binary.c  |  200 ++++
>   src/mesa/drivers/dri/i965/meson.build           |    1 +
>   src/mesa/main/dd.h                              |   20 +
>   src/mesa/main/get.c                             |    9 +
>   src/mesa/main/get_hash_params.py                |    4 +-
>   src/mesa/main/mtypes.h                          |    4 +
>   src/mesa/main/shaderapi.c                       |   63 +-
>   src/util/Makefile.sources                       |    2 +
>   src/util/meson.build                            |    2 +
>   src/util/program_binary.c                       |  322 ++++++
>   src/util/program_binary.h                       |   91 ++
>   32 files changed, 2162 insertions(+), 1245 deletions(-)
>   create mode 100644 docs/specs/MESA_program_binary_formats.txt
>   create mode 100644 src/compiler/glsl/serialize.cpp
>   create mode 100644 src/compiler/glsl/serialize.h
>   create mode 100644 src/mesa/drivers/dri/i965/brw_program_binary.c
>   create mode 100644 src/util/program_binary.c
>   create mode 100644 src/util/program_binary.h
> 


More information about the mesa-dev mailing list