[Mesa-dev] i965 implementation of the ARB_shader_image_load_store built-ins.

Francisco Jerez currojerez at riseup.net
Tue Apr 28 11:44:11 PDT 2015


This is the last major piece missing in the i965 driver for
ARB_shader_image_load_store support.  It has been tested on IVB, HSW
and BDW and passes all applicable piglit tests (some 4400 currently)
modulo hardware bugs, namely
"ARB_shader_image_load_store/invalid/index bounds test" on IVB and
"ARB_shader_image_load_store/early-z/occlusion query test/early-z pass"
on all generations.

The extension cannot yet be exposed except when the INTEL_USE_NIR
environment variable is set to false, because NIR doesn't currently
support the intrinsics required for ARB_shader_image_load_store.  This
problem will be addressed in a separate follow-up series.

Patches 1 to 6 of this series prepare the visitor and generator
classes to deal with images, and rework the handling of atomic
counters in the GLSL visitor making it consistent with other kinds of
GLSL uniforms.

Patches 7 to 13 define a number of elementary operations that assist
in the construction and submission of typed and untyped surface
messages, image coordinate manipulation and image format conversion.
Patch 14 implements the actual image load, store and atomic operations
in terms of these primitives.

Patches 17-18 take care of the GLSL IR-specific details of the image
intrinsic implementation.  Finally patches 15-16 and 19-20 replace the
current implementation of the atomic counter intrinsics with a new
unified and cleaned-up implementation based on the same surface
message building operations as image load/store.

The series and its many dependencies still pending review can be found
in a testable form in the image-load-store branch of my tree:

http://cgit.freedesktop.org/~currojerez/mesa/log/?h=image-load-store

src/mesa/drivers/dri/i965/Makefile.sources         |    3 +
src/mesa/drivers/dri/i965/brw_context.c            |   10 ++
src/mesa/drivers/dri/i965/brw_fs.cpp               |   37 ++--
src/mesa/drivers/dri/i965/brw_fs.h                 |   16 +-
src/mesa/drivers/dri/i965/brw_fs_generator.cpp     |    8 +-
src/mesa/drivers/dri/i965/brw_fs_nir.cpp           |   26 +--
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp       |  307 +++++++++++---------------------
src/mesa/drivers/dri/i965/brw_ir_glsl_intrinsics.h |  249 ++++++++++++++++++++++++++
src/mesa/drivers/dri/i965/brw_ir_surface_builder.h | 1453 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/mesa/drivers/dri/i965/brw_nir_intrinsics.h     |   80 +++++++++
src/mesa/drivers/dri/i965/brw_reg.h                |    4 +
src/mesa/drivers/dri/i965/brw_shader.cpp           |   32 ++++
src/mesa/drivers/dri/i965/brw_shader.h             |    6 +
src/mesa/drivers/dri/i965/brw_vec4.h               |   15 +-
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp   |    8 +-
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp     |  278 +++++++++++++----------------
src/mesa/drivers/dri/i965/intel_extensions.c       |    2 +
17 files changed, 2119 insertions(+), 415 deletions(-)

[PATCH 01/23] i965: Define the setup_vector_uniform_values() backend_visitor interface.
[PATCH 02/23] i965: Add support for handling image uniforms to the GLSL IR visitors.
[PATCH 03/23] i965/fs: Obtain atomic counter locations by recursing through the visitor.
[PATCH 04/23] i965/vec4: Obtain atomic counter locations by recursing through the visitor.
[PATCH 05/23] i965: Lift the constness restriction on surface indices passed to untyped ops.
[PATCH 06/23] i965: Add a visitor method to extract the result of a visit.
[PATCH 07/23] i965: Import array utils for the surface message builder.
[PATCH 08/23] i965: Import helpers to convert vectors into arrays and back.
[PATCH 09/23] i965: Import surface message builder functions.
[PATCH 10/23] i965: Import image access validity checks.
[PATCH 11/23] i965: Import image memory offset calculation code.
[PATCH 12/23] i965: Import image format conversion primitives.
[PATCH 13/23] i965: Import image format metadata queries.
[PATCH 14/23] i965: Implement image load, store and atomic.
[PATCH 15/23] i965: Revisit GLSL IR atomic counter intrinsic translation.
[PATCH 16/23] i965: Revisit NIR atomic counter intrinsic translation.
[PATCH 17/23] i965: Import GLSL IR image intrinsic translation code.
[PATCH 18/23] i965: Import GLSL IR memory barrier intrinsic translation code.
[PATCH 19/23] i965/fs: Switch atomic counters to the new intrinsic translation code.
[PATCH 20/23] i965/vec4: Switch atomic counters to the new intrinsic translation code.
[PATCH 21/23] i965: Hook up image and memory barrier built-in translation to the GLSL visitor.
[PATCH 22/23] i965: Define implementation constants for ARB_shader_image_load_store.
[PATCH 23/23] i965: Expose ARB_shader_image_load_store.


More information about the mesa-dev mailing list