[Mesa-dev] [PATCH 00/22] ARB_gl_spirv: support for uniforms and some extras

Alejandro Piñeiro apinheiro at igalia.com
Tue Apr 17 14:36:37 UTC 2018


Hi,

this is the second series for the ongoing support for ARB_gl_spirv in
Mesa and i965. The main focus of this series is providing the support
for linking uniforms. Most cases of uniforms, array uniforms, structs,
samplers and images should be supported. In any case, this is mostly
about "vanilla uniforms". Atomic counter uniforms, uniforms derived
from SSBOs, UBOs etc are not included yet.

The tree for this series can be found on the following repository:

   * https://github.com/Igalia/mesa/tree/arb_gl_spirv-series2-uniforms-v1

and this time we also provide a branch with piglit patches that test
this behaviour (although it would be needed to use
MESA_EXTENSION_OVERRIDE):

   * https://github.com/Igalia/piglit/tree/arb_gl_spirv-series1-uniforms-v1

The extras mentioned on the subject are commits that although they are
not related with uniforms, were needed in order to get those piglit
tests running. Although they are somewhat off-topic, they are also
simple patches, so we think that it is worth to get them added, as
allow to get some tests running.

Alejandro Piñeiro (5):
  i965: use gl_shader_program_data::spirv
  mesa/main: add NULL name check when searching for a resource name
  compiler/link: add linker_util.h, move linker_error/warning to it
  nir/linker: add some cross stage uniform validation
  compiler/link: move add_program_resource to linker_util

Eduardo Lima Mitev (10):
  mesa/main: Add a 'spirv' flag to gl_shader_program_data
  nir/lower_samplers: Limit assert to GLSL shader programs
  nir/types: Add a glsl_get_component_slots() utility
  nir/types: Add a utility wrapper to glsl_type::sampler_index()
  anv/nir: Use nir_variable's type if interface_type is null
  nir/linker: Add nir_link_uniforms()
  nir/linker: Add nir_build_program_resource_list()
  i965: Build SPIR-V programs' resource list using NIR
  i965: account for NIR uniforms without name
  i965: Link uniforms of SPIR-V programs using the NIR linker

Neil Roberts (6):
  nir: Add explicit_binding to nir_variable
  spirv: Get rid of vtn_variable_mode_image/sampler
  spirv: Set nir_variable->explicit_binding
  nir/linker: Set the uniform initial values
  i965: Update TexturesUsed after linking the shaders
  i965: Setup glsl uniforms by index rather than name matching

Nicolai Hähnle (1):
  spirv: translate default-block uniforms

 src/compiler/Makefile.sources                      |   5 +
 src/compiler/glsl/glsl_to_nir.cpp                  |   1 +
 .../glsl/link_uniform_block_active_visitor.cpp     |   1 +
 src/compiler/glsl/linker.cpp                       |  63 ---
 src/compiler/glsl/linker.h                         |   8 +-
 src/compiler/glsl/program.h                        |   8 -
 src/compiler/linker_util.cpp                       |  88 ++++
 src/compiler/linker_util.h                         |  48 ++
 src/compiler/meson.build                           |   2 +
 src/compiler/nir/meson.build                       |   3 +
 src/compiler/nir/nir.h                             |   5 +
 src/compiler/nir/nir_link_uniform_initializers.c   | 292 ++++++++++++
 src/compiler/nir/nir_link_uniforms.c               | 513 +++++++++++++++++++++
 src/compiler/nir/nir_linker.h                      |  48 ++
 src/compiler/nir/nir_linking_helpers.c             |  63 +++
 src/compiler/nir/nir_lower_samplers.c              |   3 +-
 src/compiler/nir_types.cpp                         |  13 +
 src/compiler/nir_types.h                           |   2 +
 src/compiler/spirv/spirv_to_nir.c                  |   4 +-
 src/compiler/spirv/vtn_cfg.c                       |   4 +-
 src/compiler/spirv/vtn_private.h                   |   4 +-
 src/compiler/spirv/vtn_variables.c                 |  56 +--
 src/intel/vulkan/anv_nir_apply_pipeline_layout.c   |   7 +-
 src/mesa/drivers/dri/i965/brw_link.cpp             |  20 +-
 src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp     |  52 ++-
 src/mesa/drivers/dri/i965/brw_program.c            |   2 +-
 src/mesa/main/mtypes.h                             |   6 +
 src/mesa/main/shader_query.cpp                     |   5 +
 src/mesa/program/ir_to_mesa.cpp                    |   1 +
 29 files changed, 1189 insertions(+), 138 deletions(-)
 create mode 100644 src/compiler/linker_util.cpp
 create mode 100644 src/compiler/linker_util.h
 create mode 100644 src/compiler/nir/nir_link_uniform_initializers.c
 create mode 100644 src/compiler/nir/nir_link_uniforms.c
 create mode 100644 src/compiler/nir/nir_linker.h

-- 
2.14.1



More information about the mesa-dev mailing list