• Tapani Pälli's avatar
    glsl: Add blob_overwrite_bytes and blob_overwrite_uint32 · ffcad3a5
    Tapani Pälli authored
    These functions are useful when serializing an unknown number of items
    to a blob. The caller can first save the current offset, write a
    placeholder uint32, write out (and count) the items, then use
    blob_overwrite_uint32 with the saved offset to replace the placeholder
    Then, when deserializing, the reader will first read the count and
    know how many subsequent items to expect.
    (I wrote this code after reading a very similar patch written by
    Tapani when he wrote serialization code for IR. Since I re-used the
    idea of his code so directly, I've credited him as the author of this
    code. --Carl)
    Reviewed-by: default avatarJason Ekstrand <jason.ekstrand@intel.com>
blob.c 6.9 KB