[Mesa-dev] [PATCH 7/8] nir: add serialization and deserialization

Jason Ekstrand jason at jlekstrand.net
Sat Sep 16 01:44:43 UTC 2017


On Fri, Sep 15, 2017 at 6:39 PM, Jason Ekstrand <jason at jlekstrand.net>
wrote:

> From: Connor Abbott <cwabbott0 at gmail.com>
>
> v2 (Jason Ekstrand):
>  - Various whitespace cleanups
>  - Add helpers for reading/writing objects
>  - Rework derefs
>  - [de]serialize nir_shader::num_*
>  - Fix uses of blob_reserve_bytes
>  - Use a bitfield struct for packing tex_instr data
> ---
>  src/compiler/Makefile.sources    |    2 +
>  src/compiler/nir/nir_serialize.c | 1195 ++++++++++++++++++++++++++++++
> ++++++++
>  src/compiler/nir/nir_serialize.h |   35 ++
>  3 files changed, 1232 insertions(+)
>  create mode 100644 src/compiler/nir/nir_serialize.c
>  create mode 100644 src/compiler/nir/nir_serialize.h
>

I didn't send an R-B with this patch because, to be honest, I didn't
actually review it properly.  I just fixed it to the point where it's
working.

The one issue that I think should probably still be considered is error
checking.  This pass does almost none beyond a couple of asserts.  It
doesn't even check that you didn't overrun the end of the blob.  How robust
does it need to be against tampering?  For an on-disk shader cache, we're
probably safe so long as we have some sort of checksum in the file.  For
program_binary, do we want to be a bit safer?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170915/063c443e/attachment-0001.html>


More information about the mesa-dev mailing list