[Mesa-dev] [PATCH v2 0/9] anv, nir: Move large constants to a UBO

Kenneth Graunke kenneth at whitecape.org
Mon Jul 2 18:26:06 UTC 2018


On Friday, June 29, 2018 5:13:48 PM PDT Jason Ekstrand wrote:
> This little series adds an optimization pass to NIR and wires up up in anv
> that moves large constant variables to a UBO.  This fixes a farily common
> case in some filter or ambient occlusion shaders where they put some sort
> of look-up table in the shader itself.  This series takes Skyrim Special
> Edition running under DXVK from a slide show to a smooth and very playable
> framerate on my SKL desktop.
> 
> The first part of the series adds a concept of constant data that can be
> associated with a NIR shader and adds an optimization pass to move large
> constant variables into this constant data section.  It's left up to the
> driver to figure out how to get this constant data into the shader.  The
> last three patches wire things up in ANV to put this data into an implicit
> UBO and enables the optimization.
> 
> v2 (Jason Ekstrand):
>  - Take anholt's feedback and make it more clear that the units on the
>    number of constants is in bytes by calling it constant_data_size.
>  - Break some of the deref to offset code out into helpers
>  - Add new size/align helpers for types to ensure that we get alignments
>    right when setting up constants.  This hasn't usually been a problem in
>    the past because we align most things to a dword and 64-bit values
>    aren't common.  We should start being more careful.
> 
> Jason Ekstrand (9):
>   util/macros: Import ALIGN_POT from ralloc.c
>   nir: Add a deref_instr_has_indirect helper
>   nir/types: Add a natural size and alignment helper
>   nir/deref: Add helpers for getting offsets
>   nir: Add a concept of constant data associated with a shader
>   nir: Add a large constants optimization pass
>   anv: Add support for shader constant data to the pipeline cache
>   anv: Add state setup support for shader constants
>   anv,intel: Enable nir_opt_large_constants for Vulkan

I had some minor commentary, but even without any changes, series is:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180702/f4aa7dcf/attachment-0001.sig>


More information about the mesa-dev mailing list