[Mesa-dev] [PATCH 0/7] i965: Use native formats in fs_surface_builder

Jason Ekstrand jason at jlekstrand.net
Wed Nov 4 17:03:49 PST 2015


This little patch series converts fs_surface_builder to use native formats
for doing all of its image_load_store workaround tricks.  If you're willing
to take as an axiom that we want to not link the backend compiler against
core mesa, this leaves us with three options:

 1) Pull mesa_format.h and friends into util
 2) Use GL enums in fs_surface_builder
 3) Use native formats in fs_surface_builder

The first option is a lot of code-shuffling and it's not clear how much
benifit it would have.  We may want to do it eventually so that gallium and
core mesa can share format conversion code, but I don't want to go down
that rabbit-trail right now.

At first glance, the second and third options look approximately
equivalent.  However, we don't really want to use GL enums in
brw_lower_image_format because it's shared by the compiler and the state
setup code and using GL enums in state setup is kind of gross.  With that
in mind, I settled on native formats.

Jason Ekstrand (7):
  i965/fs_surface_builder: Explicitly handle FORMAT_NONE in
    num_image_coordinates
  i965: Add a variant of lower_mesa_image_format that takes native
    formats
  i965: Add an image format metadata array
  i965/fs: Use image_format_info for doing image_load_store workarounds
  i965/image_load_store: Add a brw_image_format_for_gl_format helper
  i965/fs_surface_builder: Work in terms of native formats
  i965: Remove brw_lower_mesa_image_format

 src/mesa/drivers/dri/i965/Makefile.sources         |   2 +
 src/mesa/drivers/dri/i965/brw_context.h            |   2 -
 src/mesa/drivers/dri/i965/brw_fs_nir.cpp           |   7 +-
 .../drivers/dri/i965/brw_fs_surface_builder.cpp    | 162 +++++++++-----
 src/mesa/drivers/dri/i965/brw_fs_surface_builder.h |   4 +-
 src/mesa/drivers/dri/i965/brw_image_load_store.c   | 232 +++++++++++++++++++++
 src/mesa/drivers/dri/i965/brw_image_load_store.h   |  60 ++++++
 src/mesa/drivers/dri/i965/brw_surface_formats.c    | 109 ----------
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c   |   5 +-
 9 files changed, 411 insertions(+), 172 deletions(-)
 create mode 100644 src/mesa/drivers/dri/i965/brw_image_load_store.c
 create mode 100644 src/mesa/drivers/dri/i965/brw_image_load_store.h

-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list